Thomas Gleixner | d0fa117 | 2019-05-20 19:07:57 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Universal Interface for Intel High Definition Audio Codec |
| 4 | * |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5 | * HD audio interface patch for Realtek ALC codecs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 7 | * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw> |
| 8 | * PeiSen Hou <pshou@realtek.com.tw> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * Takashi Iwai <tiwai@suse.de> |
Jonathan Woithe | 409a3e9 | 2012-03-27 13:01:01 +1030 | [diff] [blame] | 10 | * Jonathan Woithe <jwoithe@just42.net> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | */ |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <linux/init.h> |
| 14 | #include <linux/delay.h> |
| 15 | #include <linux/slab.h> |
| 16 | #include <linux/pci.h> |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 17 | #include <linux/dmi.h> |
Paul Gortmaker | da155d5 | 2011-07-15 12:38:28 -0400 | [diff] [blame] | 18 | #include <linux/module.h> |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 19 | #include <linux/input.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <sound/core.h> |
Kailang Yang | 9ad0e49 | 2010-09-14 23:22:00 +0200 | [diff] [blame] | 21 | #include <sound/jack.h> |
Pierre-Louis Bossart | be57bff | 2018-08-22 15:24:57 -0500 | [diff] [blame] | 22 | #include <sound/hda_codec.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | #include "hda_local.h" |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 24 | #include "hda_auto_parser.h" |
Takashi Iwai | 1835a0f | 2011-10-27 22:12:46 +0200 | [diff] [blame] | 25 | #include "hda_jack.h" |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 26 | #include "hda_generic.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 28 | /* keep halting ALC5505 DSP, for power saving */ |
| 29 | #define HALT_REALTEK_ALC5505 |
| 30 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 31 | /* extra amp-initialization sequence types */ |
| 32 | enum { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 33 | ALC_INIT_UNDEFINED, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 34 | ALC_INIT_NONE, |
| 35 | ALC_INIT_DEFAULT, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 36 | }; |
| 37 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 38 | enum { |
| 39 | ALC_HEADSET_MODE_UNKNOWN, |
| 40 | ALC_HEADSET_MODE_UNPLUGGED, |
| 41 | ALC_HEADSET_MODE_HEADSET, |
| 42 | ALC_HEADSET_MODE_MIC, |
| 43 | ALC_HEADSET_MODE_HEADPHONE, |
| 44 | }; |
| 45 | |
| 46 | enum { |
| 47 | ALC_HEADSET_TYPE_UNKNOWN, |
| 48 | ALC_HEADSET_TYPE_CTIA, |
| 49 | ALC_HEADSET_TYPE_OMTP, |
| 50 | }; |
| 51 | |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 52 | enum { |
| 53 | ALC_KEY_MICMUTE_INDEX, |
| 54 | }; |
| 55 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 56 | struct alc_customize_define { |
| 57 | unsigned int sku_cfg; |
| 58 | unsigned char port_connectivity; |
| 59 | unsigned char check_sum; |
| 60 | unsigned char customization; |
| 61 | unsigned char external_amp; |
| 62 | unsigned int enable_pcbeep:1; |
| 63 | unsigned int platform_type:1; |
| 64 | unsigned int swap:1; |
| 65 | unsigned int override:1; |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 66 | 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] | 67 | }; |
| 68 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | struct alc_spec { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 70 | struct hda_gen_spec gen; /* must be at head */ |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 71 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | /* codec parameterization */ |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 73 | struct alc_customize_define cdefine; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 74 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
| 75 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 76 | /* GPIO bits */ |
| 77 | unsigned int gpio_mask; |
| 78 | unsigned int gpio_dir; |
| 79 | unsigned int gpio_data; |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 80 | bool gpio_write_delay; /* add a delay before writing gpio_data */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 81 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 82 | /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */ |
| 83 | int mute_led_polarity; |
| 84 | hda_nid_t mute_led_nid; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 85 | hda_nid_t cap_mute_led_nid; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 86 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 87 | unsigned int gpio_mute_led_mask; |
| 88 | unsigned int gpio_mic_led_mask; |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 89 | unsigned int mute_led_coef_idx; |
| 90 | unsigned int mute_led_coefbit_mask; |
| 91 | unsigned int mute_led_coefbit_on; |
| 92 | unsigned int mute_led_coefbit_off; |
| 93 | unsigned int mic_led_coef_idx; |
| 94 | unsigned int mic_led_coefbit_mask; |
| 95 | unsigned int mic_led_coefbit_on; |
| 96 | unsigned int mic_led_coefbit_off; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 97 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 98 | hda_nid_t headset_mic_pin; |
| 99 | hda_nid_t headphone_mic_pin; |
| 100 | int current_headset_mode; |
| 101 | int current_headset_type; |
| 102 | |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 103 | /* hooks */ |
| 104 | void (*init_hook)(struct hda_codec *codec); |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 105 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 106 | void (*power_hook)(struct hda_codec *codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 107 | #endif |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 108 | void (*shutup)(struct hda_codec *codec); |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 109 | void (*reboot_notify)(struct hda_codec *codec); |
Takashi Iwai | d922b51 | 2011-04-28 12:18:53 +0200 | [diff] [blame] | 110 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 111 | int init_amp; |
Takashi Iwai | d433a67 | 2010-09-20 15:11:54 +0200 | [diff] [blame] | 112 | int codec_variant; /* flag for other variants */ |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 113 | unsigned int has_alc5505_dsp:1; |
| 114 | unsigned int no_depop_delay:1; |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 115 | unsigned int done_hp_init:1; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 116 | unsigned int no_shutup_pins:1; |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 117 | unsigned int ultra_low_power:1; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 118 | unsigned int has_hs_key:1; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 119 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 120 | /* for PLL fix */ |
| 121 | hda_nid_t pll_nid; |
| 122 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 123 | unsigned int coef0; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 124 | struct input_dev *kb_dev; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 125 | u8 alc_mute_keycode_map[1]; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 126 | }; |
| 127 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 128 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 129 | * COEF access helper functions |
| 130 | */ |
| 131 | |
| 132 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 133 | unsigned int coef_idx) |
| 134 | { |
| 135 | unsigned int val; |
| 136 | |
| 137 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 138 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 139 | return val; |
| 140 | } |
| 141 | |
| 142 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 143 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 144 | |
| 145 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 146 | unsigned int coef_idx, unsigned int coef_val) |
| 147 | { |
| 148 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 149 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 150 | } |
| 151 | |
| 152 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 153 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 154 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 155 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 156 | unsigned int coef_idx, unsigned int mask, |
| 157 | unsigned int bits_set) |
| 158 | { |
| 159 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 160 | |
| 161 | if (val != -1) |
| 162 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 163 | (val & ~mask) | bits_set); |
| 164 | } |
| 165 | |
| 166 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 167 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 168 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 169 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 170 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 171 | { |
| 172 | struct alc_spec *spec = codec->spec; |
| 173 | |
| 174 | if (!spec->coef0) |
| 175 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 176 | return spec->coef0; |
| 177 | } |
| 178 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 179 | /* coef writes/updates batch */ |
| 180 | struct coef_fw { |
| 181 | unsigned char nid; |
| 182 | unsigned char idx; |
| 183 | unsigned short mask; |
| 184 | unsigned short val; |
| 185 | }; |
| 186 | |
| 187 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 188 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 189 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 190 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 191 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 192 | |
| 193 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 194 | const struct coef_fw *fw) |
| 195 | { |
| 196 | for (; fw->nid; fw++) { |
| 197 | if (fw->mask == (unsigned short)-1) |
| 198 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 199 | else |
| 200 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 201 | fw->mask, fw->val); |
| 202 | } |
| 203 | } |
| 204 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 205 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 206 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 207 | */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 208 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 209 | /* Enable GPIO mask and set output */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 210 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
| 211 | { |
| 212 | struct alc_spec *spec = codec->spec; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 213 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 214 | spec->gpio_mask |= mask; |
| 215 | spec->gpio_dir |= mask; |
| 216 | spec->gpio_data |= mask; |
| 217 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 218 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 219 | static void alc_write_gpio_data(struct hda_codec *codec) |
| 220 | { |
| 221 | struct alc_spec *spec = codec->spec; |
| 222 | |
| 223 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 224 | spec->gpio_data); |
| 225 | } |
| 226 | |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 227 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
| 228 | bool on) |
| 229 | { |
| 230 | struct alc_spec *spec = codec->spec; |
| 231 | unsigned int oldval = spec->gpio_data; |
| 232 | |
| 233 | if (on) |
| 234 | spec->gpio_data |= mask; |
| 235 | else |
| 236 | spec->gpio_data &= ~mask; |
| 237 | if (oldval != spec->gpio_data) |
| 238 | alc_write_gpio_data(codec); |
| 239 | } |
| 240 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 241 | static void alc_write_gpio(struct hda_codec *codec) |
| 242 | { |
| 243 | struct alc_spec *spec = codec->spec; |
| 244 | |
| 245 | if (!spec->gpio_mask) |
| 246 | return; |
| 247 | |
| 248 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 249 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); |
| 250 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 251 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 252 | if (spec->gpio_write_delay) |
| 253 | msleep(1); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 254 | alc_write_gpio_data(codec); |
| 255 | } |
| 256 | |
| 257 | static void alc_fixup_gpio(struct hda_codec *codec, int action, |
| 258 | unsigned int mask) |
| 259 | { |
| 260 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 261 | alc_setup_gpio(codec, mask); |
| 262 | } |
| 263 | |
| 264 | static void alc_fixup_gpio1(struct hda_codec *codec, |
| 265 | const struct hda_fixup *fix, int action) |
| 266 | { |
| 267 | alc_fixup_gpio(codec, action, 0x01); |
| 268 | } |
| 269 | |
| 270 | static void alc_fixup_gpio2(struct hda_codec *codec, |
| 271 | const struct hda_fixup *fix, int action) |
| 272 | { |
| 273 | alc_fixup_gpio(codec, action, 0x02); |
| 274 | } |
| 275 | |
| 276 | static void alc_fixup_gpio3(struct hda_codec *codec, |
| 277 | const struct hda_fixup *fix, int action) |
| 278 | { |
| 279 | alc_fixup_gpio(codec, action, 0x03); |
| 280 | } |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 281 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 282 | static void alc_fixup_gpio4(struct hda_codec *codec, |
| 283 | const struct hda_fixup *fix, int action) |
| 284 | { |
| 285 | alc_fixup_gpio(codec, action, 0x04); |
| 286 | } |
| 287 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 288 | /* |
| 289 | * Fix hardware PLL issue |
| 290 | * On some codecs, the analog PLL gating control must be off while |
| 291 | * the default value is 1. |
| 292 | */ |
| 293 | static void alc_fix_pll(struct hda_codec *codec) |
| 294 | { |
| 295 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 296 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 297 | if (spec->pll_nid) |
| 298 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 299 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 303 | unsigned int coef_idx, unsigned int coef_bit) |
| 304 | { |
| 305 | struct alc_spec *spec = codec->spec; |
| 306 | spec->pll_nid = nid; |
| 307 | spec->pll_coef_idx = coef_idx; |
| 308 | spec->pll_coef_bit = coef_bit; |
| 309 | alc_fix_pll(codec); |
| 310 | } |
| 311 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 312 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 313 | static void alc_update_knob_master(struct hda_codec *codec, |
| 314 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 315 | { |
| 316 | unsigned int val; |
| 317 | struct snd_kcontrol *kctl; |
| 318 | struct snd_ctl_elem_value *uctl; |
| 319 | |
| 320 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 321 | if (!kctl) |
| 322 | return; |
| 323 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 324 | if (!uctl) |
| 325 | return; |
Takashi Iwai | 2ebab40 | 2016-02-09 10:23:52 +0100 | [diff] [blame] | 326 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 327 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 328 | val &= HDA_AMP_VOLMASK; |
| 329 | uctl->value.integer.value[0] = val; |
| 330 | uctl->value.integer.value[1] = val; |
| 331 | kctl->put(kctl, uctl); |
| 332 | kfree(uctl); |
| 333 | } |
| 334 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 335 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 336 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 337 | /* For some reason, the res given from ALC880 is broken. |
| 338 | Here we adjust it properly. */ |
| 339 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 340 | } |
| 341 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 342 | /* Change EAPD to verb control */ |
| 343 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 344 | { |
| 345 | int coef; |
| 346 | |
| 347 | coef = alc_get_coef0(codec); |
| 348 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 349 | switch (codec->core.vendor_id) { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 350 | case 0x10ec0262: |
| 351 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 352 | break; |
| 353 | case 0x10ec0267: |
| 354 | case 0x10ec0268: |
| 355 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 356 | break; |
| 357 | case 0x10ec0269: |
| 358 | if ((coef & 0x00f0) == 0x0010) |
| 359 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 360 | if ((coef & 0x00f0) == 0x0020) |
| 361 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 362 | if ((coef & 0x00f0) == 0x0030) |
| 363 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 364 | break; |
| 365 | case 0x10ec0280: |
| 366 | case 0x10ec0284: |
| 367 | case 0x10ec0290: |
| 368 | case 0x10ec0292: |
| 369 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 370 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 371 | case 0x10ec0225: |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 372 | case 0x10ec0295: |
| 373 | case 0x10ec0299: |
| 374 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
| 375 | /* fallthrough */ |
| 376 | case 0x10ec0215: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 377 | case 0x10ec0233: |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 378 | case 0x10ec0235: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 379 | case 0x10ec0236: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 380 | case 0x10ec0255: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 381 | case 0x10ec0256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 382 | case 0x10ec0257: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 383 | case 0x10ec0282: |
| 384 | case 0x10ec0283: |
| 385 | case 0x10ec0286: |
| 386 | case 0x10ec0288: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 387 | case 0x10ec0285: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 388 | case 0x10ec0298: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 389 | case 0x10ec0289: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 390 | case 0x10ec0300: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 391 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 392 | break; |
Kailang Yang | 3aabf94 | 2017-11-08 15:28:33 +0800 | [diff] [blame] | 393 | case 0x10ec0275: |
| 394 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); |
| 395 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 396 | case 0x10ec0293: |
| 397 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 398 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 399 | case 0x10ec0234: |
| 400 | case 0x10ec0274: |
| 401 | case 0x10ec0294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 402 | case 0x10ec0700: |
| 403 | case 0x10ec0701: |
| 404 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 405 | case 0x10ec0711: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 406 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
| 407 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 408 | case 0x10ec0662: |
| 409 | if ((coef & 0x00f0) == 0x0030) |
| 410 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 411 | break; |
| 412 | case 0x10ec0272: |
| 413 | case 0x10ec0273: |
| 414 | case 0x10ec0663: |
| 415 | case 0x10ec0665: |
| 416 | case 0x10ec0670: |
| 417 | case 0x10ec0671: |
| 418 | case 0x10ec0672: |
| 419 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 420 | break; |
Kailang Yang | 9194a1e | 2020-01-07 17:22:19 +0800 | [diff] [blame] | 421 | case 0x10ec0222: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 422 | case 0x10ec0623: |
| 423 | alc_update_coef_idx(codec, 0x19, 1<<13, 0); |
| 424 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 425 | case 0x10ec0668: |
| 426 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 427 | break; |
| 428 | case 0x10ec0867: |
| 429 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 430 | break; |
| 431 | case 0x10ec0888: |
| 432 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 433 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 434 | break; |
| 435 | case 0x10ec0892: |
| 436 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 437 | break; |
| 438 | case 0x10ec0899: |
| 439 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 440 | case 0x10ec0b00: |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 441 | case 0x10ec1168: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 442 | case 0x10ec1220: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 443 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 444 | break; |
| 445 | } |
| 446 | } |
| 447 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 448 | /* additional initialization for ALC888 variants */ |
| 449 | static void alc888_coef_init(struct hda_codec *codec) |
| 450 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 451 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 452 | /* alc888-VA */ |
| 453 | case 0x00: |
| 454 | /* alc888-VB */ |
| 455 | case 0x10: |
| 456 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 457 | break; |
| 458 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 459 | } |
| 460 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 461 | /* turn on/off EAPD control (only if available) */ |
| 462 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 463 | { |
| 464 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 465 | return; |
| 466 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 467 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 468 | on ? 2 : 0); |
| 469 | } |
| 470 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 471 | /* turn on/off EAPD controls of the codec */ |
| 472 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 473 | { |
| 474 | /* We currently only handle front, HP */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 475 | static const hda_nid_t pins[] = { |
Hui Wang | af95b41 | 2015-03-26 17:14:55 +0800 | [diff] [blame] | 476 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 477 | }; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 478 | const hda_nid_t *p; |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 479 | for (p = pins; *p; p++) |
| 480 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 481 | } |
| 482 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 483 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 484 | |
| 485 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) |
| 486 | { |
| 487 | const struct hda_pincfg *pin; |
| 488 | int mic_pin = find_ext_mic_pin(codec); |
| 489 | int i; |
| 490 | |
| 491 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 492 | * the default pin setup at the next load of the driver |
| 493 | */ |
| 494 | if (codec->bus->shutdown) |
| 495 | return; |
| 496 | |
| 497 | snd_array_for_each(&codec->init_pins, i, pin) { |
| 498 | /* use read here for syncing after issuing each verb */ |
| 499 | if (pin->nid != mic_pin) |
| 500 | snd_hda_codec_read(codec, pin->nid, 0, |
| 501 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 502 | } |
| 503 | |
| 504 | codec->pins_shutup = 1; |
| 505 | } |
| 506 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 507 | static void alc_shutup_pins(struct hda_codec *codec) |
| 508 | { |
| 509 | struct alc_spec *spec = codec->spec; |
| 510 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 511 | switch (codec->core.vendor_id) { |
Kailang Yang | 66c5d71 | 2019-12-09 15:56:15 +0800 | [diff] [blame] | 512 | case 0x10ec0283: |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 513 | case 0x10ec0286: |
| 514 | case 0x10ec0288: |
| 515 | case 0x10ec0298: |
| 516 | alc_headset_mic_no_shutup(codec); |
| 517 | break; |
| 518 | default: |
| 519 | if (!spec->no_shutup_pins) |
| 520 | snd_hda_shutup_pins(codec); |
| 521 | break; |
| 522 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 523 | } |
| 524 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 525 | /* generic shutup callback; |
Lars-Peter Clausen | 4ce8e6a | 2016-11-08 15:48:06 +0100 | [diff] [blame] | 526 | * just turning off EAPD and a little pause for avoiding pop-noise |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 527 | */ |
| 528 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 529 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 530 | struct alc_spec *spec = codec->spec; |
| 531 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 532 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 533 | if (!spec->no_depop_delay) |
| 534 | msleep(200); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 535 | alc_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 536 | } |
| 537 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 538 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 539 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 540 | { |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 541 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 542 | alc_write_gpio(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 543 | switch (type) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 544 | case ALC_INIT_DEFAULT: |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 545 | switch (codec->core.vendor_id) { |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 546 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 547 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 548 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 549 | case 0x10ec0880: |
| 550 | case 0x10ec0882: |
| 551 | case 0x10ec0883: |
| 552 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 553 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 554 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 555 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 556 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 557 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 558 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 559 | break; |
| 560 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 561 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 562 | |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 563 | /* get a primary headphone pin if available */ |
| 564 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) |
| 565 | { |
| 566 | if (spec->gen.autocfg.hp_pins[0]) |
| 567 | return spec->gen.autocfg.hp_pins[0]; |
| 568 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 569 | return spec->gen.autocfg.line_out_pins[0]; |
| 570 | return 0; |
| 571 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 572 | |
| 573 | /* |
| 574 | * Realtek SSID verification |
| 575 | */ |
| 576 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 577 | /* Could be any non-zero and even value. When used as fixup, tells |
| 578 | * the driver to ignore any present sku defines. |
| 579 | */ |
| 580 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 581 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 582 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 583 | const struct hda_fixup *fix, int action) |
| 584 | { |
| 585 | struct alc_spec *spec = codec->spec; |
| 586 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 587 | spec->cdefine.fixup = 1; |
| 588 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 589 | } |
| 590 | } |
| 591 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 592 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 593 | const struct hda_fixup *fix, int action) |
| 594 | { |
| 595 | struct alc_spec *spec = codec->spec; |
| 596 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 597 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 598 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 599 | codec->depop_delay = 0; |
| 600 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 601 | } |
| 602 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 603 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 604 | { |
| 605 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 606 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 607 | struct alc_spec *spec = codec->spec; |
| 608 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 609 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 610 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 611 | if (spec->cdefine.fixup) { |
| 612 | ass = spec->cdefine.sku_cfg; |
| 613 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 614 | return -1; |
| 615 | goto do_sku; |
| 616 | } |
| 617 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 618 | if (!codec->bus->pci) |
| 619 | return -1; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 620 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 621 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 622 | goto do_sku; |
| 623 | |
| 624 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 625 | if (codec->core.vendor_id == 0x10ec0260) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 626 | nid = 0x17; |
| 627 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 628 | |
| 629 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 630 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 631 | codec->core.chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 632 | return -1; |
| 633 | } |
| 634 | |
| 635 | /* check sum */ |
| 636 | tmp = 0; |
| 637 | for (i = 1; i < 16; i++) { |
| 638 | if ((ass >> i) & 1) |
| 639 | tmp++; |
| 640 | } |
| 641 | if (((ass >> 16) & 0xf) != tmp) |
| 642 | return -1; |
| 643 | |
| 644 | spec->cdefine.port_connectivity = ass >> 30; |
| 645 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 646 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 647 | spec->cdefine.customization = ass >> 8; |
| 648 | do_sku: |
| 649 | spec->cdefine.sku_cfg = ass; |
| 650 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 651 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 652 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 653 | spec->cdefine.override = ass & 0x1; |
| 654 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 655 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 656 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 657 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 658 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 659 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 660 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 661 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 662 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 663 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 664 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 665 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 666 | |
| 667 | return 0; |
| 668 | } |
| 669 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 670 | /* return the position of NID in the list, or -1 if not found */ |
| 671 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 672 | { |
| 673 | int i; |
| 674 | for (i = 0; i < nums; i++) |
| 675 | if (list[i] == nid) |
| 676 | return i; |
| 677 | return -1; |
| 678 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 679 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 680 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 681 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 682 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 683 | } |
| 684 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 685 | /* check subsystem ID and set up device-specific initialization; |
| 686 | * return 1 if initialized, 0 if invalid SSID |
| 687 | */ |
| 688 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 689 | * 31 ~ 16 : Manufacture ID |
| 690 | * 15 ~ 8 : SKU ID |
| 691 | * 7 ~ 0 : Assembly ID |
| 692 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 693 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 694 | 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] | 695 | { |
| 696 | unsigned int ass, tmp, i; |
| 697 | unsigned nid; |
| 698 | struct alc_spec *spec = codec->spec; |
| 699 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 700 | if (spec->cdefine.fixup) { |
| 701 | ass = spec->cdefine.sku_cfg; |
| 702 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 703 | return 0; |
| 704 | goto do_sku; |
| 705 | } |
| 706 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 707 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 708 | if (codec->bus->pci && |
| 709 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 710 | goto do_sku; |
| 711 | |
| 712 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 713 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 714 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 715 | * 29~21 : reserve |
| 716 | * 20 : PCBEEP input |
| 717 | * 19~16 : Check sum (15:1) |
| 718 | * 15~1 : Custom |
| 719 | * 0 : override |
| 720 | */ |
| 721 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 722 | if (codec->core.vendor_id == 0x10ec0260) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 723 | nid = 0x17; |
| 724 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 725 | codec_dbg(codec, |
| 726 | "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] | 727 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 728 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 729 | return 0; |
| 730 | if ((ass >> 30) != 1) /* no physical connection */ |
| 731 | return 0; |
| 732 | |
| 733 | /* check sum */ |
| 734 | tmp = 0; |
| 735 | for (i = 1; i < 16; i++) { |
| 736 | if ((ass >> i) & 1) |
| 737 | tmp++; |
| 738 | } |
| 739 | if (((ass >> 16) & 0xf) != tmp) |
| 740 | return 0; |
| 741 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 742 | 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] | 743 | ass & 0xffff, codec->core.vendor_id); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 744 | /* |
| 745 | * 0 : override |
| 746 | * 1 : Swap Jack |
| 747 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 748 | * 3~5 : External Amplifier control |
| 749 | * 7~6 : Reserved |
| 750 | */ |
| 751 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 752 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 753 | switch (tmp) { |
| 754 | case 1: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 755 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 756 | break; |
| 757 | case 3: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 758 | alc_setup_gpio(codec, 0x02); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 759 | break; |
| 760 | case 7: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 761 | alc_setup_gpio(codec, 0x03); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 762 | break; |
| 763 | case 5: |
| 764 | default: |
| 765 | spec->init_amp = ALC_INIT_DEFAULT; |
| 766 | break; |
| 767 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 768 | } |
| 769 | |
| 770 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 771 | * when the external headphone out jack is plugged" |
| 772 | */ |
| 773 | if (!(ass & 0x8000)) |
| 774 | return 1; |
| 775 | /* |
| 776 | * 10~8 : Jack location |
| 777 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 778 | * 14~13: Resvered |
| 779 | * 15 : 1 --> enable the function "Mute internal speaker |
| 780 | * when the external headphone out jack is plugged" |
| 781 | */ |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 782 | if (!alc_get_hp_pin(spec)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 783 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 784 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 785 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 786 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 787 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 788 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 789 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 790 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 791 | return 1; |
| 792 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 793 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 794 | /* Check the validity of ALC subsystem-id |
| 795 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 796 | 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] | 797 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 798 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 799 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 800 | codec_dbg(codec, |
| 801 | "realtek: Enable default setup for auto mode as fallback\n"); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 802 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 803 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 804 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 805 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 806 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 807 | */ |
| 808 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 809 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 810 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 811 | { |
| 812 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 813 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 814 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 815 | } |
| 816 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 817 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 818 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 819 | { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 820 | int err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 821 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 822 | err = snd_hda_gen_build_controls(codec); |
| 823 | if (err < 0) |
| 824 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 825 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 826 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 827 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 828 | } |
| 829 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 830 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 831 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 832 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 833 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 834 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 835 | static void alc_pre_init(struct hda_codec *codec) |
| 836 | { |
| 837 | alc_fill_eapd_coef(codec); |
| 838 | } |
| 839 | |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 840 | #define is_s3_resume(codec) \ |
| 841 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 842 | #define is_s4_resume(codec) \ |
| 843 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) |
| 844 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 845 | static int alc_init(struct hda_codec *codec) |
| 846 | { |
| 847 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 848 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 849 | /* hibernation resume needs the full chip initialization */ |
| 850 | if (is_s4_resume(codec)) |
| 851 | alc_pre_init(codec); |
| 852 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 853 | if (spec->init_hook) |
| 854 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 855 | |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 856 | spec->gen.skip_verbs = 1; /* applied in below */ |
Kailang Yang | 607ca3b | 2019-04-26 16:35:41 +0800 | [diff] [blame] | 857 | snd_hda_gen_init(codec); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 858 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 859 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 860 | snd_hda_apply_verbs(codec); /* apply verbs here after own init */ |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 861 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 862 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 863 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 864 | return 0; |
| 865 | } |
| 866 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 867 | static inline void alc_shutup(struct hda_codec *codec) |
| 868 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 869 | struct alc_spec *spec = codec->spec; |
| 870 | |
Takashi Iwai | c7273bd | 2018-06-12 16:09:57 +0200 | [diff] [blame] | 871 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
| 872 | return; /* disabled explicitly by hints */ |
| 873 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 874 | if (spec && spec->shutup) |
| 875 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 876 | else |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 877 | alc_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 878 | } |
| 879 | |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 880 | static void alc_reboot_notify(struct hda_codec *codec) |
| 881 | { |
| 882 | struct alc_spec *spec = codec->spec; |
| 883 | |
| 884 | if (spec && spec->reboot_notify) |
| 885 | spec->reboot_notify(codec); |
| 886 | else |
| 887 | alc_shutup(codec); |
| 888 | } |
| 889 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 890 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 891 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 892 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 893 | static void alc_power_eapd(struct hda_codec *codec) |
| 894 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 895 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 896 | } |
| 897 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 898 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 899 | { |
| 900 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 901 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 902 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 903 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 904 | return 0; |
| 905 | } |
| 906 | #endif |
| 907 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 908 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 909 | static int alc_resume(struct hda_codec *codec) |
| 910 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 911 | struct alc_spec *spec = codec->spec; |
| 912 | |
| 913 | if (!spec->no_depop_delay) |
| 914 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 915 | codec->patch_ops.init(codec); |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 916 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 917 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 918 | return 0; |
| 919 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 920 | #endif |
| 921 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 922 | /* |
| 923 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 924 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 925 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 926 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 927 | .init = alc_init, |
| 928 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 929 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 930 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 931 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 932 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 933 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 934 | #endif |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 935 | .reboot_notify = alc_reboot_notify, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 936 | }; |
| 937 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 938 | |
Takashi Iwai | ded255b | 2015-10-01 17:59:43 +0200 | [diff] [blame] | 939 | #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] | 940 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 941 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 942 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 943 | */ |
| 944 | struct alc_codec_rename_table { |
| 945 | unsigned int vendor_id; |
| 946 | unsigned short coef_mask; |
| 947 | unsigned short coef_bits; |
| 948 | const char *name; |
| 949 | }; |
| 950 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 951 | struct alc_codec_rename_pci_table { |
| 952 | unsigned int codec_vendor_id; |
| 953 | unsigned short pci_subvendor; |
| 954 | unsigned short pci_subdevice; |
| 955 | const char *name; |
| 956 | }; |
| 957 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 958 | static const struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 959 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 960 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 961 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 962 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 963 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 964 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 965 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 966 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 967 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 968 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 969 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 970 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 971 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 972 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 973 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 974 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 975 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 976 | { } /* terminator */ |
| 977 | }; |
| 978 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 979 | static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 980 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 981 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 982 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 983 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 984 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 985 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 986 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 987 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 988 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 989 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
Kailang Yang | 2c674fa | 2015-05-05 15:02:42 +0800 | [diff] [blame] | 990 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 991 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
Kailang Yang | 8232450 | 2015-05-25 17:16:49 +0800 | [diff] [blame] | 992 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 993 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 994 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 995 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 996 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 997 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 998 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 999 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 1000 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 1001 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 1002 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 1003 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 1004 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 1005 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 1006 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1007 | { } /* terminator */ |
| 1008 | }; |
| 1009 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1010 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 1011 | { |
| 1012 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1013 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1014 | |
| 1015 | for (p = rename_tbl; p->vendor_id; p++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1016 | if (p->vendor_id != codec->core.vendor_id) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1017 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 1018 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1019 | return alc_codec_rename(codec, p->name); |
| 1020 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1021 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 1022 | if (!codec->bus->pci) |
| 1023 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1024 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1025 | if (q->codec_vendor_id != codec->core.vendor_id) |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1026 | continue; |
| 1027 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 1028 | continue; |
| 1029 | if (!q->pci_subdevice || |
| 1030 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 1031 | return alc_codec_rename(codec, q->name); |
| 1032 | } |
| 1033 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1034 | return 0; |
| 1035 | } |
| 1036 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 1037 | |
| 1038 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1039 | * Digital-beep handlers |
| 1040 | */ |
| 1041 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1042 | |
| 1043 | /* additional beep mixers; private_value will be overwritten */ |
| 1044 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
| 1045 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
| 1046 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
| 1047 | }; |
| 1048 | |
| 1049 | /* set up and create beep controls */ |
| 1050 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, |
| 1051 | int idx, int dir) |
| 1052 | { |
| 1053 | struct snd_kcontrol_new *knew; |
| 1054 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); |
| 1055 | int i; |
| 1056 | |
| 1057 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { |
| 1058 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 1059 | &alc_beep_mixer[i]); |
| 1060 | if (!knew) |
| 1061 | return -ENOMEM; |
| 1062 | knew->private_value = beep_amp; |
| 1063 | } |
| 1064 | return 0; |
| 1065 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1066 | |
| 1067 | static const struct snd_pci_quirk beep_white_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1068 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1069 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1070 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1071 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1072 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1073 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1074 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1075 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1076 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
Takashi Iwai | 051c78a | 2019-08-22 09:58:07 +0200 | [diff] [blame] | 1077 | /* blacklist -- no beep available */ |
| 1078 | SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
| 1079 | SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1080 | {} |
| 1081 | }; |
| 1082 | |
| 1083 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1084 | { |
| 1085 | struct alc_spec *spec = codec->spec; |
| 1086 | const struct snd_pci_quirk *q; |
| 1087 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); |
| 1088 | if (q) |
| 1089 | return q->value; |
| 1090 | return spec->cdefine.enable_pcbeep; |
| 1091 | } |
| 1092 | #else |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1093 | #define set_beep_amp(spec, nid, idx, dir) 0 |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1094 | #define has_cdefine_beep(codec) 0 |
| 1095 | #endif |
| 1096 | |
| 1097 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1098 | /* return 1 if successful, 0 if the proper config is not found, |
| 1099 | * or a negative error code |
| 1100 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1101 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1102 | const hda_nid_t *ignore_nids, |
| 1103 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1104 | { |
| 1105 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1106 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1107 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1108 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1109 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1110 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1111 | if (err < 0) |
| 1112 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1113 | |
| 1114 | if (ssid_nids) |
| 1115 | alc_ssid_check(codec, ssid_nids); |
| 1116 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1117 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1118 | if (err < 0) |
| 1119 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1120 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1121 | return 1; |
| 1122 | } |
| 1123 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1124 | /* common preparation job for alc_spec */ |
| 1125 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1126 | { |
| 1127 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1128 | int err; |
| 1129 | |
| 1130 | if (!spec) |
| 1131 | return -ENOMEM; |
| 1132 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1133 | snd_hda_gen_spec_init(&spec->gen); |
| 1134 | spec->gen.mixer_nid = mixer_nid; |
| 1135 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1136 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1137 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1138 | codec->spdif_status_reset = 1; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1139 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1140 | |
| 1141 | err = alc_codec_rename_from_preset(codec); |
| 1142 | if (err < 0) { |
| 1143 | kfree(spec); |
| 1144 | return err; |
| 1145 | } |
| 1146 | return 0; |
| 1147 | } |
| 1148 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1149 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1150 | { |
| 1151 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1152 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1153 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1154 | } |
| 1155 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1156 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1157 | * ALC880 fix-ups |
| 1158 | */ |
| 1159 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1160 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1161 | ALC880_FIXUP_GPIO2, |
| 1162 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1163 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1164 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1165 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1166 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1167 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1168 | ALC880_FIXUP_VOL_KNOB, |
| 1169 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1170 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1171 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1172 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1173 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1174 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1175 | ALC880_FIXUP_3ST_BASE, |
| 1176 | ALC880_FIXUP_3ST, |
| 1177 | ALC880_FIXUP_3ST_DIG, |
| 1178 | ALC880_FIXUP_5ST_BASE, |
| 1179 | ALC880_FIXUP_5ST, |
| 1180 | ALC880_FIXUP_5ST_DIG, |
| 1181 | ALC880_FIXUP_6ST_BASE, |
| 1182 | ALC880_FIXUP_6ST, |
| 1183 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1184 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1185 | }; |
| 1186 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1187 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1188 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1189 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1190 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1191 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1192 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1193 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1194 | } |
| 1195 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1196 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1197 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1198 | .type = HDA_FIXUP_FUNC, |
| 1199 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1200 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1201 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1202 | .type = HDA_FIXUP_FUNC, |
| 1203 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1204 | }, |
| 1205 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1206 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1207 | .v.verbs = (const struct hda_verb[]) { |
| 1208 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1209 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1210 | { } |
| 1211 | }, |
| 1212 | .chained = true, |
| 1213 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1214 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1215 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1216 | .type = HDA_FIXUP_PINS, |
| 1217 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1218 | /* disable bogus unused pins */ |
| 1219 | { 0x16, 0x411111f0 }, |
| 1220 | { 0x18, 0x411111f0 }, |
| 1221 | { 0x1a, 0x411111f0 }, |
| 1222 | { } |
| 1223 | } |
| 1224 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1225 | [ALC880_FIXUP_LG_LW25] = { |
| 1226 | .type = HDA_FIXUP_PINS, |
| 1227 | .v.pins = (const struct hda_pintbl[]) { |
| 1228 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1229 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1230 | { } |
| 1231 | } |
| 1232 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1233 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1234 | .type = HDA_FIXUP_PINS, |
| 1235 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1236 | /* disable bogus unused pins */ |
| 1237 | { 0x17, 0x411111f0 }, |
| 1238 | { } |
| 1239 | }, |
| 1240 | .chained = true, |
| 1241 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1242 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1243 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1244 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1245 | .v.verbs = (const struct hda_verb[]) { |
| 1246 | /* change to EAPD mode */ |
| 1247 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1248 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1249 | {} |
| 1250 | }, |
| 1251 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1252 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1253 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1254 | .v.verbs = (const struct hda_verb[]) { |
| 1255 | /* change to EAPD mode */ |
| 1256 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1257 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1258 | {} |
| 1259 | }, |
| 1260 | .chained = true, |
| 1261 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1262 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1263 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1264 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1265 | .v.func = alc880_fixup_vol_knob, |
| 1266 | }, |
| 1267 | [ALC880_FIXUP_FUJITSU] = { |
| 1268 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1269 | .type = HDA_FIXUP_PINS, |
| 1270 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1271 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1272 | { 0x15, 0x99030120 }, /* speaker */ |
| 1273 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1274 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1275 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1276 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1277 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1278 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1279 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1280 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1281 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1282 | { } |
| 1283 | }, |
| 1284 | .chained = true, |
| 1285 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1286 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1287 | [ALC880_FIXUP_F1734] = { |
| 1288 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1289 | .type = HDA_FIXUP_PINS, |
| 1290 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1291 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1292 | { 0x15, 0x99030120 }, /* speaker */ |
| 1293 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1294 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1295 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1296 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1297 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1298 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1299 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1300 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1301 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1302 | { } |
| 1303 | }, |
| 1304 | .chained = true, |
| 1305 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1306 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1307 | [ALC880_FIXUP_UNIWILL] = { |
| 1308 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1309 | .type = HDA_FIXUP_PINS, |
| 1310 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1311 | { 0x14, 0x0121411f }, /* HP */ |
| 1312 | { 0x15, 0x99030120 }, /* speaker */ |
| 1313 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1314 | { } |
| 1315 | }, |
| 1316 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1317 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1318 | .type = HDA_FIXUP_PINS, |
| 1319 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1320 | /* disable bogus unused pins */ |
| 1321 | { 0x17, 0x411111f0 }, |
| 1322 | { 0x19, 0x411111f0 }, |
| 1323 | { 0x1b, 0x411111f0 }, |
| 1324 | { 0x1f, 0x411111f0 }, |
| 1325 | { } |
| 1326 | } |
| 1327 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1328 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1329 | .type = HDA_FIXUP_PINS, |
| 1330 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1331 | /* set up the whole pins as BIOS is utterly broken */ |
| 1332 | { 0x14, 0x99030120 }, /* speaker */ |
| 1333 | { 0x15, 0x0121411f }, /* HP */ |
| 1334 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1335 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1336 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1337 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1338 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1339 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1340 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1341 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1342 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1343 | { } |
| 1344 | } |
| 1345 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1346 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1347 | .type = HDA_FIXUP_PINS, |
| 1348 | .v.pins = (const struct hda_pintbl[]) { |
| 1349 | /* set up the whole pins as BIOS is utterly broken */ |
| 1350 | { 0x14, 0x0121411f }, /* HP */ |
| 1351 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1352 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1353 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1354 | { 0x18, 0x90a60160 }, /* mic */ |
| 1355 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1356 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1357 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1358 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1359 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1360 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1361 | { } |
| 1362 | }, |
| 1363 | .chained = true, |
| 1364 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1365 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1366 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1367 | .type = HDA_FIXUP_PINS, |
| 1368 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1369 | { 0x14, 0x01014010 }, /* line-out */ |
| 1370 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1371 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1372 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1373 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1374 | { 0x19, 0x0121411f }, /* HP */ |
| 1375 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1376 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1377 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1378 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1379 | /* 0x1e is filled in below */ |
| 1380 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1381 | { } |
| 1382 | } |
| 1383 | }, |
| 1384 | [ALC880_FIXUP_3ST] = { |
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, 0x411111f0 }, /* N/A */ |
| 1388 | { } |
| 1389 | }, |
| 1390 | .chained = true, |
| 1391 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1392 | }, |
| 1393 | [ALC880_FIXUP_3ST_DIG] = { |
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 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1397 | { } |
| 1398 | }, |
| 1399 | .chained = true, |
| 1400 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1401 | }, |
| 1402 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1403 | .type = HDA_FIXUP_PINS, |
| 1404 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1405 | { 0x14, 0x01014010 }, /* front */ |
| 1406 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1407 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1408 | { 0x17, 0x01016412 }, /* surr */ |
| 1409 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1410 | { 0x19, 0x0121411f }, /* HP */ |
| 1411 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1412 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1413 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1414 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1415 | /* 0x1e is filled in below */ |
| 1416 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1417 | { } |
| 1418 | } |
| 1419 | }, |
| 1420 | [ALC880_FIXUP_5ST] = { |
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, 0x411111f0 }, /* N/A */ |
| 1424 | { } |
| 1425 | }, |
| 1426 | .chained = true, |
| 1427 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1428 | }, |
| 1429 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1430 | .type = HDA_FIXUP_PINS, |
| 1431 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1432 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1433 | { } |
| 1434 | }, |
| 1435 | .chained = true, |
| 1436 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1437 | }, |
| 1438 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1439 | .type = HDA_FIXUP_PINS, |
| 1440 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1441 | { 0x14, 0x01014010 }, /* front */ |
| 1442 | { 0x15, 0x01016412 }, /* surr */ |
| 1443 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1444 | { 0x17, 0x01012414 }, /* side */ |
| 1445 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1446 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1447 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1448 | { 0x1b, 0x0121411f }, /* HP */ |
| 1449 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1450 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1451 | /* 0x1e is filled in below */ |
| 1452 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1453 | { } |
| 1454 | } |
| 1455 | }, |
| 1456 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1457 | .type = HDA_FIXUP_PINS, |
| 1458 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1459 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1460 | { } |
| 1461 | }, |
| 1462 | .chained = true, |
| 1463 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1464 | }, |
| 1465 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1466 | .type = HDA_FIXUP_PINS, |
| 1467 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1468 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1469 | { } |
| 1470 | }, |
| 1471 | .chained = true, |
| 1472 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1473 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1474 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1475 | .type = HDA_FIXUP_PINS, |
| 1476 | .v.pins = (const struct hda_pintbl[]) { |
| 1477 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1478 | { } |
| 1479 | }, |
| 1480 | .chained_before = true, |
| 1481 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1482 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1483 | }; |
| 1484 | |
| 1485 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1486 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1487 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1488 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1489 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1490 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1491 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1492 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1493 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1494 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1495 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1496 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1497 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1498 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1499 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | a161574 | 2015-08-13 18:05:06 +0200 | [diff] [blame] | 1500 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1501 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1502 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1503 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1504 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1505 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1506 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1507 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1508 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1509 | |
| 1510 | /* Below is the copied entries from alc880_quirks.c. |
| 1511 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1512 | * on these machines, thus they are kept to be compatible with |
| 1513 | * the old static quirks. Once when it's confirmed to work without |
| 1514 | * these overrides, it'd be better to remove. |
| 1515 | */ |
| 1516 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1517 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1518 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1519 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1520 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1521 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1522 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1523 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1524 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1525 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1526 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1527 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1528 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1529 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1530 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1531 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1532 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1533 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1534 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1535 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1536 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1537 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1538 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1539 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1540 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1541 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1542 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1543 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1544 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1545 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1546 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1547 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1548 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1549 | /* default Intel */ |
| 1550 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1551 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1552 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1553 | {} |
| 1554 | }; |
| 1555 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1556 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1557 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1558 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1559 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1560 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1561 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1562 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1563 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1564 | {} |
| 1565 | }; |
| 1566 | |
| 1567 | |
| 1568 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1569 | * OK, here we have finally the patch for ALC880 |
| 1570 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1571 | static int patch_alc880(struct hda_codec *codec) |
| 1572 | { |
| 1573 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1574 | int err; |
| 1575 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1576 | err = alc_alloc_spec(codec, 0x0b); |
| 1577 | if (err < 0) |
| 1578 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1579 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1580 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1581 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1582 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1583 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1584 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1585 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1586 | alc_pre_init(codec); |
| 1587 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1588 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1589 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1590 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1591 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1592 | /* automatic parse from the BIOS config */ |
| 1593 | err = alc880_parse_auto_config(codec); |
| 1594 | if (err < 0) |
| 1595 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1596 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1597 | if (!spec->gen.no_analog) { |
| 1598 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 1599 | if (err < 0) |
| 1600 | goto error; |
| 1601 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1602 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1603 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1604 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1605 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1606 | |
| 1607 | error: |
| 1608 | alc_free(codec); |
| 1609 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1610 | } |
| 1611 | |
| 1612 | |
| 1613 | /* |
| 1614 | * ALC260 support |
| 1615 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1616 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1617 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1618 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1619 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1620 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1621 | } |
| 1622 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1623 | /* |
| 1624 | * Pin config fixes |
| 1625 | */ |
| 1626 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1627 | ALC260_FIXUP_HP_DC5750, |
| 1628 | ALC260_FIXUP_HP_PIN_0F, |
| 1629 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1630 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1631 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1632 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1633 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1634 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1635 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1636 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1637 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1638 | }; |
| 1639 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1640 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1641 | { |
| 1642 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 1643 | |
| 1644 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1645 | } |
| 1646 | |
| 1647 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1648 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1649 | { |
| 1650 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1651 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1652 | /* although the machine has only one output pin, we need to |
| 1653 | * toggle GPIO1 according to the jack state |
| 1654 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1655 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1656 | spec->gen.detect_hp = 1; |
| 1657 | spec->gen.automute_speaker = 1; |
| 1658 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1659 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1660 | snd_hda_gen_hp_automute); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1661 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1662 | } |
| 1663 | } |
| 1664 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1665 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1666 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1667 | { |
| 1668 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1669 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1670 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1671 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1672 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1673 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1674 | /* disable bogus I/O pins */ |
| 1675 | { 0x10, 0x411111f0 }, |
| 1676 | { 0x11, 0x411111f0 }, |
| 1677 | { 0x14, 0x411111f0 }, |
| 1678 | { 0x15, 0x411111f0 }, |
| 1679 | { 0x16, 0x411111f0 }, |
| 1680 | { 0x17, 0x411111f0 }, |
| 1681 | { 0x19, 0x411111f0 }, |
| 1682 | { } |
| 1683 | }; |
| 1684 | |
| 1685 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1686 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1687 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1688 | spec->init_amp = ALC_INIT_NONE; |
| 1689 | break; |
| 1690 | } |
| 1691 | } |
| 1692 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1693 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1694 | const struct hda_fixup *fix, int action) |
| 1695 | { |
| 1696 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 1697 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1698 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1699 | } |
| 1700 | |
| 1701 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1702 | const struct hda_fixup *fix, int action) |
| 1703 | { |
| 1704 | struct alc_spec *spec = codec->spec; |
| 1705 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1706 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1707 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1708 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1709 | } |
| 1710 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1711 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1712 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1713 | .type = HDA_FIXUP_PINS, |
| 1714 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1715 | { 0x11, 0x90130110 }, /* speaker */ |
| 1716 | { } |
| 1717 | } |
| 1718 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1719 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1720 | .type = HDA_FIXUP_PINS, |
| 1721 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1722 | { 0x0f, 0x01214000 }, /* HP */ |
| 1723 | { } |
| 1724 | } |
| 1725 | }, |
| 1726 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1727 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1728 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1729 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1730 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1731 | { } |
| 1732 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1733 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1734 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1735 | .type = HDA_FIXUP_FUNC, |
| 1736 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1737 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1738 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1739 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1740 | .v.func = alc260_fixup_gpio1_toggle, |
| 1741 | .chained = true, |
| 1742 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1743 | }, |
| 1744 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1745 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1746 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1747 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1748 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1749 | { } |
| 1750 | }, |
| 1751 | .chained = true, |
| 1752 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1753 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1754 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1755 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1756 | .v.func = alc260_fixup_gpio1_toggle, |
| 1757 | .chained = true, |
| 1758 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1759 | }, |
| 1760 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1761 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1762 | .v.func = alc260_fixup_kn1, |
| 1763 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1764 | [ALC260_FIXUP_FSC_S7020] = { |
| 1765 | .type = HDA_FIXUP_FUNC, |
| 1766 | .v.func = alc260_fixup_fsc_s7020, |
| 1767 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1768 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1769 | .type = HDA_FIXUP_FUNC, |
| 1770 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1771 | .chained = true, |
| 1772 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1773 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1774 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1775 | .type = HDA_FIXUP_PINS, |
| 1776 | .v.pins = (const struct hda_pintbl[]) { |
| 1777 | /* Pin configs are missing completely on some VAIOs */ |
| 1778 | { 0x0f, 0x01211020 }, |
| 1779 | { 0x10, 0x0001003f }, |
| 1780 | { 0x11, 0x411111f0 }, |
| 1781 | { 0x12, 0x01a15930 }, |
| 1782 | { 0x13, 0x411111f0 }, |
| 1783 | { 0x14, 0x411111f0 }, |
| 1784 | { 0x15, 0x411111f0 }, |
| 1785 | { 0x16, 0x411111f0 }, |
| 1786 | { 0x17, 0x411111f0 }, |
| 1787 | { 0x18, 0x411111f0 }, |
| 1788 | { 0x19, 0x411111f0 }, |
| 1789 | { } |
| 1790 | } |
| 1791 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1792 | }; |
| 1793 | |
| 1794 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1795 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1796 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1797 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1798 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1799 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1800 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1801 | 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] | 1802 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1803 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1804 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1805 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1806 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1807 | {} |
| 1808 | }; |
| 1809 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1810 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1811 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1812 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1813 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1814 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1815 | {} |
| 1816 | }; |
| 1817 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1818 | /* |
| 1819 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1820 | static int patch_alc260(struct hda_codec *codec) |
| 1821 | { |
| 1822 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1823 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1824 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1825 | err = alc_alloc_spec(codec, 0x07); |
| 1826 | if (err < 0) |
| 1827 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1828 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1829 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1830 | /* as quite a few machines require HP amp for speaker outputs, |
| 1831 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1832 | * it's almost harmless. |
| 1833 | */ |
| 1834 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1835 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1836 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1837 | spec->shutup = alc_eapd_shutup; |
| 1838 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1839 | alc_pre_init(codec); |
| 1840 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1841 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1842 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1843 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1844 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1845 | /* automatic parse from the BIOS config */ |
| 1846 | err = alc260_parse_auto_config(codec); |
| 1847 | if (err < 0) |
| 1848 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1849 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1850 | if (!spec->gen.no_analog) { |
| 1851 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
| 1852 | if (err < 0) |
| 1853 | goto error; |
| 1854 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1855 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1856 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1857 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1858 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1859 | |
| 1860 | error: |
| 1861 | alc_free(codec); |
| 1862 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1863 | } |
| 1864 | |
| 1865 | |
| 1866 | /* |
| 1867 | * ALC882/883/885/888/889 support |
| 1868 | * |
| 1869 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1870 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1871 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1872 | * 6-channel independent captures. |
| 1873 | * |
| 1874 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1875 | * driver yet). |
| 1876 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1877 | |
| 1878 | /* |
| 1879 | * Pin config fixes |
| 1880 | */ |
| 1881 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1882 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1883 | ALC882_FIXUP_LENOVO_Y530, |
| 1884 | ALC882_FIXUP_PB_M5210, |
| 1885 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1886 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1887 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1888 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1889 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1890 | ALC888_FIXUP_EEE1601, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1891 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1892 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1893 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1894 | ALC882_FIXUP_GPIO1, |
| 1895 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1896 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1897 | ALC889_FIXUP_COEF, |
| 1898 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1899 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1900 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1901 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1902 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1903 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1904 | ALC889_FIXUP_MBP_VREF, |
| 1905 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1906 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1907 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1908 | ALC889_FIXUP_MP11_VREF, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1909 | ALC889_FIXUP_MP41_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1910 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1911 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1912 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1913 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1914 | ALC1220_FIXUP_GB_DUAL_CODECS, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 1915 | ALC1220_FIXUP_CLEVO_P950, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 1916 | ALC1220_FIXUP_CLEVO_PB51ED, |
| 1917 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1918 | }; |
| 1919 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1920 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1921 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1922 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1923 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1924 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1925 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1926 | } |
| 1927 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1928 | /* set up GPIO at initialization */ |
| 1929 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1930 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1931 | { |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 1932 | struct alc_spec *spec = codec->spec; |
| 1933 | |
| 1934 | spec->gpio_write_delay = true; |
| 1935 | alc_fixup_gpio3(codec, fix, action); |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1936 | } |
| 1937 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1938 | /* Fix the connection of some pins for ALC889: |
| 1939 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1940 | * work correctly (bko#42740) |
| 1941 | */ |
| 1942 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1943 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1944 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1945 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1946 | /* fake the connections during parsing the tree */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1947 | static const hda_nid_t conn1[] = { 0x0c, 0x0d }; |
| 1948 | static const hda_nid_t conn2[] = { 0x0e, 0x0f }; |
| 1949 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 1950 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
| 1951 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); |
| 1952 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1953 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1954 | /* restore the connections */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1955 | static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1956 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); |
| 1957 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); |
| 1958 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); |
| 1959 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1960 | } |
| 1961 | } |
| 1962 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1963 | /* Set VREF on HP pin */ |
| 1964 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1965 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1966 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1967 | static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1968 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1969 | int i; |
| 1970 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1971 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1972 | return; |
| 1973 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1974 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1975 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1976 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1977 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1978 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1979 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1980 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1981 | break; |
| 1982 | } |
| 1983 | } |
| 1984 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1985 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 1986 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1987 | { |
| 1988 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1989 | int i; |
| 1990 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1991 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1992 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1993 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1994 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1995 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1996 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1997 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1998 | } |
| 1999 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2000 | /* Set VREF on speaker pins on imac91 */ |
| 2001 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 2002 | const struct hda_fixup *fix, int action) |
| 2003 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2004 | static const hda_nid_t nids[] = { 0x18, 0x1a }; |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2005 | |
| 2006 | if (action == HDA_FIXUP_ACT_INIT) |
| 2007 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2008 | } |
| 2009 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2010 | /* Set VREF on speaker pins on mba11 */ |
| 2011 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 2012 | const struct hda_fixup *fix, int action) |
| 2013 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2014 | static const hda_nid_t nids[] = { 0x18 }; |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2015 | |
| 2016 | if (action == HDA_FIXUP_ACT_INIT) |
| 2017 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2018 | } |
| 2019 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2020 | /* Set VREF on speaker pins on mba21 */ |
| 2021 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 2022 | const struct hda_fixup *fix, int action) |
| 2023 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2024 | static const hda_nid_t nids[] = { 0x18, 0x19 }; |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2025 | |
| 2026 | if (action == HDA_FIXUP_ACT_INIT) |
| 2027 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2028 | } |
| 2029 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2030 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 2031 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 2032 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2033 | */ |
| 2034 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2035 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2036 | { |
| 2037 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2038 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2039 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2040 | spec->gen.no_multi_io = 1; |
| 2041 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2042 | } |
| 2043 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2044 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 2045 | const struct hda_fixup *fix, int action); |
| 2046 | |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2047 | /* For dual-codec configuration, we need to disable some features to avoid |
| 2048 | * conflicts of kctls and PCM streams |
| 2049 | */ |
| 2050 | static void alc_fixup_dual_codecs(struct hda_codec *codec, |
| 2051 | const struct hda_fixup *fix, int action) |
| 2052 | { |
| 2053 | struct alc_spec *spec = codec->spec; |
| 2054 | |
| 2055 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2056 | return; |
| 2057 | /* disable vmaster */ |
| 2058 | spec->gen.suppress_vmaster = 1; |
| 2059 | /* auto-mute and auto-mic switch don't work with multiple codecs */ |
| 2060 | spec->gen.suppress_auto_mute = 1; |
| 2061 | spec->gen.suppress_auto_mic = 1; |
| 2062 | /* disable aamix as well */ |
| 2063 | spec->gen.mixer_nid = 0; |
| 2064 | /* add location prefix to avoid conflicts */ |
| 2065 | codec->force_pin_prefix = 1; |
| 2066 | } |
| 2067 | |
| 2068 | static void rename_ctl(struct hda_codec *codec, const char *oldname, |
| 2069 | const char *newname) |
| 2070 | { |
| 2071 | struct snd_kcontrol *kctl; |
| 2072 | |
| 2073 | kctl = snd_hda_find_mixer_ctl(codec, oldname); |
| 2074 | if (kctl) |
| 2075 | strcpy(kctl->id.name, newname); |
| 2076 | } |
| 2077 | |
| 2078 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
| 2079 | const struct hda_fixup *fix, |
| 2080 | int action) |
| 2081 | { |
| 2082 | alc_fixup_dual_codecs(codec, fix, action); |
| 2083 | switch (action) { |
| 2084 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2085 | /* override card longname to provide a unique UCM profile */ |
| 2086 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); |
| 2087 | break; |
| 2088 | case HDA_FIXUP_ACT_BUILD: |
| 2089 | /* rename Capture controls depending on the codec */ |
| 2090 | rename_ctl(codec, "Capture Volume", |
| 2091 | codec->addr == 0 ? |
| 2092 | "Rear-Panel Capture Volume" : |
| 2093 | "Front-Panel Capture Volume"); |
| 2094 | rename_ctl(codec, "Capture Switch", |
| 2095 | codec->addr == 0 ? |
| 2096 | "Rear-Panel Capture Switch" : |
| 2097 | "Front-Panel Capture Switch"); |
| 2098 | break; |
| 2099 | } |
| 2100 | } |
| 2101 | |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2102 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
| 2103 | const struct hda_fixup *fix, |
| 2104 | int action) |
| 2105 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2106 | static const hda_nid_t conn1[] = { 0x0c }; |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2107 | |
| 2108 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2109 | return; |
| 2110 | |
| 2111 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); |
| 2112 | /* We therefore want to make sure 0x14 (front headphone) and |
| 2113 | * 0x1b (speakers) use the stereo DAC 0x02 |
| 2114 | */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2115 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 2116 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2117 | } |
| 2118 | |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2119 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 2120 | const struct hda_fixup *fix, int action); |
| 2121 | |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2122 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2123 | const struct hda_fixup *fix, |
| 2124 | int action) |
| 2125 | { |
| 2126 | alc1220_fixup_clevo_p950(codec, fix, action); |
| 2127 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); |
| 2128 | } |
| 2129 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2130 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2131 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2132 | .type = HDA_FIXUP_PINS, |
| 2133 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2134 | { 0x15, 0x01080104 }, /* side */ |
| 2135 | { 0x16, 0x01011012 }, /* rear */ |
| 2136 | { 0x17, 0x01016011 }, /* clfe */ |
| 2137 | { } |
| 2138 | } |
| 2139 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2140 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2141 | .type = HDA_FIXUP_PINS, |
| 2142 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2143 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2144 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2145 | { } |
| 2146 | } |
| 2147 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2148 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2149 | .type = HDA_FIXUP_PINCTLS, |
| 2150 | .v.pins = (const struct hda_pintbl[]) { |
| 2151 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2152 | {} |
| 2153 | } |
| 2154 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2155 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2156 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2157 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2158 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2159 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2160 | .type = HDA_FIXUP_PINS, |
| 2161 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2162 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2163 | { } |
| 2164 | } |
| 2165 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2166 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2167 | .type = HDA_FIXUP_PINS, |
| 2168 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2169 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2170 | { } |
| 2171 | } |
| 2172 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2173 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2174 | .type = HDA_FIXUP_PINS, |
| 2175 | .v.pins = (const struct hda_pintbl[]) { |
| 2176 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2177 | { } |
| 2178 | }, |
| 2179 | .chained = true, |
| 2180 | .chain_id = ALC889_FIXUP_CD, |
| 2181 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2182 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2183 | .type = HDA_FIXUP_PINS, |
| 2184 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2185 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2186 | { } |
| 2187 | } |
| 2188 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2189 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2190 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2191 | .v.verbs = (const struct hda_verb[]) { |
| 2192 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2193 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2194 | { } |
| 2195 | } |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2196 | }, |
| 2197 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2198 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2199 | .v.verbs = (const struct hda_verb[]) { |
| 2200 | /* change to EAPD mode */ |
| 2201 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2202 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2203 | { } |
| 2204 | } |
| 2205 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2206 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2207 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2208 | .v.verbs = (const struct hda_verb[]) { |
| 2209 | /* change to EAPD mode */ |
| 2210 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2211 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2212 | { } |
| 2213 | } |
| 2214 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2215 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2216 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2217 | .v.verbs = (const struct hda_verb[]) { |
| 2218 | /* eanable EAPD on Acer laptops */ |
| 2219 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2220 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2221 | { } |
| 2222 | } |
| 2223 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2224 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2225 | .type = HDA_FIXUP_FUNC, |
| 2226 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2227 | }, |
| 2228 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2229 | .type = HDA_FIXUP_FUNC, |
| 2230 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2231 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2232 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2233 | .type = HDA_FIXUP_FUNC, |
| 2234 | .v.func = alc_fixup_gpio3, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2235 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2236 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2237 | .type = HDA_FIXUP_FUNC, |
| 2238 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2239 | .chained = true, |
| 2240 | .chain_id = ALC882_FIXUP_EAPD, |
| 2241 | }, |
| 2242 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2243 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2244 | .v.func = alc889_fixup_coef, |
| 2245 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2246 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2247 | .type = HDA_FIXUP_PINS, |
| 2248 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2249 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2250 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2251 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2252 | }, |
| 2253 | .chained = true, |
| 2254 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2255 | }, |
| 2256 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2257 | .type = HDA_FIXUP_PINS, |
| 2258 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2259 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2260 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2261 | { } |
| 2262 | }, |
| 2263 | .chained = true, |
| 2264 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2265 | }, |
| 2266 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2267 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2268 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2269 | .v.verbs = (const struct hda_verb[]) { |
| 2270 | /* Enable all DACs */ |
| 2271 | /* DAC DISABLE/MUTE 1? */ |
| 2272 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2273 | * apparently. Init=0x38 */ |
| 2274 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2275 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2276 | /* DAC DISABLE/MUTE 2? */ |
| 2277 | /* some bit here disables the other DACs. |
| 2278 | * Init=0x4900 */ |
| 2279 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2280 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2281 | /* DMIC fix |
| 2282 | * This laptop has a stereo digital microphone. |
| 2283 | * The mics are only 1cm apart which makes the stereo |
| 2284 | * useless. However, either the mic or the ALC889 |
| 2285 | * makes the signal become a difference/sum signal |
| 2286 | * instead of standard stereo, which is annoying. |
| 2287 | * So instead we flip this bit which makes the |
| 2288 | * codec replicate the sum signal to both channels, |
| 2289 | * turning it into a normal mono mic. |
| 2290 | */ |
| 2291 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2292 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2293 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2294 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2295 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2296 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2297 | }, |
| 2298 | .chained = true, |
| 2299 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2300 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2301 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2302 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2303 | .v.func = alc885_fixup_macpro_gpio, |
| 2304 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2305 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2306 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2307 | .v.func = alc889_fixup_dac_route, |
| 2308 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2309 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2310 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2311 | .v.func = alc889_fixup_mbp_vref, |
| 2312 | .chained = true, |
| 2313 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2314 | }, |
| 2315 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2316 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2317 | .v.func = alc889_fixup_imac91_vref, |
| 2318 | .chained = true, |
| 2319 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2320 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2321 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2322 | .type = HDA_FIXUP_FUNC, |
| 2323 | .v.func = alc889_fixup_mba11_vref, |
| 2324 | .chained = true, |
| 2325 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2326 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2327 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2328 | .type = HDA_FIXUP_FUNC, |
| 2329 | .v.func = alc889_fixup_mba21_vref, |
| 2330 | .chained = true, |
| 2331 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2332 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2333 | [ALC889_FIXUP_MP11_VREF] = { |
| 2334 | .type = HDA_FIXUP_FUNC, |
| 2335 | .v.func = alc889_fixup_mba11_vref, |
| 2336 | .chained = true, |
| 2337 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2338 | }, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2339 | [ALC889_FIXUP_MP41_VREF] = { |
| 2340 | .type = HDA_FIXUP_FUNC, |
| 2341 | .v.func = alc889_fixup_mbp_vref, |
| 2342 | .chained = true, |
| 2343 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2344 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2345 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2346 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2347 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2348 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2349 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2350 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2351 | .v.func = alc882_fixup_no_primary_hp, |
| 2352 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2353 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2354 | .type = HDA_FIXUP_PINS, |
| 2355 | .v.pins = (const struct hda_pintbl[]) { |
| 2356 | {0x16, 0x99130130}, /* bass speaker */ |
| 2357 | {} |
| 2358 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2359 | .chained = true, |
| 2360 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2361 | }, |
| 2362 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2363 | .type = HDA_FIXUP_FUNC, |
| 2364 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2365 | }, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2366 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
| 2367 | .type = HDA_FIXUP_FUNC, |
| 2368 | .v.func = alc1220_fixup_gb_dual_codecs, |
| 2369 | }, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2370 | [ALC1220_FIXUP_CLEVO_P950] = { |
| 2371 | .type = HDA_FIXUP_FUNC, |
| 2372 | .v.func = alc1220_fixup_clevo_p950, |
| 2373 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2374 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2375 | .type = HDA_FIXUP_FUNC, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2376 | .v.func = alc1220_fixup_clevo_pb51ed, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2377 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2378 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2379 | .type = HDA_FIXUP_PINS, |
| 2380 | .v.pins = (const struct hda_pintbl[]) { |
| 2381 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 2382 | {} |
| 2383 | }, |
| 2384 | .chained = true, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2385 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2386 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2387 | }; |
| 2388 | |
| 2389 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2390 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2391 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | b5d724b | 2015-06-02 19:57:08 +0200 | [diff] [blame] | 2392 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2393 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2394 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2395 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2396 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2397 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2398 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2399 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2400 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2401 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2402 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2403 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2404 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2405 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2406 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2407 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2408 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2409 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2410 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2411 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2412 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2413 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2414 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2415 | 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] | 2416 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2417 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2418 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2419 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2420 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2421 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | 85bcf96 | 2016-12-06 16:20:36 +0100 | [diff] [blame] | 2422 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2423 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2424 | 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] | 2425 | 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] | 2426 | 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] | 2427 | 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] | 2428 | |
| 2429 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2430 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2431 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2432 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2433 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2434 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2435 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2436 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2437 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2438 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2439 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2440 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2441 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2442 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2443 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2444 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2445 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2446 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2447 | 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] | 2448 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2449 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2450 | 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] | 2451 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2452 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2453 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2454 | 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] | 2455 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
Christian Lachner | 0d45e86 | 2020-02-23 10:24:16 +0100 | [diff] [blame] | 2456 | SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | a655e2b | 2020-02-17 16:19:47 +0100 | [diff] [blame] | 2457 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 7dafba3 | 2020-02-12 09:10:47 +0100 | [diff] [blame] | 2458 | SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | cc5049a | 2020-02-18 09:09:15 +0100 | [diff] [blame] | 2459 | SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | d2c3b14 | 2017-06-01 09:35:30 +0200 | [diff] [blame] | 2460 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | 6369158 | 2017-05-22 16:32:46 +0200 | [diff] [blame] | 2461 | 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] | 2462 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2463 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2464 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | f3d737b | 2018-07-17 17:08:32 +0200 | [diff] [blame] | 2465 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
Jeremy Soller | 2f0d520 | 2018-05-07 09:28:45 -0600 | [diff] [blame] | 2466 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
Richard Sailer | 503d90b | 2019-06-19 13:33:11 +0200 | [diff] [blame] | 2467 | SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), |
| 2468 | SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), |
| 2469 | SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2470 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2471 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2472 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2473 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2474 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2475 | {} |
| 2476 | }; |
| 2477 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2478 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2479 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
| 2480 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, |
| 2481 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, |
| 2482 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, |
| 2483 | {.id = ALC889_FIXUP_CD, .name = "cd"}, |
| 2484 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, |
| 2485 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, |
| 2486 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, |
| 2487 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, |
| 2488 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, |
| 2489 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, |
| 2490 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, |
| 2491 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, |
| 2492 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, |
| 2493 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2494 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2495 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2496 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2497 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
| 2498 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, |
| 2499 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, |
| 2500 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, |
| 2501 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, |
| 2502 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, |
| 2503 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, |
| 2504 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2505 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2506 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2507 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 2508 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2509 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2510 | {} |
| 2511 | }; |
| 2512 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2513 | /* |
| 2514 | * BIOS auto configuration |
| 2515 | */ |
| 2516 | /* almost identical with ALC880 parser... */ |
| 2517 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2518 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2519 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2520 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2521 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2522 | } |
| 2523 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2524 | /* |
| 2525 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2526 | static int patch_alc882(struct hda_codec *codec) |
| 2527 | { |
| 2528 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2529 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2530 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2531 | err = alc_alloc_spec(codec, 0x0b); |
| 2532 | if (err < 0) |
| 2533 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2534 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2535 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2536 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 2537 | switch (codec->core.vendor_id) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2538 | case 0x10ec0882: |
| 2539 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2540 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 2541 | case 0x10ec0b00: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 2542 | case 0x10ec1220: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2543 | break; |
| 2544 | default: |
| 2545 | /* ALC883 and variants */ |
| 2546 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2547 | break; |
| 2548 | } |
| 2549 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2550 | alc_pre_init(codec); |
| 2551 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2552 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2553 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2554 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2555 | |
| 2556 | alc_auto_parse_customize_define(codec); |
| 2557 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2558 | if (has_cdefine_beep(codec)) |
| 2559 | spec->gen.beep_nid = 0x01; |
| 2560 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2561 | /* automatic parse from the BIOS config */ |
| 2562 | err = alc882_parse_auto_config(codec); |
| 2563 | if (err < 0) |
| 2564 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2565 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2566 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2567 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2568 | if (err < 0) |
| 2569 | goto error; |
| 2570 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2571 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2572 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2573 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2574 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2575 | |
| 2576 | error: |
| 2577 | alc_free(codec); |
| 2578 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2579 | } |
| 2580 | |
| 2581 | |
| 2582 | /* |
| 2583 | * ALC262 support |
| 2584 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2585 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2586 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2587 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2588 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2589 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2590 | } |
| 2591 | |
| 2592 | /* |
| 2593 | * Pin config fixes |
| 2594 | */ |
| 2595 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2596 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2597 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2598 | ALC262_FIXUP_HP_Z200, |
| 2599 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2600 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2601 | ALC262_FIXUP_BENQ, |
| 2602 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2603 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2604 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2605 | }; |
| 2606 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2607 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2608 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2609 | .type = HDA_FIXUP_PINS, |
| 2610 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2611 | { 0x14, 0x99130110 }, /* speaker */ |
| 2612 | { 0x15, 0x0221142f }, /* front HP */ |
| 2613 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2614 | { } |
| 2615 | } |
| 2616 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2617 | [ALC262_FIXUP_FSC_S7110] = { |
| 2618 | .type = HDA_FIXUP_PINS, |
| 2619 | .v.pins = (const struct hda_pintbl[]) { |
| 2620 | { 0x15, 0x90170110 }, /* speaker */ |
| 2621 | { } |
| 2622 | }, |
| 2623 | .chained = true, |
| 2624 | .chain_id = ALC262_FIXUP_BENQ, |
| 2625 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2626 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2627 | .type = HDA_FIXUP_PINS, |
| 2628 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2629 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2630 | { } |
| 2631 | } |
| 2632 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2633 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2634 | .type = HDA_FIXUP_PINS, |
| 2635 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2636 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2637 | { } |
| 2638 | } |
| 2639 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2640 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2641 | .type = HDA_FIXUP_PINCTLS, |
| 2642 | .v.pins = (const struct hda_pintbl[]) { |
| 2643 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2644 | {} |
| 2645 | }, |
| 2646 | .chained = true, |
| 2647 | .chain_id = ALC262_FIXUP_BENQ, |
| 2648 | }, |
| 2649 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2650 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2651 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2652 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2653 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2654 | {} |
| 2655 | } |
| 2656 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2657 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2658 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2659 | .v.verbs = (const struct hda_verb[]) { |
| 2660 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2661 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2662 | {} |
| 2663 | } |
| 2664 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2665 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2666 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2667 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2668 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2669 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2670 | .type = HDA_FIXUP_FUNC, |
| 2671 | .v.func = alc_fixup_no_depop_delay, |
| 2672 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2673 | }; |
| 2674 | |
| 2675 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2676 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2677 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2678 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2679 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
Takashi Iwai | 275ec0c | 2018-06-22 12:17:45 +0200 | [diff] [blame] | 2680 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2681 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2682 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2683 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2684 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2685 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2686 | {} |
| 2687 | }; |
| 2688 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2689 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2690 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e43c44d | 2018-06-26 17:02:08 +0200 | [diff] [blame] | 2691 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
| 2692 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, |
| 2693 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, |
| 2694 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, |
| 2695 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, |
| 2696 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, |
| 2697 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, |
| 2698 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2699 | {} |
| 2700 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2701 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2702 | /* |
| 2703 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2704 | static int patch_alc262(struct hda_codec *codec) |
| 2705 | { |
| 2706 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2707 | int err; |
| 2708 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2709 | err = alc_alloc_spec(codec, 0x0b); |
| 2710 | if (err < 0) |
| 2711 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2712 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2713 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2714 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2715 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2716 | spec->shutup = alc_eapd_shutup; |
| 2717 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2718 | #if 0 |
| 2719 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2720 | * under-run |
| 2721 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2722 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2723 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2724 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2725 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2726 | alc_pre_init(codec); |
| 2727 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2728 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2729 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2730 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2731 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2732 | alc_auto_parse_customize_define(codec); |
| 2733 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2734 | if (has_cdefine_beep(codec)) |
| 2735 | spec->gen.beep_nid = 0x01; |
| 2736 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2737 | /* automatic parse from the BIOS config */ |
| 2738 | err = alc262_parse_auto_config(codec); |
| 2739 | if (err < 0) |
| 2740 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2741 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2742 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2743 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2744 | if (err < 0) |
| 2745 | goto error; |
| 2746 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2747 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2748 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2749 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2750 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2751 | |
| 2752 | error: |
| 2753 | alc_free(codec); |
| 2754 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2755 | } |
| 2756 | |
| 2757 | /* |
| 2758 | * ALC268 |
| 2759 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2760 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2761 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 2762 | struct snd_ctl_elem_value *ucontrol) |
| 2763 | { |
| 2764 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2765 | unsigned long pval; |
| 2766 | int err; |
| 2767 | |
| 2768 | mutex_lock(&codec->control_mutex); |
| 2769 | pval = kcontrol->private_value; |
| 2770 | kcontrol->private_value = (pval & ~0xff) | 0x0f; |
| 2771 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2772 | if (err >= 0) { |
| 2773 | kcontrol->private_value = (pval & ~0xff) | 0x10; |
| 2774 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2775 | } |
| 2776 | kcontrol->private_value = pval; |
| 2777 | mutex_unlock(&codec->control_mutex); |
| 2778 | return err; |
| 2779 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2780 | |
| 2781 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2782 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2783 | { |
| 2784 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2785 | .name = "Beep Playback Switch", |
| 2786 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
| 2787 | .info = snd_hda_mixer_amp_switch_info, |
| 2788 | .get = snd_hda_mixer_amp_switch_get, |
| 2789 | .put = alc268_beep_switch_put, |
| 2790 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) |
| 2791 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2792 | }; |
| 2793 | |
| 2794 | /* set PCBEEP vol = 0, mute connections */ |
| 2795 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2796 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2797 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2798 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2799 | { } |
| 2800 | }; |
| 2801 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2802 | enum { |
| 2803 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2804 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2805 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2806 | }; |
| 2807 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2808 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2809 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2810 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2811 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2812 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2813 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2814 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2815 | .v.verbs = (const struct hda_verb[]) { |
| 2816 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2817 | {} |
| 2818 | } |
| 2819 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2820 | [ALC268_FIXUP_SPDIF] = { |
| 2821 | .type = HDA_FIXUP_PINS, |
| 2822 | .v.pins = (const struct hda_pintbl[]) { |
| 2823 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2824 | {} |
| 2825 | } |
| 2826 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2827 | }; |
| 2828 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2829 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2830 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2831 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
Takashi Iwai | 03bf11c | 2018-06-26 16:56:41 +0200 | [diff] [blame] | 2832 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2833 | {} |
| 2834 | }; |
| 2835 | |
| 2836 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2837 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2838 | 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] | 2839 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2840 | * same PCI SSID 1179:ff00 |
| 2841 | */ |
| 2842 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2843 | {} |
| 2844 | }; |
| 2845 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2846 | /* |
| 2847 | * BIOS auto configuration |
| 2848 | */ |
| 2849 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2850 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2851 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2852 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2853 | } |
| 2854 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2855 | /* |
| 2856 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2857 | static int patch_alc268(struct hda_codec *codec) |
| 2858 | { |
| 2859 | struct alc_spec *spec; |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2860 | int i, err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2861 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2862 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2863 | err = alc_alloc_spec(codec, 0); |
| 2864 | if (err < 0) |
| 2865 | return err; |
| 2866 | |
| 2867 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 2868 | if (has_cdefine_beep(codec)) |
| 2869 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2870 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2871 | spec->shutup = alc_eapd_shutup; |
| 2872 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2873 | alc_pre_init(codec); |
| 2874 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2875 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2876 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2877 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2878 | /* automatic parse from the BIOS config */ |
| 2879 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2880 | if (err < 0) |
| 2881 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2882 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2883 | if (err > 0 && !spec->gen.no_analog && |
| 2884 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2885 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
| 2886 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 2887 | &alc268_beep_mixer[i])) { |
| 2888 | err = -ENOMEM; |
| 2889 | goto error; |
| 2890 | } |
| 2891 | } |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2892 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2893 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2894 | /* override the amp caps for beep generator */ |
| 2895 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2896 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2897 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2898 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2899 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2900 | } |
| 2901 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2902 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2903 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2904 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2905 | |
| 2906 | error: |
| 2907 | alc_free(codec); |
| 2908 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2909 | } |
| 2910 | |
| 2911 | /* |
| 2912 | * ALC269 |
| 2913 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2914 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2915 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2916 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2917 | }; |
| 2918 | |
| 2919 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2920 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2921 | }; |
| 2922 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2923 | /* different alc269-variants */ |
| 2924 | enum { |
| 2925 | ALC269_TYPE_ALC269VA, |
| 2926 | ALC269_TYPE_ALC269VB, |
| 2927 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2928 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2929 | ALC269_TYPE_ALC280, |
| 2930 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2931 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2932 | ALC269_TYPE_ALC284, |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2933 | ALC269_TYPE_ALC293, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2934 | ALC269_TYPE_ALC286, |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2935 | ALC269_TYPE_ALC298, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2936 | ALC269_TYPE_ALC255, |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2937 | ALC269_TYPE_ALC256, |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2938 | ALC269_TYPE_ALC257, |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2939 | ALC269_TYPE_ALC215, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2940 | ALC269_TYPE_ALC225, |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2941 | ALC269_TYPE_ALC294, |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2942 | ALC269_TYPE_ALC300, |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 2943 | ALC269_TYPE_ALC623, |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2944 | ALC269_TYPE_ALC700, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2945 | }; |
| 2946 | |
| 2947 | /* |
| 2948 | * BIOS auto configuration |
| 2949 | */ |
| 2950 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 2951 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2952 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2953 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 2954 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2955 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2956 | const hda_nid_t *ssids; |
| 2957 | |
| 2958 | switch (spec->codec_variant) { |
| 2959 | case ALC269_TYPE_ALC269VA: |
| 2960 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2961 | case ALC269_TYPE_ALC280: |
| 2962 | case ALC269_TYPE_ALC284: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2963 | case ALC269_TYPE_ALC293: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2964 | ssids = alc269va_ssids; |
| 2965 | break; |
| 2966 | case ALC269_TYPE_ALC269VB: |
| 2967 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2968 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2969 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2970 | case ALC269_TYPE_ALC286: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2971 | case ALC269_TYPE_ALC298: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2972 | case ALC269_TYPE_ALC255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2973 | case ALC269_TYPE_ALC256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2974 | case ALC269_TYPE_ALC257: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2975 | case ALC269_TYPE_ALC215: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2976 | case ALC269_TYPE_ALC225: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2977 | case ALC269_TYPE_ALC294: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2978 | case ALC269_TYPE_ALC300: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 2979 | case ALC269_TYPE_ALC623: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2980 | case ALC269_TYPE_ALC700: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2981 | ssids = alc269_ssids; |
| 2982 | break; |
| 2983 | default: |
| 2984 | ssids = alc269_ssids; |
| 2985 | break; |
| 2986 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2987 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2988 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2989 | } |
| 2990 | |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 2991 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
| 2992 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, |
| 2993 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, |
| 2994 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, |
| 2995 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, |
| 2996 | {} |
| 2997 | }; |
| 2998 | |
| 2999 | static void alc_headset_btn_callback(struct hda_codec *codec, |
| 3000 | struct hda_jack_callback *jack) |
| 3001 | { |
| 3002 | int report = 0; |
| 3003 | |
| 3004 | if (jack->unsol_res & (7 << 13)) |
| 3005 | report |= SND_JACK_BTN_0; |
| 3006 | |
| 3007 | if (jack->unsol_res & (1 << 16 | 3 << 8)) |
| 3008 | report |= SND_JACK_BTN_1; |
| 3009 | |
| 3010 | /* Volume up key */ |
| 3011 | if (jack->unsol_res & (7 << 23)) |
| 3012 | report |= SND_JACK_BTN_2; |
| 3013 | |
| 3014 | /* Volume down key */ |
| 3015 | if (jack->unsol_res & (7 << 10)) |
| 3016 | report |= SND_JACK_BTN_3; |
| 3017 | |
| 3018 | jack->jack->button_state = report; |
| 3019 | } |
| 3020 | |
| 3021 | static void alc_disable_headset_jack_key(struct hda_codec *codec) |
| 3022 | { |
| 3023 | struct alc_spec *spec = codec->spec; |
| 3024 | |
| 3025 | if (!spec->has_hs_key) |
| 3026 | return; |
| 3027 | |
| 3028 | switch (codec->core.vendor_id) { |
| 3029 | case 0x10ec0215: |
| 3030 | case 0x10ec0225: |
| 3031 | case 0x10ec0285: |
| 3032 | case 0x10ec0295: |
| 3033 | case 0x10ec0289: |
| 3034 | case 0x10ec0299: |
| 3035 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3036 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3037 | alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); |
| 3038 | break; |
| 3039 | case 0x10ec0236: |
| 3040 | case 0x10ec0256: |
| 3041 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3042 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3043 | break; |
| 3044 | } |
| 3045 | } |
| 3046 | |
| 3047 | static void alc_enable_headset_jack_key(struct hda_codec *codec) |
| 3048 | { |
| 3049 | struct alc_spec *spec = codec->spec; |
| 3050 | |
| 3051 | if (!spec->has_hs_key) |
| 3052 | return; |
| 3053 | |
| 3054 | switch (codec->core.vendor_id) { |
| 3055 | case 0x10ec0215: |
| 3056 | case 0x10ec0225: |
| 3057 | case 0x10ec0285: |
| 3058 | case 0x10ec0295: |
| 3059 | case 0x10ec0289: |
| 3060 | case 0x10ec0299: |
| 3061 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3062 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3063 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); |
| 3064 | break; |
| 3065 | case 0x10ec0236: |
| 3066 | case 0x10ec0256: |
| 3067 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3068 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3069 | break; |
| 3070 | } |
| 3071 | } |
| 3072 | |
| 3073 | static void alc_fixup_headset_jack(struct hda_codec *codec, |
| 3074 | const struct hda_fixup *fix, int action) |
| 3075 | { |
| 3076 | struct alc_spec *spec = codec->spec; |
| 3077 | |
| 3078 | switch (action) { |
| 3079 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 3080 | spec->has_hs_key = 1; |
| 3081 | snd_hda_jack_detect_enable_callback(codec, 0x55, |
| 3082 | alc_headset_btn_callback); |
| 3083 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, |
| 3084 | SND_JACK_HEADSET, alc_headset_btn_keymap); |
| 3085 | break; |
| 3086 | case HDA_FIXUP_ACT_INIT: |
| 3087 | alc_enable_headset_jack_key(codec); |
| 3088 | break; |
| 3089 | } |
| 3090 | } |
| 3091 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3092 | 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] | 3093 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3094 | 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] | 3095 | } |
| 3096 | |
| 3097 | static void alc269_shutup(struct hda_codec *codec) |
| 3098 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3099 | struct alc_spec *spec = codec->spec; |
| 3100 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3101 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3102 | alc269vb_toggle_power_output(codec, 0); |
| 3103 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 3104 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3105 | msleep(150); |
| 3106 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3107 | alc_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3108 | } |
| 3109 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3110 | static const struct coef_fw alc282_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3111 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 3112 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3113 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3114 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3115 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3116 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3117 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3118 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 3119 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3120 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3121 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 3122 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 3123 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 3124 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 3125 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3126 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3127 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3128 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 3129 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 3130 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 3131 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 3132 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 3133 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 3134 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 3135 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3136 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 3137 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 3138 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 3139 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 3140 | {} |
| 3141 | }; |
| 3142 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3143 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 3144 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3145 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3146 | } |
| 3147 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3148 | static void alc282_init(struct hda_codec *codec) |
| 3149 | { |
| 3150 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3151 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3152 | bool hp_pin_sense; |
| 3153 | int coef78; |
| 3154 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3155 | alc282_restore_default_value(codec); |
| 3156 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3157 | if (!hp_pin) |
| 3158 | return; |
| 3159 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3160 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3161 | |
| 3162 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 3163 | /* Headphone capless set to high power mode */ |
| 3164 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3165 | |
| 3166 | if (hp_pin_sense) |
| 3167 | msleep(2); |
| 3168 | |
| 3169 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3170 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3171 | |
| 3172 | if (hp_pin_sense) |
| 3173 | msleep(85); |
| 3174 | |
| 3175 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3176 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3177 | |
| 3178 | if (hp_pin_sense) |
| 3179 | msleep(100); |
| 3180 | |
| 3181 | /* Headphone capless set to normal mode */ |
| 3182 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3183 | } |
| 3184 | |
| 3185 | static void alc282_shutup(struct hda_codec *codec) |
| 3186 | { |
| 3187 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3188 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3189 | bool hp_pin_sense; |
| 3190 | int coef78; |
| 3191 | |
| 3192 | if (!hp_pin) { |
| 3193 | alc269_shutup(codec); |
| 3194 | return; |
| 3195 | } |
| 3196 | |
| 3197 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3198 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3199 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3200 | |
| 3201 | if (hp_pin_sense) |
| 3202 | msleep(2); |
| 3203 | |
| 3204 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3205 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3206 | |
| 3207 | if (hp_pin_sense) |
| 3208 | msleep(85); |
| 3209 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3210 | if (!spec->no_shutup_pins) |
| 3211 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3212 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3213 | |
| 3214 | if (hp_pin_sense) |
| 3215 | msleep(100); |
| 3216 | |
| 3217 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3218 | alc_shutup_pins(codec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3219 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3220 | } |
| 3221 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3222 | static const struct coef_fw alc283_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3223 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3224 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3225 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3226 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3227 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3228 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3229 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3230 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 3231 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3232 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3233 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 3234 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 3235 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 3236 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 3237 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3238 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3239 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3240 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 3241 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 3242 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 3243 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 3244 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 3245 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 3246 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 3247 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3248 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 3249 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 3250 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 3251 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 3252 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 3253 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 3254 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3255 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3256 | {} |
| 3257 | }; |
| 3258 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3259 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 3260 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3261 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3262 | } |
| 3263 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3264 | static void alc283_init(struct hda_codec *codec) |
| 3265 | { |
| 3266 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3267 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3268 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3269 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3270 | alc283_restore_default_value(codec); |
| 3271 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3272 | if (!hp_pin) |
| 3273 | return; |
Kailang Yang | a59d719 | 2015-04-08 16:34:00 +0800 | [diff] [blame] | 3274 | |
| 3275 | msleep(30); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3276 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3277 | |
| 3278 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 3279 | /* Headphone capless set to high power mode */ |
| 3280 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3281 | |
| 3282 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3283 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3284 | |
| 3285 | if (hp_pin_sense) |
| 3286 | msleep(85); |
| 3287 | |
| 3288 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3289 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3290 | |
| 3291 | if (hp_pin_sense) |
| 3292 | msleep(85); |
| 3293 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3294 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3295 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3296 | /* Headphone capless set to normal mode */ |
| 3297 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3298 | } |
| 3299 | |
| 3300 | static void alc283_shutup(struct hda_codec *codec) |
| 3301 | { |
| 3302 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3303 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3304 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3305 | |
| 3306 | if (!hp_pin) { |
| 3307 | alc269_shutup(codec); |
| 3308 | return; |
| 3309 | } |
| 3310 | |
| 3311 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3312 | |
| 3313 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3314 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 3315 | /*depop hp during suspend*/ |
| 3316 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 3317 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3318 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3319 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3320 | |
| 3321 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3322 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3323 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3324 | if (!spec->no_shutup_pins) |
| 3325 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3326 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3327 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3328 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3329 | |
| 3330 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3331 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3332 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3333 | alc_shutup_pins(codec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3334 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3335 | } |
| 3336 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3337 | static void alc256_init(struct hda_codec *codec) |
| 3338 | { |
| 3339 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3340 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3341 | bool hp_pin_sense; |
| 3342 | |
| 3343 | if (!hp_pin) |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3344 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3345 | |
| 3346 | msleep(30); |
| 3347 | |
| 3348 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3349 | |
| 3350 | if (hp_pin_sense) |
| 3351 | msleep(2); |
| 3352 | |
| 3353 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3354 | if (spec->ultra_low_power) { |
| 3355 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); |
| 3356 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); |
| 3357 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); |
| 3358 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); |
| 3359 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3360 | msleep(30); |
| 3361 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3362 | |
| 3363 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3364 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3365 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3366 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3367 | msleep(85); |
| 3368 | |
| 3369 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3370 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3371 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3372 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3373 | msleep(100); |
| 3374 | |
| 3375 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
| 3376 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 3377 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
| 3378 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 3379 | /* |
| 3380 | * Expose headphone mic (or possibly Line In on some machines) instead |
| 3381 | * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See |
| 3382 | * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of |
| 3383 | * this register. |
| 3384 | */ |
| 3385 | alc_write_coef_idx(codec, 0x36, 0x5757); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3386 | } |
| 3387 | |
| 3388 | static void alc256_shutup(struct hda_codec *codec) |
| 3389 | { |
| 3390 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3391 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3392 | bool hp_pin_sense; |
| 3393 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3394 | if (!hp_pin) |
| 3395 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3396 | |
| 3397 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3398 | |
| 3399 | if (hp_pin_sense) |
| 3400 | msleep(2); |
| 3401 | |
| 3402 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3403 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3404 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3405 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3406 | msleep(85); |
| 3407 | |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3408 | /* 3k pull low control for Headset jack. */ |
| 3409 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
| 3410 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
| 3411 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3412 | if (!spec->no_shutup_pins) |
| 3413 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3414 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3415 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3416 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3417 | msleep(100); |
| 3418 | |
| 3419 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3420 | alc_shutup_pins(codec); |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3421 | if (spec->ultra_low_power) { |
| 3422 | msleep(50); |
| 3423 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); |
| 3424 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); |
| 3425 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); |
| 3426 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); |
| 3427 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3428 | msleep(30); |
| 3429 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3430 | } |
| 3431 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3432 | static void alc225_init(struct hda_codec *codec) |
| 3433 | { |
| 3434 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3435 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3436 | bool hp1_pin_sense, hp2_pin_sense; |
| 3437 | |
| 3438 | if (!hp_pin) |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3439 | hp_pin = 0x21; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3440 | msleep(30); |
| 3441 | |
| 3442 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3443 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3444 | |
| 3445 | if (hp1_pin_sense || hp2_pin_sense) |
| 3446 | msleep(2); |
| 3447 | |
| 3448 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3449 | if (spec->ultra_low_power) { |
| 3450 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); |
| 3451 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3452 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); |
| 3453 | msleep(30); |
| 3454 | } |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3455 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3456 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3457 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3458 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3459 | if (hp2_pin_sense) |
| 3460 | snd_hda_codec_write(codec, 0x16, 0, |
| 3461 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3462 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3463 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3464 | msleep(85); |
| 3465 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3466 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3467 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3468 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3469 | if (hp2_pin_sense) |
| 3470 | snd_hda_codec_write(codec, 0x16, 0, |
| 3471 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3472 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3473 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3474 | msleep(100); |
| 3475 | |
| 3476 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3477 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
| 3478 | } |
| 3479 | |
| 3480 | static void alc225_shutup(struct hda_codec *codec) |
| 3481 | { |
| 3482 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3483 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3484 | bool hp1_pin_sense, hp2_pin_sense; |
| 3485 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3486 | if (!hp_pin) |
| 3487 | hp_pin = 0x21; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3488 | |
| 3489 | alc_disable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3490 | /* 3k pull low control for Headset jack. */ |
| 3491 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); |
| 3492 | |
| 3493 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3494 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3495 | |
| 3496 | if (hp1_pin_sense || hp2_pin_sense) |
| 3497 | msleep(2); |
| 3498 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3499 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3500 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3501 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3502 | if (hp2_pin_sense) |
| 3503 | snd_hda_codec_write(codec, 0x16, 0, |
| 3504 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3505 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3506 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3507 | msleep(85); |
| 3508 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3509 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3510 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3511 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3512 | if (hp2_pin_sense) |
| 3513 | snd_hda_codec_write(codec, 0x16, 0, |
| 3514 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3515 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3516 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3517 | msleep(100); |
| 3518 | |
| 3519 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3520 | alc_shutup_pins(codec); |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3521 | if (spec->ultra_low_power) { |
| 3522 | msleep(50); |
| 3523 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); |
| 3524 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3525 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); |
| 3526 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); |
| 3527 | msleep(30); |
| 3528 | } |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3529 | |
| 3530 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3531 | alc_enable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3532 | } |
| 3533 | |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3534 | static void alc_default_init(struct hda_codec *codec) |
| 3535 | { |
| 3536 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3537 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3538 | bool hp_pin_sense; |
| 3539 | |
| 3540 | if (!hp_pin) |
| 3541 | return; |
| 3542 | |
| 3543 | msleep(30); |
| 3544 | |
| 3545 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3546 | |
| 3547 | if (hp_pin_sense) |
| 3548 | msleep(2); |
| 3549 | |
| 3550 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3551 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3552 | |
| 3553 | if (hp_pin_sense) |
| 3554 | msleep(85); |
| 3555 | |
| 3556 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3557 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3558 | |
| 3559 | if (hp_pin_sense) |
| 3560 | msleep(100); |
| 3561 | } |
| 3562 | |
| 3563 | static void alc_default_shutup(struct hda_codec *codec) |
| 3564 | { |
| 3565 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3566 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3567 | bool hp_pin_sense; |
| 3568 | |
| 3569 | if (!hp_pin) { |
| 3570 | alc269_shutup(codec); |
| 3571 | return; |
| 3572 | } |
| 3573 | |
| 3574 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3575 | |
| 3576 | if (hp_pin_sense) |
| 3577 | msleep(2); |
| 3578 | |
| 3579 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3580 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3581 | |
| 3582 | if (hp_pin_sense) |
| 3583 | msleep(85); |
| 3584 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3585 | if (!spec->no_shutup_pins) |
| 3586 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3587 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3588 | |
| 3589 | if (hp_pin_sense) |
| 3590 | msleep(100); |
| 3591 | |
| 3592 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3593 | alc_shutup_pins(codec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3594 | } |
| 3595 | |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3596 | static void alc294_hp_init(struct hda_codec *codec) |
| 3597 | { |
| 3598 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3599 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3600 | int i, val; |
| 3601 | |
| 3602 | if (!hp_pin) |
| 3603 | return; |
| 3604 | |
| 3605 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3606 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3607 | |
| 3608 | msleep(100); |
| 3609 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3610 | if (!spec->no_shutup_pins) |
| 3611 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3612 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3613 | |
| 3614 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ |
| 3615 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ |
| 3616 | |
| 3617 | /* Wait for depop procedure finish */ |
| 3618 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3619 | for (i = 0; i < 20 && val & 0x0080; i++) { |
| 3620 | msleep(50); |
| 3621 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3622 | } |
| 3623 | /* Set HP depop to auto mode */ |
| 3624 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); |
| 3625 | msleep(50); |
| 3626 | } |
| 3627 | |
| 3628 | static void alc294_init(struct hda_codec *codec) |
| 3629 | { |
| 3630 | struct alc_spec *spec = codec->spec; |
| 3631 | |
Takashi Iwai | f6ef4e0 | 2019-01-29 14:14:51 +0100 | [diff] [blame] | 3632 | /* required only at boot or S4 resume time */ |
| 3633 | if (!spec->done_hp_init || |
| 3634 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3635 | alc294_hp_init(codec); |
| 3636 | spec->done_hp_init = true; |
| 3637 | } |
| 3638 | alc_default_init(codec); |
| 3639 | } |
| 3640 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3641 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3642 | unsigned int val) |
| 3643 | { |
| 3644 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3645 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3646 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3647 | } |
| 3648 | |
| 3649 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3650 | { |
| 3651 | unsigned int val; |
| 3652 | |
| 3653 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3654 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3655 | & 0xffff; |
| 3656 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3657 | << 16; |
| 3658 | return val; |
| 3659 | } |
| 3660 | |
| 3661 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3662 | { |
| 3663 | unsigned int val; |
| 3664 | |
| 3665 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3666 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3667 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3668 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3669 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3670 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3671 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3672 | val = alc5505_coef_get(codec, 0x6220); |
| 3673 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3674 | } |
| 3675 | |
| 3676 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3677 | { |
| 3678 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3679 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3680 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3681 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3682 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3683 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3684 | } |
| 3685 | |
| 3686 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3687 | { |
| 3688 | unsigned int val; |
| 3689 | |
| 3690 | alc5505_dsp_halt(codec); |
| 3691 | alc5505_dsp_back_from_halt(codec); |
| 3692 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3693 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3694 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3695 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3696 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3697 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3698 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3699 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3700 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3701 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3702 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3703 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3704 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3705 | |
| 3706 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3707 | if (val <= 3) |
| 3708 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3709 | else |
| 3710 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3711 | |
| 3712 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3713 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3714 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3715 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3716 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3717 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3718 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3719 | |
| 3720 | #ifdef HALT_REALTEK_ALC5505 |
| 3721 | alc5505_dsp_halt(codec); |
| 3722 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3723 | } |
| 3724 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3725 | #ifdef HALT_REALTEK_ALC5505 |
Pierre-Louis Bossart | 8a71821 | 2020-01-11 15:47:35 -0600 | [diff] [blame] | 3726 | #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ |
| 3727 | #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3728 | #else |
| 3729 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3730 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3731 | #endif |
| 3732 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3733 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3734 | static int alc269_suspend(struct hda_codec *codec) |
| 3735 | { |
| 3736 | struct alc_spec *spec = codec->spec; |
| 3737 | |
| 3738 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3739 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3740 | return alc_suspend(codec); |
| 3741 | } |
| 3742 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3743 | static int alc269_resume(struct hda_codec *codec) |
| 3744 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3745 | struct alc_spec *spec = codec->spec; |
| 3746 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3747 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3748 | alc269vb_toggle_power_output(codec, 0); |
| 3749 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3750 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3751 | msleep(150); |
| 3752 | } |
| 3753 | |
| 3754 | codec->patch_ops.init(codec); |
| 3755 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3756 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3757 | alc269vb_toggle_power_output(codec, 1); |
| 3758 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3759 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3760 | msleep(200); |
| 3761 | } |
| 3762 | |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 3763 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3764 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3765 | |
| 3766 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3767 | * suspend, and won't restore the data after resume, so we restore it |
| 3768 | * in the driver. |
| 3769 | */ |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 3770 | if (spec->gpio_data) |
| 3771 | alc_write_gpio_data(codec); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3772 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3773 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3774 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3775 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3776 | return 0; |
| 3777 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3778 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3779 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3780 | 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] | 3781 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3782 | { |
| 3783 | struct alc_spec *spec = codec->spec; |
| 3784 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3785 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3786 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3787 | } |
| 3788 | |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 3789 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
| 3790 | const struct hda_fixup *fix, |
| 3791 | int action) |
| 3792 | { |
| 3793 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); |
| 3794 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); |
| 3795 | |
| 3796 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) |
| 3797 | snd_hda_codec_set_pincfg(codec, 0x19, |
| 3798 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | |
| 3799 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); |
| 3800 | } |
| 3801 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3802 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3803 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3804 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3805 | if (action == HDA_FIXUP_ACT_INIT) |
| 3806 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3807 | } |
| 3808 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3809 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3810 | const struct hda_fixup *fix, int action) |
| 3811 | { |
| 3812 | struct alc_spec *spec = codec->spec; |
| 3813 | |
| 3814 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3815 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3816 | } |
| 3817 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3818 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3819 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3820 | { |
| 3821 | static const struct hda_verb verbs[] = { |
| 3822 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3823 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3824 | {} |
| 3825 | }; |
| 3826 | unsigned int cfg; |
| 3827 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3828 | if (strcmp(codec->core.chip_name, "ALC271X") && |
| 3829 | strcmp(codec->core.chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3830 | return; |
| 3831 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3832 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3833 | snd_hda_sequence_write(codec, verbs); |
| 3834 | } |
| 3835 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3836 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3837 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3838 | { |
| 3839 | struct alc_spec *spec = codec->spec; |
| 3840 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3841 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3842 | return; |
| 3843 | |
| 3844 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3845 | * fix the sample rate of analog I/O to 44.1kHz |
| 3846 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3847 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3848 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3849 | } |
| 3850 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3851 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3852 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3853 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3854 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3855 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3856 | * Below is a workaround specific to ALC269 to control the dmic |
| 3857 | * signal source as mono. |
| 3858 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3859 | if (action == HDA_FIXUP_ACT_INIT) |
| 3860 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3861 | } |
| 3862 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3863 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3864 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3865 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3866 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3867 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3868 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3869 | } |
| 3870 | |
| 3871 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3872 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3873 | { |
| 3874 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3875 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3876 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3877 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3878 | } |
| 3879 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3880 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3881 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3882 | { |
| 3883 | struct alc_spec *spec = codec->spec; |
| 3884 | int vref; |
| 3885 | msleep(200); |
| 3886 | snd_hda_gen_hp_automute(codec, jack); |
| 3887 | |
| 3888 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 3889 | msleep(100); |
| 3890 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3891 | vref); |
| 3892 | msleep(500); |
| 3893 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3894 | vref); |
| 3895 | } |
| 3896 | |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 3897 | /* |
| 3898 | * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) |
| 3899 | */ |
| 3900 | struct hda_alc298_mbxinit { |
| 3901 | unsigned char value_0x23; |
| 3902 | unsigned char value_0x25; |
| 3903 | }; |
| 3904 | |
| 3905 | static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, |
| 3906 | const struct hda_alc298_mbxinit *initval, |
| 3907 | bool first) |
| 3908 | { |
| 3909 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); |
| 3910 | alc_write_coef_idx(codec, 0x26, 0xb000); |
| 3911 | |
| 3912 | if (first) |
| 3913 | snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); |
| 3914 | |
| 3915 | snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 3916 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 3917 | alc_write_coef_idx(codec, 0x23, initval->value_0x23); |
| 3918 | |
| 3919 | if (initval->value_0x23 != 0x1e) |
| 3920 | alc_write_coef_idx(codec, 0x25, initval->value_0x25); |
| 3921 | |
| 3922 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 3923 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 3924 | } |
| 3925 | |
| 3926 | static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, |
| 3927 | const struct hda_fixup *fix, |
| 3928 | int action) |
| 3929 | { |
| 3930 | /* Initialization magic */ |
| 3931 | static const struct hda_alc298_mbxinit dac_init[] = { |
| 3932 | {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, |
| 3933 | {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, |
| 3934 | {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, |
| 3935 | {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, |
| 3936 | {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, |
| 3937 | {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, |
| 3938 | {0x2f, 0x00}, |
| 3939 | {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, |
| 3940 | {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, |
| 3941 | {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, |
| 3942 | {} |
| 3943 | }; |
| 3944 | const struct hda_alc298_mbxinit *seq; |
| 3945 | |
| 3946 | if (action != HDA_FIXUP_ACT_INIT) |
| 3947 | return; |
| 3948 | |
| 3949 | /* Start */ |
| 3950 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); |
| 3951 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 3952 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 3953 | alc_write_coef_idx(codec, 0x22, 0x31); |
| 3954 | alc_write_coef_idx(codec, 0x23, 0x0b); |
| 3955 | alc_write_coef_idx(codec, 0x25, 0x00); |
| 3956 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 3957 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 3958 | |
| 3959 | for (seq = dac_init; seq->value_0x23; seq++) |
| 3960 | alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); |
| 3961 | } |
| 3962 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3963 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 3964 | const struct hda_fixup *fix, int action) |
| 3965 | { |
| 3966 | struct alc_spec *spec = codec->spec; |
| 3967 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3968 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3969 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 3970 | } |
| 3971 | } |
| 3972 | |
| 3973 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3974 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
| 3975 | static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3976 | { |
| 3977 | struct hda_codec *codec = private_data; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3978 | struct alc_spec *spec = codec->spec; |
| 3979 | unsigned int pinval; |
| 3980 | |
| 3981 | if (spec->mute_led_polarity) |
| 3982 | enabled = !enabled; |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 3983 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
| 3984 | pinval &= ~AC_PINCTL_VREFEN; |
| 3985 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3986 | if (spec->mute_led_nid) { |
| 3987 | /* temporarily power up/down for setting VREF */ |
| 3988 | snd_hda_power_up_pm(codec); |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3989 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3990 | snd_hda_power_down_pm(codec); |
| 3991 | } |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3992 | } |
| 3993 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3994 | /* Make sure the led works even in runtime suspend */ |
| 3995 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 3996 | hda_nid_t nid, |
| 3997 | unsigned int power_state) |
| 3998 | { |
| 3999 | struct alc_spec *spec = codec->spec; |
| 4000 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4001 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 4002 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4003 | return power_state; |
| 4004 | |
| 4005 | /* Set pin ctl again, it might have just been set to 0 */ |
| 4006 | snd_hda_set_pin_ctl(codec, nid, |
| 4007 | snd_hda_codec_get_pin_target(codec, nid)); |
| 4008 | |
Takashi Iwai | cffd396 | 2015-04-09 10:30:25 +0200 | [diff] [blame] | 4009 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4010 | } |
| 4011 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4012 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 4013 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4014 | { |
| 4015 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4016 | const struct dmi_device *dev = NULL; |
| 4017 | |
| 4018 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4019 | return; |
| 4020 | |
| 4021 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 4022 | int pol, pin; |
| 4023 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 4024 | continue; |
| 4025 | if (pin < 0x0a || pin >= 0x10) |
| 4026 | break; |
| 4027 | spec->mute_led_polarity = pol; |
| 4028 | spec->mute_led_nid = pin - 0x0a + 0x18; |
| 4029 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 4030 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4031 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4032 | codec_dbg(codec, |
| 4033 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4034 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4035 | break; |
| 4036 | } |
| 4037 | } |
| 4038 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4039 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
| 4040 | const struct hda_fixup *fix, |
| 4041 | int action, hda_nid_t pin) |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4042 | { |
| 4043 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4044 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4045 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4046 | spec->mute_led_polarity = 0; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4047 | spec->mute_led_nid = pin; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4048 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 4049 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4050 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4051 | } |
| 4052 | } |
| 4053 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4054 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 4055 | const struct hda_fixup *fix, int action) |
| 4056 | { |
| 4057 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); |
| 4058 | } |
| 4059 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4060 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 4061 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4062 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4063 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4064 | } |
| 4065 | |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4066 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
| 4067 | const struct hda_fixup *fix, int action) |
| 4068 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4069 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4070 | } |
| 4071 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4072 | /* update LED status via GPIO */ |
| 4073 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, |
| 4074 | bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4075 | { |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4076 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4077 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4078 | if (spec->mute_led_polarity) |
| 4079 | enabled = !enabled; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 4080 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4081 | } |
| 4082 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4083 | /* turn on/off mute LED via GPIO per vmaster hook */ |
| 4084 | static void alc_fixup_gpio_mute_hook(void *private_data, int enabled) |
| 4085 | { |
| 4086 | struct hda_codec *codec = private_data; |
| 4087 | struct alc_spec *spec = codec->spec; |
| 4088 | |
| 4089 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); |
| 4090 | } |
| 4091 | |
| 4092 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4093 | static void alc_gpio_micmute_update(struct hda_codec *codec) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4094 | { |
| 4095 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4096 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4097 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
| 4098 | spec->gen.micmute_led.led_value); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4099 | } |
| 4100 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4101 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
| 4102 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4103 | int action, |
| 4104 | unsigned int mute_mask, |
| 4105 | unsigned int micmute_mask) |
| 4106 | { |
| 4107 | struct alc_spec *spec = codec->spec; |
| 4108 | |
| 4109 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
| 4110 | |
| 4111 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4112 | return; |
| 4113 | if (mute_mask) { |
| 4114 | spec->gpio_mute_led_mask = mute_mask; |
| 4115 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
| 4116 | } |
| 4117 | if (micmute_mask) { |
| 4118 | spec->gpio_mic_led_mask = micmute_mask; |
| 4119 | snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); |
| 4120 | } |
| 4121 | } |
| 4122 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4123 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4124 | const struct hda_fixup *fix, int action) |
| 4125 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4126 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4127 | } |
| 4128 | |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 4129 | static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4130 | const struct hda_fixup *fix, int action) |
| 4131 | { |
| 4132 | alc_fixup_hp_gpio_led(codec, action, 0x04, 0x00); |
| 4133 | } |
| 4134 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 4135 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4136 | const struct hda_fixup *fix, int action) |
| 4137 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4138 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4139 | } |
| 4140 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4141 | /* turn on/off mic-mute LED per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4142 | static void alc_cap_micmute_update(struct hda_codec *codec) |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4143 | { |
| 4144 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4145 | unsigned int pinval; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4146 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4147 | if (!spec->cap_mute_led_nid) |
| 4148 | return; |
Hui Wang | fc1fad9 | 2014-07-08 17:56:14 +0800 | [diff] [blame] | 4149 | 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] | 4150 | pinval &= ~AC_PINCTL_VREFEN; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4151 | if (spec->gen.micmute_led.led_value) |
| 4152 | pinval |= AC_PINCTL_VREF_80; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4153 | else |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4154 | pinval |= AC_PINCTL_VREF_HIZ; |
| 4155 | 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] | 4156 | } |
| 4157 | |
| 4158 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 4159 | const struct hda_fixup *fix, int action) |
| 4160 | { |
| 4161 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4162 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4163 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4164 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4165 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
| 4166 | * enable headphone amp |
| 4167 | */ |
| 4168 | spec->gpio_mask |= 0x10; |
| 4169 | spec->gpio_dir |= 0x10; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4170 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4171 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4172 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4173 | } |
| 4174 | } |
| 4175 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4176 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 4177 | const struct hda_fixup *fix, int action) |
| 4178 | { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4179 | struct alc_spec *spec = codec->spec; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4180 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4181 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4182 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4183 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4184 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4185 | codec->power_filter = led_power_filter; |
| 4186 | } |
| 4187 | } |
| 4188 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4189 | /* update mute-LED according to the speaker mute state via COEF bit */ |
| 4190 | static void alc_fixup_mute_led_coefbit_hook(void *private_data, int enabled) |
| 4191 | { |
| 4192 | struct hda_codec *codec = private_data; |
| 4193 | struct alc_spec *spec = codec->spec; |
| 4194 | |
| 4195 | if (spec->mute_led_polarity) |
| 4196 | enabled = !enabled; |
| 4197 | |
| 4198 | /* temporarily power up/down for setting COEF bit */ |
| 4199 | enabled ? alc_update_coef_idx(codec, spec->mute_led_coef_idx, |
| 4200 | spec->mute_led_coefbit_mask, spec->mute_led_coefbit_off) : |
| 4201 | alc_update_coef_idx(codec, spec->mute_led_coef_idx, |
| 4202 | spec->mute_led_coefbit_mask, spec->mute_led_coefbit_on); |
| 4203 | } |
| 4204 | |
| 4205 | static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4206 | const struct hda_fixup *fix, |
| 4207 | int action) |
| 4208 | { |
| 4209 | struct alc_spec *spec = codec->spec; |
| 4210 | |
| 4211 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4212 | spec->mute_led_polarity = 0; |
| 4213 | spec->mute_led_coef_idx = 0x0b; |
| 4214 | spec->mute_led_coefbit_mask = 1<<3; |
| 4215 | spec->mute_led_coefbit_on = 1<<3; |
| 4216 | spec->mute_led_coefbit_off = 0; |
| 4217 | spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook; |
| 4218 | spec->gen.vmaster_mute_enum = 1; |
| 4219 | } |
| 4220 | } |
| 4221 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4222 | static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4223 | const struct hda_fixup *fix, |
| 4224 | int action) |
| 4225 | { |
| 4226 | struct alc_spec *spec = codec->spec; |
| 4227 | |
| 4228 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4229 | spec->mute_led_polarity = 0; |
| 4230 | spec->mute_led_coef_idx = 0x34; |
| 4231 | spec->mute_led_coefbit_mask = 1<<5; |
| 4232 | spec->mute_led_coefbit_on = 0; |
| 4233 | spec->mute_led_coefbit_off = 1<<5; |
| 4234 | spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook; |
| 4235 | spec->gen.vmaster_mute_enum = 1; |
| 4236 | } |
| 4237 | } |
| 4238 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4239 | /* turn on/off mic-mute LED per capture hook by coef bit */ |
| 4240 | static void alc_hp_cap_micmute_update(struct hda_codec *codec) |
| 4241 | { |
| 4242 | struct alc_spec *spec = codec->spec; |
| 4243 | |
| 4244 | if (spec->gen.micmute_led.led_value) |
| 4245 | alc_update_coef_idx(codec, spec->mic_led_coef_idx, |
| 4246 | spec->mic_led_coefbit_mask, spec->mic_led_coefbit_on); |
| 4247 | else |
| 4248 | alc_update_coef_idx(codec, spec->mic_led_coef_idx, |
| 4249 | spec->mic_led_coefbit_mask, spec->mic_led_coefbit_off); |
| 4250 | } |
| 4251 | |
| 4252 | static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4253 | const struct hda_fixup *fix, int action) |
| 4254 | { |
| 4255 | struct alc_spec *spec = codec->spec; |
| 4256 | |
| 4257 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4258 | spec->mic_led_coef_idx = 0x19; |
| 4259 | spec->mic_led_coefbit_mask = 1<<13; |
| 4260 | spec->mic_led_coefbit_on = 1<<13; |
| 4261 | spec->mic_led_coefbit_off = 0; |
| 4262 | snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update); |
| 4263 | } |
| 4264 | } |
| 4265 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4266 | static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4267 | const struct hda_fixup *fix, int action) |
| 4268 | { |
| 4269 | struct alc_spec *spec = codec->spec; |
| 4270 | |
| 4271 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4272 | spec->mic_led_coef_idx = 0x35; |
| 4273 | spec->mic_led_coefbit_mask = 3<<2; |
| 4274 | spec->mic_led_coefbit_on = 2<<2; |
| 4275 | spec->mic_led_coefbit_off = 1<<2; |
| 4276 | snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update); |
| 4277 | } |
| 4278 | } |
| 4279 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4280 | static void alc285_fixup_hp_mute_led(struct hda_codec *codec, |
| 4281 | const struct hda_fixup *fix, int action) |
| 4282 | { |
| 4283 | alc285_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4284 | alc285_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4285 | } |
| 4286 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4287 | static void alc236_fixup_hp_mute_led(struct hda_codec *codec, |
| 4288 | const struct hda_fixup *fix, int action) |
| 4289 | { |
| 4290 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4291 | alc236_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4292 | } |
| 4293 | |
Takashi Iwai | 6a30aba | 2018-04-27 17:17:35 +0200 | [diff] [blame] | 4294 | #if IS_REACHABLE(CONFIG_INPUT) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4295 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 4296 | struct hda_jack_callback *event) |
| 4297 | { |
| 4298 | struct alc_spec *spec = codec->spec; |
| 4299 | |
| 4300 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore |
| 4301 | send both key on and key off event for every interrupt. */ |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4302 | 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] | 4303 | input_sync(spec->kb_dev); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4304 | 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] | 4305 | input_sync(spec->kb_dev); |
| 4306 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4307 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4308 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
| 4309 | { |
| 4310 | struct alc_spec *spec = codec->spec; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4311 | int i; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4312 | |
| 4313 | spec->kb_dev = input_allocate_device(); |
| 4314 | if (!spec->kb_dev) { |
| 4315 | codec_err(codec, "Out of memory (input_allocate_device)\n"); |
| 4316 | return -ENOMEM; |
| 4317 | } |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4318 | |
| 4319 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; |
| 4320 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4321 | spec->kb_dev->name = "Microphone Mute Button"; |
| 4322 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4323 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
| 4324 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); |
| 4325 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; |
| 4326 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) |
| 4327 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4328 | |
| 4329 | if (input_register_device(spec->kb_dev)) { |
| 4330 | codec_err(codec, "input_register_device failed\n"); |
| 4331 | input_free_device(spec->kb_dev); |
| 4332 | spec->kb_dev = NULL; |
| 4333 | return -ENOMEM; |
| 4334 | } |
| 4335 | |
| 4336 | return 0; |
| 4337 | } |
| 4338 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4339 | /* GPIO1 = set according to SKU external amp |
| 4340 | * GPIO2 = mic mute hotkey |
| 4341 | * GPIO3 = mute LED |
| 4342 | * GPIO4 = mic mute LED |
| 4343 | */ |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4344 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
| 4345 | const struct hda_fixup *fix, int action) |
| 4346 | { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4347 | struct alc_spec *spec = codec->spec; |
| 4348 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4349 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4350 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4351 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4352 | if (alc_register_micmute_input_device(codec) != 0) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4353 | return; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4354 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4355 | spec->gpio_mask |= 0x06; |
| 4356 | spec->gpio_dir |= 0x02; |
| 4357 | spec->gpio_data |= 0x02; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4358 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4359 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4360 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4361 | gpio2_mic_hotkey_event); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4362 | return; |
| 4363 | } |
| 4364 | |
| 4365 | if (!spec->kb_dev) |
| 4366 | return; |
| 4367 | |
| 4368 | switch (action) { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4369 | case HDA_FIXUP_ACT_FREE: |
| 4370 | input_unregister_device(spec->kb_dev); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4371 | spec->kb_dev = NULL; |
| 4372 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4373 | } |
| 4374 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4375 | /* Line2 = mic mute hotkey |
| 4376 | * GPIO2 = mic mute LED |
| 4377 | */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4378 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
| 4379 | const struct hda_fixup *fix, int action) |
| 4380 | { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4381 | struct alc_spec *spec = codec->spec; |
| 4382 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4383 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4384 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4385 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4386 | if (alc_register_micmute_input_device(codec) != 0) |
| 4387 | return; |
| 4388 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4389 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 4390 | gpio2_mic_hotkey_event); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4391 | return; |
| 4392 | } |
| 4393 | |
| 4394 | if (!spec->kb_dev) |
| 4395 | return; |
| 4396 | |
| 4397 | switch (action) { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4398 | case HDA_FIXUP_ACT_FREE: |
| 4399 | input_unregister_device(spec->kb_dev); |
| 4400 | spec->kb_dev = NULL; |
| 4401 | } |
| 4402 | } |
Takashi Iwai | c469652 | 2018-01-15 10:44:35 +0100 | [diff] [blame] | 4403 | #else /* INPUT */ |
| 4404 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL |
| 4405 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL |
| 4406 | #endif /* INPUT */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4407 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4408 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 4409 | const struct hda_fixup *fix, int action) |
| 4410 | { |
| 4411 | struct alc_spec *spec = codec->spec; |
| 4412 | |
Takashi Iwai | 1bce62a | 2018-06-19 23:15:59 +0200 | [diff] [blame] | 4413 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4414 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4415 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4416 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4417 | } |
| 4418 | } |
| 4419 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4420 | static const struct coef_fw alc225_pre_hsmode[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4421 | UPDATE_COEF(0x4a, 1<<8, 0), |
| 4422 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), |
| 4423 | UPDATE_COEF(0x63, 3<<14, 3<<14), |
| 4424 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4425 | UPDATE_COEF(0x4a, 3<<10, 3<<10), |
| 4426 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), |
| 4427 | UPDATE_COEF(0x4a, 3<<10, 0), |
| 4428 | {} |
| 4429 | }; |
| 4430 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4431 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 4432 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4433 | static const struct coef_fw coef0255[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4434 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4435 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4436 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4437 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4438 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 4439 | {} |
| 4440 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4441 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4442 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4443 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4444 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4445 | WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ |
| 4446 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4447 | {} |
| 4448 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4449 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4450 | WRITE_COEF(0x1b, 0x0c0b), |
| 4451 | WRITE_COEF(0x45, 0xc429), |
| 4452 | UPDATE_COEF(0x35, 0x4000, 0), |
| 4453 | WRITE_COEF(0x06, 0x2104), |
| 4454 | WRITE_COEF(0x1a, 0x0001), |
| 4455 | WRITE_COEF(0x26, 0x0004), |
| 4456 | WRITE_COEF(0x32, 0x42a3), |
| 4457 | {} |
| 4458 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4459 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4460 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4461 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4462 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4463 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4464 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4465 | {} |
| 4466 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4467 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4468 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
| 4469 | {} |
| 4470 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4471 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4472 | WRITE_COEF(0x76, 0x000e), |
| 4473 | WRITE_COEF(0x6c, 0x2400), |
| 4474 | WRITE_COEF(0x18, 0x7308), |
| 4475 | WRITE_COEF(0x6b, 0xc429), |
| 4476 | {} |
| 4477 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4478 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4479 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 4480 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 4481 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 4482 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 4483 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 4484 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4485 | {} |
| 4486 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4487 | static const struct coef_fw coef0668[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4488 | WRITE_COEF(0x15, 0x0d40), |
| 4489 | WRITE_COEF(0xb7, 0x802b), |
| 4490 | {} |
| 4491 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4492 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4493 | UPDATE_COEF(0x63, 3<<14, 0), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4494 | {} |
| 4495 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4496 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4497 | UPDATE_COEF(0x4a, 0x0100, 0), |
| 4498 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), |
| 4499 | UPDATE_COEF(0x6b, 0xf000, 0x5000), |
| 4500 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4501 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), |
| 4502 | WRITE_COEF(0x45, 0x5289), |
| 4503 | UPDATE_COEF(0x4a, 0x0c00, 0), |
| 4504 | {} |
| 4505 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4506 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4507 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4508 | case 0x10ec0255: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4509 | alc_process_coef_fw(codec, coef0255); |
| 4510 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4511 | case 0x10ec0236: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4512 | case 0x10ec0256: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4513 | alc_process_coef_fw(codec, coef0256); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4514 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4515 | case 0x10ec0234: |
| 4516 | case 0x10ec0274: |
| 4517 | case 0x10ec0294: |
| 4518 | alc_process_coef_fw(codec, coef0274); |
| 4519 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4520 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4521 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4522 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4523 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4524 | case 0x10ec0286: |
| 4525 | case 0x10ec0288: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4526 | alc_process_coef_fw(codec, coef0288); |
| 4527 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4528 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4529 | alc_process_coef_fw(codec, coef0298); |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4530 | alc_process_coef_fw(codec, coef0288); |
| 4531 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4532 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4533 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4534 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4535 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4536 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4537 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4538 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4539 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4540 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4541 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4542 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4543 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4544 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4545 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4546 | case 0x10ec0299: |
Kailang Yang | 4d4b0c5 | 2019-01-09 16:23:37 +0800 | [diff] [blame] | 4547 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4548 | alc_process_coef_fw(codec, coef0225); |
| 4549 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4550 | case 0x10ec0867: |
| 4551 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4552 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4553 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4554 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4555 | } |
| 4556 | |
| 4557 | |
| 4558 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 4559 | hda_nid_t mic_pin) |
| 4560 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4561 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4562 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 4563 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4564 | {} |
| 4565 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4566 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4567 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4568 | WRITE_COEFEX(0x57, 0x03, 0x09a3), |
| 4569 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4570 | {} |
| 4571 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4572 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4573 | UPDATE_COEF(0x35, 0, 1<<14), |
| 4574 | WRITE_COEF(0x06, 0x2100), |
| 4575 | WRITE_COEF(0x1a, 0x0021), |
| 4576 | WRITE_COEF(0x26, 0x008c), |
| 4577 | {} |
| 4578 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4579 | static const struct coef_fw coef0288[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4580 | UPDATE_COEF(0x4f, 0x00c0, 0), |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4581 | UPDATE_COEF(0x50, 0x2000, 0), |
| 4582 | UPDATE_COEF(0x56, 0x0006, 0), |
| 4583 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4584 | UPDATE_COEF(0x66, 0x0008, 0x0008), |
| 4585 | UPDATE_COEF(0x67, 0x2000, 0x2000), |
| 4586 | {} |
| 4587 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4588 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4589 | WRITE_COEF(0x19, 0xa208), |
| 4590 | WRITE_COEF(0x2e, 0xacf0), |
| 4591 | {} |
| 4592 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4593 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4594 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 4595 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 4596 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4597 | {} |
| 4598 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4599 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4600 | WRITE_COEF(0xb7, 0x802b), |
| 4601 | WRITE_COEF(0xb5, 0x1040), |
| 4602 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 4603 | {} |
| 4604 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4605 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4606 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
| 4607 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4608 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4609 | {} |
| 4610 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4611 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4612 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
| 4613 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4614 | UPDATE_COEF(0x6b, 0xf000, 0), |
| 4615 | {} |
| 4616 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4617 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4618 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4619 | case 0x10ec0255: |
| 4620 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4621 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4622 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4623 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4624 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4625 | case 0x10ec0236: |
| 4626 | case 0x10ec0256: |
| 4627 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4628 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4629 | alc_process_coef_fw(codec, coef0256); |
| 4630 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4631 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4632 | case 0x10ec0234: |
| 4633 | case 0x10ec0274: |
| 4634 | case 0x10ec0294: |
| 4635 | alc_write_coef_idx(codec, 0x45, 0x4689); |
| 4636 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4637 | alc_process_coef_fw(codec, coef0274); |
| 4638 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4639 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4640 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4641 | case 0x10ec0283: |
| 4642 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4643 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4644 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4645 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4646 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4647 | case 0x10ec0286: |
| 4648 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4649 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4650 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4651 | alc_process_coef_fw(codec, coef0288); |
| 4652 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4653 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4654 | case 0x10ec0292: |
| 4655 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4656 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4657 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4658 | case 0x10ec0293: |
| 4659 | /* Set to TRS mode */ |
| 4660 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4661 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4662 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4663 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4664 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4665 | case 0x10ec0867: |
| 4666 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); |
| 4667 | /* fallthru */ |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 4668 | case 0x10ec0221: |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4669 | case 0x10ec0662: |
| 4670 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4671 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4672 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4673 | case 0x10ec0668: |
| 4674 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 4675 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4676 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4677 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4678 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4679 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4680 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4681 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4682 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4683 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4684 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4685 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4686 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
| 4687 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4688 | alc_process_coef_fw(codec, coef0225); |
| 4689 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4690 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4691 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4692 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4693 | } |
| 4694 | |
| 4695 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 4696 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4697 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4698 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
| 4699 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), |
| 4700 | UPDATE_COEF(0x49, 3<<8, 0<<8), |
| 4701 | UPDATE_COEF(0x4a, 3<<4, 3<<4), |
| 4702 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4703 | UPDATE_COEF(0x67, 0xf000, 0x3000), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4704 | {} |
| 4705 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4706 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4707 | WRITE_COEF(0x45, 0xc089), |
| 4708 | WRITE_COEF(0x45, 0xc489), |
| 4709 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4710 | WRITE_COEF(0x49, 0x0049), |
| 4711 | {} |
| 4712 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4713 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4714 | WRITE_COEF(0x45, 0xc489), |
| 4715 | WRITE_COEFEX(0x57, 0x03, 0x0da3), |
| 4716 | WRITE_COEF(0x49, 0x0049), |
| 4717 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4718 | WRITE_COEF(0x06, 0x6100), |
| 4719 | {} |
| 4720 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4721 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4722 | WRITE_COEF(0x06, 0x2100), |
| 4723 | WRITE_COEF(0x32, 0x4ea3), |
| 4724 | {} |
| 4725 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4726 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4727 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
| 4728 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4729 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4730 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4731 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4732 | {} |
| 4733 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4734 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4735 | WRITE_COEF(0x76, 0x000e), |
| 4736 | WRITE_COEF(0x6c, 0x2400), |
| 4737 | WRITE_COEF(0x6b, 0xc429), |
| 4738 | WRITE_COEF(0x18, 0x7308), |
| 4739 | {} |
| 4740 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4741 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4742 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4743 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 4744 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4745 | {} |
| 4746 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4747 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4748 | WRITE_COEF(0x11, 0x0041), |
| 4749 | WRITE_COEF(0x15, 0x0d40), |
| 4750 | WRITE_COEF(0xb7, 0x802b), |
| 4751 | {} |
| 4752 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4753 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4754 | WRITE_COEF(0x45, 0x4289), |
| 4755 | UPDATE_COEF(0x4a, 0x0010, 0x0010), |
| 4756 | UPDATE_COEF(0x6b, 0x0f00, 0), |
| 4757 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4758 | {} |
| 4759 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4760 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4761 | switch (codec->core.vendor_id) { |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4762 | case 0x10ec0215: |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4763 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4764 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4765 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4766 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4767 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4768 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4769 | alc_process_coef_fw(codec, coef0225); |
| 4770 | break; |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4771 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4772 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4773 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4774 | case 0x10ec0236: |
| 4775 | case 0x10ec0256: |
| 4776 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 4777 | alc_write_coef_idx(codec, 0x45, 0xc089); |
| 4778 | msleep(50); |
| 4779 | alc_process_coef_fw(codec, coef0256); |
| 4780 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4781 | case 0x10ec0234: |
| 4782 | case 0x10ec0274: |
| 4783 | case 0x10ec0294: |
| 4784 | alc_process_coef_fw(codec, coef0274); |
| 4785 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4786 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4787 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4788 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4789 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4790 | case 0x10ec0286: |
| 4791 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4792 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4793 | alc_process_coef_fw(codec, coef0288); |
| 4794 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4795 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4796 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4797 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4798 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4799 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4800 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4801 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4802 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4803 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4804 | case 0x10ec0867: |
| 4805 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4806 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4807 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4808 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4809 | } |
| 4810 | |
| 4811 | /* Iphone type */ |
| 4812 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 4813 | { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4814 | int val; |
| 4815 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4816 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4817 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4818 | WRITE_COEF(0x1b, 0x0c2b), |
| 4819 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4820 | {} |
| 4821 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4822 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4823 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4824 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4825 | {} |
| 4826 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4827 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4828 | WRITE_COEF(0x45, 0xd429), |
| 4829 | WRITE_COEF(0x1b, 0x0c2b), |
| 4830 | WRITE_COEF(0x32, 0x4ea3), |
| 4831 | {} |
| 4832 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4833 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4834 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4835 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4836 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4837 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4838 | {} |
| 4839 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4840 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4841 | WRITE_COEF(0x6b, 0xd429), |
| 4842 | WRITE_COEF(0x76, 0x0008), |
| 4843 | WRITE_COEF(0x18, 0x7388), |
| 4844 | {} |
| 4845 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4846 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4847 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 4848 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4849 | {} |
| 4850 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4851 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4852 | WRITE_COEF(0x11, 0x0001), |
| 4853 | WRITE_COEF(0x15, 0x0d60), |
| 4854 | WRITE_COEF(0xc3, 0x0000), |
| 4855 | {} |
| 4856 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4857 | static const struct coef_fw coef0225_1[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4858 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4859 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
| 4860 | {} |
| 4861 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4862 | static const struct coef_fw coef0225_2[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4863 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
| 4864 | UPDATE_COEF(0x63, 3<<14, 1<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4865 | {} |
| 4866 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4867 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4868 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4869 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4870 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4871 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4872 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4873 | case 0x10ec0256: |
| 4874 | alc_process_coef_fw(codec, coef0256); |
| 4875 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4876 | case 0x10ec0234: |
| 4877 | case 0x10ec0274: |
| 4878 | case 0x10ec0294: |
| 4879 | alc_write_coef_idx(codec, 0x45, 0xd689); |
| 4880 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4881 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4882 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4883 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4884 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4885 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4886 | val = alc_read_coef_idx(codec, 0x50); |
| 4887 | if (val & (1 << 12)) { |
| 4888 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4889 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4890 | msleep(300); |
| 4891 | } else { |
| 4892 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4893 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4894 | msleep(300); |
| 4895 | } |
| 4896 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4897 | case 0x10ec0286: |
| 4898 | case 0x10ec0288: |
| 4899 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4900 | msleep(300); |
| 4901 | alc_process_coef_fw(codec, coef0288); |
| 4902 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4903 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4904 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4905 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4906 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4907 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4908 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4909 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4910 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4911 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4912 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4913 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4914 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4915 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4916 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4917 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4918 | val = alc_read_coef_idx(codec, 0x45); |
| 4919 | if (val & (1 << 9)) |
| 4920 | alc_process_coef_fw(codec, coef0225_2); |
| 4921 | else |
| 4922 | alc_process_coef_fw(codec, coef0225_1); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4923 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4924 | case 0x10ec0867: |
| 4925 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4926 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4927 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4928 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4929 | } |
| 4930 | |
| 4931 | /* Nokia type */ |
| 4932 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 4933 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4934 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4935 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4936 | WRITE_COEF(0x1b, 0x0c2b), |
| 4937 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4938 | {} |
| 4939 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4940 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4941 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4942 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4943 | {} |
| 4944 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4945 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4946 | WRITE_COEF(0x45, 0xe429), |
| 4947 | WRITE_COEF(0x1b, 0x0c2b), |
| 4948 | WRITE_COEF(0x32, 0x4ea3), |
| 4949 | {} |
| 4950 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4951 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4952 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4953 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4954 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4955 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4956 | {} |
| 4957 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4958 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4959 | WRITE_COEF(0x6b, 0xe429), |
| 4960 | WRITE_COEF(0x76, 0x0008), |
| 4961 | WRITE_COEF(0x18, 0x7388), |
| 4962 | {} |
| 4963 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4964 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4965 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 4966 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4967 | {} |
| 4968 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4969 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4970 | WRITE_COEF(0x11, 0x0001), |
| 4971 | WRITE_COEF(0x15, 0x0d50), |
| 4972 | WRITE_COEF(0xc3, 0x0000), |
| 4973 | {} |
| 4974 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4975 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4976 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4977 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4978 | {} |
| 4979 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4980 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4981 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4982 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4983 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4984 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4985 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4986 | case 0x10ec0256: |
| 4987 | alc_process_coef_fw(codec, coef0256); |
| 4988 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4989 | case 0x10ec0234: |
| 4990 | case 0x10ec0274: |
| 4991 | case 0x10ec0294: |
| 4992 | alc_write_coef_idx(codec, 0x45, 0xe689); |
| 4993 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4994 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4995 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4996 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4997 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4998 | case 0x10ec0298: |
| 4999 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5000 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5001 | msleep(300); |
| 5002 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5003 | case 0x10ec0286: |
| 5004 | case 0x10ec0288: |
| 5005 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5006 | msleep(300); |
| 5007 | alc_process_coef_fw(codec, coef0288); |
| 5008 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5009 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5010 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5011 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5012 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5013 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5014 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5015 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5016 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5017 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5018 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5019 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5020 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5021 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5022 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5023 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5024 | alc_process_coef_fw(codec, coef0225); |
| 5025 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5026 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5027 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5028 | } |
| 5029 | |
| 5030 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 5031 | { |
| 5032 | int val; |
| 5033 | bool is_ctia = false; |
| 5034 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5035 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5036 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 5037 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 5038 | conteol) */ |
| 5039 | {} |
| 5040 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5041 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5042 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
| 5043 | {} |
| 5044 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5045 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5046 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5047 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5048 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5049 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5050 | UPDATE_COEF(0x19, 0x1300, 0x1300), |
| 5051 | {} |
| 5052 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5053 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5054 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 5055 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 5056 | {} |
| 5057 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5058 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5059 | WRITE_COEF(0x11, 0x0001), |
| 5060 | WRITE_COEF(0xb7, 0x802b), |
| 5061 | WRITE_COEF(0x15, 0x0d60), |
| 5062 | WRITE_COEF(0xc3, 0x0c00), |
| 5063 | {} |
| 5064 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5065 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5066 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 5067 | UPDATE_COEF(0x4a, 0x8000, 0), |
| 5068 | WRITE_COEF(0x45, 0xd289), |
| 5069 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 5070 | {} |
| 5071 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5072 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5073 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5074 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5075 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5076 | msleep(300); |
| 5077 | val = alc_read_coef_idx(codec, 0x46); |
| 5078 | is_ctia = (val & 0x0070) == 0x0070; |
| 5079 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5080 | case 0x10ec0236: |
| 5081 | case 0x10ec0256: |
| 5082 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 5083 | alc_write_coef_idx(codec, 0x06, 0x6104); |
| 5084 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); |
| 5085 | |
| 5086 | snd_hda_codec_write(codec, 0x21, 0, |
| 5087 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5088 | msleep(80); |
| 5089 | snd_hda_codec_write(codec, 0x21, 0, |
| 5090 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5091 | |
| 5092 | alc_process_coef_fw(codec, coef0255); |
| 5093 | msleep(300); |
| 5094 | val = alc_read_coef_idx(codec, 0x46); |
| 5095 | is_ctia = (val & 0x0070) == 0x0070; |
| 5096 | |
| 5097 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); |
| 5098 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 5099 | |
| 5100 | snd_hda_codec_write(codec, 0x21, 0, |
| 5101 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5102 | msleep(80); |
| 5103 | snd_hda_codec_write(codec, 0x21, 0, |
| 5104 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5105 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5106 | case 0x10ec0234: |
| 5107 | case 0x10ec0274: |
| 5108 | case 0x10ec0294: |
| 5109 | alc_process_coef_fw(codec, coef0274); |
| 5110 | msleep(80); |
| 5111 | val = alc_read_coef_idx(codec, 0x46); |
| 5112 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5113 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5114 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5115 | case 0x10ec0283: |
| 5116 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 5117 | msleep(300); |
| 5118 | val = alc_read_coef_idx(codec, 0x46); |
| 5119 | is_ctia = (val & 0x0070) == 0x0070; |
| 5120 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5121 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5122 | snd_hda_codec_write(codec, 0x21, 0, |
| 5123 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5124 | msleep(100); |
| 5125 | snd_hda_codec_write(codec, 0x21, 0, |
| 5126 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5127 | msleep(200); |
| 5128 | |
| 5129 | val = alc_read_coef_idx(codec, 0x50); |
| 5130 | if (val & (1 << 12)) { |
| 5131 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 5132 | alc_process_coef_fw(codec, coef0288); |
| 5133 | msleep(350); |
| 5134 | val = alc_read_coef_idx(codec, 0x50); |
| 5135 | is_ctia = (val & 0x0070) == 0x0070; |
| 5136 | } else { |
| 5137 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 5138 | alc_process_coef_fw(codec, coef0288); |
| 5139 | msleep(350); |
| 5140 | val = alc_read_coef_idx(codec, 0x50); |
| 5141 | is_ctia = (val & 0x0070) == 0x0070; |
| 5142 | } |
| 5143 | alc_process_coef_fw(codec, coef0298); |
| 5144 | snd_hda_codec_write(codec, 0x21, 0, |
| 5145 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); |
| 5146 | msleep(75); |
| 5147 | snd_hda_codec_write(codec, 0x21, 0, |
| 5148 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5149 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5150 | case 0x10ec0286: |
| 5151 | case 0x10ec0288: |
| 5152 | alc_process_coef_fw(codec, coef0288); |
| 5153 | msleep(350); |
| 5154 | val = alc_read_coef_idx(codec, 0x50); |
| 5155 | is_ctia = (val & 0x0070) == 0x0070; |
| 5156 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5157 | case 0x10ec0292: |
| 5158 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 5159 | msleep(300); |
| 5160 | val = alc_read_coef_idx(codec, 0x6c); |
| 5161 | is_ctia = (val & 0x001c) == 0x001c; |
| 5162 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5163 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5164 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5165 | msleep(300); |
| 5166 | val = alc_read_coef_idx(codec, 0x46); |
| 5167 | is_ctia = (val & 0x0070) == 0x0070; |
| 5168 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5169 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5170 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5171 | msleep(300); |
| 5172 | val = alc_read_coef_idx(codec, 0xbe); |
| 5173 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 5174 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5175 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5176 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5177 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5178 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5179 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5180 | case 0x10ec0299: |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5181 | snd_hda_codec_write(codec, 0x21, 0, |
| 5182 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5183 | msleep(80); |
| 5184 | snd_hda_codec_write(codec, 0x21, 0, |
| 5185 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5186 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5187 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
| 5188 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
| 5189 | val = alc_read_coef_idx(codec, 0x45); |
| 5190 | if (val & (1 << 9)) { |
| 5191 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5192 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); |
| 5193 | msleep(800); |
| 5194 | val = alc_read_coef_idx(codec, 0x46); |
| 5195 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5196 | } else { |
| 5197 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5198 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); |
| 5199 | msleep(800); |
| 5200 | val = alc_read_coef_idx(codec, 0x46); |
| 5201 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5202 | } |
| 5203 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); |
| 5204 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); |
| 5205 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5206 | |
| 5207 | snd_hda_codec_write(codec, 0x21, 0, |
| 5208 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5209 | msleep(80); |
| 5210 | snd_hda_codec_write(codec, 0x21, 0, |
| 5211 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5212 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5213 | case 0x10ec0867: |
| 5214 | is_ctia = true; |
| 5215 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5216 | } |
| 5217 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5218 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5219 | is_ctia ? "yes" : "no"); |
| 5220 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 5221 | } |
| 5222 | |
| 5223 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 5224 | { |
| 5225 | struct alc_spec *spec = codec->spec; |
| 5226 | |
| 5227 | 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] | 5228 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5229 | |
| 5230 | int new_headset_mode; |
| 5231 | |
| 5232 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 5233 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 5234 | else if (mux_pin == spec->headset_mic_pin) |
| 5235 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 5236 | else if (mux_pin == spec->headphone_mic_pin) |
| 5237 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 5238 | else |
| 5239 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 5240 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5241 | if (new_headset_mode == spec->current_headset_mode) { |
| 5242 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5243 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5244 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5245 | |
| 5246 | switch (new_headset_mode) { |
| 5247 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 5248 | alc_headset_mode_unplugged(codec); |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5249 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5250 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5251 | spec->gen.hp_jack_present = false; |
| 5252 | break; |
| 5253 | case ALC_HEADSET_MODE_HEADSET: |
| 5254 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 5255 | alc_determine_headset_type(codec); |
| 5256 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 5257 | alc_headset_mode_ctia(codec); |
| 5258 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 5259 | alc_headset_mode_omtp(codec); |
| 5260 | spec->gen.hp_jack_present = true; |
| 5261 | break; |
| 5262 | case ALC_HEADSET_MODE_MIC: |
| 5263 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 5264 | spec->gen.hp_jack_present = false; |
| 5265 | break; |
| 5266 | case ALC_HEADSET_MODE_HEADPHONE: |
| 5267 | alc_headset_mode_default(codec); |
| 5268 | spec->gen.hp_jack_present = true; |
| 5269 | break; |
| 5270 | } |
| 5271 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 5272 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 5273 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5274 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5275 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 5276 | PIN_VREFHIZ); |
| 5277 | } |
| 5278 | spec->current_headset_mode = new_headset_mode; |
| 5279 | |
| 5280 | snd_hda_gen_update_outputs(codec); |
| 5281 | } |
| 5282 | |
| 5283 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 5284 | struct snd_kcontrol *kcontrol, |
| 5285 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5286 | { |
| 5287 | alc_update_headset_mode(codec); |
| 5288 | } |
| 5289 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5290 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 5291 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5292 | { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5293 | snd_hda_gen_hp_automute(codec, jack); |
| 5294 | } |
| 5295 | |
| 5296 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 5297 | { |
| 5298 | int i; |
| 5299 | struct alc_spec *spec = codec->spec; |
| 5300 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5301 | |
| 5302 | /* Find mic pins */ |
| 5303 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5304 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 5305 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 5306 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 5307 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 5308 | } |
| 5309 | |
Takashi Iwai | 0bed2aa | 2018-06-19 12:45:53 +0200 | [diff] [blame] | 5310 | WARN_ON(spec->gen.cap_sync_hook); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5311 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 5312 | spec->gen.automute_hook = alc_update_headset_mode; |
| 5313 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 5314 | } |
| 5315 | |
| 5316 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 5317 | const struct hda_fixup *fix, int action) |
| 5318 | { |
| 5319 | struct alc_spec *spec = codec->spec; |
| 5320 | |
| 5321 | switch (action) { |
| 5322 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5323 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 5324 | break; |
| 5325 | case HDA_FIXUP_ACT_PROBE: |
| 5326 | alc_probe_headset_mode(codec); |
| 5327 | break; |
| 5328 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5329 | if (is_s3_resume(codec) || is_s4_resume(codec)) { |
| 5330 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5331 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
| 5332 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5333 | alc_update_headset_mode(codec); |
| 5334 | break; |
| 5335 | } |
| 5336 | } |
| 5337 | |
| 5338 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 5339 | const struct hda_fixup *fix, int action) |
| 5340 | { |
| 5341 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5342 | struct alc_spec *spec = codec->spec; |
| 5343 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5344 | } |
| 5345 | else |
| 5346 | alc_fixup_headset_mode(codec, fix, action); |
| 5347 | } |
| 5348 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5349 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 5350 | { |
| 5351 | /* Set to iphone type */ |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5352 | static const struct coef_fw alc255fw[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5353 | WRITE_COEF(0x1b, 0x880b), |
| 5354 | WRITE_COEF(0x45, 0xd089), |
| 5355 | WRITE_COEF(0x1b, 0x080b), |
| 5356 | WRITE_COEF(0x46, 0x0004), |
| 5357 | WRITE_COEF(0x1b, 0x0c0b), |
| 5358 | {} |
| 5359 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5360 | static const struct coef_fw alc256fw[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5361 | WRITE_COEF(0x1b, 0x884b), |
| 5362 | WRITE_COEF(0x45, 0xd089), |
| 5363 | WRITE_COEF(0x1b, 0x084b), |
| 5364 | WRITE_COEF(0x46, 0x0004), |
| 5365 | WRITE_COEF(0x1b, 0x0c4b), |
| 5366 | {} |
| 5367 | }; |
| 5368 | switch (codec->core.vendor_id) { |
| 5369 | case 0x10ec0255: |
| 5370 | alc_process_coef_fw(codec, alc255fw); |
| 5371 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5372 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5373 | case 0x10ec0256: |
| 5374 | alc_process_coef_fw(codec, alc256fw); |
| 5375 | break; |
| 5376 | } |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5377 | msleep(30); |
| 5378 | } |
| 5379 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5380 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 5381 | const struct hda_fixup *fix, int action) |
| 5382 | { |
| 5383 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5384 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5385 | } |
| 5386 | alc_fixup_headset_mode(codec, fix, action); |
| 5387 | } |
| 5388 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5389 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 5390 | const struct hda_fixup *fix, int action) |
| 5391 | { |
| 5392 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5393 | struct alc_spec *spec = codec->spec; |
| 5394 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5395 | alc255_set_default_jack_type(codec); |
| 5396 | } |
| 5397 | else |
| 5398 | alc_fixup_headset_mode(codec, fix, action); |
| 5399 | } |
| 5400 | |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5401 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
| 5402 | struct hda_jack_callback *jack) |
| 5403 | { |
| 5404 | struct alc_spec *spec = codec->spec; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5405 | |
| 5406 | alc_update_headset_jack_cb(codec, jack); |
| 5407 | /* Headset Mic enable or disable, only for Dell Dino */ |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5408 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5409 | } |
| 5410 | |
| 5411 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, |
| 5412 | const struct hda_fixup *fix, int action) |
| 5413 | { |
| 5414 | alc_fixup_headset_mode(codec, fix, action); |
| 5415 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 5416 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5417 | /* toggled via hp_automute_hook */ |
| 5418 | spec->gpio_mask |= 0x40; |
| 5419 | spec->gpio_dir |= 0x40; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5420 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
| 5421 | } |
| 5422 | } |
| 5423 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5424 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 5425 | const struct hda_fixup *fix, int action) |
| 5426 | { |
| 5427 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5428 | struct alc_spec *spec = codec->spec; |
| 5429 | spec->gen.auto_mute_via_amp = 1; |
| 5430 | } |
| 5431 | } |
| 5432 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5433 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 5434 | const struct hda_fixup *fix, int action) |
| 5435 | { |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5436 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5437 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 5438 | spec->no_shutup_pins = 1; |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5439 | } |
| 5440 | } |
| 5441 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5442 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 5443 | const struct hda_fixup *fix, int action) |
| 5444 | { |
| 5445 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5446 | struct alc_spec *spec = codec->spec; |
| 5447 | /* Disable AA-loopback as it causes white noise */ |
| 5448 | spec->gen.mixer_nid = 0; |
| 5449 | } |
| 5450 | } |
| 5451 | |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5452 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
| 5453 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, |
| 5454 | const struct hda_fixup *fix, int action) |
| 5455 | { |
| 5456 | static const struct hda_pintbl pincfgs[] = { |
| 5457 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 5458 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5459 | { } |
| 5460 | }; |
| 5461 | struct alc_spec *spec = codec->spec; |
| 5462 | |
| 5463 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Hui Wang | 871b906 | 2019-08-14 12:09:08 +0800 | [diff] [blame] | 5464 | spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */ |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5465 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5466 | codec->power_save_node = 0; /* avoid click noises */ |
| 5467 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5468 | } |
| 5469 | } |
| 5470 | |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5471 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
| 5472 | const struct hda_fixup *fix, int action) |
| 5473 | { |
| 5474 | static const struct hda_pintbl pincfgs[] = { |
| 5475 | { 0x17, 0x21211010 }, /* dock headphone */ |
| 5476 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5477 | { } |
| 5478 | }; |
Takashi Iwai | 54947cd | 2018-12-03 10:44:15 +0100 | [diff] [blame] | 5479 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise |
| 5480 | * the speaker output becomes too low by some reason on Thinkpads with |
| 5481 | * ALC298 codec |
| 5482 | */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5483 | static const hda_nid_t preferred_pairs[] = { |
Takashi Iwai | 54947cd | 2018-12-03 10:44:15 +0100 | [diff] [blame] | 5484 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, |
| 5485 | 0 |
| 5486 | }; |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5487 | struct alc_spec *spec = codec->spec; |
| 5488 | |
| 5489 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 54947cd | 2018-12-03 10:44:15 +0100 | [diff] [blame] | 5490 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5491 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
Takashi Iwai | 71db96d | 2018-02-26 15:36:38 +0100 | [diff] [blame] | 5492 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5493 | } else if (action == HDA_FIXUP_ACT_INIT) { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5494 | /* Enable DOCK device */ |
| 5495 | snd_hda_codec_write(codec, 0x17, 0, |
| 5496 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
| 5497 | /* Enable DOCK device */ |
| 5498 | snd_hda_codec_write(codec, 0x19, 0, |
| 5499 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5500 | } |
| 5501 | } |
| 5502 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5503 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5504 | { |
| 5505 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5506 | int hp_pin = alc_get_hp_pin(spec); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5507 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5508 | /* Prevent pop noises when headphones are plugged in */ |
| 5509 | snd_hda_codec_write(codec, hp_pin, 0, |
| 5510 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5511 | msleep(20); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5512 | } |
| 5513 | |
| 5514 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 5515 | const struct hda_fixup *fix, int action) |
| 5516 | { |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5517 | struct alc_spec *spec = codec->spec; |
| 5518 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 5519 | int i; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5520 | |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5521 | switch (action) { |
| 5522 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5523 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise |
| 5524 | * it causes a click noise at start up |
| 5525 | */ |
| 5526 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5527 | spec->shutup = alc_shutup_dell_xps13; |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5528 | break; |
| 5529 | case HDA_FIXUP_ACT_PROBE: |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5530 | /* Make the internal mic the default input source. */ |
| 5531 | for (i = 0; i < imux->num_items; i++) { |
| 5532 | if (spec->gen.imux_pins[i] == 0x12) { |
| 5533 | spec->gen.cur_mux[0] = i; |
| 5534 | break; |
| 5535 | } |
| 5536 | } |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5537 | break; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5538 | } |
| 5539 | } |
| 5540 | |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5541 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
| 5542 | const struct hda_fixup *fix, int action) |
| 5543 | { |
| 5544 | struct alc_spec *spec = codec->spec; |
| 5545 | |
| 5546 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5547 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5548 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ |
David Henningsson | b40eda6 | 2015-05-28 09:40:23 +0200 | [diff] [blame] | 5549 | |
| 5550 | /* Disable boost for mic-in permanently. (This code is only called |
| 5551 | from quirks that guarantee that the headphone is at NID 0x1b.) */ |
| 5552 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); |
| 5553 | 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] | 5554 | } else |
| 5555 | alc_fixup_headset_mode(codec, fix, action); |
| 5556 | } |
| 5557 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5558 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 5559 | const struct hda_fixup *fix, int action) |
| 5560 | { |
| 5561 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5562 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5563 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5564 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 5565 | } |
| 5566 | alc_fixup_headset_mode(codec, fix, action); |
| 5567 | } |
| 5568 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5569 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 5570 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 5571 | { |
| 5572 | struct alc_spec *spec = codec->spec; |
| 5573 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5574 | hda_nid_t nid; |
| 5575 | unsigned int defcfg; |
| 5576 | int i; |
| 5577 | |
| 5578 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5579 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5580 | continue; |
| 5581 | nid = cfg->inputs[i].pin; |
| 5582 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5583 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 5584 | continue; |
| 5585 | return nid; |
| 5586 | } |
| 5587 | |
| 5588 | return 0; |
| 5589 | } |
| 5590 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5591 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5592 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5593 | int action) |
| 5594 | { |
| 5595 | struct alc_spec *spec = codec->spec; |
| 5596 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5597 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5598 | int mic_pin = find_ext_mic_pin(codec); |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5599 | int hp_pin = alc_get_hp_pin(spec); |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5600 | |
| 5601 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5602 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5603 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5604 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5605 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5606 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5607 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 5608 | const struct hda_fixup *fix, |
| 5609 | int action) |
| 5610 | { |
| 5611 | struct alc_spec *spec = codec->spec; |
| 5612 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5613 | int i; |
| 5614 | |
| 5615 | /* The mic boosts on level 2 and 3 are too noisy |
| 5616 | on the internal mic input. |
| 5617 | Therefore limit the boost to 0 or 1. */ |
| 5618 | |
| 5619 | if (action != HDA_FIXUP_ACT_PROBE) |
| 5620 | return; |
| 5621 | |
| 5622 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5623 | hda_nid_t nid = cfg->inputs[i].pin; |
| 5624 | unsigned int defcfg; |
| 5625 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5626 | continue; |
| 5627 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5628 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 5629 | continue; |
| 5630 | |
| 5631 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 5632 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 5633 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5634 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5635 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 5636 | } |
| 5637 | } |
| 5638 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5639 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5640 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5641 | { |
| 5642 | struct alc_spec *spec = codec->spec; |
| 5643 | int vref; |
| 5644 | |
| 5645 | msleep(200); |
| 5646 | snd_hda_gen_hp_automute(codec, jack); |
| 5647 | |
| 5648 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 5649 | |
| 5650 | msleep(600); |
| 5651 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 5652 | vref); |
| 5653 | } |
| 5654 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5655 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 5656 | const struct hda_fixup *fix, int action) |
| 5657 | { |
| 5658 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5659 | |
| 5660 | switch (action) { |
| 5661 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5662 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 5663 | /* Disable AA-loopback as it causes white noise */ |
| 5664 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 5665 | break; |
| 5666 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 5667 | /* MIC2-VREF control */ |
| 5668 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5669 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5670 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5671 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5672 | break; |
| 5673 | } |
| 5674 | } |
| 5675 | |
| 5676 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 5677 | const struct hda_fixup *fix, int action) |
| 5678 | { |
| 5679 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5680 | |
| 5681 | switch (action) { |
| 5682 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5683 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 5684 | break; |
| 5685 | case HDA_FIXUP_ACT_INIT: |
| 5686 | /* MIC2-VREF control */ |
| 5687 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5688 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5689 | break; |
| 5690 | } |
| 5691 | } |
| 5692 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5693 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 5694 | static void asus_tx300_automute(struct hda_codec *codec) |
| 5695 | { |
| 5696 | struct alc_spec *spec = codec->spec; |
| 5697 | snd_hda_gen_update_outputs(codec); |
| 5698 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 5699 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 5700 | } |
| 5701 | |
| 5702 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 5703 | const struct hda_fixup *fix, int action) |
| 5704 | { |
| 5705 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5706 | static const struct hda_pintbl dock_pins[] = { |
| 5707 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 5708 | {} |
| 5709 | }; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5710 | |
| 5711 | switch (action) { |
| 5712 | case HDA_FIXUP_ACT_PRE_PROBE: |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 5713 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5714 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 5715 | alc_setup_gpio(codec, 0x04); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5716 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 5717 | spec->gen.auto_mute_via_amp = 1; |
| 5718 | spec->gen.automute_hook = asus_tx300_automute; |
| 5719 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5720 | snd_hda_gen_hp_automute); |
| 5721 | break; |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 5722 | case HDA_FIXUP_ACT_PROBE: |
| 5723 | spec->init_amp = ALC_INIT_DEFAULT; |
| 5724 | break; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5725 | case HDA_FIXUP_ACT_BUILD: |
| 5726 | /* this is a bit tricky; give more sane names for the main |
| 5727 | * (tablet) speaker and the dock speaker, respectively |
| 5728 | */ |
Takashi Iwai | 56798e6 | 2017-04-11 08:10:52 +0200 | [diff] [blame] | 5729 | rename_ctl(codec, "Speaker Playback Switch", |
| 5730 | "Dock Speaker Playback Switch"); |
| 5731 | rename_ctl(codec, "Bass Speaker Playback Switch", |
| 5732 | "Speaker Playback Switch"); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5733 | break; |
| 5734 | } |
| 5735 | } |
| 5736 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5737 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 5738 | const struct hda_fixup *fix, int action) |
| 5739 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5740 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5741 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 5742 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 5743 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5744 | static const hda_nid_t conn1[] = { 0x0c }; |
| 5745 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 5746 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5747 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5748 | } |
| 5749 | |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5750 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
| 5751 | const struct hda_fixup *fix, int action) |
| 5752 | { |
| 5753 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5754 | /* The speaker is routed to the Node 0x06 by a mistake, as a result |
| 5755 | we can't adjust the speaker's volume since this node does not has |
| 5756 | Amp-out capability. we change the speaker's route to: |
| 5757 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( |
| 5758 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust |
| 5759 | speaker's volume now. */ |
| 5760 | |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5761 | static const hda_nid_t conn1[] = { 0x0c }; |
| 5762 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5763 | } |
| 5764 | } |
| 5765 | |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5766 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
| 5767 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, |
| 5768 | const struct hda_fixup *fix, int action) |
| 5769 | { |
| 5770 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5771 | static const hda_nid_t conn[] = { 0x02, 0x03 }; |
| 5772 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5773 | } |
| 5774 | } |
| 5775 | |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 5776 | /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ |
| 5777 | static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, |
| 5778 | const struct hda_fixup *fix, int action) |
| 5779 | { |
| 5780 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5781 | static const hda_nid_t conn[] = { 0x02 }; |
| 5782 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 5783 | } |
| 5784 | } |
| 5785 | |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5786 | /* Hook to update amp GPIO4 for automute */ |
| 5787 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, |
| 5788 | struct hda_jack_callback *jack) |
| 5789 | { |
| 5790 | struct alc_spec *spec = codec->spec; |
| 5791 | |
| 5792 | snd_hda_gen_hp_automute(codec, jack); |
| 5793 | /* mute_led_polarity is set to 0, so we pass inverted value here */ |
| 5794 | alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present); |
| 5795 | } |
| 5796 | |
| 5797 | /* Manage GPIOs for HP EliteBook Folio 9480m. |
| 5798 | * |
| 5799 | * GPIO4 is the headphone amplifier power control |
| 5800 | * GPIO3 is the audio output mute indicator LED |
| 5801 | */ |
| 5802 | |
| 5803 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, |
| 5804 | const struct hda_fixup *fix, |
| 5805 | int action) |
| 5806 | { |
| 5807 | struct alc_spec *spec = codec->spec; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5808 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5809 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5810 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5811 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
| 5812 | spec->gpio_mask |= 0x10; |
| 5813 | spec->gpio_dir |= 0x10; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5814 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5815 | } |
| 5816 | } |
| 5817 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5818 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
| 5819 | const struct hda_fixup *fix, |
| 5820 | int action) |
| 5821 | { |
| 5822 | struct alc_spec *spec = codec->spec; |
| 5823 | |
| 5824 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5825 | spec->gpio_mask |= 0x04; |
| 5826 | spec->gpio_dir |= 0x04; |
| 5827 | /* set data bit low */ |
| 5828 | } |
| 5829 | } |
| 5830 | |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5831 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
| 5832 | const struct hda_fixup *fix, |
| 5833 | int action) |
| 5834 | { |
| 5835 | alc_fixup_dual_codecs(codec, fix, action); |
| 5836 | switch (action) { |
| 5837 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5838 | /* override card longname to provide a unique UCM profile */ |
| 5839 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); |
| 5840 | break; |
| 5841 | case HDA_FIXUP_ACT_BUILD: |
| 5842 | /* rename Capture controls depending on the codec */ |
| 5843 | rename_ctl(codec, "Capture Volume", |
| 5844 | codec->addr == 0 ? |
| 5845 | "Rear-Panel Capture Volume" : |
| 5846 | "Front-Panel Capture Volume"); |
| 5847 | rename_ctl(codec, "Capture Switch", |
| 5848 | codec->addr == 0 ? |
| 5849 | "Rear-Panel Capture Switch" : |
| 5850 | "Front-Panel Capture Switch"); |
| 5851 | break; |
| 5852 | } |
| 5853 | } |
| 5854 | |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5855 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
| 5856 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
| 5857 | const struct hda_fixup *fix, int action) |
| 5858 | { |
| 5859 | struct alc_spec *spec = codec->spec; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5860 | static const hda_nid_t preferred_pairs[] = { |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5861 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
| 5862 | 0 |
| 5863 | }; |
| 5864 | |
| 5865 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5866 | return; |
| 5867 | |
| 5868 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 0700d3d | 2019-04-26 16:13:54 +0800 | [diff] [blame] | 5869 | spec->gen.auto_mute_via_amp = 1; |
| 5870 | codec->power_save_node = 0; |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5871 | } |
| 5872 | |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 5873 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
| 5874 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, |
| 5875 | const struct hda_fixup *fix, int action) |
| 5876 | { |
| 5877 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5878 | return; |
| 5879 | |
| 5880 | snd_hda_override_wcaps(codec, 0x03, 0); |
| 5881 | } |
| 5882 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5883 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
| 5884 | const struct hda_fixup *fix, int action) |
| 5885 | { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 5886 | struct alc_spec *spec = codec->spec; |
| 5887 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5888 | switch (action) { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 5889 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5890 | spec->ultra_low_power = true; |
| 5891 | break; |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5892 | case HDA_FIXUP_ACT_INIT: |
| 5893 | switch (codec->core.vendor_id) { |
| 5894 | case 0x10ec0295: |
| 5895 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5896 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); |
| 5897 | break; |
| 5898 | case 0x10ec0236: |
| 5899 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5900 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); |
| 5901 | break; |
| 5902 | } |
| 5903 | break; |
| 5904 | } |
| 5905 | } |
| 5906 | |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 5907 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
| 5908 | const struct hda_fixup *fix, int action) |
| 5909 | { |
| 5910 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5911 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
| 5912 | } |
| 5913 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 5914 | /* for hda_fixup_thinkpad_acpi() */ |
| 5915 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5916 | |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 5917 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
| 5918 | const struct hda_fixup *fix, int action) |
| 5919 | { |
| 5920 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ |
| 5921 | hda_fixup_thinkpad_acpi(codec, fix, action); |
| 5922 | } |
| 5923 | |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 5924 | /* for alc295_fixup_hp_top_speakers */ |
| 5925 | #include "hp_x360_helper.c" |
| 5926 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5927 | enum { |
| 5928 | ALC269_FIXUP_SONY_VAIO, |
| 5929 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 5930 | ALC269_FIXUP_DELL_M101Z, |
| 5931 | ALC269_FIXUP_SKU_IGNORE, |
| 5932 | ALC269_FIXUP_ASUS_G73JW, |
| 5933 | ALC269_FIXUP_LENOVO_EAPD, |
| 5934 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 5935 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5936 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5937 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5938 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5939 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5940 | ALC269_FIXUP_QUANTA_MUTE, |
| 5941 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 5942 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 5943 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 5944 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 5945 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5946 | ALC269_FIXUP_AMIC, |
| 5947 | ALC269_FIXUP_DMIC, |
| 5948 | ALC269VB_FIXUP_AMIC, |
| 5949 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5950 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 5951 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5952 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5953 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5954 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 5955 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 5956 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5957 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5958 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5959 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5960 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5961 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5962 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5963 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5964 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 5965 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5966 | ALC269_FIXUP_HEADSET_MODE, |
| 5967 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 5968 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 5969 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 5970 | ALC269_FIXUP_ASUS_X101_VERB, |
| 5971 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5972 | ALC271_FIXUP_AMIC_MIC2, |
| 5973 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 5974 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 5975 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5976 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 5977 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 5978 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 5979 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 5980 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5981 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5982 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5983 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 5984 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5985 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5986 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 5987 | ALC290_FIXUP_SUBWOOFER, |
| 5988 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5989 | ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 5990 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 5991 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 5992 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5993 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5994 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5995 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5996 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5997 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 5998 | ALC292_FIXUP_TPT440_DOCK, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 5999 | ALC292_FIXUP_TPT440, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6000 | ALC283_FIXUP_HEADSET_MIC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6001 | ALC255_FIXUP_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6002 | ALC282_FIXUP_ASPIRE_V5_PINS, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6003 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6004 | ALC286_FIXUP_HP_GPIO_LED, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6005 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6006 | ALC280_FIXUP_HP_DOCK_PINS, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6007 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6008 | ALC280_FIXUP_HP_9480M, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6009 | ALC288_FIXUP_DELL_HEADSET_MODE, |
| 6010 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6011 | ALC288_FIXUP_DELL_XPS_13, |
| 6012 | ALC288_FIXUP_DISABLE_AAMIX, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6013 | ALC292_FIXUP_DELL_E7X_AAMIX, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6014 | ALC292_FIXUP_DELL_E7X, |
| 6015 | ALC292_FIXUP_DISABLE_AAMIX, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6016 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 6017 | ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6018 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6019 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6020 | ALC275_FIXUP_DELL_XPS, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6021 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6022 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6023 | ALC255_FIXUP_DELL_SPK_NOISE, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6024 | ALC225_FIXUP_DISABLE_MIC_VREF, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6025 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6026 | ALC295_FIXUP_DISABLE_DAC3, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6027 | ALC285_FIXUP_SPEAKER2_TO_DAC1, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6028 | ALC280_FIXUP_HP_HEADSET_MIC, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6029 | ALC221_FIXUP_HP_FRONT_MIC, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6030 | ALC292_FIXUP_TPT460, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6031 | ALC298_FIXUP_SPK_VOLUME, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6032 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6033 | ALC269_FIXUP_ATIV_BOOK_8, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6034 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6035 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
| 6036 | ALC256_FIXUP_ASUS_MIC, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6037 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6038 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 6039 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6040 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 6041 | ALC233_FIXUP_ACER_HEADSET_MIC, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6042 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6043 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6044 | ALC700_FIXUP_INTEL_REFERENCE, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6045 | ALC274_FIXUP_DELL_BIND_DACS, |
| 6046 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6047 | ALC298_FIXUP_TPT470_DOCK, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6048 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6049 | ALC255_FIXUP_DELL_HEADSET_MIC, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 6050 | ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 6051 | ALC298_FIXUP_HUAWEI_MBX_STEREO, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6052 | ALC295_FIXUP_HP_X360, |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 6053 | ALC221_FIXUP_HP_HEADSET_MIC, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6054 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6055 | ALC295_FIXUP_HP_AUTO_MUTE, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 6056 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 6057 | ALC294_FIXUP_ASUS_MIC, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6058 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
| 6059 | ALC294_FIXUP_ASUS_SPK, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 6060 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 6061 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6062 | ALC255_FIXUP_ACER_HEADSET_MIC, |
Kailang Yang | 10f5b1b | 2019-02-21 16:10:22 +0800 | [diff] [blame] | 6063 | ALC295_FIXUP_CHROME_BOOK, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6064 | ALC225_FIXUP_HEADSET_JACK, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 6065 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
| 6066 | ALC225_FIXUP_WYSE_AUTO_MUTE, |
| 6067 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6068 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 6069 | ALC256_FIXUP_ASUS_HEADSET_MIC, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 6070 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 6071 | ALC299_FIXUP_PREDATOR_SPK, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 6072 | ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 6073 | ALC289_FIXUP_DELL_SPK2, |
| 6074 | ALC289_FIXUP_DUAL_SPK, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 6075 | ALC294_FIXUP_SPK2_TO_DAC1, |
| 6076 | ALC294_FIXUP_ASUS_DUAL_SPK, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 6077 | ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 6078 | ALC294_FIXUP_ASUS_HPE, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 6079 | ALC285_FIXUP_HP_GPIO_LED, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 6080 | ALC285_FIXUP_HP_MUTE_LED, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 6081 | ALC236_FIXUP_HP_MUTE_LED, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6082 | }; |
| 6083 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6084 | static const struct hda_fixup alc269_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6085 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 6086 | .type = HDA_FIXUP_PINCTLS, |
| 6087 | .v.pins = (const struct hda_pintbl[]) { |
| 6088 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6089 | {} |
| 6090 | } |
| 6091 | }, |
| 6092 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6093 | .type = HDA_FIXUP_FUNC, |
| 6094 | .v.func = alc275_fixup_gpio4_off, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6095 | .chained = true, |
| 6096 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 6097 | }, |
| 6098 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6099 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6100 | .v.verbs = (const struct hda_verb[]) { |
| 6101 | /* Enables internal speaker */ |
| 6102 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 6103 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 6104 | {} |
| 6105 | } |
| 6106 | }, |
| 6107 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6108 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 6109 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6110 | }, |
| 6111 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6112 | .type = HDA_FIXUP_PINS, |
| 6113 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6114 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 6115 | { } |
| 6116 | } |
| 6117 | }, |
| 6118 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6119 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6120 | .v.verbs = (const struct hda_verb[]) { |
| 6121 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 6122 | {} |
| 6123 | } |
| 6124 | }, |
| 6125 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6126 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6127 | .v.func = alc269_fixup_hweq, |
| 6128 | .chained = true, |
| 6129 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 6130 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6131 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 6132 | .type = HDA_FIXUP_FUNC, |
| 6133 | .v.func = alc_fixup_disable_aamix, |
| 6134 | .chained = true, |
| 6135 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 6136 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6137 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6138 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6139 | .v.func = alc271_fixup_dmic, |
| 6140 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6141 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6142 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6143 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 6144 | .chained = true, |
| 6145 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6146 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6147 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6148 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6149 | .v.func = alc269_fixup_stereo_dmic, |
| 6150 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 6151 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 6152 | .type = HDA_FIXUP_FUNC, |
| 6153 | .v.func = alc269_fixup_headset_mic, |
| 6154 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6155 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6156 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6157 | .v.func = alc269_fixup_quanta_mute, |
| 6158 | }, |
| 6159 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6160 | .type = HDA_FIXUP_PINS, |
| 6161 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6162 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 6163 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 6164 | { } |
| 6165 | }, |
| 6166 | .chained = true, |
| 6167 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 6168 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 6169 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 6170 | .type = HDA_FIXUP_PINS, |
| 6171 | .v.pins = (const struct hda_pintbl[]) { |
| 6172 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 6173 | { } |
| 6174 | }, |
| 6175 | }, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 6176 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
| 6177 | .type = HDA_FIXUP_PINS, |
| 6178 | .v.pins = (const struct hda_pintbl[]) { |
| 6179 | { 0x21, 0x0221102f }, /* HP out */ |
| 6180 | { } |
| 6181 | }, |
| 6182 | }, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6183 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
| 6184 | .type = HDA_FIXUP_FUNC, |
| 6185 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
| 6186 | }, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 6187 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
| 6188 | .type = HDA_FIXUP_FUNC, |
| 6189 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, |
| 6190 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6191 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6192 | .type = HDA_FIXUP_PINS, |
| 6193 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6194 | { 0x14, 0x99130110 }, /* speaker */ |
| 6195 | { 0x15, 0x0121401f }, /* HP out */ |
| 6196 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6197 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 6198 | { } |
| 6199 | }, |
| 6200 | }, |
| 6201 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6202 | .type = HDA_FIXUP_PINS, |
| 6203 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6204 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6205 | { 0x14, 0x99130110 }, /* speaker */ |
| 6206 | { 0x15, 0x0121401f }, /* HP out */ |
| 6207 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6208 | { } |
| 6209 | }, |
| 6210 | }, |
| 6211 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6212 | .type = HDA_FIXUP_PINS, |
| 6213 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6214 | { 0x14, 0x99130110 }, /* speaker */ |
| 6215 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6216 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 6217 | { 0x21, 0x0121401f }, /* HP out */ |
| 6218 | { } |
| 6219 | }, |
| 6220 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 6221 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6222 | .type = HDA_FIXUP_PINS, |
| 6223 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6224 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6225 | { 0x14, 0x99130110 }, /* speaker */ |
| 6226 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6227 | { 0x21, 0x0121401f }, /* HP out */ |
| 6228 | { } |
| 6229 | }, |
| 6230 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6231 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6232 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6233 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 6234 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 6235 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 6236 | .type = HDA_FIXUP_FUNC, |
| 6237 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 6238 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6239 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6240 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6241 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 6242 | }, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6243 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
| 6244 | .type = HDA_FIXUP_FUNC, |
| 6245 | .v.func = alc269_fixup_hp_mute_led_mic3, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6246 | .chained = true, |
| 6247 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6248 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6249 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 6250 | .type = HDA_FIXUP_FUNC, |
| 6251 | .v.func = alc269_fixup_hp_gpio_led, |
| 6252 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6253 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 6254 | .type = HDA_FIXUP_FUNC, |
| 6255 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 6256 | }, |
| 6257 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 6258 | .type = HDA_FIXUP_FUNC, |
| 6259 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 6260 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6261 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6262 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 6263 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6264 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6265 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 6266 | .type = HDA_FIXUP_FUNC, |
| 6267 | .v.func = alc_fixup_no_shutup, |
| 6268 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6269 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6270 | .type = HDA_FIXUP_PINS, |
| 6271 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6272 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 6273 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 6274 | { } |
| 6275 | }, |
| 6276 | .chained = true, |
| 6277 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 6278 | }, |
| 6279 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6280 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6281 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 6282 | .chained = true, |
| 6283 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6284 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6285 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6286 | .type = HDA_FIXUP_PINS, |
| 6287 | .v.pins = (const struct hda_pintbl[]) { |
| 6288 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6289 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6290 | { } |
| 6291 | }, |
| 6292 | .chained = true, |
| 6293 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6294 | }, |
| 6295 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6296 | .type = HDA_FIXUP_PINS, |
| 6297 | .v.pins = (const struct hda_pintbl[]) { |
| 6298 | { 0x16, 0x21014020 }, /* dock line out */ |
| 6299 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 6300 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6301 | { } |
| 6302 | }, |
| 6303 | .chained = true, |
| 6304 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6305 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6306 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 6307 | .type = HDA_FIXUP_PINS, |
| 6308 | .v.pins = (const struct hda_pintbl[]) { |
| 6309 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6310 | { } |
| 6311 | }, |
| 6312 | .chained = true, |
| 6313 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6314 | }, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 6315 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
| 6316 | .type = HDA_FIXUP_PINS, |
| 6317 | .v.pins = (const struct hda_pintbl[]) { |
| 6318 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6319 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6320 | { } |
| 6321 | }, |
| 6322 | .chained = true, |
| 6323 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6324 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6325 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 6326 | .type = HDA_FIXUP_FUNC, |
| 6327 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 6328 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6329 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6330 | }, |
| 6331 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6332 | .type = HDA_FIXUP_FUNC, |
| 6333 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 6334 | }, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6335 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
| 6336 | .type = HDA_FIXUP_PINS, |
| 6337 | .v.pins = (const struct hda_pintbl[]) { |
| 6338 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 6339 | { } |
| 6340 | }, |
| 6341 | .chained = true, |
| 6342 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 6343 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6344 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 6345 | .type = HDA_FIXUP_PINS, |
| 6346 | .v.pins = (const struct hda_pintbl[]) { |
| 6347 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6348 | { } |
| 6349 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 6350 | .chained = true, |
| 6351 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6352 | }, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 6353 | [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6354 | .type = HDA_FIXUP_PINS, |
| 6355 | .v.pins = (const struct hda_pintbl[]) { |
| 6356 | {0x12, 0x90a60130}, |
| 6357 | {0x13, 0x40000000}, |
| 6358 | {0x14, 0x90170110}, |
| 6359 | {0x18, 0x411111f0}, |
| 6360 | {0x19, 0x04a11040}, |
| 6361 | {0x1a, 0x411111f0}, |
| 6362 | {0x1b, 0x90170112}, |
| 6363 | {0x1d, 0x40759a05}, |
| 6364 | {0x1e, 0x411111f0}, |
| 6365 | {0x21, 0x04211020}, |
| 6366 | { } |
| 6367 | }, |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 6368 | .chained = true, |
| 6369 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6370 | }, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 6371 | [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { |
| 6372 | .type = HDA_FIXUP_FUNC, |
| 6373 | .v.func = alc298_fixup_huawei_mbx_stereo, |
| 6374 | .chained = true, |
| 6375 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
| 6376 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6377 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 6378 | .type = HDA_FIXUP_FUNC, |
| 6379 | .v.func = alc269_fixup_x101_headset_mic, |
| 6380 | }, |
| 6381 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 6382 | .type = HDA_FIXUP_VERBS, |
| 6383 | .v.verbs = (const struct hda_verb[]) { |
| 6384 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 6385 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 6386 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 6387 | { } |
| 6388 | }, |
| 6389 | .chained = true, |
| 6390 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 6391 | }, |
| 6392 | [ALC269_FIXUP_ASUS_X101] = { |
| 6393 | .type = HDA_FIXUP_PINS, |
| 6394 | .v.pins = (const struct hda_pintbl[]) { |
| 6395 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 6396 | { } |
| 6397 | }, |
| 6398 | .chained = true, |
| 6399 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 6400 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6401 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6402 | .type = HDA_FIXUP_PINS, |
| 6403 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6404 | { 0x14, 0x99130110 }, /* speaker */ |
| 6405 | { 0x19, 0x01a19c20 }, /* mic */ |
| 6406 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 6407 | { 0x21, 0x0121401f }, /* HP out */ |
| 6408 | { } |
| 6409 | }, |
| 6410 | }, |
| 6411 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6412 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6413 | .v.func = alc271_hp_gate_mic_jack, |
| 6414 | .chained = true, |
| 6415 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 6416 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6417 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 6418 | .type = HDA_FIXUP_FUNC, |
| 6419 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6420 | .chained = true, |
| 6421 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 6422 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6423 | [ALC269_FIXUP_ACER_AC700] = { |
| 6424 | .type = HDA_FIXUP_PINS, |
| 6425 | .v.pins = (const struct hda_pintbl[]) { |
| 6426 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6427 | { 0x14, 0x99130110 }, /* speaker */ |
| 6428 | { 0x18, 0x03a11c20 }, /* mic */ |
| 6429 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 6430 | { 0x21, 0x0321101f }, /* HP out */ |
| 6431 | { } |
| 6432 | }, |
| 6433 | .chained = true, |
| 6434 | .chain_id = ALC271_FIXUP_DMIC, |
| 6435 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6436 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 6437 | .type = HDA_FIXUP_FUNC, |
| 6438 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 6439 | .chained = true, |
| 6440 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6441 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6442 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 6443 | .type = HDA_FIXUP_FUNC, |
| 6444 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6445 | .chained = true, |
| 6446 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 6447 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6448 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 6449 | .type = HDA_FIXUP_VERBS, |
| 6450 | .v.verbs = (const struct hda_verb[]) { |
| 6451 | /* class-D output amp +5dB */ |
| 6452 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 6453 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 6454 | {} |
| 6455 | }, |
| 6456 | .chained = true, |
| 6457 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 6458 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6459 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 6460 | .type = HDA_FIXUP_FUNC, |
| 6461 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6462 | .chained = true, |
| 6463 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 6464 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6465 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 6466 | .type = HDA_FIXUP_PINS, |
| 6467 | .v.pins = (const struct hda_pintbl[]) { |
| 6468 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6469 | { 0x18, 0x03a11d20 }, /* mic */ |
| 6470 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 6471 | { } |
| 6472 | }, |
| 6473 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6474 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 6475 | .type = HDA_FIXUP_FUNC, |
| 6476 | .v.func = alc283_fixup_chromebook, |
| 6477 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6478 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 6479 | .type = HDA_FIXUP_FUNC, |
| 6480 | .v.func = alc283_fixup_sense_combo_jack, |
| 6481 | .chained = true, |
| 6482 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 6483 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6484 | [ALC282_FIXUP_ASUS_TX300] = { |
| 6485 | .type = HDA_FIXUP_FUNC, |
| 6486 | .v.func = alc282_fixup_asus_tx300, |
| 6487 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6488 | [ALC283_FIXUP_INT_MIC] = { |
| 6489 | .type = HDA_FIXUP_VERBS, |
| 6490 | .v.verbs = (const struct hda_verb[]) { |
| 6491 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 6492 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 6493 | { } |
| 6494 | }, |
| 6495 | .chained = true, |
| 6496 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6497 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6498 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 6499 | .type = HDA_FIXUP_PINS, |
| 6500 | .v.pins = (const struct hda_pintbl[]) { |
| 6501 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6502 | { } |
| 6503 | }, |
| 6504 | .chained = true, |
| 6505 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6506 | }, |
| 6507 | [ALC290_FIXUP_SUBWOOFER] = { |
| 6508 | .type = HDA_FIXUP_PINS, |
| 6509 | .v.pins = (const struct hda_pintbl[]) { |
| 6510 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6511 | { } |
| 6512 | }, |
| 6513 | .chained = true, |
| 6514 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 6515 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6516 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 6517 | .type = HDA_FIXUP_FUNC, |
| 6518 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6519 | }, |
| 6520 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 6521 | .type = HDA_FIXUP_FUNC, |
| 6522 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6523 | .chained = true, |
| 6524 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 6525 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6526 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 6527 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6528 | .v.func = alc_fixup_thinkpad_acpi, |
Takashi Iwai | 09da111 | 2016-09-08 12:15:02 +0200 | [diff] [blame] | 6529 | .chained = true, |
| 6530 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6531 | }, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6532 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
| 6533 | .type = HDA_FIXUP_FUNC, |
| 6534 | .v.func = alc_fixup_inv_dmic, |
| 6535 | .chained = true, |
| 6536 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 6537 | }, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6538 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 6539 | .type = HDA_FIXUP_PINS, |
| 6540 | .v.pins = (const struct hda_pintbl[]) { |
| 6541 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6542 | { } |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6543 | }, |
| 6544 | .chained = true, |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 6545 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6546 | }, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6547 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6548 | .type = HDA_FIXUP_PINS, |
| 6549 | .v.pins = (const struct hda_pintbl[]) { |
| 6550 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6551 | { } |
| 6552 | }, |
| 6553 | .chained = true, |
| 6554 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6555 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6556 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6557 | .type = HDA_FIXUP_PINS, |
| 6558 | .v.pins = (const struct hda_pintbl[]) { |
| 6559 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6560 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6561 | { } |
| 6562 | }, |
| 6563 | .chained = true, |
| 6564 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6565 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6566 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6567 | .type = HDA_FIXUP_PINS, |
| 6568 | .v.pins = (const struct hda_pintbl[]) { |
| 6569 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6570 | { } |
| 6571 | }, |
| 6572 | .chained = true, |
| 6573 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6574 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6575 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 6576 | .type = HDA_FIXUP_FUNC, |
| 6577 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 6578 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6579 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6580 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6581 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6582 | .type = HDA_FIXUP_FUNC, |
| 6583 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 6584 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6585 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6586 | .type = HDA_FIXUP_PINS, |
| 6587 | .v.pins = (const struct hda_pintbl[]) { |
| 6588 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6589 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6590 | { } |
| 6591 | }, |
| 6592 | .chained = true, |
| 6593 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6594 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6595 | [ALC292_FIXUP_TPT440_DOCK] = { |
David Henningsson | ec56af6 | 2015-06-24 10:46:33 +0200 | [diff] [blame] | 6596 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 6597 | .v.func = alc_fixup_tpt440_dock, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6598 | .chained = true, |
| 6599 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6600 | }, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6601 | [ALC292_FIXUP_TPT440] = { |
| 6602 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 157f0b7 | 2015-12-10 23:30:43 +0100 | [diff] [blame] | 6603 | .v.func = alc_fixup_disable_aamix, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6604 | .chained = true, |
| 6605 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
| 6606 | }, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6607 | [ALC283_FIXUP_HEADSET_MIC] = { |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 6608 | .type = HDA_FIXUP_PINS, |
| 6609 | .v.pins = (const struct hda_pintbl[]) { |
| 6610 | { 0x19, 0x04a110f0 }, |
| 6611 | { }, |
| 6612 | }, |
| 6613 | }, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6614 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6615 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6616 | .v.func = snd_hda_gen_fixup_micmute_led, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6617 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6618 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 6619 | .type = HDA_FIXUP_PINS, |
| 6620 | .v.pins = (const struct hda_pintbl[]) { |
| 6621 | { 0x12, 0x90a60130 }, |
| 6622 | { 0x14, 0x90170110 }, |
| 6623 | { 0x17, 0x40000008 }, |
| 6624 | { 0x18, 0x411111f0 }, |
Mateusz Sylwestrzak | 0420694 | 2015-07-19 17:38:56 +0200 | [diff] [blame] | 6625 | { 0x19, 0x01a1913c }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6626 | { 0x1a, 0x411111f0 }, |
| 6627 | { 0x1b, 0x411111f0 }, |
| 6628 | { 0x1d, 0x40f89b2d }, |
| 6629 | { 0x1e, 0x411111f0 }, |
| 6630 | { 0x21, 0x0321101f }, |
| 6631 | { }, |
| 6632 | }, |
| 6633 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6634 | [ALC280_FIXUP_HP_GPIO4] = { |
| 6635 | .type = HDA_FIXUP_FUNC, |
| 6636 | .v.func = alc280_fixup_hp_gpio4, |
| 6637 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6638 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 6639 | .type = HDA_FIXUP_FUNC, |
| 6640 | .v.func = alc286_fixup_hp_gpio_led, |
| 6641 | }, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6642 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
| 6643 | .type = HDA_FIXUP_FUNC, |
| 6644 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, |
| 6645 | }, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6646 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
| 6647 | .type = HDA_FIXUP_PINS, |
| 6648 | .v.pins = (const struct hda_pintbl[]) { |
| 6649 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6650 | { 0x1a, 0x01a1903c }, /* headset mic */ |
| 6651 | { 0x18, 0x2181103f }, /* line-in */ |
| 6652 | { }, |
| 6653 | }, |
| 6654 | .chained = true, |
| 6655 | .chain_id = ALC280_FIXUP_HP_GPIO4 |
| 6656 | }, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6657 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
| 6658 | .type = HDA_FIXUP_PINS, |
| 6659 | .v.pins = (const struct hda_pintbl[]) { |
| 6660 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6661 | { 0x18, 0x2181103f }, /* line-in */ |
| 6662 | { }, |
| 6663 | }, |
| 6664 | .chained = true, |
| 6665 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED |
| 6666 | }, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6667 | [ALC280_FIXUP_HP_9480M] = { |
| 6668 | .type = HDA_FIXUP_FUNC, |
| 6669 | .v.func = alc280_fixup_hp_9480m, |
| 6670 | }, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6671 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
| 6672 | .type = HDA_FIXUP_FUNC, |
| 6673 | .v.func = alc_fixup_headset_mode_dell_alc288, |
| 6674 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6675 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6676 | }, |
| 6677 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6678 | .type = HDA_FIXUP_PINS, |
| 6679 | .v.pins = (const struct hda_pintbl[]) { |
| 6680 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6681 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6682 | { } |
| 6683 | }, |
| 6684 | .chained = true, |
| 6685 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE |
| 6686 | }, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6687 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
| 6688 | .type = HDA_FIXUP_FUNC, |
| 6689 | .v.func = alc_fixup_disable_aamix, |
| 6690 | .chained = true, |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 6691 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6692 | }, |
| 6693 | [ALC288_FIXUP_DELL_XPS_13] = { |
| 6694 | .type = HDA_FIXUP_FUNC, |
| 6695 | .v.func = alc_fixup_dell_xps13, |
| 6696 | .chained = true, |
| 6697 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX |
| 6698 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6699 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
| 6700 | .type = HDA_FIXUP_FUNC, |
| 6701 | .v.func = alc_fixup_disable_aamix, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6702 | .chained = true, |
| 6703 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6704 | }, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6705 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
| 6706 | .type = HDA_FIXUP_FUNC, |
| 6707 | .v.func = alc_fixup_disable_aamix, |
| 6708 | .chained = true, |
| 6709 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6710 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6711 | [ALC292_FIXUP_DELL_E7X_AAMIX] = { |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6712 | .type = HDA_FIXUP_FUNC, |
| 6713 | .v.func = alc_fixup_dell_xps13, |
| 6714 | .chained = true, |
| 6715 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX |
| 6716 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6717 | [ALC292_FIXUP_DELL_E7X] = { |
| 6718 | .type = HDA_FIXUP_FUNC, |
| 6719 | .v.func = snd_hda_gen_fixup_micmute_led, |
| 6720 | /* micmute fixup must be applied at last */ |
| 6721 | .chained_before = true, |
| 6722 | .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, |
| 6723 | }, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 6724 | [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { |
| 6725 | .type = HDA_FIXUP_PINS, |
| 6726 | .v.pins = (const struct hda_pintbl[]) { |
| 6727 | { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 6728 | { } |
| 6729 | }, |
| 6730 | .chained_before = true, |
| 6731 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 6732 | }, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6733 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6734 | .type = HDA_FIXUP_PINS, |
| 6735 | .v.pins = (const struct hda_pintbl[]) { |
| 6736 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6737 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6738 | { } |
| 6739 | }, |
| 6740 | .chained = true, |
| 6741 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6742 | }, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6743 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
| 6744 | .type = HDA_FIXUP_PINS, |
| 6745 | .v.pins = (const struct hda_pintbl[]) { |
| 6746 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6747 | { } |
| 6748 | }, |
| 6749 | .chained = true, |
| 6750 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6751 | }, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6752 | [ALC275_FIXUP_DELL_XPS] = { |
| 6753 | .type = HDA_FIXUP_VERBS, |
| 6754 | .v.verbs = (const struct hda_verb[]) { |
| 6755 | /* Enables internal speaker */ |
| 6756 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, |
| 6757 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, |
| 6758 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, |
| 6759 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, |
| 6760 | {} |
| 6761 | } |
| 6762 | }, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6763 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
| 6764 | .type = HDA_FIXUP_FUNC, |
| 6765 | .v.func = alc_fixup_disable_aamix, |
| 6766 | .chained = true, |
| 6767 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 6768 | }, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6769 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
| 6770 | .type = HDA_FIXUP_FUNC, |
| 6771 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, |
| 6772 | }, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6773 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
| 6774 | .type = HDA_FIXUP_FUNC, |
| 6775 | .v.func = alc_fixup_disable_aamix, |
| 6776 | .chained = true, |
| 6777 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6778 | }, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6779 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
| 6780 | .type = HDA_FIXUP_FUNC, |
| 6781 | .v.func = alc_fixup_disable_mic_vref, |
| 6782 | .chained = true, |
| 6783 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6784 | }, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6785 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6786 | .type = HDA_FIXUP_VERBS, |
| 6787 | .v.verbs = (const struct hda_verb[]) { |
| 6788 | /* Disable pass-through path for FRONT 14h */ |
| 6789 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 6790 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 6791 | {} |
| 6792 | }, |
| 6793 | .chained = true, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6794 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6795 | }, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6796 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
| 6797 | .type = HDA_FIXUP_FUNC, |
| 6798 | .v.func = alc_fixup_disable_aamix, |
| 6799 | .chained = true, |
| 6800 | .chain_id = ALC269_FIXUP_HEADSET_MIC, |
| 6801 | }, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6802 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
| 6803 | .type = HDA_FIXUP_PINS, |
| 6804 | .v.pins = (const struct hda_pintbl[]) { |
| 6805 | { 0x19, 0x02a19020 }, /* Front Mic */ |
| 6806 | { } |
| 6807 | }, |
| 6808 | }, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6809 | [ALC292_FIXUP_TPT460] = { |
| 6810 | .type = HDA_FIXUP_FUNC, |
| 6811 | .v.func = alc_fixup_tpt440_dock, |
| 6812 | .chained = true, |
| 6813 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, |
| 6814 | }, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6815 | [ALC298_FIXUP_SPK_VOLUME] = { |
| 6816 | .type = HDA_FIXUP_FUNC, |
| 6817 | .v.func = alc298_fixup_speaker_volume, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 6818 | .chained = true, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6819 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6820 | }, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6821 | [ALC295_FIXUP_DISABLE_DAC3] = { |
| 6822 | .type = HDA_FIXUP_FUNC, |
| 6823 | .v.func = alc295_fixup_disable_dac3, |
| 6824 | }, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6825 | [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { |
| 6826 | .type = HDA_FIXUP_FUNC, |
| 6827 | .v.func = alc285_fixup_speaker2_to_dac1, |
Hui Wang | c37c0ab | 2020-02-19 13:23:06 +0800 | [diff] [blame] | 6828 | .chained = true, |
| 6829 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6830 | }, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6831 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
| 6832 | .type = HDA_FIXUP_PINS, |
| 6833 | .v.pins = (const struct hda_pintbl[]) { |
| 6834 | { 0x1b, 0x90170151 }, |
| 6835 | { } |
| 6836 | }, |
| 6837 | .chained = true, |
| 6838 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6839 | }, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6840 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
| 6841 | .type = HDA_FIXUP_FUNC, |
| 6842 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6843 | .chained = true, |
| 6844 | .chain_id = ALC269_FIXUP_NO_SHUTUP |
| 6845 | }, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6846 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
| 6847 | .type = HDA_FIXUP_PINS, |
| 6848 | .v.pins = (const struct hda_pintbl[]) { |
| 6849 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6850 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6851 | { } |
| 6852 | }, |
| 6853 | .chained = true, |
| 6854 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6855 | }, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6856 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
| 6857 | .type = HDA_FIXUP_FUNC, |
| 6858 | .v.func = alc_fixup_headset_mode, |
| 6859 | }, |
| 6860 | [ALC256_FIXUP_ASUS_MIC] = { |
| 6861 | .type = HDA_FIXUP_PINS, |
| 6862 | .v.pins = (const struct hda_pintbl[]) { |
| 6863 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 6864 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 6865 | { } |
| 6866 | }, |
| 6867 | .chained = true, |
| 6868 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 6869 | }, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6870 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6871 | .type = HDA_FIXUP_FUNC, |
| 6872 | /* Set up GPIO2 for the speaker amp */ |
| 6873 | .v.func = alc_fixup_gpio4, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6874 | }, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6875 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6876 | .type = HDA_FIXUP_PINS, |
| 6877 | .v.pins = (const struct hda_pintbl[]) { |
| 6878 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6879 | { } |
| 6880 | }, |
| 6881 | .chained = true, |
| 6882 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6883 | }, |
| 6884 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { |
| 6885 | .type = HDA_FIXUP_VERBS, |
| 6886 | .v.verbs = (const struct hda_verb[]) { |
| 6887 | /* Enables internal speaker */ |
| 6888 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, |
| 6889 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, |
| 6890 | {} |
| 6891 | }, |
| 6892 | .chained = true, |
| 6893 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 6894 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6895 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
| 6896 | .type = HDA_FIXUP_FUNC, |
| 6897 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 6898 | }, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 6899 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
| 6900 | .type = HDA_FIXUP_VERBS, |
| 6901 | .v.verbs = (const struct hda_verb[]) { |
| 6902 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 6903 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 6904 | { } |
| 6905 | }, |
| 6906 | .chained = true, |
| 6907 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 6908 | }, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6909 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
| 6910 | .type = HDA_FIXUP_PINS, |
| 6911 | .v.pins = (const struct hda_pintbl[]) { |
| 6912 | /* Change the mic location from front to right, otherwise there are |
| 6913 | two front mics with the same name, pulseaudio can't handle them. |
| 6914 | This is just a temporary workaround, after applying this fixup, |
| 6915 | there will be one "Front Mic" and one "Mic" in this machine. |
| 6916 | */ |
| 6917 | { 0x1a, 0x04a19040 }, |
| 6918 | { } |
| 6919 | }, |
| 6920 | }, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6921 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
| 6922 | .type = HDA_FIXUP_PINS, |
| 6923 | .v.pins = (const struct hda_pintbl[]) { |
| 6924 | { 0x16, 0x0101102f }, /* Rear Headset HP */ |
| 6925 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 6926 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ |
| 6927 | { 0x1b, 0x02011020 }, |
| 6928 | { } |
| 6929 | }, |
| 6930 | .chained = true, |
| 6931 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6932 | }, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6933 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
| 6934 | .type = HDA_FIXUP_VERBS, |
| 6935 | .v.verbs = (const struct hda_verb[]) { |
| 6936 | /* Enables internal speaker */ |
| 6937 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, |
| 6938 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, |
| 6939 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, |
| 6940 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, |
| 6941 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, |
| 6942 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, |
| 6943 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, |
| 6944 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, |
| 6945 | {} |
| 6946 | } |
| 6947 | }, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6948 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
| 6949 | .type = HDA_FIXUP_FUNC, |
| 6950 | .v.func = alc274_fixup_bind_dacs, |
| 6951 | .chained = true, |
| 6952 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6953 | }, |
| 6954 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { |
| 6955 | .type = HDA_FIXUP_PINS, |
| 6956 | .v.pins = (const struct hda_pintbl[]) { |
| 6957 | { 0x1b, 0x0401102f }, |
| 6958 | { } |
| 6959 | }, |
| 6960 | .chained = true, |
| 6961 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS |
| 6962 | }, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6963 | [ALC298_FIXUP_TPT470_DOCK] = { |
| 6964 | .type = HDA_FIXUP_FUNC, |
| 6965 | .v.func = alc_fixup_tpt470_dock, |
| 6966 | .chained = true, |
| 6967 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE |
| 6968 | }, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6969 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
| 6970 | .type = HDA_FIXUP_PINS, |
| 6971 | .v.pins = (const struct hda_pintbl[]) { |
| 6972 | { 0x14, 0x0201101f }, |
| 6973 | { } |
| 6974 | }, |
| 6975 | .chained = true, |
| 6976 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6977 | }, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6978 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
| 6979 | .type = HDA_FIXUP_PINS, |
| 6980 | .v.pins = (const struct hda_pintbl[]) { |
| 6981 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6982 | { } |
| 6983 | }, |
Hui Wang | 3ce0d5a | 2018-04-19 13:29:04 +0800 | [diff] [blame] | 6984 | .chained = true, |
| 6985 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6986 | }, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6987 | [ALC295_FIXUP_HP_X360] = { |
| 6988 | .type = HDA_FIXUP_FUNC, |
| 6989 | .v.func = alc295_fixup_hp_top_speakers, |
| 6990 | .chained = true, |
| 6991 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 6992 | }, |
| 6993 | [ALC221_FIXUP_HP_HEADSET_MIC] = { |
| 6994 | .type = HDA_FIXUP_PINS, |
| 6995 | .v.pins = (const struct hda_pintbl[]) { |
| 6996 | { 0x19, 0x0181313f}, |
| 6997 | { } |
| 6998 | }, |
| 6999 | .chained = true, |
| 7000 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7001 | }, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7002 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
| 7003 | .type = HDA_FIXUP_FUNC, |
| 7004 | .v.func = alc285_fixup_invalidate_dacs, |
Hui Wang | 6ba189c | 2018-12-09 09:16:43 +0800 | [diff] [blame] | 7005 | .chained = true, |
| 7006 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7007 | }, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 7008 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
| 7009 | .type = HDA_FIXUP_FUNC, |
| 7010 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7011 | }, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 7012 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
| 7013 | .type = HDA_FIXUP_PINS, |
| 7014 | .v.pins = (const struct hda_pintbl[]) { |
| 7015 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7016 | { } |
| 7017 | }, |
| 7018 | .chained = true, |
| 7019 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7020 | }, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7021 | [ALC294_FIXUP_ASUS_MIC] = { |
| 7022 | .type = HDA_FIXUP_PINS, |
| 7023 | .v.pins = (const struct hda_pintbl[]) { |
| 7024 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 7025 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7026 | { } |
| 7027 | }, |
| 7028 | .chained = true, |
| 7029 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7030 | }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7031 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
| 7032 | .type = HDA_FIXUP_PINS, |
| 7033 | .v.pins = (const struct hda_pintbl[]) { |
Jian-Hong Pan | 82b0114 | 2018-12-27 16:46:31 +0800 | [diff] [blame] | 7034 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7035 | { } |
| 7036 | }, |
| 7037 | .chained = true, |
| 7038 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7039 | }, |
| 7040 | [ALC294_FIXUP_ASUS_SPK] = { |
| 7041 | .type = HDA_FIXUP_VERBS, |
| 7042 | .v.verbs = (const struct hda_verb[]) { |
| 7043 | /* Set EAPD high */ |
| 7044 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, |
| 7045 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, |
| 7046 | { } |
| 7047 | }, |
| 7048 | .chained = true, |
| 7049 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7050 | }, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 7051 | [ALC295_FIXUP_CHROME_BOOK] = { |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 7052 | .type = HDA_FIXUP_FUNC, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 7053 | .v.func = alc295_fixup_chromebook, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 7054 | .chained = true, |
| 7055 | .chain_id = ALC225_FIXUP_HEADSET_JACK |
| 7056 | }, |
| 7057 | [ALC225_FIXUP_HEADSET_JACK] = { |
| 7058 | .type = HDA_FIXUP_FUNC, |
| 7059 | .v.func = alc_fixup_headset_jack, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 7060 | }, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 7061 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
| 7062 | .type = HDA_FIXUP_PINS, |
| 7063 | .v.pins = (const struct hda_pintbl[]) { |
| 7064 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7065 | { } |
| 7066 | }, |
| 7067 | .chained = true, |
| 7068 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7069 | }, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 7070 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
| 7071 | .type = HDA_FIXUP_VERBS, |
| 7072 | .v.verbs = (const struct hda_verb[]) { |
| 7073 | /* Disable PCBEEP-IN passthrough */ |
| 7074 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 7075 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 7076 | { } |
| 7077 | }, |
| 7078 | .chained = true, |
| 7079 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
| 7080 | }, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 7081 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
| 7082 | .type = HDA_FIXUP_PINS, |
| 7083 | .v.pins = (const struct hda_pintbl[]) { |
| 7084 | { 0x19, 0x03a11130 }, |
| 7085 | { 0x1a, 0x90a60140 }, /* use as internal mic */ |
| 7086 | { } |
| 7087 | }, |
| 7088 | .chained = true, |
| 7089 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7090 | }, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 7091 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
| 7092 | .type = HDA_FIXUP_PINS, |
| 7093 | .v.pins = (const struct hda_pintbl[]) { |
| 7094 | { 0x16, 0x01011020 }, /* Rear Line out */ |
| 7095 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 7096 | { } |
| 7097 | }, |
| 7098 | .chained = true, |
| 7099 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE |
| 7100 | }, |
| 7101 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { |
| 7102 | .type = HDA_FIXUP_FUNC, |
| 7103 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7104 | .chained = true, |
| 7105 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF |
| 7106 | }, |
| 7107 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { |
| 7108 | .type = HDA_FIXUP_FUNC, |
| 7109 | .v.func = alc_fixup_disable_mic_vref, |
| 7110 | .chained = true, |
| 7111 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7112 | }, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 7113 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
| 7114 | .type = HDA_FIXUP_VERBS, |
| 7115 | .v.verbs = (const struct hda_verb[]) { |
| 7116 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, |
| 7117 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, |
| 7118 | { } |
| 7119 | }, |
| 7120 | .chained = true, |
| 7121 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE |
| 7122 | }, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 7123 | [ALC256_FIXUP_ASUS_HEADSET_MIC] = { |
| 7124 | .type = HDA_FIXUP_PINS, |
| 7125 | .v.pins = (const struct hda_pintbl[]) { |
| 7126 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 7127 | { } |
| 7128 | }, |
| 7129 | .chained = true, |
| 7130 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7131 | }, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 7132 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7133 | .type = HDA_FIXUP_PINS, |
| 7134 | .v.pins = (const struct hda_pintbl[]) { |
| 7135 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7136 | { } |
| 7137 | }, |
| 7138 | .chained = true, |
| 7139 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7140 | }, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7141 | [ALC299_FIXUP_PREDATOR_SPK] = { |
| 7142 | .type = HDA_FIXUP_PINS, |
| 7143 | .v.pins = (const struct hda_pintbl[]) { |
| 7144 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ |
| 7145 | { } |
| 7146 | } |
| 7147 | }, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 7148 | [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { |
| 7149 | .type = HDA_FIXUP_PINS, |
| 7150 | .v.pins = (const struct hda_pintbl[]) { |
| 7151 | { 0x19, 0x04a11040 }, |
| 7152 | { 0x21, 0x04211020 }, |
| 7153 | { } |
| 7154 | }, |
| 7155 | .chained = true, |
| 7156 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7157 | }, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 7158 | [ALC289_FIXUP_DELL_SPK2] = { |
| 7159 | .type = HDA_FIXUP_PINS, |
| 7160 | .v.pins = (const struct hda_pintbl[]) { |
| 7161 | { 0x17, 0x90170130 }, /* bass spk */ |
| 7162 | { } |
| 7163 | }, |
| 7164 | .chained = true, |
| 7165 | .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE |
| 7166 | }, |
| 7167 | [ALC289_FIXUP_DUAL_SPK] = { |
| 7168 | .type = HDA_FIXUP_FUNC, |
| 7169 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 7170 | .chained = true, |
| 7171 | .chain_id = ALC289_FIXUP_DELL_SPK2 |
| 7172 | }, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7173 | [ALC294_FIXUP_SPK2_TO_DAC1] = { |
| 7174 | .type = HDA_FIXUP_FUNC, |
| 7175 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 7176 | .chained = true, |
| 7177 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7178 | }, |
| 7179 | [ALC294_FIXUP_ASUS_DUAL_SPK] = { |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 7180 | .type = HDA_FIXUP_FUNC, |
| 7181 | /* The GPIO must be pulled to initialize the AMP */ |
| 7182 | .v.func = alc_fixup_gpio4, |
| 7183 | .chained = true, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7184 | .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 7185 | }, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 7186 | [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { |
| 7187 | .type = HDA_FIXUP_FUNC, |
| 7188 | .v.func = alc_fixup_headset_jack, |
| 7189 | .chained = true, |
| 7190 | .chain_id = ALC285_FIXUP_SPEAKER2_TO_DAC1 |
| 7191 | }, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 7192 | [ALC294_FIXUP_ASUS_HPE] = { |
| 7193 | .type = HDA_FIXUP_VERBS, |
| 7194 | .v.verbs = (const struct hda_verb[]) { |
| 7195 | /* Set EAPD high */ |
| 7196 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 7197 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, |
| 7198 | { } |
| 7199 | }, |
| 7200 | .chained = true, |
| 7201 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7202 | }, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 7203 | [ALC285_FIXUP_HP_GPIO_LED] = { |
| 7204 | .type = HDA_FIXUP_FUNC, |
| 7205 | .v.func = alc285_fixup_hp_gpio_led, |
| 7206 | }, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 7207 | [ALC285_FIXUP_HP_MUTE_LED] = { |
| 7208 | .type = HDA_FIXUP_FUNC, |
| 7209 | .v.func = alc285_fixup_hp_mute_led, |
| 7210 | }, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 7211 | [ALC236_FIXUP_HP_MUTE_LED] = { |
| 7212 | .type = HDA_FIXUP_FUNC, |
| 7213 | .v.func = alc236_fixup_hp_mute_led, |
| 7214 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7215 | }; |
| 7216 | |
| 7217 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 7218 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 7219 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 7220 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7221 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 7222 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
| 7223 | 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] | 7224 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 7225 | 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] | 7226 | 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] | 7227 | 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] | 7228 | 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] | 7229 | 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] | 7230 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
Chris Chiu | c7531e3 | 2019-03-21 17:17:31 +0800 | [diff] [blame] | 7231 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
| 7232 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7233 | SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 7234 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 7235 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 7236 | 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] | 7237 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 7238 | SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 7239 | 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] | 7240 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 7241 | 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] | 7242 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | cf52103 | 2016-01-15 12:59:25 +0100 | [diff] [blame] | 7243 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7244 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
| 7245 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7246 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7247 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7248 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7249 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7250 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 7251 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Takashi Iwai | 9807057 | 2016-01-12 21:06:39 +0100 | [diff] [blame] | 7252 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 4275554 | 2015-06-29 10:56:53 +0200 | [diff] [blame] | 7253 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7254 | 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] | 7255 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7256 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7257 | 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] | 7258 | 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] | 7259 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Kailang Yang | 8b72415 | 2014-12-17 17:08:59 +0800 | [diff] [blame] | 7260 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 7261 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7262 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 7263 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7264 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7265 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7266 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7267 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 7268 | 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] | 7269 | 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] | 7270 | SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), |
Kai-Heng Feng | 709ae62 | 2018-10-04 11:39:42 +0800 | [diff] [blame] | 7271 | 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] | 7272 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 7273 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
Takashi Iwai | 493de34 | 2017-02-28 17:27:57 +0100 | [diff] [blame] | 7274 | 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] | 7275 | SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), |
Kailang Yang | 40e2c4e | 2018-02-02 15:13:09 +0800 | [diff] [blame] | 7276 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
| 7277 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7278 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
| 7279 | 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] | 7280 | 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] | 7281 | 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] | 7282 | 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] | 7283 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 7284 | SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
| 7285 | SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
Kailang Yang | 78def22 | 2020-02-20 15:21:54 +0800 | [diff] [blame] | 7286 | SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 7287 | SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 7288 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7289 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 7290 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 7291 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 7292 | 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] | 7293 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7294 | /* ALC282 */ |
Hui Wang | 7976eb4 | 2015-02-13 11:14:41 +0800 | [diff] [blame] | 7295 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7296 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7297 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7298 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 7299 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 7300 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 7301 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7302 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7303 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7304 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7305 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7306 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 7307 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 7308 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
TienFu Chen | 3271cb2 | 2015-02-10 09:09:41 +0100 | [diff] [blame] | 7309 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7310 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7311 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7312 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7313 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7314 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 7315 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7316 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7317 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7318 | /* ALC290 */ |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7319 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7320 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7321 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7322 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7323 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7324 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7325 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7326 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7327 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7328 | 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] | 7329 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7330 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7331 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7332 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7333 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7334 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7335 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7336 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7337 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7338 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7339 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7340 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7341 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7342 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7343 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7344 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7345 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7346 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7347 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 7348 | 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] | 7349 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 7350 | 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] | 7351 | 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] | 7352 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 7353 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 7354 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 7355 | 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] | 7356 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Takashi Iwai | 190d038 | 2019-08-13 17:39:56 +0200 | [diff] [blame] | 7357 | SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Sam Bazley | d33cd42 | 2019-09-01 03:31:30 +0100 | [diff] [blame] | 7358 | SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 7359 | SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED), |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 7360 | SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 7361 | SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7362 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 7363 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 7364 | 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] | 7365 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7366 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 7367 | 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] | 7368 | 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] | 7369 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 7370 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
| 7371 | 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] | 7372 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
| 7373 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
| 7374 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 7375 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 7376 | 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] | 7377 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7378 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 7379 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 7380 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 7381 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
Chris Chiu | 28e8af8 | 2017-06-05 15:05:30 -0600 | [diff] [blame] | 7382 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 7383 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 7384 | 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] | 7385 | 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] | 7386 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7387 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 7388 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 7389 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 7390 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 7391 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 7392 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | f88abaa | 2014-02-07 12:07:59 +0100 | [diff] [blame] | 7393 | 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] | 7394 | 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] | 7395 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 7396 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 7397 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 7398 | 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] | 7399 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 7400 | 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] | 7401 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Takashi Iwai | 88776f3 | 2015-05-01 09:20:34 +0200 | [diff] [blame] | 7402 | 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] | 7403 | 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] | 7404 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 7405 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
YOKOTA Hiroshi | 0fca97a | 2018-07-01 18:30:01 +0900 | [diff] [blame] | 7406 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 7407 | 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] | 7408 | 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] | 7409 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
| 7410 | 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] | 7411 | 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] | 7412 | SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 80a5052 | 2019-05-07 17:11:08 -0400 | [diff] [blame] | 7413 | SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 891afcf | 2019-05-10 10:15:07 -0400 | [diff] [blame] | 7414 | SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 7415 | SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
| 7416 | SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7417 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7418 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 7419 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 7420 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 7421 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 7422 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | 707fba3 | 2012-08-02 09:04:39 +0200 | [diff] [blame] | 7423 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
Felix Kaechele | c8415a4 | 2012-08-06 23:02:01 +0200 | [diff] [blame] | 7424 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Stefán Freyr | 84f98fd | 2012-10-19 22:46:00 +0200 | [diff] [blame] | 7425 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 7426 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7427 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7428 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7429 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7430 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 7431 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Rick Sherman | 59a51a6 | 2015-08-18 21:04:30 -0500 | [diff] [blame] | 7432 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 7433 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 7434 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 7435 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | b6903c0 | 2015-12-10 12:20:20 +0100 | [diff] [blame] | 7436 | 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] | 7437 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
Yves-Alexis Perez | c027866 | 2015-04-11 09:31:35 +0200 | [diff] [blame] | 7438 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7439 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7440 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Torsten Hilbrich | dab38e4 | 2016-06-07 13:14:21 +0200 | [diff] [blame] | 7441 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7442 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7443 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
| 7444 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7445 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Dennis Wassenberg | e4c07b3 | 2018-03-08 13:17:54 +0100 | [diff] [blame] | 7446 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7447 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7448 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7449 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Benjamin Berg | 85981df | 2018-02-14 13:29:39 +0100 | [diff] [blame] | 7450 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 7451 | SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Yoga 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
| 7452 | SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
Hans de Goede | ca707b3 | 2020-04-02 19:43:11 +0200 | [diff] [blame] | 7453 | SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 7454 | 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] | 7455 | 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] | 7456 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Dennis Wassenberg | bef33e1 | 2019-06-28 10:54:53 +0200 | [diff] [blame] | 7457 | SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 7458 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Kailang Yang | 6581183 | 2018-04-25 17:07:27 +0800 | [diff] [blame] | 7459 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 8da5bbf | 2017-12-22 11:17:46 +0800 | [diff] [blame] | 7460 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 7461 | SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Aaron Ma | 8a6c55d | 2019-10-24 19:44:39 +0800 | [diff] [blame] | 7462 | SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
| 7463 | SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 7464 | 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] | 7465 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Michał Wadowski | 56df90b | 2019-05-14 16:58:00 +0200 | [diff] [blame] | 7466 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 7467 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 7468 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 7469 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 7470 | 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] | 7471 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
Sebastian Wicki | 80b311d | 2015-03-23 17:23:11 +0100 | [diff] [blame] | 7472 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
Ansgar Hegerfeld | 09ea997 | 2015-05-14 12:31:32 +0200 | [diff] [blame] | 7473 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
Conrad Kostecki | 037e119 | 2016-04-26 10:08:10 +0200 | [diff] [blame] | 7474 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 7475 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 7476 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
Torsten Hilbrich | 9cd2574 | 2016-07-05 10:40:22 +0200 | [diff] [blame] | 7477 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 7478 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7479 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7480 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7481 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 7482 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7483 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7484 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 7485 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7486 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 7487 | SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 7488 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
Hui Wang | 695d1ec | 2019-11-21 10:54:27 +0800 | [diff] [blame] | 7489 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 7490 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7491 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 7492 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7493 | /* Below is a quirk table taken from the old code. |
| 7494 | * Basically the device should work as is without the fixup table. |
| 7495 | * If BIOS doesn't give a proper info, enable the corresponding |
| 7496 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 7497 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7498 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 7499 | ALC269_FIXUP_AMIC), |
| 7500 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7501 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 7502 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 7503 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 7504 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 7505 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 7506 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 7507 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 7508 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 7509 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 7510 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 7511 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 7512 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 7513 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 7514 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 7515 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 7516 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 7517 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 7518 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 7519 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 7520 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 7521 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 7522 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 7523 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 7524 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 7525 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 7526 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 7527 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 7528 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 7529 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 7530 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 7531 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 7532 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 7533 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 7534 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 7535 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 7536 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 7537 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 7538 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 7539 | #endif |
| 7540 | {} |
| 7541 | }; |
| 7542 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 7543 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 7544 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 7545 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 7546 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 7547 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 7548 | SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 7549 | {} |
| 7550 | }; |
| 7551 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7552 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7553 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 7554 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 7555 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 7556 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 7557 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 7558 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
Takashi Iwai | b016951 | 2015-05-19 10:20:13 +0200 | [diff] [blame] | 7559 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
| 7560 | {.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] | 7561 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 7562 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7563 | {.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] | 7564 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 7565 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7566 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
| 7567 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 7568 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 7569 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7570 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7571 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7572 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7573 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 7574 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 28d1d6d | 2017-10-18 14:01:58 +0200 | [diff] [blame] | 7575 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7576 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
| 7577 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, |
| 7578 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, |
| 7579 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, |
| 7580 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, |
| 7581 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, |
| 7582 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, |
| 7583 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, |
| 7584 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, |
| 7585 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, |
| 7586 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, |
| 7587 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, |
| 7588 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, |
| 7589 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, |
| 7590 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, |
| 7591 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, |
| 7592 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, |
| 7593 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, |
| 7594 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, |
| 7595 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, |
| 7596 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, |
| 7597 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, |
| 7598 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, |
| 7599 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, |
| 7600 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, |
| 7601 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, |
| 7602 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, |
| 7603 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, |
| 7604 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, |
| 7605 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, |
| 7606 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, |
| 7607 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, |
| 7608 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, |
| 7609 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, |
| 7610 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, |
| 7611 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, |
| 7612 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, |
| 7613 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, |
| 7614 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, |
| 7615 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7616 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7617 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
| 7618 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
| 7619 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
| 7620 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, |
| 7621 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, |
| 7622 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, |
| 7623 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, |
| 7624 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, |
| 7625 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, |
| 7626 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, |
| 7627 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, |
| 7628 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, |
| 7629 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, |
| 7630 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, |
| 7631 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7632 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
| 7633 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, |
| 7634 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, |
Kailang Yang | 82aa0d7 | 2019-01-11 17:15:53 +0800 | [diff] [blame] | 7635 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7636 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 7637 | {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7638 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
| 7639 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, |
| 7640 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, |
| 7641 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, |
| 7642 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, |
| 7643 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, |
| 7644 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, |
| 7645 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, |
| 7646 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, |
| 7647 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, |
| 7648 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, |
| 7649 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, |
| 7650 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, |
| 7651 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, |
| 7652 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
| 7653 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
| 7654 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 7655 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
| 7656 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7657 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 7658 | {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 7659 | {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7660 | {} |
| 7661 | }; |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7662 | #define ALC225_STANDARD_PINS \ |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7663 | {0x21, 0x04211020} |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7664 | |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 7665 | #define ALC256_STANDARD_PINS \ |
| 7666 | {0x12, 0x90a60140}, \ |
| 7667 | {0x14, 0x90170110}, \ |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 7668 | {0x21, 0x02211020} |
| 7669 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7670 | #define ALC282_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7671 | {0x14, 0x90170110} |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7672 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7673 | #define ALC290_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7674 | {0x12, 0x99a30130} |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7675 | |
| 7676 | #define ALC292_STANDARD_PINS \ |
| 7677 | {0x14, 0x90170110}, \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7678 | {0x15, 0x0221401f} |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7679 | |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7680 | #define ALC295_STANDARD_PINS \ |
| 7681 | {0x12, 0xb7a60130}, \ |
| 7682 | {0x14, 0x90170110}, \ |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7683 | {0x21, 0x04211020} |
| 7684 | |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 7685 | #define ALC298_STANDARD_PINS \ |
| 7686 | {0x12, 0x90a60130}, \ |
| 7687 | {0x21, 0x03211020} |
| 7688 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 7689 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 7690 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
| 7691 | {0x14, 0x01014020}, |
| 7692 | {0x17, 0x90170110}, |
| 7693 | {0x18, 0x02a11030}, |
| 7694 | {0x19, 0x0181303F}, |
| 7695 | {0x21, 0x0221102f}), |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 7696 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 7697 | {0x12, 0x90a601c0}, |
| 7698 | {0x14, 0x90171120}, |
| 7699 | {0x21, 0x02211030}), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 7700 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 7701 | {0x14, 0x90170110}, |
| 7702 | {0x1b, 0x90a70130}, |
| 7703 | {0x21, 0x03211020}), |
| 7704 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 7705 | {0x1a, 0x90a70130}, |
| 7706 | {0x1b, 0x90170110}, |
| 7707 | {0x21, 0x03211020}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7708 | 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] | 7709 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7710 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7711 | {0x14, 0x901701a0}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7712 | 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] | 7713 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7714 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7715 | {0x14, 0x901701b0}), |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7716 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7717 | ALC225_STANDARD_PINS, |
| 7718 | {0x12, 0xb7a60150}, |
| 7719 | {0x14, 0x901701a0}), |
| 7720 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7721 | ALC225_STANDARD_PINS, |
| 7722 | {0x12, 0xb7a60150}, |
| 7723 | {0x14, 0x901701b0}), |
| 7724 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7725 | ALC225_STANDARD_PINS, |
| 7726 | {0x12, 0xb7a60130}, |
| 7727 | {0x1b, 0x90170110}), |
Kai-Heng Feng | 0ce48e1 | 2017-11-20 02:29:13 -0500 | [diff] [blame] | 7728 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7729 | {0x1b, 0x01111010}, |
| 7730 | {0x1e, 0x01451130}, |
| 7731 | {0x21, 0x02211020}), |
Hui Wang | 986376b | 2018-05-30 12:33:07 +0800 | [diff] [blame] | 7732 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
| 7733 | {0x12, 0x90a60140}, |
| 7734 | {0x14, 0x90170110}, |
| 7735 | {0x19, 0x02a11030}, |
| 7736 | {0x21, 0x02211020}), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 7737 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7738 | {0x14, 0x90170110}, |
| 7739 | {0x19, 0x02a11030}, |
| 7740 | {0x1a, 0x02a11040}, |
| 7741 | {0x1b, 0x01014020}, |
| 7742 | {0x21, 0x0221101f}), |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 7743 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7744 | {0x14, 0x90170110}, |
Hui Wang | d06fb56 | 2018-10-10 11:57:25 +0800 | [diff] [blame] | 7745 | {0x19, 0x02a11030}, |
| 7746 | {0x1a, 0x02a11040}, |
| 7747 | {0x1b, 0x01011020}, |
| 7748 | {0x21, 0x0221101f}), |
| 7749 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7750 | {0x14, 0x90170110}, |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 7751 | {0x19, 0x02a11020}, |
| 7752 | {0x1a, 0x02a11030}, |
| 7753 | {0x21, 0x0221101f}), |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 7754 | 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] | 7755 | {0x14, 0x90170110}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 7756 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7757 | 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] | 7758 | {0x14, 0x90170130}, |
| 7759 | {0x21, 0x02211040}), |
| 7760 | 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] | 7761 | {0x12, 0x90a60140}, |
| 7762 | {0x14, 0x90170110}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7763 | {0x21, 0x02211020}), |
| 7764 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7765 | {0x12, 0x90a60160}, |
| 7766 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7767 | {0x21, 0x02211030}), |
| 7768 | 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] | 7769 | {0x14, 0x90170110}, |
| 7770 | {0x1b, 0x02011020}, |
| 7771 | {0x21, 0x0221101f}), |
| 7772 | 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] | 7773 | {0x14, 0x90170110}, |
| 7774 | {0x1b, 0x01011020}, |
| 7775 | {0x21, 0x0221101f}), |
| 7776 | 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] | 7777 | {0x14, 0x90170130}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 7778 | {0x1b, 0x01014020}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 7779 | {0x21, 0x0221103f}), |
| 7780 | 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] | 7781 | {0x14, 0x90170130}, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 7782 | {0x1b, 0x01011020}, |
| 7783 | {0x21, 0x0221103f}), |
| 7784 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7785 | {0x14, 0x90170130}, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 7786 | {0x1b, 0x02011020}, |
| 7787 | {0x21, 0x0221103f}), |
| 7788 | 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] | 7789 | {0x14, 0x90170150}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7790 | {0x1b, 0x02011020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7791 | {0x21, 0x0221105f}), |
| 7792 | 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] | 7793 | {0x14, 0x90170110}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7794 | {0x1b, 0x01014020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7795 | {0x21, 0x0221101f}), |
| 7796 | 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] | 7797 | {0x12, 0x90a60160}, |
| 7798 | {0x14, 0x90170120}, |
| 7799 | {0x17, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7800 | {0x21, 0x0321102f}), |
| 7801 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7802 | {0x12, 0x90a60160}, |
| 7803 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7804 | {0x21, 0x02211040}), |
| 7805 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7806 | {0x12, 0x90a60160}, |
| 7807 | {0x14, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7808 | {0x21, 0x02211050}), |
| 7809 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7810 | {0x12, 0x90a60170}, |
| 7811 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7812 | {0x21, 0x02211030}), |
| 7813 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7814 | {0x12, 0x90a60170}, |
| 7815 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7816 | {0x21, 0x02211040}), |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7817 | 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] | 7818 | {0x12, 0x90a60170}, |
Hui Wang | 0a1f90a | 2016-01-13 11:51:38 +0800 | [diff] [blame] | 7819 | {0x14, 0x90171130}, |
| 7820 | {0x21, 0x02211040}), |
| 7821 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7822 | {0x12, 0x90a60170}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7823 | {0x14, 0x90170140}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7824 | {0x21, 0x02211050}), |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 7825 | 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] | 7826 | {0x12, 0x90a60180}, |
| 7827 | {0x14, 0x90170130}, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 7828 | {0x21, 0x02211040}), |
AceLan Kao | f90d83b | 2016-06-03 14:45:25 +0800 | [diff] [blame] | 7829 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7830 | {0x12, 0x90a60180}, |
| 7831 | {0x14, 0x90170120}, |
| 7832 | {0x21, 0x02211030}), |
Hui Wang | 989dbe4 | 2016-11-23 16:05:38 +0800 | [diff] [blame] | 7833 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7834 | {0x1b, 0x01011020}, |
| 7835 | {0x21, 0x02211010}), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7836 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 7837 | {0x14, 0x90170110}, |
| 7838 | {0x1b, 0x90a70130}, |
| 7839 | {0x21, 0x04211020}), |
| 7840 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 7841 | {0x14, 0x90170110}, |
| 7842 | {0x1b, 0x90a70130}, |
| 7843 | {0x21, 0x03211020}), |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 7844 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Chris Chiu | a806ef1 | 2019-03-22 11:37:20 +0800 | [diff] [blame] | 7845 | {0x12, 0x90a60130}, |
| 7846 | {0x14, 0x90170110}, |
| 7847 | {0x21, 0x03211020}), |
| 7848 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | 6ac371a | 2019-03-22 11:37:22 +0800 | [diff] [blame] | 7849 | {0x12, 0x90a60130}, |
| 7850 | {0x14, 0x90170110}, |
| 7851 | {0x21, 0x04211020}), |
| 7852 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 7853 | {0x1a, 0x90a70130}, |
| 7854 | {0x1b, 0x90170110}, |
| 7855 | {0x21, 0x03211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 7856 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 7857 | {0x12, 0x90a60130}, |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 7858 | {0x14, 0x90170110}, |
| 7859 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7860 | {0x1a, 0x04a11020}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7861 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 7862 | {0x12, 0x90a60140}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7863 | {0x14, 0x90170110}, |
| 7864 | {0x15, 0x0421101f}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7865 | {0x18, 0x02811030}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7866 | {0x1a, 0x04a1103f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7867 | {0x1b, 0x02011020}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7868 | 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] | 7869 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7870 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7871 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7872 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7873 | 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] | 7874 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7875 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7876 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7877 | {0x21, 0x03211040}), |
| 7878 | 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] | 7879 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7880 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7881 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7882 | {0x21, 0x03211020}), |
| 7883 | 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] | 7884 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7885 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7886 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7887 | {0x21, 0x0421101f}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7888 | 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] | 7889 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7890 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7891 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7892 | {0x21, 0x04211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7893 | 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] | 7894 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7895 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7896 | {0x21, 0x0321101f}), |
| 7897 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7898 | {0x12, 0x90a60160}, |
| 7899 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7900 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7901 | 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] | 7902 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7903 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7904 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7905 | {0x21, 0x0321101f}), |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 7906 | 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] | 7907 | {0x12, 0x90a60130}, |
| 7908 | {0x14, 0x90170110}, |
| 7909 | {0x19, 0x04a11040}, |
| 7910 | {0x21, 0x04211020}), |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 7911 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
| 7912 | {0x12, 0x90a60130}, |
| 7913 | {0x17, 0x90170110}, |
| 7914 | {0x21, 0x02211020}), |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 7915 | 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] | 7916 | {0x12, 0x90a60120}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7917 | {0x14, 0x90170110}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7918 | {0x21, 0x0321101f}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7919 | 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] | 7920 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7921 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7922 | {0x18, 0x90170112}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7923 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7924 | 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] | 7925 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7926 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7927 | {0x18, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7928 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7929 | 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] | 7930 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7931 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7932 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7933 | 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] | 7934 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7935 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7936 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7937 | 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] | 7938 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7939 | {0x14, 0x90170110}, |
| 7940 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7941 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7942 | 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] | 7943 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7944 | {0x14, 0x90170110}, |
| 7945 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7946 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7947 | 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] | 7948 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7949 | {0x14, 0x90170110}, |
| 7950 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7951 | {0x1a, 0x04a11020}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7952 | 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] | 7953 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7954 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7955 | {0x16, 0x01014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7956 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7957 | 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] | 7958 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7959 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7960 | {0x16, 0x01014020}, |
| 7961 | {0x18, 0x02a19031}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7962 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7963 | 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] | 7964 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7965 | {0x12, 0x90a60140}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7966 | 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] | 7967 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7968 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7969 | {0x16, 0x21014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7970 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 7971 | 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] | 7972 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7973 | {0x13, 0x90a60140}), |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7974 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
| 7975 | {0x14, 0x90170110}, |
| 7976 | {0x1b, 0x90a70130}, |
| 7977 | {0x21, 0x04211020}), |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 7978 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7979 | {0x12, 0x90a60130}, |
| 7980 | {0x17, 0x90170110}, |
Jian-Hong Pan | 8bb37a2 | 2019-02-21 17:00:18 +0800 | [diff] [blame] | 7981 | {0x21, 0x03211020}), |
| 7982 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7983 | {0x12, 0x90a60130}, |
| 7984 | {0x17, 0x90170110}, |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 7985 | {0x21, 0x04211020}), |
Takashi Iwai | 3887c26 | 2019-04-30 15:10:01 +0200 | [diff] [blame] | 7986 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7987 | {0x12, 0x90a60130}, |
| 7988 | {0x17, 0x90170110}, |
| 7989 | {0x21, 0x03211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 7990 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
Kailang Yang | 0a29c57 | 2019-04-24 16:34:25 +0800 | [diff] [blame] | 7991 | {0x14, 0x90170110}, |
| 7992 | {0x21, 0x04211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 7993 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 7994 | {0x14, 0x90170110}, |
| 7995 | {0x21, 0x04211030}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7996 | 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] | 7997 | ALC295_STANDARD_PINS, |
| 7998 | {0x17, 0x21014020}, |
| 7999 | {0x18, 0x21a19030}), |
| 8000 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8001 | ALC295_STANDARD_PINS, |
| 8002 | {0x17, 0x21014040}, |
| 8003 | {0x18, 0x21a19050}), |
Hui Wang | 3f30783 | 2017-03-23 10:00:25 +0800 | [diff] [blame] | 8004 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8005 | ALC295_STANDARD_PINS), |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 8006 | 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] | 8007 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 8008 | {0x17, 0x90170110}), |
| 8009 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8010 | ALC298_STANDARD_PINS, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 8011 | {0x17, 0x90170140}), |
| 8012 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8013 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 8014 | {0x17, 0x90170150}), |
Kai-Heng Feng | 9f1bc2c4 | 2017-02-16 15:26:54 +0800 | [diff] [blame] | 8015 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
| 8016 | {0x12, 0xb7a60140}, |
| 8017 | {0x13, 0xb7a60150}, |
| 8018 | {0x17, 0x90170110}, |
| 8019 | {0x1a, 0x03011020}, |
| 8020 | {0x21, 0x03211030}), |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 8021 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
| 8022 | {0x12, 0xb7a60140}, |
| 8023 | {0x17, 0x90170110}, |
| 8024 | {0x1a, 0x03a11030}, |
| 8025 | {0x21, 0x03211020}), |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 8026 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8027 | ALC225_STANDARD_PINS, |
| 8028 | {0x12, 0xb7a60130}, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 8029 | {0x17, 0x90170110}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 8030 | {} |
| 8031 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8032 | |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 8033 | /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match |
| 8034 | * more machines, don't need to match all valid pins, just need to match |
| 8035 | * all the pins defined in the tbl. Just because of this reason, it is possible |
| 8036 | * that a single machine matches multiple tbls, so there is one limitation: |
| 8037 | * at most one tbl is allowed to define for the same vendor and same codec |
| 8038 | */ |
| 8039 | static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { |
| 8040 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8041 | {0x19, 0x40000000}, |
| 8042 | {0x1b, 0x40000000}), |
Hui Wang | aed8c7f | 2019-11-21 10:26:43 +0800 | [diff] [blame] | 8043 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8044 | {0x19, 0x40000000}, |
| 8045 | {0x1a, 0x40000000}), |
Hui Wang | d64ebdb | 2019-11-21 10:26:44 +0800 | [diff] [blame] | 8046 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8047 | {0x19, 0x40000000}, |
| 8048 | {0x1a, 0x40000000}), |
Hui Wang | 5815bdf | 2019-12-11 13:13:21 +0800 | [diff] [blame] | 8049 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
| 8050 | {0x19, 0x40000000}, |
| 8051 | {0x1a, 0x40000000}), |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 8052 | {} |
| 8053 | }; |
| 8054 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8055 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8056 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8057 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8058 | int val; |
| 8059 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8060 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8061 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8062 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8063 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8064 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 8065 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 8066 | } |
| 8067 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8068 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8069 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 8070 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 8071 | } |
| 8072 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8073 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8074 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 8075 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8076 | } |
| 8077 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8078 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8079 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 8080 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8081 | /* Capless ramp up clock control */ |
| 8082 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 8083 | } |
| 8084 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 8085 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8086 | /* Class D power on reset */ |
| 8087 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 8088 | } |
| 8089 | } |
| 8090 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 8091 | /* HP */ |
| 8092 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8093 | } |
| 8094 | |
| 8095 | /* |
| 8096 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8097 | static int patch_alc269(struct hda_codec *codec) |
| 8098 | { |
| 8099 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8100 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8101 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8102 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8103 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8104 | return err; |
| 8105 | |
| 8106 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 8107 | spec->gen.shared_mic_vref_pin = 0x18; |
Kailang Yang | 317d931 | 2019-05-23 14:43:04 +0800 | [diff] [blame] | 8108 | codec->power_save_node = 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8109 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8110 | #ifdef CONFIG_PM |
| 8111 | codec->patch_ops.suspend = alc269_suspend; |
| 8112 | codec->patch_ops.resume = alc269_resume; |
| 8113 | #endif |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 8114 | spec->shutup = alc_default_shutup; |
| 8115 | spec->init_hook = alc_default_init; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8116 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8117 | switch (codec->core.vendor_id) { |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8118 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8119 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8120 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 8121 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 8122 | if (codec->bus->pci && |
| 8123 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8124 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 8125 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8126 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8127 | break; |
| 8128 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 8129 | if (codec->bus->pci && |
| 8130 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8131 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 8132 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8133 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8134 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 8135 | case 0x0030: |
| 8136 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 8137 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8138 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8139 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8140 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8141 | if (err < 0) |
| 8142 | goto error; |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 8143 | spec->shutup = alc269_shutup; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8144 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8145 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8146 | break; |
| 8147 | |
| 8148 | case 0x10ec0280: |
| 8149 | case 0x10ec0290: |
| 8150 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 8151 | break; |
| 8152 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8153 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 8154 | spec->shutup = alc282_shutup; |
| 8155 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8156 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 8157 | case 0x10ec0233: |
| 8158 | case 0x10ec0283: |
| 8159 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 8160 | spec->shutup = alc283_shutup; |
| 8161 | spec->init_hook = alc283_init; |
| 8162 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8163 | case 0x10ec0284: |
| 8164 | case 0x10ec0292: |
| 8165 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 8166 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 8167 | case 0x10ec0293: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 8168 | spec->codec_variant = ALC269_TYPE_ALC293; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 8169 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 8170 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 8171 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 8172 | spec->codec_variant = ALC269_TYPE_ALC286; |
| 8173 | break; |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 8174 | case 0x10ec0298: |
| 8175 | spec->codec_variant = ALC269_TYPE_ALC298; |
| 8176 | break; |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 8177 | case 0x10ec0235: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 8178 | case 0x10ec0255: |
| 8179 | spec->codec_variant = ALC269_TYPE_ALC255; |
Kailang Yang | ab3b8e5 | 2018-04-25 16:05:27 +0800 | [diff] [blame] | 8180 | spec->shutup = alc256_shutup; |
| 8181 | spec->init_hook = alc256_init; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 8182 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 8183 | case 0x10ec0236: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 8184 | case 0x10ec0256: |
| 8185 | spec->codec_variant = ALC269_TYPE_ALC256; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 8186 | spec->shutup = alc256_shutup; |
| 8187 | spec->init_hook = alc256_init; |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 8188 | spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 8189 | break; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 8190 | case 0x10ec0257: |
| 8191 | spec->codec_variant = ALC269_TYPE_ALC257; |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 8192 | spec->shutup = alc256_shutup; |
| 8193 | spec->init_hook = alc256_init; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 8194 | spec->gen.mixer_nid = 0; |
| 8195 | break; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8196 | case 0x10ec0215: |
| 8197 | case 0x10ec0285: |
| 8198 | case 0x10ec0289: |
| 8199 | spec->codec_variant = ALC269_TYPE_ALC215; |
Kailang Yang | 1b6832be | 2018-01-17 15:32:03 +0800 | [diff] [blame] | 8200 | spec->shutup = alc225_shutup; |
| 8201 | spec->init_hook = alc225_init; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8202 | spec->gen.mixer_nid = 0; |
| 8203 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8204 | case 0x10ec0225: |
Kai-Heng Feng | 3b36b13 | 2020-03-11 14:13:28 +0800 | [diff] [blame] | 8205 | codec->power_save_node = 1; |
| 8206 | /* fall through */ |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 8207 | case 0x10ec0295: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 8208 | case 0x10ec0299: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8209 | spec->codec_variant = ALC269_TYPE_ALC225; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 8210 | spec->shutup = alc225_shutup; |
| 8211 | spec->init_hook = alc225_init; |
Takashi Iwai | c1350bf | 2017-12-27 09:03:45 +0100 | [diff] [blame] | 8212 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8213 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8214 | case 0x10ec0234: |
| 8215 | case 0x10ec0274: |
| 8216 | case 0x10ec0294: |
| 8217 | spec->codec_variant = ALC269_TYPE_ALC294; |
Hui Wang | 532a778 | 2017-06-26 12:30:32 +0800 | [diff] [blame] | 8218 | 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] | 8219 | 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] | 8220 | spec->init_hook = alc294_init; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8221 | break; |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 8222 | case 0x10ec0300: |
| 8223 | spec->codec_variant = ALC269_TYPE_ALC300; |
| 8224 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8225 | break; |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 8226 | case 0x10ec0623: |
| 8227 | spec->codec_variant = ALC269_TYPE_ALC623; |
| 8228 | break; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8229 | case 0x10ec0700: |
| 8230 | case 0x10ec0701: |
| 8231 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 8232 | case 0x10ec0711: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8233 | spec->codec_variant = ALC269_TYPE_ALC700; |
| 8234 | 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] | 8235 | 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] | 8236 | spec->init_hook = alc294_init; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8237 | break; |
| 8238 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8239 | } |
| 8240 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 8241 | 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] | 8242 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 8243 | spec->init_hook = alc5505_dsp_init; |
| 8244 | } |
| 8245 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8246 | alc_pre_init(codec); |
| 8247 | |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 8248 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
| 8249 | alc269_fixup_tbl, alc269_fixups); |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 8250 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 8251 | snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 8252 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 8253 | alc269_fixups); |
| 8254 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 8255 | |
| 8256 | alc_auto_parse_customize_define(codec); |
| 8257 | |
| 8258 | if (has_cdefine_beep(codec)) |
| 8259 | spec->gen.beep_nid = 0x01; |
| 8260 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 8261 | /* automatic parse from the BIOS config */ |
| 8262 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8263 | if (err < 0) |
| 8264 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8265 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8266 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
| 8267 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); |
| 8268 | if (err < 0) |
| 8269 | goto error; |
| 8270 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8271 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8272 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8273 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8274 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8275 | |
| 8276 | error: |
| 8277 | alc_free(codec); |
| 8278 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8279 | } |
| 8280 | |
| 8281 | /* |
| 8282 | * ALC861 |
| 8283 | */ |
| 8284 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8285 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 8286 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8287 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8288 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 8289 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8290 | } |
| 8291 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8292 | /* Pin config fixes */ |
| 8293 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8294 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 8295 | ALC861_FIXUP_AMP_VREF_0F, |
| 8296 | ALC861_FIXUP_NO_JACK_DETECT, |
| 8297 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 8298 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8299 | }; |
| 8300 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8301 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 8302 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8303 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8304 | { |
| 8305 | struct alc_spec *spec = codec->spec; |
| 8306 | unsigned int val; |
| 8307 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8308 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8309 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 8310 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8311 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 8312 | val |= AC_PINCTL_IN_EN; |
| 8313 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 8314 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 8315 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8316 | } |
| 8317 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8318 | /* suppress the jack-detection */ |
| 8319 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8320 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8321 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8322 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8323 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 8324 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8325 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8326 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8327 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8328 | .type = HDA_FIXUP_PINS, |
| 8329 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8330 | { 0x0b, 0x0221101f }, /* HP */ |
| 8331 | { 0x0f, 0x90170310 }, /* speaker */ |
| 8332 | { } |
| 8333 | } |
| 8334 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8335 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8336 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8337 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 8338 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8339 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8340 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8341 | .v.func = alc_fixup_no_jack_detect, |
| 8342 | }, |
| 8343 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8344 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8345 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 8346 | .chained = true, |
| 8347 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 8348 | }, |
| 8349 | [ALC660_FIXUP_ASUS_W7J] = { |
| 8350 | .type = HDA_FIXUP_VERBS, |
| 8351 | .v.verbs = (const struct hda_verb[]) { |
| 8352 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 8353 | * for enabling outputs |
| 8354 | */ |
| 8355 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 8356 | { } |
| 8357 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8358 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8359 | }; |
| 8360 | |
| 8361 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 8362 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 8363 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8364 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 8365 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 8366 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 8367 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 8368 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 8369 | 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] | 8370 | {} |
| 8371 | }; |
| 8372 | |
| 8373 | /* |
| 8374 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8375 | static int patch_alc861(struct hda_codec *codec) |
| 8376 | { |
| 8377 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8378 | int err; |
| 8379 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8380 | err = alc_alloc_spec(codec, 0x15); |
| 8381 | if (err < 0) |
| 8382 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8383 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8384 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 8385 | if (has_cdefine_beep(codec)) |
| 8386 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8387 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8388 | #ifdef CONFIG_PM |
| 8389 | spec->power_hook = alc_power_eapd; |
| 8390 | #endif |
| 8391 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8392 | alc_pre_init(codec); |
| 8393 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8394 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 8395 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8396 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8397 | /* automatic parse from the BIOS config */ |
| 8398 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8399 | if (err < 0) |
| 8400 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8401 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8402 | if (!spec->gen.no_analog) { |
| 8403 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
| 8404 | if (err < 0) |
| 8405 | goto error; |
| 8406 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8407 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8408 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8409 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8410 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8411 | |
| 8412 | error: |
| 8413 | alc_free(codec); |
| 8414 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8415 | } |
| 8416 | |
| 8417 | /* |
| 8418 | * ALC861-VD support |
| 8419 | * |
| 8420 | * Based on ALC882 |
| 8421 | * |
| 8422 | * In addition, an independent DAC |
| 8423 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8424 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 8425 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8426 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8427 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 8428 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8429 | } |
| 8430 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8431 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8432 | ALC660VD_FIX_ASUS_GPIO1, |
| 8433 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8434 | }; |
| 8435 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8436 | /* exclude VREF80 */ |
| 8437 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8438 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8439 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8440 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 8441 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 8442 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8443 | } |
| 8444 | } |
| 8445 | |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 8446 | /* reset GPIO1 */ |
| 8447 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, |
| 8448 | const struct hda_fixup *fix, int action) |
| 8449 | { |
| 8450 | struct alc_spec *spec = codec->spec; |
| 8451 | |
| 8452 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 8453 | spec->gpio_mask |= 0x02; |
| 8454 | alc_fixup_gpio(codec, action, 0x01); |
| 8455 | } |
| 8456 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8457 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8458 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 8459 | .type = HDA_FIXUP_FUNC, |
| 8460 | .v.func = alc660vd_fixup_asus_gpio1, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8461 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8462 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8463 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8464 | .v.func = alc861vd_fixup_dallas, |
| 8465 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8466 | }; |
| 8467 | |
| 8468 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8469 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8470 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8471 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8472 | {} |
| 8473 | }; |
| 8474 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8475 | /* |
| 8476 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8477 | static int patch_alc861vd(struct hda_codec *codec) |
| 8478 | { |
| 8479 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8480 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8481 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8482 | err = alc_alloc_spec(codec, 0x0b); |
| 8483 | if (err < 0) |
| 8484 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8485 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8486 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 8487 | if (has_cdefine_beep(codec)) |
| 8488 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8489 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8490 | spec->shutup = alc_eapd_shutup; |
| 8491 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8492 | alc_pre_init(codec); |
| 8493 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8494 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 8495 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8496 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8497 | /* automatic parse from the BIOS config */ |
| 8498 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8499 | if (err < 0) |
| 8500 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8501 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8502 | if (!spec->gen.no_analog) { |
| 8503 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 8504 | if (err < 0) |
| 8505 | goto error; |
| 8506 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8507 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8508 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8509 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8510 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8511 | |
| 8512 | error: |
| 8513 | alc_free(codec); |
| 8514 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8515 | } |
| 8516 | |
| 8517 | /* |
| 8518 | * ALC662 support |
| 8519 | * |
| 8520 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 8521 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 8522 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 8523 | * 6-channel independent captures. |
| 8524 | * |
| 8525 | * In addition, an independent DAC for the multi-playback (not used in this |
| 8526 | * driver yet). |
| 8527 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8528 | |
| 8529 | /* |
| 8530 | * BIOS auto configuration |
| 8531 | */ |
| 8532 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8533 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 8534 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 8535 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8536 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 8537 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 8538 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 8539 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8540 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
| 8541 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || |
| 8542 | codec->core.vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8543 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 8544 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8545 | ssids = alc662_ssids; |
| 8546 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8547 | } |
| 8548 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8549 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8550 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 8551 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 8552 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 8553 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8554 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 8555 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 8556 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 8557 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 8558 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 8559 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8560 | } |
| 8561 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8562 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 8563 | { .channels = 2, |
| 8564 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 8565 | { .channels = 4, |
| 8566 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 8567 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 8568 | { } |
| 8569 | }; |
| 8570 | |
| 8571 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8572 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8573 | const struct hda_fixup *fix, int action) |
| 8574 | { |
| 8575 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 8576 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | bbbc7e8 | 2015-02-27 17:43:19 +0100 | [diff] [blame] | 8577 | 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] | 8578 | } |
| 8579 | } |
| 8580 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 8581 | /* avoid D3 for keeping GPIO up */ |
| 8582 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 8583 | hda_nid_t nid, |
| 8584 | unsigned int power_state) |
| 8585 | { |
| 8586 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 8587 | 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] | 8588 | return AC_PWRST_D0; |
| 8589 | return power_state; |
| 8590 | } |
| 8591 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8592 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 8593 | const struct hda_fixup *fix, int action) |
| 8594 | { |
| 8595 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8596 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 8597 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8598 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 8599 | spec->mute_led_polarity = 1; |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 8600 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8601 | } |
| 8602 | } |
| 8603 | |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8604 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
| 8605 | struct hda_jack_callback *jack) |
| 8606 | { |
| 8607 | struct alc_spec *spec = codec->spec; |
| 8608 | int vref; |
| 8609 | msleep(200); |
| 8610 | snd_hda_gen_hp_automute(codec, jack); |
| 8611 | |
| 8612 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 8613 | msleep(100); |
| 8614 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 8615 | vref); |
| 8616 | } |
| 8617 | |
| 8618 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, |
| 8619 | const struct hda_fixup *fix, int action) |
| 8620 | { |
| 8621 | struct alc_spec *spec = codec->spec; |
| 8622 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 8623 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 8624 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; |
| 8625 | } |
| 8626 | } |
| 8627 | |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 8628 | static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, |
| 8629 | struct hda_jack_callback *cb) |
| 8630 | { |
| 8631 | /* surround speakers at 0x1b already get muted automatically when |
| 8632 | * headphones are plugged in, but we have to mute/unmute the remaining |
| 8633 | * channels manually: |
| 8634 | * 0x15 - front left/front right |
| 8635 | * 0x18 - front center/ LFE |
| 8636 | */ |
| 8637 | if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { |
| 8638 | snd_hda_set_pin_ctl_cache(codec, 0x15, 0); |
| 8639 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 8640 | } else { |
| 8641 | snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); |
| 8642 | snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); |
| 8643 | } |
| 8644 | } |
| 8645 | |
| 8646 | static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, |
| 8647 | const struct hda_fixup *fix, int action) |
| 8648 | { |
| 8649 | /* Pin 0x1b: shared headphones jack and surround speakers */ |
| 8650 | if (!is_jack_detectable(codec, 0x1b)) |
| 8651 | return; |
| 8652 | |
| 8653 | switch (action) { |
| 8654 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 8655 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 8656 | alc662_aspire_ethos_mute_speakers); |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 8657 | /* subwoofer needs an extra GPIO setting to become audible */ |
| 8658 | alc_setup_gpio(codec, 0x02); |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 8659 | break; |
| 8660 | case HDA_FIXUP_ACT_INIT: |
| 8661 | /* Make sure to start in a correct state, i.e. if |
| 8662 | * headphones have been plugged in before powering up the system |
| 8663 | */ |
| 8664 | alc662_aspire_ethos_mute_speakers(codec, NULL); |
| 8665 | break; |
| 8666 | } |
| 8667 | } |
| 8668 | |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 8669 | static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, |
| 8670 | const struct hda_fixup *fix, int action) |
| 8671 | { |
| 8672 | struct alc_spec *spec = codec->spec; |
| 8673 | |
| 8674 | static const struct hda_pintbl pincfgs[] = { |
| 8675 | { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ |
| 8676 | { 0x1b, 0x0181304f }, |
| 8677 | { } |
| 8678 | }; |
| 8679 | |
| 8680 | switch (action) { |
| 8681 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 8682 | spec->gen.mixer_nid = 0; |
| 8683 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 8684 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 8685 | break; |
| 8686 | case HDA_FIXUP_ACT_INIT: |
| 8687 | alc_write_coef_idx(codec, 0x19, 0xa054); |
| 8688 | break; |
| 8689 | } |
| 8690 | } |
| 8691 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 8692 | static const struct coef_fw alc668_coefs[] = { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8693 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 8694 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 8695 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 8696 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 8697 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 8698 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 8699 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 8700 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 8701 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 8702 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 8703 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 8704 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 8705 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 8706 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 8707 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 8708 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 8709 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 8710 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 8711 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 8712 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 8713 | {} |
| 8714 | }; |
| 8715 | |
| 8716 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 8717 | { |
| 8718 | alc_process_coef_fw(codec, alc668_coefs); |
| 8719 | } |
| 8720 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8721 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8722 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8723 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8724 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8725 | ALC272_FIXUP_MARIO, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8726 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8727 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8728 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8729 | ALC662_FIXUP_ASUS_MODE1, |
| 8730 | ALC662_FIXUP_ASUS_MODE2, |
| 8731 | ALC662_FIXUP_ASUS_MODE3, |
| 8732 | ALC662_FIXUP_ASUS_MODE4, |
| 8733 | ALC662_FIXUP_ASUS_MODE5, |
| 8734 | ALC662_FIXUP_ASUS_MODE6, |
| 8735 | ALC662_FIXUP_ASUS_MODE7, |
| 8736 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8737 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8738 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8739 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8740 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8741 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8742 | ALC662_FIXUP_HEADSET_MODE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8743 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8744 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8745 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8746 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8747 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 8748 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 8749 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8750 | ALC668_FIXUP_DELL_XPS13, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8751 | ALC662_FIXUP_ASUS_Nx50, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8752 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8753 | ALC668_FIXUP_ASUS_Nx51, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 8754 | ALC668_FIXUP_MIC_COEF, |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 8755 | ALC668_FIXUP_ASUS_G751, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8756 | ALC891_FIXUP_HEADSET_MODE, |
| 8757 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8758 | ALC662_FIXUP_ACER_VERITON, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8759 | ALC892_FIXUP_ASROCK_MOBO, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8760 | ALC662_FIXUP_USI_FUNC, |
| 8761 | ALC662_FIXUP_USI_HEADSET_MODE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8762 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 8763 | ALC669_FIXUP_ACER_ASPIRE_ETHOS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 8764 | ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 8765 | ALC671_FIXUP_HP_HEADSET_MIC2, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 8766 | ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 8767 | ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8768 | }; |
| 8769 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8770 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8771 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8772 | .type = HDA_FIXUP_PINS, |
| 8773 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8774 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 8775 | { } |
| 8776 | } |
| 8777 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8778 | [ALC662_FIXUP_LED_GPIO1] = { |
| 8779 | .type = HDA_FIXUP_FUNC, |
| 8780 | .v.func = alc662_fixup_led_gpio1, |
| 8781 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8782 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8783 | .type = HDA_FIXUP_PINS, |
| 8784 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8785 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 8786 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8787 | }, |
| 8788 | .chained = true, |
| 8789 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8790 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8791 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8792 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 8793 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8794 | }, |
| 8795 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8796 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8797 | .v.verbs = (const struct hda_verb[]) { |
| 8798 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 8799 | {} |
| 8800 | } |
| 8801 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8802 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8803 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 8804 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 8805 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8806 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8807 | .type = HDA_FIXUP_PINS, |
| 8808 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8809 | { 0x14, 0x0221201f }, /* HP out */ |
| 8810 | { } |
| 8811 | }, |
| 8812 | .chained = true, |
| 8813 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8814 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8815 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8816 | .type = HDA_FIXUP_PINS, |
| 8817 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8818 | { 0x14, 0x99130110 }, /* speaker */ |
| 8819 | { 0x18, 0x01a19c20 }, /* mic */ |
| 8820 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 8821 | { 0x21, 0x0121401f }, /* HP out */ |
| 8822 | { } |
| 8823 | }, |
| 8824 | .chained = true, |
| 8825 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8826 | }, |
| 8827 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8828 | .type = HDA_FIXUP_PINS, |
| 8829 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 8830 | { 0x14, 0x99130110 }, /* speaker */ |
| 8831 | { 0x18, 0x01a19820 }, /* mic */ |
| 8832 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 8833 | { 0x1b, 0x0121401f }, /* HP out */ |
| 8834 | { } |
| 8835 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8836 | .chained = true, |
| 8837 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8838 | }, |
| 8839 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8840 | .type = HDA_FIXUP_PINS, |
| 8841 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8842 | { 0x14, 0x99130110 }, /* speaker */ |
| 8843 | { 0x15, 0x0121441f }, /* HP */ |
| 8844 | { 0x18, 0x01a19840 }, /* mic */ |
| 8845 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8846 | { 0x21, 0x01211420 }, /* HP2 */ |
| 8847 | { } |
| 8848 | }, |
| 8849 | .chained = true, |
| 8850 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8851 | }, |
| 8852 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8853 | .type = HDA_FIXUP_PINS, |
| 8854 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8855 | { 0x14, 0x99130110 }, /* speaker */ |
| 8856 | { 0x16, 0x99130111 }, /* speaker */ |
| 8857 | { 0x18, 0x01a19840 }, /* mic */ |
| 8858 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8859 | { 0x21, 0x0121441f }, /* HP */ |
| 8860 | { } |
| 8861 | }, |
| 8862 | .chained = true, |
| 8863 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8864 | }, |
| 8865 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8866 | .type = HDA_FIXUP_PINS, |
| 8867 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8868 | { 0x14, 0x99130110 }, /* speaker */ |
| 8869 | { 0x15, 0x0121441f }, /* HP */ |
| 8870 | { 0x16, 0x99130111 }, /* speaker */ |
| 8871 | { 0x18, 0x01a19840 }, /* mic */ |
| 8872 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8873 | { } |
| 8874 | }, |
| 8875 | .chained = true, |
| 8876 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8877 | }, |
| 8878 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8879 | .type = HDA_FIXUP_PINS, |
| 8880 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8881 | { 0x14, 0x99130110 }, /* speaker */ |
| 8882 | { 0x15, 0x01211420 }, /* HP2 */ |
| 8883 | { 0x18, 0x01a19840 }, /* mic */ |
| 8884 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8885 | { 0x1b, 0x0121441f }, /* HP */ |
| 8886 | { } |
| 8887 | }, |
| 8888 | .chained = true, |
| 8889 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8890 | }, |
| 8891 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8892 | .type = HDA_FIXUP_PINS, |
| 8893 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8894 | { 0x14, 0x99130110 }, /* speaker */ |
| 8895 | { 0x17, 0x99130111 }, /* speaker */ |
| 8896 | { 0x18, 0x01a19840 }, /* mic */ |
| 8897 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8898 | { 0x1b, 0x01214020 }, /* HP */ |
| 8899 | { 0x21, 0x0121401f }, /* HP */ |
| 8900 | { } |
| 8901 | }, |
| 8902 | .chained = true, |
| 8903 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8904 | }, |
| 8905 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8906 | .type = HDA_FIXUP_PINS, |
| 8907 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8908 | { 0x14, 0x99130110 }, /* speaker */ |
| 8909 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 8910 | { 0x15, 0x01214020 }, /* HP */ |
| 8911 | { 0x17, 0x99130111 }, /* speaker */ |
| 8912 | { 0x18, 0x01a19840 }, /* mic */ |
| 8913 | { 0x21, 0x0121401f }, /* HP */ |
| 8914 | { } |
| 8915 | }, |
| 8916 | .chained = true, |
| 8917 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 8918 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8919 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8920 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8921 | .v.func = alc_fixup_no_jack_detect, |
| 8922 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8923 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8924 | .type = HDA_FIXUP_PINS, |
| 8925 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8926 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 8927 | { } |
| 8928 | } |
| 8929 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8930 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8931 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 8932 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8933 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8934 | [ALC668_FIXUP_DELL_XPS13] = { |
| 8935 | .type = HDA_FIXUP_FUNC, |
| 8936 | .v.func = alc_fixup_dell_xps13, |
| 8937 | .chained = true, |
| 8938 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 8939 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 8940 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 8941 | .type = HDA_FIXUP_FUNC, |
| 8942 | .v.func = alc_fixup_disable_aamix, |
| 8943 | .chained = true, |
| 8944 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 8945 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 8946 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 8947 | .type = HDA_FIXUP_FUNC, |
| 8948 | .v.func = alc_fixup_auto_mute_via_amp, |
| 8949 | .chained = true, |
| 8950 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 8951 | }, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8952 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8953 | .type = HDA_FIXUP_PINS, |
| 8954 | .v.pins = (const struct hda_pintbl[]) { |
| 8955 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8956 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ |
| 8957 | { } |
| 8958 | }, |
| 8959 | .chained = true, |
| 8960 | .chain_id = ALC662_FIXUP_HEADSET_MODE |
| 8961 | }, |
| 8962 | [ALC662_FIXUP_HEADSET_MODE] = { |
| 8963 | .type = HDA_FIXUP_FUNC, |
| 8964 | .v.func = alc_fixup_headset_mode_alc662, |
| 8965 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8966 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8967 | .type = HDA_FIXUP_PINS, |
| 8968 | .v.pins = (const struct hda_pintbl[]) { |
| 8969 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 8970 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8971 | { } |
| 8972 | }, |
| 8973 | .chained = true, |
| 8974 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 8975 | }, |
| 8976 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 8977 | .type = HDA_FIXUP_FUNC, |
| 8978 | .v.func = alc_fixup_headset_mode_alc668, |
| 8979 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8980 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8981 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8982 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8983 | .chained = true, |
| 8984 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 8985 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8986 | [ALC662_FIXUP_BASS_16] = { |
| 8987 | .type = HDA_FIXUP_PINS, |
| 8988 | .v.pins = (const struct hda_pintbl[]) { |
| 8989 | {0x16, 0x80106111}, /* bass speaker */ |
| 8990 | {} |
| 8991 | }, |
| 8992 | .chained = true, |
| 8993 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 8994 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8995 | [ALC662_FIXUP_BASS_1A] = { |
| 8996 | .type = HDA_FIXUP_PINS, |
| 8997 | .v.pins = (const struct hda_pintbl[]) { |
| 8998 | {0x1a, 0x80106111}, /* bass speaker */ |
| 8999 | {} |
| 9000 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9001 | .chained = true, |
| 9002 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9003 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9004 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9005 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 9006 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9007 | }, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 9008 | [ALC662_FIXUP_ASUS_Nx50] = { |
| 9009 | .type = HDA_FIXUP_FUNC, |
| 9010 | .v.func = alc_fixup_auto_mute_via_amp, |
| 9011 | .chained = true, |
| 9012 | .chain_id = ALC662_FIXUP_BASS_1A |
| 9013 | }, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9014 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
| 9015 | .type = HDA_FIXUP_FUNC, |
| 9016 | .v.func = alc_fixup_headset_mode_alc668, |
| 9017 | .chain_id = ALC662_FIXUP_BASS_CHMAP |
| 9018 | }, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9019 | [ALC668_FIXUP_ASUS_Nx51] = { |
| 9020 | .type = HDA_FIXUP_PINS, |
| 9021 | .v.pins = (const struct hda_pintbl[]) { |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9022 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 9023 | { 0x1a, 0x90170151 }, /* bass speaker */ |
| 9024 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9025 | {} |
| 9026 | }, |
| 9027 | .chained = true, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9028 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9029 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9030 | [ALC668_FIXUP_MIC_COEF] = { |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 9031 | .type = HDA_FIXUP_VERBS, |
| 9032 | .v.verbs = (const struct hda_verb[]) { |
| 9033 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, |
| 9034 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, |
| 9035 | {} |
| 9036 | }, |
| 9037 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9038 | [ALC668_FIXUP_ASUS_G751] = { |
| 9039 | .type = HDA_FIXUP_PINS, |
| 9040 | .v.pins = (const struct hda_pintbl[]) { |
| 9041 | { 0x16, 0x0421101f }, /* HP */ |
| 9042 | {} |
| 9043 | }, |
| 9044 | .chained = true, |
| 9045 | .chain_id = ALC668_FIXUP_MIC_COEF |
| 9046 | }, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9047 | [ALC891_FIXUP_HEADSET_MODE] = { |
| 9048 | .type = HDA_FIXUP_FUNC, |
| 9049 | .v.func = alc_fixup_headset_mode, |
| 9050 | }, |
| 9051 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 9052 | .type = HDA_FIXUP_PINS, |
| 9053 | .v.pins = (const struct hda_pintbl[]) { |
| 9054 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 9055 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 9056 | { } |
| 9057 | }, |
| 9058 | .chained = true, |
| 9059 | .chain_id = ALC891_FIXUP_HEADSET_MODE |
| 9060 | }, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 9061 | [ALC662_FIXUP_ACER_VERITON] = { |
| 9062 | .type = HDA_FIXUP_PINS, |
| 9063 | .v.pins = (const struct hda_pintbl[]) { |
| 9064 | { 0x15, 0x50170120 }, /* no internal speaker */ |
| 9065 | { } |
| 9066 | } |
| 9067 | }, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9068 | [ALC892_FIXUP_ASROCK_MOBO] = { |
| 9069 | .type = HDA_FIXUP_PINS, |
| 9070 | .v.pins = (const struct hda_pintbl[]) { |
| 9071 | { 0x15, 0x40f000f0 }, /* disabled */ |
| 9072 | { 0x16, 0x40f000f0 }, /* disabled */ |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9073 | { } |
| 9074 | } |
| 9075 | }, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9076 | [ALC662_FIXUP_USI_FUNC] = { |
| 9077 | .type = HDA_FIXUP_FUNC, |
| 9078 | .v.func = alc662_fixup_usi_headset_mic, |
| 9079 | }, |
| 9080 | [ALC662_FIXUP_USI_HEADSET_MODE] = { |
| 9081 | .type = HDA_FIXUP_PINS, |
| 9082 | .v.pins = (const struct hda_pintbl[]) { |
| 9083 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ |
| 9084 | { 0x18, 0x01a1903d }, |
| 9085 | { } |
| 9086 | }, |
| 9087 | .chained = true, |
| 9088 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 9089 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 9090 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
| 9091 | .type = HDA_FIXUP_FUNC, |
| 9092 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 9093 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9094 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { |
| 9095 | .type = HDA_FIXUP_FUNC, |
| 9096 | .v.func = alc662_fixup_aspire_ethos_hp, |
| 9097 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9098 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { |
| 9099 | .type = HDA_FIXUP_PINS, |
| 9100 | .v.pins = (const struct hda_pintbl[]) { |
| 9101 | { 0x15, 0x92130110 }, /* front speakers */ |
| 9102 | { 0x18, 0x99130111 }, /* center/subwoofer */ |
| 9103 | { 0x1b, 0x11130012 }, /* surround plus jack for HP */ |
| 9104 | { } |
| 9105 | }, |
| 9106 | .chained = true, |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 9107 | .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9108 | }, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9109 | [ALC671_FIXUP_HP_HEADSET_MIC2] = { |
| 9110 | .type = HDA_FIXUP_FUNC, |
| 9111 | .v.func = alc671_fixup_hp_headset_mic2, |
| 9112 | }, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 9113 | [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { |
| 9114 | .type = HDA_FIXUP_PINS, |
| 9115 | .v.pins = (const struct hda_pintbl[]) { |
| 9116 | { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ |
| 9117 | { } |
| 9118 | }, |
| 9119 | .chained = true, |
| 9120 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 9121 | }, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 9122 | [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { |
| 9123 | .type = HDA_FIXUP_PINS, |
| 9124 | .v.pins = (const struct hda_pintbl[]) { |
| 9125 | { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ |
| 9126 | { 0x1b, 0x0221144f }, |
| 9127 | { } |
| 9128 | }, |
| 9129 | .chained = true, |
| 9130 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 9131 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9132 | }; |
| 9133 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 9134 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9135 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 9136 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | 02f6ff9 | 2015-12-07 11:29:31 +0100 | [diff] [blame] | 9137 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 9138 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 9139 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9140 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 9141 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9142 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 9143 | SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 9144 | SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 9145 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 9146 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 9147 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 9148 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
Niranjan Sivakumar | 467e143 | 2015-09-05 18:20:35 +0200 | [diff] [blame] | 9149 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 9150 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99e | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 9151 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 9152 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 9153 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 9154 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9155 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
Kaho Ng | 2da2dc9 | 2016-05-09 00:27:49 +0800 | [diff] [blame] | 9156 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
Bobi Mihalca | 83a9efb | 2016-03-23 13:32:33 +0200 | [diff] [blame] | 9157 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | db8948e | 2016-01-18 09:17:30 +0100 | [diff] [blame] | 9158 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 9159 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 9160 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9161 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9162 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9163 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
| 9164 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
Takashi Iwai | c7efff9 | 2017-01-04 21:38:16 +0100 | [diff] [blame] | 9165 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9166 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9167 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9168 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9169 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 9170 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9171 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 9172 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 9173 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9174 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9175 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9176 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 9177 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9178 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9179 | SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9180 | |
| 9181 | #if 0 |
| 9182 | /* Below is a quirk table taken from the old code. |
| 9183 | * Basically the device should work as is without the fixup table. |
| 9184 | * If BIOS doesn't give a proper info, enable the corresponding |
| 9185 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 9186 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9187 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 9188 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 9189 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 9190 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 9191 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9192 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9193 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9194 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 9195 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 9196 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9197 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 9198 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 9199 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 9200 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 9201 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 9202 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9203 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 9204 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 9205 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9206 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 9207 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 9208 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9209 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 9210 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 9211 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 9212 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9213 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 9214 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 9215 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9216 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 9217 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9218 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9219 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 9220 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 9221 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 9222 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 9223 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 9224 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 9225 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 9226 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9227 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 9228 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 9229 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9230 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 9231 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 9232 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 9233 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 9234 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 9235 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9236 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 9237 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9238 | {} |
| 9239 | }; |
| 9240 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9241 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9242 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
| 9243 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9244 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9245 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9246 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 9247 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 9248 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 9249 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 9250 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 9251 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 9252 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 9253 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9254 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 9255 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9256 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 9257 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9258 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
| 9259 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, |
| 9260 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, |
| 9261 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, |
| 9262 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, |
| 9263 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, |
| 9264 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, |
| 9265 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, |
Takashi Iwai | 40c5167 | 2018-10-07 09:47:39 +0200 | [diff] [blame] | 9266 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9267 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
| 9268 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, |
| 9269 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, |
| 9270 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, |
| 9271 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 9272 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9273 | {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9274 | {} |
| 9275 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9276 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 9277 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9278 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 9279 | {0x17, 0x02211010}, |
| 9280 | {0x18, 0x01a19030}, |
| 9281 | {0x1a, 0x01813040}, |
| 9282 | {0x21, 0x01014020}), |
Hui Wang | 4b4e0e3 | 2019-07-16 15:21:34 +0800 | [diff] [blame] | 9283 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 9284 | {0x16, 0x01813030}, |
| 9285 | {0x17, 0x02211010}, |
| 9286 | {0x18, 0x01a19040}, |
| 9287 | {0x21, 0x01014020}), |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9288 | 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] | 9289 | {0x14, 0x01014010}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9290 | {0x18, 0x01a19020}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9291 | {0x1a, 0x0181302f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9292 | {0x1b, 0x0221401f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9293 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 9294 | {0x12, 0x99a30130}, |
| 9295 | {0x14, 0x90170110}, |
| 9296 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9297 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9298 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 9299 | {0x12, 0x99a30140}, |
| 9300 | {0x14, 0x90170110}, |
| 9301 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9302 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9303 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 9304 | {0x12, 0x99a30150}, |
| 9305 | {0x14, 0x90170110}, |
| 9306 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9307 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9308 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9309 | {0x14, 0x90170110}, |
| 9310 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9311 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9312 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 9313 | {0x12, 0x90a60130}, |
| 9314 | {0x14, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9315 | {0x15, 0x0321101f}), |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9316 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 9317 | {0x14, 0x01014010}, |
| 9318 | {0x17, 0x90170150}, |
Kailang Yang | f2adbae | 2020-02-05 15:40:01 +0800 | [diff] [blame] | 9319 | {0x19, 0x02a11060}, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9320 | {0x1b, 0x01813030}, |
| 9321 | {0x21, 0x02211020}), |
| 9322 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 9323 | {0x14, 0x01014010}, |
| 9324 | {0x18, 0x01a19040}, |
| 9325 | {0x1b, 0x01813030}, |
| 9326 | {0x21, 0x02211020}), |
| 9327 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 9328 | {0x14, 0x01014020}, |
| 9329 | {0x17, 0x90170110}, |
| 9330 | {0x18, 0x01a19050}, |
| 9331 | {0x1b, 0x01813040}, |
| 9332 | {0x21, 0x02211030}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 9333 | {} |
| 9334 | }; |
| 9335 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9336 | /* |
| 9337 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9338 | static int patch_alc662(struct hda_codec *codec) |
| 9339 | { |
| 9340 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9341 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9342 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9343 | err = alc_alloc_spec(codec, 0x0b); |
| 9344 | if (err < 0) |
| 9345 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9346 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9347 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 9348 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9349 | spec->shutup = alc_eapd_shutup; |
| 9350 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9351 | /* handle multiple HPs as is */ |
| 9352 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 9353 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 9354 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 9355 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 9356 | switch (codec->core.vendor_id) { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 9357 | case 0x10ec0668: |
| 9358 | spec->init_hook = alc668_restore_default_value; |
| 9359 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 9360 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 9361 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 9362 | alc_pre_init(codec); |
| 9363 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9364 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 9365 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 9366 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9367 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 9368 | |
| 9369 | alc_auto_parse_customize_define(codec); |
| 9370 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 9371 | if (has_cdefine_beep(codec)) |
| 9372 | spec->gen.beep_nid = 0x01; |
| 9373 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9374 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 9375 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9376 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 9377 | err = alc_codec_rename(codec, "ALC272X"); |
| 9378 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9379 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 9380 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 9381 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 9382 | /* automatic parse from the BIOS config */ |
| 9383 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9384 | if (err < 0) |
| 9385 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9386 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 9387 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 9388 | switch (codec->core.vendor_id) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9389 | case 0x10ec0662: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9390 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9391 | break; |
| 9392 | case 0x10ec0272: |
| 9393 | case 0x10ec0663: |
| 9394 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 9395 | case 0x10ec0668: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9396 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9397 | break; |
| 9398 | case 0x10ec0273: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9399 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9400 | break; |
| 9401 | } |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9402 | if (err < 0) |
| 9403 | goto error; |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 9404 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 9405 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9406 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 9407 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9408 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9409 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9410 | error: |
| 9411 | alc_free(codec); |
| 9412 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 9413 | } |
| 9414 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9415 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9416 | * ALC680 support |
| 9417 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9418 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9419 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 9420 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 9421 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9422 | } |
| 9423 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9424 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9425 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9426 | static int patch_alc680(struct hda_codec *codec) |
| 9427 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9428 | int err; |
| 9429 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 9430 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9431 | err = alc_alloc_spec(codec, 0); |
| 9432 | if (err < 0) |
| 9433 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 9434 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 9435 | /* automatic parse from the BIOS config */ |
| 9436 | err = alc680_parse_auto_config(codec); |
| 9437 | if (err < 0) { |
| 9438 | alc_free(codec); |
| 9439 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9440 | } |
| 9441 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9442 | return 0; |
| 9443 | } |
| 9444 | |
| 9445 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9446 | * patch entries |
| 9447 | */ |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9448 | static const struct hda_device_id snd_hda_id_realtek[] = { |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9449 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9450 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 9451 | HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 9452 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9453 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
| 9454 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9455 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9456 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 9457 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9458 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
| 9459 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 9460 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9461 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
| 9462 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), |
| 9463 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), |
| 9464 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), |
| 9465 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), |
| 9466 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), |
| 9467 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9468 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9469 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
| 9470 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), |
| 9471 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), |
| 9472 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), |
| 9473 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), |
| 9474 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9475 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9476 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
| 9477 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9478 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9479 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
| 9480 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), |
| 9481 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9482 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 9483 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9484 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 9485 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 9486 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 9487 | HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9488 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
| 9489 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
| 9490 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
| 9491 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), |
| 9492 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), |
| 9493 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), |
| 9494 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), |
| 9495 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), |
| 9496 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), |
| 9497 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), |
| 9498 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), |
| 9499 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), |
| 9500 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), |
| 9501 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 9502 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
| 9503 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), |
| 9504 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 9505 | HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9506 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9507 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
| 9508 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), |
| 9509 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), |
| 9510 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), |
| 9511 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), |
| 9512 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), |
| 9513 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), |
| 9514 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), |
| 9515 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), |
| 9516 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), |
| 9517 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), |
| 9518 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
| 9519 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 9520 | HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 9521 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 9522 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9523 | {} /* terminator */ |
| 9524 | }; |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9525 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 9526 | |
| 9527 | MODULE_LICENSE("GPL"); |
| 9528 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 9529 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 9530 | static struct hda_codec_driver realtek_driver = { |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9531 | .id = snd_hda_id_realtek, |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 9532 | }; |
| 9533 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 9534 | module_hda_codec_driver(realtek_driver); |