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> |
Kai-Heng Feng | 87dc364 | 2020-04-30 21:52:07 +0800 | [diff] [blame] | 20 | #include <linux/leds.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | #include <sound/core.h> |
Kailang Yang | 9ad0e49 | 2010-09-14 23:22:00 +0200 | [diff] [blame] | 22 | #include <sound/jack.h> |
Pierre-Louis Bossart | be57bff | 2018-08-22 15:24:57 -0500 | [diff] [blame] | 23 | #include <sound/hda_codec.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include "hda_local.h" |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 25 | #include "hda_auto_parser.h" |
Takashi Iwai | 1835a0f | 2011-10-27 22:12:46 +0200 | [diff] [blame] | 26 | #include "hda_jack.h" |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 27 | #include "hda_generic.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 29 | /* keep halting ALC5505 DSP, for power saving */ |
| 30 | #define HALT_REALTEK_ALC5505 |
| 31 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 32 | /* extra amp-initialization sequence types */ |
| 33 | enum { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 34 | ALC_INIT_UNDEFINED, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 35 | ALC_INIT_NONE, |
| 36 | ALC_INIT_DEFAULT, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 37 | }; |
| 38 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 39 | enum { |
| 40 | ALC_HEADSET_MODE_UNKNOWN, |
| 41 | ALC_HEADSET_MODE_UNPLUGGED, |
| 42 | ALC_HEADSET_MODE_HEADSET, |
| 43 | ALC_HEADSET_MODE_MIC, |
| 44 | ALC_HEADSET_MODE_HEADPHONE, |
| 45 | }; |
| 46 | |
| 47 | enum { |
| 48 | ALC_HEADSET_TYPE_UNKNOWN, |
| 49 | ALC_HEADSET_TYPE_CTIA, |
| 50 | ALC_HEADSET_TYPE_OMTP, |
| 51 | }; |
| 52 | |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 53 | enum { |
| 54 | ALC_KEY_MICMUTE_INDEX, |
| 55 | }; |
| 56 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 57 | struct alc_customize_define { |
| 58 | unsigned int sku_cfg; |
| 59 | unsigned char port_connectivity; |
| 60 | unsigned char check_sum; |
| 61 | unsigned char customization; |
| 62 | unsigned char external_amp; |
| 63 | unsigned int enable_pcbeep:1; |
| 64 | unsigned int platform_type:1; |
| 65 | unsigned int swap:1; |
| 66 | unsigned int override:1; |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 67 | 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] | 68 | }; |
| 69 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 70 | struct alc_coef_led { |
| 71 | unsigned int idx; |
| 72 | unsigned int mask; |
| 73 | unsigned int on; |
| 74 | unsigned int off; |
| 75 | }; |
| 76 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | struct alc_spec { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 78 | struct hda_gen_spec gen; /* must be at head */ |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 79 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | /* codec parameterization */ |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 81 | struct alc_customize_define cdefine; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 82 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
| 83 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 84 | /* GPIO bits */ |
| 85 | unsigned int gpio_mask; |
| 86 | unsigned int gpio_dir; |
| 87 | unsigned int gpio_data; |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 88 | bool gpio_write_delay; /* add a delay before writing gpio_data */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 89 | |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 90 | /* mute LED for HP laptops, see vref_mute_led_set() */ |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 91 | int mute_led_polarity; |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 92 | int micmute_led_polarity; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 93 | hda_nid_t mute_led_nid; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 94 | hda_nid_t cap_mute_led_nid; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 95 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 96 | unsigned int gpio_mute_led_mask; |
| 97 | unsigned int gpio_mic_led_mask; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 98 | struct alc_coef_led mute_led_coef; |
| 99 | struct alc_coef_led mic_led_coef; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 100 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 101 | hda_nid_t headset_mic_pin; |
| 102 | hda_nid_t headphone_mic_pin; |
| 103 | int current_headset_mode; |
| 104 | int current_headset_type; |
| 105 | |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 106 | /* hooks */ |
| 107 | void (*init_hook)(struct hda_codec *codec); |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 108 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 109 | void (*power_hook)(struct hda_codec *codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 110 | #endif |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 111 | void (*shutup)(struct hda_codec *codec); |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 112 | void (*reboot_notify)(struct hda_codec *codec); |
Takashi Iwai | d922b51 | 2011-04-28 12:18:53 +0200 | [diff] [blame] | 113 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 114 | int init_amp; |
Takashi Iwai | d433a67 | 2010-09-20 15:11:54 +0200 | [diff] [blame] | 115 | int codec_variant; /* flag for other variants */ |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 116 | unsigned int has_alc5505_dsp:1; |
| 117 | unsigned int no_depop_delay:1; |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 118 | unsigned int done_hp_init:1; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 119 | unsigned int no_shutup_pins:1; |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 120 | unsigned int ultra_low_power:1; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 121 | unsigned int has_hs_key:1; |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 122 | unsigned int no_internal_mic_pin:1; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 123 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 124 | /* for PLL fix */ |
| 125 | hda_nid_t pll_nid; |
| 126 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 127 | unsigned int coef0; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 128 | struct input_dev *kb_dev; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 129 | u8 alc_mute_keycode_map[1]; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 130 | }; |
| 131 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 132 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 133 | * COEF access helper functions |
| 134 | */ |
| 135 | |
| 136 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 137 | unsigned int coef_idx) |
| 138 | { |
| 139 | unsigned int val; |
| 140 | |
| 141 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 142 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 143 | return val; |
| 144 | } |
| 145 | |
| 146 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 147 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 148 | |
| 149 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 150 | unsigned int coef_idx, unsigned int coef_val) |
| 151 | { |
| 152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 153 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 154 | } |
| 155 | |
| 156 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 157 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 158 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 159 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 160 | unsigned int coef_idx, unsigned int mask, |
| 161 | unsigned int bits_set) |
| 162 | { |
| 163 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 164 | |
| 165 | if (val != -1) |
| 166 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 167 | (val & ~mask) | bits_set); |
| 168 | } |
| 169 | |
| 170 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 171 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 172 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 173 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 174 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 175 | { |
| 176 | struct alc_spec *spec = codec->spec; |
| 177 | |
| 178 | if (!spec->coef0) |
| 179 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 180 | return spec->coef0; |
| 181 | } |
| 182 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 183 | /* coef writes/updates batch */ |
| 184 | struct coef_fw { |
| 185 | unsigned char nid; |
| 186 | unsigned char idx; |
| 187 | unsigned short mask; |
| 188 | unsigned short val; |
| 189 | }; |
| 190 | |
| 191 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 192 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 193 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 194 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 195 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 196 | |
| 197 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 198 | const struct coef_fw *fw) |
| 199 | { |
| 200 | for (; fw->nid; fw++) { |
| 201 | if (fw->mask == (unsigned short)-1) |
| 202 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 203 | else |
| 204 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 205 | fw->mask, fw->val); |
| 206 | } |
| 207 | } |
| 208 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 209 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 210 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 211 | */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 212 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 213 | /* Enable GPIO mask and set output */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 214 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
| 215 | { |
| 216 | struct alc_spec *spec = codec->spec; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 217 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 218 | spec->gpio_mask |= mask; |
| 219 | spec->gpio_dir |= mask; |
| 220 | spec->gpio_data |= mask; |
| 221 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 222 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 223 | static void alc_write_gpio_data(struct hda_codec *codec) |
| 224 | { |
| 225 | struct alc_spec *spec = codec->spec; |
| 226 | |
| 227 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 228 | spec->gpio_data); |
| 229 | } |
| 230 | |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 231 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
| 232 | bool on) |
| 233 | { |
| 234 | struct alc_spec *spec = codec->spec; |
| 235 | unsigned int oldval = spec->gpio_data; |
| 236 | |
| 237 | if (on) |
| 238 | spec->gpio_data |= mask; |
| 239 | else |
| 240 | spec->gpio_data &= ~mask; |
| 241 | if (oldval != spec->gpio_data) |
| 242 | alc_write_gpio_data(codec); |
| 243 | } |
| 244 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 245 | static void alc_write_gpio(struct hda_codec *codec) |
| 246 | { |
| 247 | struct alc_spec *spec = codec->spec; |
| 248 | |
| 249 | if (!spec->gpio_mask) |
| 250 | return; |
| 251 | |
| 252 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 253 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); |
| 254 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 255 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 256 | if (spec->gpio_write_delay) |
| 257 | msleep(1); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 258 | alc_write_gpio_data(codec); |
| 259 | } |
| 260 | |
| 261 | static void alc_fixup_gpio(struct hda_codec *codec, int action, |
| 262 | unsigned int mask) |
| 263 | { |
| 264 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 265 | alc_setup_gpio(codec, mask); |
| 266 | } |
| 267 | |
| 268 | static void alc_fixup_gpio1(struct hda_codec *codec, |
| 269 | const struct hda_fixup *fix, int action) |
| 270 | { |
| 271 | alc_fixup_gpio(codec, action, 0x01); |
| 272 | } |
| 273 | |
| 274 | static void alc_fixup_gpio2(struct hda_codec *codec, |
| 275 | const struct hda_fixup *fix, int action) |
| 276 | { |
| 277 | alc_fixup_gpio(codec, action, 0x02); |
| 278 | } |
| 279 | |
| 280 | static void alc_fixup_gpio3(struct hda_codec *codec, |
| 281 | const struct hda_fixup *fix, int action) |
| 282 | { |
| 283 | alc_fixup_gpio(codec, action, 0x03); |
| 284 | } |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 285 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 286 | static void alc_fixup_gpio4(struct hda_codec *codec, |
| 287 | const struct hda_fixup *fix, int action) |
| 288 | { |
| 289 | alc_fixup_gpio(codec, action, 0x04); |
| 290 | } |
| 291 | |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 292 | static void alc_fixup_micmute_led(struct hda_codec *codec, |
| 293 | const struct hda_fixup *fix, int action) |
| 294 | { |
Jaroslav Kysela | e65bf99 | 2021-03-17 18:29:43 +0100 | [diff] [blame] | 295 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 296 | snd_hda_gen_add_micmute_led_cdev(codec, NULL); |
| 297 | } |
| 298 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 299 | /* |
| 300 | * Fix hardware PLL issue |
| 301 | * On some codecs, the analog PLL gating control must be off while |
| 302 | * the default value is 1. |
| 303 | */ |
| 304 | static void alc_fix_pll(struct hda_codec *codec) |
| 305 | { |
| 306 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 307 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 308 | if (spec->pll_nid) |
| 309 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 310 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 314 | unsigned int coef_idx, unsigned int coef_bit) |
| 315 | { |
| 316 | struct alc_spec *spec = codec->spec; |
| 317 | spec->pll_nid = nid; |
| 318 | spec->pll_coef_idx = coef_idx; |
| 319 | spec->pll_coef_bit = coef_bit; |
| 320 | alc_fix_pll(codec); |
| 321 | } |
| 322 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 323 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 324 | static void alc_update_knob_master(struct hda_codec *codec, |
| 325 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 326 | { |
| 327 | unsigned int val; |
| 328 | struct snd_kcontrol *kctl; |
| 329 | struct snd_ctl_elem_value *uctl; |
| 330 | |
| 331 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 332 | if (!kctl) |
| 333 | return; |
| 334 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 335 | if (!uctl) |
| 336 | return; |
Takashi Iwai | 2ebab40 | 2016-02-09 10:23:52 +0100 | [diff] [blame] | 337 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 338 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 339 | val &= HDA_AMP_VOLMASK; |
| 340 | uctl->value.integer.value[0] = val; |
| 341 | uctl->value.integer.value[1] = val; |
| 342 | kctl->put(kctl, uctl); |
| 343 | kfree(uctl); |
| 344 | } |
| 345 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 346 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 347 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 348 | /* For some reason, the res given from ALC880 is broken. |
| 349 | Here we adjust it properly. */ |
| 350 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 351 | } |
| 352 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 353 | /* Change EAPD to verb control */ |
| 354 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 355 | { |
| 356 | int coef; |
| 357 | |
| 358 | coef = alc_get_coef0(codec); |
| 359 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 360 | switch (codec->core.vendor_id) { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 361 | case 0x10ec0262: |
| 362 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 363 | break; |
| 364 | case 0x10ec0267: |
| 365 | case 0x10ec0268: |
| 366 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 367 | break; |
| 368 | case 0x10ec0269: |
| 369 | if ((coef & 0x00f0) == 0x0010) |
| 370 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 371 | if ((coef & 0x00f0) == 0x0020) |
| 372 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 373 | if ((coef & 0x00f0) == 0x0030) |
| 374 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 375 | break; |
| 376 | case 0x10ec0280: |
| 377 | case 0x10ec0284: |
| 378 | case 0x10ec0290: |
| 379 | case 0x10ec0292: |
| 380 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 381 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 382 | case 0x10ec0225: |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 383 | case 0x10ec0295: |
| 384 | case 0x10ec0299: |
| 385 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Gustavo A. R. Silva | c0dbbda | 2020-07-08 15:32:36 -0500 | [diff] [blame] | 386 | fallthrough; |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 387 | case 0x10ec0215: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 388 | case 0x10ec0233: |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 389 | case 0x10ec0235: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 390 | case 0x10ec0236: |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 391 | case 0x10ec0245: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 392 | case 0x10ec0255: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 393 | case 0x10ec0256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 394 | case 0x10ec0257: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 395 | case 0x10ec0282: |
| 396 | case 0x10ec0283: |
| 397 | case 0x10ec0286: |
Kailang Yang | 630e361 | 2020-05-27 14:10:26 +0800 | [diff] [blame] | 398 | case 0x10ec0287: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 399 | case 0x10ec0288: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 400 | case 0x10ec0285: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 401 | case 0x10ec0298: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 402 | case 0x10ec0289: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 403 | case 0x10ec0300: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 404 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 405 | break; |
Kailang Yang | 3aabf94 | 2017-11-08 15:28:33 +0800 | [diff] [blame] | 406 | case 0x10ec0275: |
| 407 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); |
| 408 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 409 | case 0x10ec0293: |
| 410 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 411 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 412 | case 0x10ec0234: |
| 413 | case 0x10ec0274: |
| 414 | case 0x10ec0294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 415 | case 0x10ec0700: |
| 416 | case 0x10ec0701: |
| 417 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 418 | case 0x10ec0711: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 419 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
| 420 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 421 | case 0x10ec0662: |
| 422 | if ((coef & 0x00f0) == 0x0030) |
| 423 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 424 | break; |
| 425 | case 0x10ec0272: |
| 426 | case 0x10ec0273: |
| 427 | case 0x10ec0663: |
| 428 | case 0x10ec0665: |
| 429 | case 0x10ec0670: |
| 430 | case 0x10ec0671: |
| 431 | case 0x10ec0672: |
| 432 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 433 | break; |
Kailang Yang | 9194a1e | 2020-01-07 17:22:19 +0800 | [diff] [blame] | 434 | case 0x10ec0222: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 435 | case 0x10ec0623: |
| 436 | alc_update_coef_idx(codec, 0x19, 1<<13, 0); |
| 437 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 438 | case 0x10ec0668: |
| 439 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 440 | break; |
| 441 | case 0x10ec0867: |
| 442 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 443 | break; |
| 444 | case 0x10ec0888: |
| 445 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 446 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 447 | break; |
| 448 | case 0x10ec0892: |
Kailang Yang | e5782a5 | 2020-11-27 14:39:23 +0800 | [diff] [blame] | 449 | case 0x10ec0897: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 450 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 451 | break; |
| 452 | case 0x10ec0899: |
| 453 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 454 | case 0x10ec0b00: |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 455 | case 0x10ec1168: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 456 | case 0x10ec1220: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 457 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 458 | break; |
| 459 | } |
| 460 | } |
| 461 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 462 | /* additional initialization for ALC888 variants */ |
| 463 | static void alc888_coef_init(struct hda_codec *codec) |
| 464 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 465 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 466 | /* alc888-VA */ |
| 467 | case 0x00: |
| 468 | /* alc888-VB */ |
| 469 | case 0x10: |
| 470 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 471 | break; |
| 472 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 473 | } |
| 474 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 475 | /* turn on/off EAPD control (only if available) */ |
| 476 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 477 | { |
| 478 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 479 | return; |
| 480 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 481 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 482 | on ? 2 : 0); |
| 483 | } |
| 484 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 485 | /* turn on/off EAPD controls of the codec */ |
| 486 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 487 | { |
| 488 | /* We currently only handle front, HP */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 489 | static const hda_nid_t pins[] = { |
Hui Wang | af95b41 | 2015-03-26 17:14:55 +0800 | [diff] [blame] | 490 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 491 | }; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 492 | const hda_nid_t *p; |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 493 | for (p = pins; *p; p++) |
| 494 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 495 | } |
| 496 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 497 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 498 | |
| 499 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) |
| 500 | { |
| 501 | const struct hda_pincfg *pin; |
| 502 | int mic_pin = find_ext_mic_pin(codec); |
| 503 | int i; |
| 504 | |
| 505 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 506 | * the default pin setup at the next load of the driver |
| 507 | */ |
| 508 | if (codec->bus->shutdown) |
| 509 | return; |
| 510 | |
| 511 | snd_array_for_each(&codec->init_pins, i, pin) { |
| 512 | /* use read here for syncing after issuing each verb */ |
| 513 | if (pin->nid != mic_pin) |
| 514 | snd_hda_codec_read(codec, pin->nid, 0, |
| 515 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 516 | } |
| 517 | |
| 518 | codec->pins_shutup = 1; |
| 519 | } |
| 520 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 521 | static void alc_shutup_pins(struct hda_codec *codec) |
| 522 | { |
| 523 | struct alc_spec *spec = codec->spec; |
| 524 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 525 | switch (codec->core.vendor_id) { |
Kailang Yang | 66c5d71 | 2019-12-09 15:56:15 +0800 | [diff] [blame] | 526 | case 0x10ec0283: |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 527 | case 0x10ec0286: |
| 528 | case 0x10ec0288: |
| 529 | case 0x10ec0298: |
| 530 | alc_headset_mic_no_shutup(codec); |
| 531 | break; |
| 532 | default: |
| 533 | if (!spec->no_shutup_pins) |
| 534 | snd_hda_shutup_pins(codec); |
| 535 | break; |
| 536 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 537 | } |
| 538 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 539 | /* generic shutup callback; |
Lars-Peter Clausen | 4ce8e6a | 2016-11-08 15:48:06 +0100 | [diff] [blame] | 540 | * just turning off EAPD and a little pause for avoiding pop-noise |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 541 | */ |
| 542 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 543 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 544 | struct alc_spec *spec = codec->spec; |
| 545 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 546 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 547 | if (!spec->no_depop_delay) |
| 548 | msleep(200); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 549 | alc_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 550 | } |
| 551 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 552 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 553 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 554 | { |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 555 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 556 | alc_write_gpio(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 557 | switch (type) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 558 | case ALC_INIT_DEFAULT: |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 559 | switch (codec->core.vendor_id) { |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 560 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 561 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 562 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 563 | case 0x10ec0880: |
| 564 | case 0x10ec0882: |
| 565 | case 0x10ec0883: |
| 566 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 567 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 568 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 569 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 570 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 571 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 572 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 573 | break; |
| 574 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 575 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 576 | |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 577 | /* get a primary headphone pin if available */ |
| 578 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) |
| 579 | { |
| 580 | if (spec->gen.autocfg.hp_pins[0]) |
| 581 | return spec->gen.autocfg.hp_pins[0]; |
| 582 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 583 | return spec->gen.autocfg.line_out_pins[0]; |
| 584 | return 0; |
| 585 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 586 | |
| 587 | /* |
| 588 | * Realtek SSID verification |
| 589 | */ |
| 590 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 591 | /* Could be any non-zero and even value. When used as fixup, tells |
| 592 | * the driver to ignore any present sku defines. |
| 593 | */ |
| 594 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 595 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 596 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 597 | const struct hda_fixup *fix, int action) |
| 598 | { |
| 599 | struct alc_spec *spec = codec->spec; |
| 600 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 601 | spec->cdefine.fixup = 1; |
| 602 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 603 | } |
| 604 | } |
| 605 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 606 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 607 | const struct hda_fixup *fix, int action) |
| 608 | { |
| 609 | struct alc_spec *spec = codec->spec; |
| 610 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 611 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 612 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 613 | codec->depop_delay = 0; |
| 614 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 615 | } |
| 616 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 617 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 618 | { |
| 619 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 620 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 621 | struct alc_spec *spec = codec->spec; |
| 622 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 623 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 624 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 625 | if (spec->cdefine.fixup) { |
| 626 | ass = spec->cdefine.sku_cfg; |
| 627 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 628 | return -1; |
| 629 | goto do_sku; |
| 630 | } |
| 631 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 632 | if (!codec->bus->pci) |
| 633 | return -1; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 634 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 635 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 636 | goto do_sku; |
| 637 | |
| 638 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 639 | if (codec->core.vendor_id == 0x10ec0260) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 640 | nid = 0x17; |
| 641 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 642 | |
| 643 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 644 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 645 | codec->core.chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 646 | return -1; |
| 647 | } |
| 648 | |
| 649 | /* check sum */ |
| 650 | tmp = 0; |
| 651 | for (i = 1; i < 16; i++) { |
| 652 | if ((ass >> i) & 1) |
| 653 | tmp++; |
| 654 | } |
| 655 | if (((ass >> 16) & 0xf) != tmp) |
| 656 | return -1; |
| 657 | |
| 658 | spec->cdefine.port_connectivity = ass >> 30; |
| 659 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 660 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 661 | spec->cdefine.customization = ass >> 8; |
| 662 | do_sku: |
| 663 | spec->cdefine.sku_cfg = ass; |
| 664 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 665 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 666 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 667 | spec->cdefine.override = ass & 0x1; |
| 668 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 669 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 670 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 671 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 672 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 673 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 674 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 675 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 676 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 677 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 678 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 679 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 680 | |
| 681 | return 0; |
| 682 | } |
| 683 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 684 | /* return the position of NID in the list, or -1 if not found */ |
| 685 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 686 | { |
| 687 | int i; |
| 688 | for (i = 0; i < nums; i++) |
| 689 | if (list[i] == nid) |
| 690 | return i; |
| 691 | return -1; |
| 692 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 693 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 694 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 695 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 696 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 697 | } |
| 698 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 699 | /* check subsystem ID and set up device-specific initialization; |
| 700 | * return 1 if initialized, 0 if invalid SSID |
| 701 | */ |
| 702 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 703 | * 31 ~ 16 : Manufacture ID |
| 704 | * 15 ~ 8 : SKU ID |
| 705 | * 7 ~ 0 : Assembly ID |
| 706 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 707 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 708 | 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] | 709 | { |
| 710 | unsigned int ass, tmp, i; |
| 711 | unsigned nid; |
| 712 | struct alc_spec *spec = codec->spec; |
| 713 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 714 | if (spec->cdefine.fixup) { |
| 715 | ass = spec->cdefine.sku_cfg; |
| 716 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 717 | return 0; |
| 718 | goto do_sku; |
| 719 | } |
| 720 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 721 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 722 | if (codec->bus->pci && |
| 723 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 724 | goto do_sku; |
| 725 | |
| 726 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 727 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 728 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 729 | * 29~21 : reserve |
| 730 | * 20 : PCBEEP input |
| 731 | * 19~16 : Check sum (15:1) |
| 732 | * 15~1 : Custom |
| 733 | * 0 : override |
| 734 | */ |
| 735 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 736 | if (codec->core.vendor_id == 0x10ec0260) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 737 | nid = 0x17; |
| 738 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 739 | codec_dbg(codec, |
| 740 | "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] | 741 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 742 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 743 | return 0; |
| 744 | if ((ass >> 30) != 1) /* no physical connection */ |
| 745 | return 0; |
| 746 | |
| 747 | /* check sum */ |
| 748 | tmp = 0; |
| 749 | for (i = 1; i < 16; i++) { |
| 750 | if ((ass >> i) & 1) |
| 751 | tmp++; |
| 752 | } |
| 753 | if (((ass >> 16) & 0xf) != tmp) |
| 754 | return 0; |
| 755 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 756 | 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] | 757 | ass & 0xffff, codec->core.vendor_id); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 758 | /* |
| 759 | * 0 : override |
| 760 | * 1 : Swap Jack |
| 761 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 762 | * 3~5 : External Amplifier control |
| 763 | * 7~6 : Reserved |
| 764 | */ |
| 765 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 766 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 767 | switch (tmp) { |
| 768 | case 1: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 769 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 770 | break; |
| 771 | case 3: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 772 | alc_setup_gpio(codec, 0x02); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 773 | break; |
| 774 | case 7: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 775 | alc_setup_gpio(codec, 0x03); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 776 | break; |
| 777 | case 5: |
| 778 | default: |
| 779 | spec->init_amp = ALC_INIT_DEFAULT; |
| 780 | break; |
| 781 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 782 | } |
| 783 | |
| 784 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 785 | * when the external headphone out jack is plugged" |
| 786 | */ |
| 787 | if (!(ass & 0x8000)) |
| 788 | return 1; |
| 789 | /* |
| 790 | * 10~8 : Jack location |
| 791 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 792 | * 14~13: Resvered |
| 793 | * 15 : 1 --> enable the function "Mute internal speaker |
| 794 | * when the external headphone out jack is plugged" |
| 795 | */ |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 796 | if (!alc_get_hp_pin(spec)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 797 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 798 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 799 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 800 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 801 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 802 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 803 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 804 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 805 | return 1; |
| 806 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 807 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 808 | /* Check the validity of ALC subsystem-id |
| 809 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 810 | 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] | 811 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 812 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 813 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6779120 | 2020-04-18 21:06:39 +0200 | [diff] [blame] | 814 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 815 | codec_dbg(codec, |
| 816 | "realtek: Enable default setup for auto mode as fallback\n"); |
| 817 | spec->init_amp = ALC_INIT_DEFAULT; |
| 818 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 819 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 820 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 821 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 822 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 823 | */ |
| 824 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 825 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 826 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 827 | { |
| 828 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 829 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 830 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 831 | } |
| 832 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 833 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 834 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 835 | { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 836 | int err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 837 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 838 | err = snd_hda_gen_build_controls(codec); |
| 839 | if (err < 0) |
| 840 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 841 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 842 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 843 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 844 | } |
| 845 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 846 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 847 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 848 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 849 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 850 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 851 | static void alc_pre_init(struct hda_codec *codec) |
| 852 | { |
| 853 | alc_fill_eapd_coef(codec); |
| 854 | } |
| 855 | |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 856 | #define is_s3_resume(codec) \ |
| 857 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 858 | #define is_s4_resume(codec) \ |
| 859 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) |
| 860 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 861 | static int alc_init(struct hda_codec *codec) |
| 862 | { |
| 863 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 864 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 865 | /* hibernation resume needs the full chip initialization */ |
| 866 | if (is_s4_resume(codec)) |
| 867 | alc_pre_init(codec); |
| 868 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 869 | if (spec->init_hook) |
| 870 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 871 | |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 872 | spec->gen.skip_verbs = 1; /* applied in below */ |
Kailang Yang | 607ca3b | 2019-04-26 16:35:41 +0800 | [diff] [blame] | 873 | snd_hda_gen_init(codec); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 874 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 875 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 876 | snd_hda_apply_verbs(codec); /* apply verbs here after own init */ |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 877 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 878 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 879 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 880 | return 0; |
| 881 | } |
| 882 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 883 | static inline void alc_shutup(struct hda_codec *codec) |
| 884 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 885 | struct alc_spec *spec = codec->spec; |
| 886 | |
Takashi Iwai | c7273bd | 2018-06-12 16:09:57 +0200 | [diff] [blame] | 887 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
| 888 | return; /* disabled explicitly by hints */ |
| 889 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 890 | if (spec && spec->shutup) |
| 891 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 892 | else |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 893 | alc_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 894 | } |
| 895 | |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 896 | static void alc_reboot_notify(struct hda_codec *codec) |
| 897 | { |
| 898 | struct alc_spec *spec = codec->spec; |
| 899 | |
| 900 | if (spec && spec->reboot_notify) |
| 901 | spec->reboot_notify(codec); |
| 902 | else |
| 903 | alc_shutup(codec); |
| 904 | } |
| 905 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 906 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 907 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 908 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 909 | static void alc_power_eapd(struct hda_codec *codec) |
| 910 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 911 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 912 | } |
| 913 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 914 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 915 | { |
| 916 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 917 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 918 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 919 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 920 | return 0; |
| 921 | } |
| 922 | #endif |
| 923 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 924 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 925 | static int alc_resume(struct hda_codec *codec) |
| 926 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 927 | struct alc_spec *spec = codec->spec; |
| 928 | |
| 929 | if (!spec->no_depop_delay) |
| 930 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 931 | codec->patch_ops.init(codec); |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 932 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 933 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 934 | return 0; |
| 935 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 936 | #endif |
| 937 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 938 | /* |
| 939 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 940 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 941 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 942 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 943 | .init = alc_init, |
| 944 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 945 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 946 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 947 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 948 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 949 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 950 | #endif |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 951 | .reboot_notify = alc_reboot_notify, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 952 | }; |
| 953 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 954 | |
Takashi Iwai | ded255b | 2015-10-01 17:59:43 +0200 | [diff] [blame] | 955 | #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] | 956 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 957 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 958 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 959 | */ |
| 960 | struct alc_codec_rename_table { |
| 961 | unsigned int vendor_id; |
| 962 | unsigned short coef_mask; |
| 963 | unsigned short coef_bits; |
| 964 | const char *name; |
| 965 | }; |
| 966 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 967 | struct alc_codec_rename_pci_table { |
| 968 | unsigned int codec_vendor_id; |
| 969 | unsigned short pci_subvendor; |
| 970 | unsigned short pci_subdevice; |
| 971 | const char *name; |
| 972 | }; |
| 973 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 974 | static const struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 975 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 976 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 977 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 978 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 979 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 980 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 981 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 982 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 983 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 984 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 985 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 986 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 987 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 988 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 989 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 990 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 991 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 992 | { } /* terminator */ |
| 993 | }; |
| 994 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 995 | static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 996 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 997 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 998 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 999 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1000 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 1001 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1002 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 1003 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1004 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 1005 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
Kailang Yang | 2c674fa | 2015-05-05 15:02:42 +0800 | [diff] [blame] | 1006 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 1007 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
Kailang Yang | 8232450 | 2015-05-25 17:16:49 +0800 | [diff] [blame] | 1008 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 1009 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 1010 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 1011 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1012 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 1013 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 1014 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 1015 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 1016 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 1017 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 1018 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 1019 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 1020 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 1021 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 1022 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1023 | { } /* terminator */ |
| 1024 | }; |
| 1025 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1026 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 1027 | { |
| 1028 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1029 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1030 | |
| 1031 | for (p = rename_tbl; p->vendor_id; p++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1032 | if (p->vendor_id != codec->core.vendor_id) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1033 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 1034 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1035 | return alc_codec_rename(codec, p->name); |
| 1036 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1037 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 1038 | if (!codec->bus->pci) |
| 1039 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1040 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1041 | if (q->codec_vendor_id != codec->core.vendor_id) |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1042 | continue; |
| 1043 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 1044 | continue; |
| 1045 | if (!q->pci_subdevice || |
| 1046 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 1047 | return alc_codec_rename(codec, q->name); |
| 1048 | } |
| 1049 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1050 | return 0; |
| 1051 | } |
| 1052 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 1053 | |
| 1054 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1055 | * Digital-beep handlers |
| 1056 | */ |
| 1057 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1058 | |
| 1059 | /* additional beep mixers; private_value will be overwritten */ |
| 1060 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
| 1061 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
| 1062 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
| 1063 | }; |
| 1064 | |
| 1065 | /* set up and create beep controls */ |
| 1066 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, |
| 1067 | int idx, int dir) |
| 1068 | { |
| 1069 | struct snd_kcontrol_new *knew; |
| 1070 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); |
| 1071 | int i; |
| 1072 | |
| 1073 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { |
| 1074 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 1075 | &alc_beep_mixer[i]); |
| 1076 | if (!knew) |
| 1077 | return -ENOMEM; |
| 1078 | knew->private_value = beep_amp; |
| 1079 | } |
| 1080 | return 0; |
| 1081 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1082 | |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1083 | static const struct snd_pci_quirk beep_allow_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1084 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1085 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1086 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1087 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1088 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1089 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1090 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1091 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1092 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1093 | /* denylist -- no beep available */ |
Takashi Iwai | 051c78a | 2019-08-22 09:58:07 +0200 | [diff] [blame] | 1094 | SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
| 1095 | SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1096 | {} |
| 1097 | }; |
| 1098 | |
| 1099 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1100 | { |
| 1101 | struct alc_spec *spec = codec->spec; |
| 1102 | const struct snd_pci_quirk *q; |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1103 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1104 | if (q) |
| 1105 | return q->value; |
| 1106 | return spec->cdefine.enable_pcbeep; |
| 1107 | } |
| 1108 | #else |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1109 | #define set_beep_amp(spec, nid, idx, dir) 0 |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1110 | #define has_cdefine_beep(codec) 0 |
| 1111 | #endif |
| 1112 | |
| 1113 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1114 | /* return 1 if successful, 0 if the proper config is not found, |
| 1115 | * or a negative error code |
| 1116 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1117 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1118 | const hda_nid_t *ignore_nids, |
| 1119 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1120 | { |
| 1121 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1122 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1123 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1124 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1125 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1126 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1127 | if (err < 0) |
| 1128 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1129 | |
| 1130 | if (ssid_nids) |
| 1131 | alc_ssid_check(codec, ssid_nids); |
| 1132 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1133 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1134 | if (err < 0) |
| 1135 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1136 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1137 | return 1; |
| 1138 | } |
| 1139 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1140 | /* common preparation job for alc_spec */ |
| 1141 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1142 | { |
| 1143 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1144 | int err; |
| 1145 | |
| 1146 | if (!spec) |
| 1147 | return -ENOMEM; |
| 1148 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1149 | snd_hda_gen_spec_init(&spec->gen); |
| 1150 | spec->gen.mixer_nid = mixer_nid; |
| 1151 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1152 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1153 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1154 | codec->spdif_status_reset = 1; |
Kai Vehmanen | a6e7d0a | 2020-10-12 13:27:04 +0300 | [diff] [blame] | 1155 | codec->forced_resume = 1; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1156 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1157 | |
| 1158 | err = alc_codec_rename_from_preset(codec); |
| 1159 | if (err < 0) { |
| 1160 | kfree(spec); |
| 1161 | return err; |
| 1162 | } |
| 1163 | return 0; |
| 1164 | } |
| 1165 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1166 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1167 | { |
| 1168 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1169 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1170 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1171 | } |
| 1172 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1173 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1174 | * ALC880 fix-ups |
| 1175 | */ |
| 1176 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1177 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1178 | ALC880_FIXUP_GPIO2, |
| 1179 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1180 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1181 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1182 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1183 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1184 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1185 | ALC880_FIXUP_VOL_KNOB, |
| 1186 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1187 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1188 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1189 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1190 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1191 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1192 | ALC880_FIXUP_3ST_BASE, |
| 1193 | ALC880_FIXUP_3ST, |
| 1194 | ALC880_FIXUP_3ST_DIG, |
| 1195 | ALC880_FIXUP_5ST_BASE, |
| 1196 | ALC880_FIXUP_5ST, |
| 1197 | ALC880_FIXUP_5ST_DIG, |
| 1198 | ALC880_FIXUP_6ST_BASE, |
| 1199 | ALC880_FIXUP_6ST, |
| 1200 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1201 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1202 | }; |
| 1203 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1204 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1205 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1206 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1207 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1208 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1209 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1210 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1211 | } |
| 1212 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1213 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1214 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1215 | .type = HDA_FIXUP_FUNC, |
| 1216 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1217 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1218 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1219 | .type = HDA_FIXUP_FUNC, |
| 1220 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1221 | }, |
| 1222 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1223 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1224 | .v.verbs = (const struct hda_verb[]) { |
| 1225 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1226 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1227 | { } |
| 1228 | }, |
| 1229 | .chained = true, |
| 1230 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1231 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1232 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1233 | .type = HDA_FIXUP_PINS, |
| 1234 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1235 | /* disable bogus unused pins */ |
| 1236 | { 0x16, 0x411111f0 }, |
| 1237 | { 0x18, 0x411111f0 }, |
| 1238 | { 0x1a, 0x411111f0 }, |
| 1239 | { } |
| 1240 | } |
| 1241 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1242 | [ALC880_FIXUP_LG_LW25] = { |
| 1243 | .type = HDA_FIXUP_PINS, |
| 1244 | .v.pins = (const struct hda_pintbl[]) { |
| 1245 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1246 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1247 | { } |
| 1248 | } |
| 1249 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1250 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1251 | .type = HDA_FIXUP_PINS, |
| 1252 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1253 | /* disable bogus unused pins */ |
| 1254 | { 0x17, 0x411111f0 }, |
| 1255 | { } |
| 1256 | }, |
| 1257 | .chained = true, |
| 1258 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1259 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1260 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1261 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1262 | .v.verbs = (const struct hda_verb[]) { |
| 1263 | /* change to EAPD mode */ |
| 1264 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1265 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1266 | {} |
| 1267 | }, |
| 1268 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1269 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1270 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1271 | .v.verbs = (const struct hda_verb[]) { |
| 1272 | /* change to EAPD mode */ |
| 1273 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1274 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1275 | {} |
| 1276 | }, |
| 1277 | .chained = true, |
| 1278 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1279 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1280 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1281 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1282 | .v.func = alc880_fixup_vol_knob, |
| 1283 | }, |
| 1284 | [ALC880_FIXUP_FUJITSU] = { |
| 1285 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1286 | .type = HDA_FIXUP_PINS, |
| 1287 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1288 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1289 | { 0x15, 0x99030120 }, /* speaker */ |
| 1290 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1291 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1292 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1293 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1294 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1295 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1296 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1297 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1298 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1299 | { } |
| 1300 | }, |
| 1301 | .chained = true, |
| 1302 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1303 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1304 | [ALC880_FIXUP_F1734] = { |
| 1305 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1306 | .type = HDA_FIXUP_PINS, |
| 1307 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1308 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1309 | { 0x15, 0x99030120 }, /* speaker */ |
| 1310 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1311 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1312 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1313 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1314 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1315 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1316 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1317 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1318 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1319 | { } |
| 1320 | }, |
| 1321 | .chained = true, |
| 1322 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1323 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1324 | [ALC880_FIXUP_UNIWILL] = { |
| 1325 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1326 | .type = HDA_FIXUP_PINS, |
| 1327 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1328 | { 0x14, 0x0121411f }, /* HP */ |
| 1329 | { 0x15, 0x99030120 }, /* speaker */ |
| 1330 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1331 | { } |
| 1332 | }, |
| 1333 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1334 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1335 | .type = HDA_FIXUP_PINS, |
| 1336 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1337 | /* disable bogus unused pins */ |
| 1338 | { 0x17, 0x411111f0 }, |
| 1339 | { 0x19, 0x411111f0 }, |
| 1340 | { 0x1b, 0x411111f0 }, |
| 1341 | { 0x1f, 0x411111f0 }, |
| 1342 | { } |
| 1343 | } |
| 1344 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1345 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1346 | .type = HDA_FIXUP_PINS, |
| 1347 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1348 | /* set up the whole pins as BIOS is utterly broken */ |
| 1349 | { 0x14, 0x99030120 }, /* speaker */ |
| 1350 | { 0x15, 0x0121411f }, /* HP */ |
| 1351 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1352 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1353 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1354 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1355 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1356 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1357 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1358 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1359 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1360 | { } |
| 1361 | } |
| 1362 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1363 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1364 | .type = HDA_FIXUP_PINS, |
| 1365 | .v.pins = (const struct hda_pintbl[]) { |
| 1366 | /* set up the whole pins as BIOS is utterly broken */ |
| 1367 | { 0x14, 0x0121411f }, /* HP */ |
| 1368 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1369 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1370 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1371 | { 0x18, 0x90a60160 }, /* mic */ |
| 1372 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1373 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1374 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1375 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1376 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1377 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1378 | { } |
| 1379 | }, |
| 1380 | .chained = true, |
| 1381 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1382 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1383 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1384 | .type = HDA_FIXUP_PINS, |
| 1385 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1386 | { 0x14, 0x01014010 }, /* line-out */ |
| 1387 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1388 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1389 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1390 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1391 | { 0x19, 0x0121411f }, /* HP */ |
| 1392 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1393 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1394 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1395 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1396 | /* 0x1e is filled in below */ |
| 1397 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1398 | { } |
| 1399 | } |
| 1400 | }, |
| 1401 | [ALC880_FIXUP_3ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1402 | .type = HDA_FIXUP_PINS, |
| 1403 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1404 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1405 | { } |
| 1406 | }, |
| 1407 | .chained = true, |
| 1408 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1409 | }, |
| 1410 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1411 | .type = HDA_FIXUP_PINS, |
| 1412 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1413 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1414 | { } |
| 1415 | }, |
| 1416 | .chained = true, |
| 1417 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1418 | }, |
| 1419 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1420 | .type = HDA_FIXUP_PINS, |
| 1421 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1422 | { 0x14, 0x01014010 }, /* front */ |
| 1423 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1424 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1425 | { 0x17, 0x01016412 }, /* surr */ |
| 1426 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1427 | { 0x19, 0x0121411f }, /* HP */ |
| 1428 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1429 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1430 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1431 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1432 | /* 0x1e is filled in below */ |
| 1433 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1434 | { } |
| 1435 | } |
| 1436 | }, |
| 1437 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1438 | .type = HDA_FIXUP_PINS, |
| 1439 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1440 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1441 | { } |
| 1442 | }, |
| 1443 | .chained = true, |
| 1444 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1445 | }, |
| 1446 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1447 | .type = HDA_FIXUP_PINS, |
| 1448 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1449 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1450 | { } |
| 1451 | }, |
| 1452 | .chained = true, |
| 1453 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1454 | }, |
| 1455 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1456 | .type = HDA_FIXUP_PINS, |
| 1457 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1458 | { 0x14, 0x01014010 }, /* front */ |
| 1459 | { 0x15, 0x01016412 }, /* surr */ |
| 1460 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1461 | { 0x17, 0x01012414 }, /* side */ |
| 1462 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1463 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1464 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1465 | { 0x1b, 0x0121411f }, /* HP */ |
| 1466 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1467 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1468 | /* 0x1e is filled in below */ |
| 1469 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1470 | { } |
| 1471 | } |
| 1472 | }, |
| 1473 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1474 | .type = HDA_FIXUP_PINS, |
| 1475 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1476 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1477 | { } |
| 1478 | }, |
| 1479 | .chained = true, |
| 1480 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1481 | }, |
| 1482 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1483 | .type = HDA_FIXUP_PINS, |
| 1484 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1485 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1486 | { } |
| 1487 | }, |
| 1488 | .chained = true, |
| 1489 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1490 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1491 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1492 | .type = HDA_FIXUP_PINS, |
| 1493 | .v.pins = (const struct hda_pintbl[]) { |
| 1494 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1495 | { } |
| 1496 | }, |
| 1497 | .chained_before = true, |
| 1498 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1499 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1500 | }; |
| 1501 | |
| 1502 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1503 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1504 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1505 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1506 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1507 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1508 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1509 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1510 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1511 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1512 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1513 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1514 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1515 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1516 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | a161574 | 2015-08-13 18:05:06 +0200 | [diff] [blame] | 1517 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1518 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1519 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1520 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1521 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1522 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1523 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1524 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1525 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1526 | |
| 1527 | /* Below is the copied entries from alc880_quirks.c. |
| 1528 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1529 | * on these machines, thus they are kept to be compatible with |
| 1530 | * the old static quirks. Once when it's confirmed to work without |
| 1531 | * these overrides, it'd be better to remove. |
| 1532 | */ |
| 1533 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1534 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1535 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1536 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1537 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1538 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1539 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1540 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1541 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1542 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1543 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1544 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1545 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1546 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1547 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1548 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1549 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1550 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1551 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1552 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1553 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1554 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1555 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1556 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1557 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1558 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1559 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1560 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1561 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1562 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1563 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1564 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1565 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1566 | /* default Intel */ |
| 1567 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1568 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1569 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1570 | {} |
| 1571 | }; |
| 1572 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1573 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1574 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1575 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1576 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1577 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1578 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1579 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1580 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1581 | {} |
| 1582 | }; |
| 1583 | |
| 1584 | |
| 1585 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1586 | * OK, here we have finally the patch for ALC880 |
| 1587 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1588 | static int patch_alc880(struct hda_codec *codec) |
| 1589 | { |
| 1590 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1591 | int err; |
| 1592 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1593 | err = alc_alloc_spec(codec, 0x0b); |
| 1594 | if (err < 0) |
| 1595 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1596 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1597 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1598 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1599 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1600 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1601 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1602 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1603 | alc_pre_init(codec); |
| 1604 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1605 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1606 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1607 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1608 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1609 | /* automatic parse from the BIOS config */ |
| 1610 | err = alc880_parse_auto_config(codec); |
| 1611 | if (err < 0) |
| 1612 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1613 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1614 | if (!spec->gen.no_analog) { |
| 1615 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 1616 | if (err < 0) |
| 1617 | goto error; |
| 1618 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1619 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1620 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1621 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1622 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1623 | |
| 1624 | error: |
| 1625 | alc_free(codec); |
| 1626 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1627 | } |
| 1628 | |
| 1629 | |
| 1630 | /* |
| 1631 | * ALC260 support |
| 1632 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1633 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1634 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1635 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1636 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1637 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1638 | } |
| 1639 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1640 | /* |
| 1641 | * Pin config fixes |
| 1642 | */ |
| 1643 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1644 | ALC260_FIXUP_HP_DC5750, |
| 1645 | ALC260_FIXUP_HP_PIN_0F, |
| 1646 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1647 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1648 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1649 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1650 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1651 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1652 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1653 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1654 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1655 | }; |
| 1656 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1657 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1658 | { |
| 1659 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 1660 | |
| 1661 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1662 | } |
| 1663 | |
| 1664 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1665 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1666 | { |
| 1667 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1668 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1669 | /* although the machine has only one output pin, we need to |
| 1670 | * toggle GPIO1 according to the jack state |
| 1671 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1672 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1673 | spec->gen.detect_hp = 1; |
| 1674 | spec->gen.automute_speaker = 1; |
| 1675 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1676 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1677 | snd_hda_gen_hp_automute); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1678 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1679 | } |
| 1680 | } |
| 1681 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1682 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1683 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1684 | { |
| 1685 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1686 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1687 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1688 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1689 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1690 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1691 | /* disable bogus I/O pins */ |
| 1692 | { 0x10, 0x411111f0 }, |
| 1693 | { 0x11, 0x411111f0 }, |
| 1694 | { 0x14, 0x411111f0 }, |
| 1695 | { 0x15, 0x411111f0 }, |
| 1696 | { 0x16, 0x411111f0 }, |
| 1697 | { 0x17, 0x411111f0 }, |
| 1698 | { 0x19, 0x411111f0 }, |
| 1699 | { } |
| 1700 | }; |
| 1701 | |
| 1702 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1703 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1704 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1705 | spec->init_amp = ALC_INIT_NONE; |
| 1706 | break; |
| 1707 | } |
| 1708 | } |
| 1709 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1710 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1711 | const struct hda_fixup *fix, int action) |
| 1712 | { |
| 1713 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 1714 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1715 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1716 | } |
| 1717 | |
| 1718 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1719 | const struct hda_fixup *fix, int action) |
| 1720 | { |
| 1721 | struct alc_spec *spec = codec->spec; |
| 1722 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1723 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1724 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1725 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1726 | } |
| 1727 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1728 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1729 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1730 | .type = HDA_FIXUP_PINS, |
| 1731 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1732 | { 0x11, 0x90130110 }, /* speaker */ |
| 1733 | { } |
| 1734 | } |
| 1735 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1736 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1737 | .type = HDA_FIXUP_PINS, |
| 1738 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1739 | { 0x0f, 0x01214000 }, /* HP */ |
| 1740 | { } |
| 1741 | } |
| 1742 | }, |
| 1743 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1744 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1745 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1746 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1747 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1748 | { } |
| 1749 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1750 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1751 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1752 | .type = HDA_FIXUP_FUNC, |
| 1753 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1754 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1755 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1756 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1757 | .v.func = alc260_fixup_gpio1_toggle, |
| 1758 | .chained = true, |
| 1759 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1760 | }, |
| 1761 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1762 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1763 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1764 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1765 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1766 | { } |
| 1767 | }, |
| 1768 | .chained = true, |
| 1769 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1770 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1771 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1772 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1773 | .v.func = alc260_fixup_gpio1_toggle, |
| 1774 | .chained = true, |
| 1775 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1776 | }, |
| 1777 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1778 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1779 | .v.func = alc260_fixup_kn1, |
| 1780 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1781 | [ALC260_FIXUP_FSC_S7020] = { |
| 1782 | .type = HDA_FIXUP_FUNC, |
| 1783 | .v.func = alc260_fixup_fsc_s7020, |
| 1784 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1785 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1786 | .type = HDA_FIXUP_FUNC, |
| 1787 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1788 | .chained = true, |
| 1789 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1790 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1791 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1792 | .type = HDA_FIXUP_PINS, |
| 1793 | .v.pins = (const struct hda_pintbl[]) { |
| 1794 | /* Pin configs are missing completely on some VAIOs */ |
| 1795 | { 0x0f, 0x01211020 }, |
| 1796 | { 0x10, 0x0001003f }, |
| 1797 | { 0x11, 0x411111f0 }, |
| 1798 | { 0x12, 0x01a15930 }, |
| 1799 | { 0x13, 0x411111f0 }, |
| 1800 | { 0x14, 0x411111f0 }, |
| 1801 | { 0x15, 0x411111f0 }, |
| 1802 | { 0x16, 0x411111f0 }, |
| 1803 | { 0x17, 0x411111f0 }, |
| 1804 | { 0x18, 0x411111f0 }, |
| 1805 | { 0x19, 0x411111f0 }, |
| 1806 | { } |
| 1807 | } |
| 1808 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1809 | }; |
| 1810 | |
| 1811 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1812 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1813 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1814 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1815 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1816 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1817 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1818 | 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] | 1819 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1820 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1821 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1822 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1823 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1824 | {} |
| 1825 | }; |
| 1826 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1827 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1828 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1829 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1830 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1831 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1832 | {} |
| 1833 | }; |
| 1834 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1835 | /* |
| 1836 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1837 | static int patch_alc260(struct hda_codec *codec) |
| 1838 | { |
| 1839 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1840 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1841 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1842 | err = alc_alloc_spec(codec, 0x07); |
| 1843 | if (err < 0) |
| 1844 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1845 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1846 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1847 | /* as quite a few machines require HP amp for speaker outputs, |
| 1848 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1849 | * it's almost harmless. |
| 1850 | */ |
| 1851 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1852 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1853 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1854 | spec->shutup = alc_eapd_shutup; |
| 1855 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1856 | alc_pre_init(codec); |
| 1857 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1858 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1859 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1860 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1861 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1862 | /* automatic parse from the BIOS config */ |
| 1863 | err = alc260_parse_auto_config(codec); |
| 1864 | if (err < 0) |
| 1865 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1866 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1867 | if (!spec->gen.no_analog) { |
| 1868 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
| 1869 | if (err < 0) |
| 1870 | goto error; |
| 1871 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1872 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1873 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1874 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1875 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1876 | |
| 1877 | error: |
| 1878 | alc_free(codec); |
| 1879 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1880 | } |
| 1881 | |
| 1882 | |
| 1883 | /* |
| 1884 | * ALC882/883/885/888/889 support |
| 1885 | * |
| 1886 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1887 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1888 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1889 | * 6-channel independent captures. |
| 1890 | * |
| 1891 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1892 | * driver yet). |
| 1893 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1894 | |
| 1895 | /* |
| 1896 | * Pin config fixes |
| 1897 | */ |
| 1898 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1899 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1900 | ALC882_FIXUP_LENOVO_Y530, |
| 1901 | ALC882_FIXUP_PB_M5210, |
| 1902 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1903 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1904 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1905 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1906 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1907 | ALC888_FIXUP_EEE1601, |
PeiSen Hou | 4841b8e | 2021-02-02 10:30:22 +0100 | [diff] [blame] | 1908 | ALC886_FIXUP_EAPD, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1909 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1910 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1911 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1912 | ALC882_FIXUP_GPIO1, |
| 1913 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1914 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1915 | ALC889_FIXUP_COEF, |
| 1916 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1917 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1918 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1919 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1920 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1921 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1922 | ALC889_FIXUP_MBP_VREF, |
| 1923 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1924 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1925 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1926 | ALC889_FIXUP_MP11_VREF, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1927 | ALC889_FIXUP_MP41_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1928 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1929 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1930 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1931 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1932 | ALC1220_FIXUP_GB_DUAL_CODECS, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 1933 | ALC1220_FIXUP_CLEVO_P950, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 1934 | ALC1220_FIXUP_CLEVO_PB51ED, |
| 1935 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 1936 | ALC887_FIXUP_ASUS_AUDIO, |
| 1937 | ALC887_FIXUP_ASUS_HMIC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1938 | }; |
| 1939 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1940 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1941 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1942 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1943 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1944 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1945 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1946 | } |
| 1947 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1948 | /* set up GPIO at initialization */ |
| 1949 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1950 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1951 | { |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 1952 | struct alc_spec *spec = codec->spec; |
| 1953 | |
| 1954 | spec->gpio_write_delay = true; |
| 1955 | alc_fixup_gpio3(codec, fix, action); |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1956 | } |
| 1957 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1958 | /* Fix the connection of some pins for ALC889: |
| 1959 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1960 | * work correctly (bko#42740) |
| 1961 | */ |
| 1962 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1963 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1964 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1965 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1966 | /* fake the connections during parsing the tree */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1967 | static const hda_nid_t conn1[] = { 0x0c, 0x0d }; |
| 1968 | static const hda_nid_t conn2[] = { 0x0e, 0x0f }; |
| 1969 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 1970 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
| 1971 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); |
| 1972 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1973 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1974 | /* restore the connections */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1975 | static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1976 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); |
| 1977 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); |
| 1978 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); |
| 1979 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1980 | } |
| 1981 | } |
| 1982 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1983 | /* Set VREF on HP pin */ |
| 1984 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1985 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1986 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1987 | static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 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 | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1991 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1992 | return; |
| 1993 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1994 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1995 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1996 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1997 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1998 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1999 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2000 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2001 | break; |
| 2002 | } |
| 2003 | } |
| 2004 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2005 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 2006 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2007 | { |
| 2008 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2009 | int i; |
| 2010 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2011 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2012 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 2013 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2014 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 2015 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2016 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2017 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2018 | } |
| 2019 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2020 | /* Set VREF on speaker pins on imac91 */ |
| 2021 | static void alc889_fixup_imac91_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, 0x1a }; |
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 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2030 | /* Set VREF on speaker pins on mba11 */ |
| 2031 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 2032 | const struct hda_fixup *fix, int action) |
| 2033 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2034 | static const hda_nid_t nids[] = { 0x18 }; |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2035 | |
| 2036 | if (action == HDA_FIXUP_ACT_INIT) |
| 2037 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2038 | } |
| 2039 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2040 | /* Set VREF on speaker pins on mba21 */ |
| 2041 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 2042 | const struct hda_fixup *fix, int action) |
| 2043 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2044 | static const hda_nid_t nids[] = { 0x18, 0x19 }; |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2045 | |
| 2046 | if (action == HDA_FIXUP_ACT_INIT) |
| 2047 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2048 | } |
| 2049 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2050 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 2051 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 2052 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2053 | */ |
| 2054 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2055 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2056 | { |
| 2057 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2058 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2059 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2060 | spec->gen.no_multi_io = 1; |
| 2061 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2062 | } |
| 2063 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2064 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 2065 | const struct hda_fixup *fix, int action); |
| 2066 | |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2067 | /* For dual-codec configuration, we need to disable some features to avoid |
| 2068 | * conflicts of kctls and PCM streams |
| 2069 | */ |
| 2070 | static void alc_fixup_dual_codecs(struct hda_codec *codec, |
| 2071 | const struct hda_fixup *fix, int action) |
| 2072 | { |
| 2073 | struct alc_spec *spec = codec->spec; |
| 2074 | |
| 2075 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2076 | return; |
| 2077 | /* disable vmaster */ |
| 2078 | spec->gen.suppress_vmaster = 1; |
| 2079 | /* auto-mute and auto-mic switch don't work with multiple codecs */ |
| 2080 | spec->gen.suppress_auto_mute = 1; |
| 2081 | spec->gen.suppress_auto_mic = 1; |
| 2082 | /* disable aamix as well */ |
| 2083 | spec->gen.mixer_nid = 0; |
| 2084 | /* add location prefix to avoid conflicts */ |
| 2085 | codec->force_pin_prefix = 1; |
| 2086 | } |
| 2087 | |
| 2088 | static void rename_ctl(struct hda_codec *codec, const char *oldname, |
| 2089 | const char *newname) |
| 2090 | { |
| 2091 | struct snd_kcontrol *kctl; |
| 2092 | |
| 2093 | kctl = snd_hda_find_mixer_ctl(codec, oldname); |
| 2094 | if (kctl) |
| 2095 | strcpy(kctl->id.name, newname); |
| 2096 | } |
| 2097 | |
| 2098 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
| 2099 | const struct hda_fixup *fix, |
| 2100 | int action) |
| 2101 | { |
| 2102 | alc_fixup_dual_codecs(codec, fix, action); |
| 2103 | switch (action) { |
| 2104 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2105 | /* override card longname to provide a unique UCM profile */ |
| 2106 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); |
| 2107 | break; |
| 2108 | case HDA_FIXUP_ACT_BUILD: |
| 2109 | /* rename Capture controls depending on the codec */ |
| 2110 | rename_ctl(codec, "Capture Volume", |
| 2111 | codec->addr == 0 ? |
| 2112 | "Rear-Panel Capture Volume" : |
| 2113 | "Front-Panel Capture Volume"); |
| 2114 | rename_ctl(codec, "Capture Switch", |
| 2115 | codec->addr == 0 ? |
| 2116 | "Rear-Panel Capture Switch" : |
| 2117 | "Front-Panel Capture Switch"); |
| 2118 | break; |
| 2119 | } |
| 2120 | } |
| 2121 | |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2122 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
| 2123 | const struct hda_fixup *fix, |
| 2124 | int action) |
| 2125 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2126 | static const hda_nid_t conn1[] = { 0x0c }; |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2127 | |
| 2128 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2129 | return; |
| 2130 | |
| 2131 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); |
| 2132 | /* We therefore want to make sure 0x14 (front headphone) and |
| 2133 | * 0x1b (speakers) use the stereo DAC 0x02 |
| 2134 | */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2135 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 2136 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2137 | } |
| 2138 | |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2139 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 2140 | const struct hda_fixup *fix, int action); |
| 2141 | |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2142 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2143 | const struct hda_fixup *fix, |
| 2144 | int action) |
| 2145 | { |
| 2146 | alc1220_fixup_clevo_p950(codec, fix, action); |
| 2147 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); |
| 2148 | } |
| 2149 | |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 2150 | static void alc887_asus_hp_automute_hook(struct hda_codec *codec, |
| 2151 | struct hda_jack_callback *jack) |
| 2152 | { |
| 2153 | struct alc_spec *spec = codec->spec; |
| 2154 | unsigned int vref; |
| 2155 | |
| 2156 | snd_hda_gen_hp_automute(codec, jack); |
| 2157 | |
| 2158 | if (spec->gen.hp_jack_present) |
| 2159 | vref = AC_PINCTL_VREF_80; |
| 2160 | else |
| 2161 | vref = AC_PINCTL_VREF_HIZ; |
| 2162 | snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); |
| 2163 | } |
| 2164 | |
| 2165 | static void alc887_fixup_asus_jack(struct hda_codec *codec, |
| 2166 | const struct hda_fixup *fix, int action) |
| 2167 | { |
| 2168 | struct alc_spec *spec = codec->spec; |
| 2169 | if (action != HDA_FIXUP_ACT_PROBE) |
| 2170 | return; |
| 2171 | snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); |
| 2172 | spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; |
| 2173 | } |
| 2174 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2175 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2176 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2177 | .type = HDA_FIXUP_PINS, |
| 2178 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2179 | { 0x15, 0x01080104 }, /* side */ |
| 2180 | { 0x16, 0x01011012 }, /* rear */ |
| 2181 | { 0x17, 0x01016011 }, /* clfe */ |
| 2182 | { } |
| 2183 | } |
| 2184 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2185 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2186 | .type = HDA_FIXUP_PINS, |
| 2187 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2188 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2189 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2190 | { } |
| 2191 | } |
| 2192 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2193 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2194 | .type = HDA_FIXUP_PINCTLS, |
| 2195 | .v.pins = (const struct hda_pintbl[]) { |
| 2196 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2197 | {} |
| 2198 | } |
| 2199 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2200 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2201 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2202 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2203 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2204 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2205 | .type = HDA_FIXUP_PINS, |
| 2206 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2207 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2208 | { } |
| 2209 | } |
| 2210 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2211 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2212 | .type = HDA_FIXUP_PINS, |
| 2213 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2214 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2215 | { } |
| 2216 | } |
| 2217 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2218 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2219 | .type = HDA_FIXUP_PINS, |
| 2220 | .v.pins = (const struct hda_pintbl[]) { |
| 2221 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2222 | { } |
| 2223 | }, |
| 2224 | .chained = true, |
| 2225 | .chain_id = ALC889_FIXUP_CD, |
| 2226 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2227 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2228 | .type = HDA_FIXUP_PINS, |
| 2229 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2230 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2231 | { } |
| 2232 | } |
| 2233 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2234 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2235 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2236 | .v.verbs = (const struct hda_verb[]) { |
| 2237 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2238 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2239 | { } |
| 2240 | } |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2241 | }, |
PeiSen Hou | 4841b8e | 2021-02-02 10:30:22 +0100 | [diff] [blame] | 2242 | [ALC886_FIXUP_EAPD] = { |
| 2243 | .type = HDA_FIXUP_VERBS, |
| 2244 | .v.verbs = (const struct hda_verb[]) { |
| 2245 | /* change to EAPD mode */ |
| 2246 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2247 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 }, |
| 2248 | { } |
| 2249 | } |
| 2250 | }, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2251 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2252 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2253 | .v.verbs = (const struct hda_verb[]) { |
| 2254 | /* change to EAPD mode */ |
| 2255 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2256 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2257 | { } |
| 2258 | } |
| 2259 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2260 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2261 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2262 | .v.verbs = (const struct hda_verb[]) { |
| 2263 | /* change to EAPD mode */ |
| 2264 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2265 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2266 | { } |
| 2267 | } |
| 2268 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2269 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2270 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2271 | .v.verbs = (const struct hda_verb[]) { |
| 2272 | /* eanable EAPD on Acer laptops */ |
| 2273 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2274 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2275 | { } |
| 2276 | } |
| 2277 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2278 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2279 | .type = HDA_FIXUP_FUNC, |
| 2280 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2281 | }, |
| 2282 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2283 | .type = HDA_FIXUP_FUNC, |
| 2284 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2285 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2286 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2287 | .type = HDA_FIXUP_FUNC, |
| 2288 | .v.func = alc_fixup_gpio3, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2289 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2290 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2291 | .type = HDA_FIXUP_FUNC, |
| 2292 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2293 | .chained = true, |
| 2294 | .chain_id = ALC882_FIXUP_EAPD, |
| 2295 | }, |
| 2296 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2297 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2298 | .v.func = alc889_fixup_coef, |
| 2299 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2300 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2301 | .type = HDA_FIXUP_PINS, |
| 2302 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2303 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2304 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2305 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2306 | }, |
| 2307 | .chained = true, |
| 2308 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2309 | }, |
| 2310 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2311 | .type = HDA_FIXUP_PINS, |
| 2312 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2313 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2314 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2315 | { } |
| 2316 | }, |
| 2317 | .chained = true, |
| 2318 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2319 | }, |
| 2320 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2321 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2322 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2323 | .v.verbs = (const struct hda_verb[]) { |
| 2324 | /* Enable all DACs */ |
| 2325 | /* DAC DISABLE/MUTE 1? */ |
| 2326 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2327 | * apparently. Init=0x38 */ |
| 2328 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2329 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2330 | /* DAC DISABLE/MUTE 2? */ |
| 2331 | /* some bit here disables the other DACs. |
| 2332 | * Init=0x4900 */ |
| 2333 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2334 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2335 | /* DMIC fix |
| 2336 | * This laptop has a stereo digital microphone. |
| 2337 | * The mics are only 1cm apart which makes the stereo |
| 2338 | * useless. However, either the mic or the ALC889 |
| 2339 | * makes the signal become a difference/sum signal |
| 2340 | * instead of standard stereo, which is annoying. |
| 2341 | * So instead we flip this bit which makes the |
| 2342 | * codec replicate the sum signal to both channels, |
| 2343 | * turning it into a normal mono mic. |
| 2344 | */ |
| 2345 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2346 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2347 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2348 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2349 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2350 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2351 | }, |
| 2352 | .chained = true, |
| 2353 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2354 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2355 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2356 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2357 | .v.func = alc885_fixup_macpro_gpio, |
| 2358 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2359 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2360 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2361 | .v.func = alc889_fixup_dac_route, |
| 2362 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2363 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2364 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2365 | .v.func = alc889_fixup_mbp_vref, |
| 2366 | .chained = true, |
| 2367 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2368 | }, |
| 2369 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2370 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2371 | .v.func = alc889_fixup_imac91_vref, |
| 2372 | .chained = true, |
| 2373 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2374 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2375 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2376 | .type = HDA_FIXUP_FUNC, |
| 2377 | .v.func = alc889_fixup_mba11_vref, |
| 2378 | .chained = true, |
| 2379 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2380 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2381 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2382 | .type = HDA_FIXUP_FUNC, |
| 2383 | .v.func = alc889_fixup_mba21_vref, |
| 2384 | .chained = true, |
| 2385 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2386 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2387 | [ALC889_FIXUP_MP11_VREF] = { |
| 2388 | .type = HDA_FIXUP_FUNC, |
| 2389 | .v.func = alc889_fixup_mba11_vref, |
| 2390 | .chained = true, |
| 2391 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2392 | }, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2393 | [ALC889_FIXUP_MP41_VREF] = { |
| 2394 | .type = HDA_FIXUP_FUNC, |
| 2395 | .v.func = alc889_fixup_mbp_vref, |
| 2396 | .chained = true, |
| 2397 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2398 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2399 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2400 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2401 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2402 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2403 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2404 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2405 | .v.func = alc882_fixup_no_primary_hp, |
| 2406 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2407 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2408 | .type = HDA_FIXUP_PINS, |
| 2409 | .v.pins = (const struct hda_pintbl[]) { |
| 2410 | {0x16, 0x99130130}, /* bass speaker */ |
| 2411 | {} |
| 2412 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2413 | .chained = true, |
| 2414 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2415 | }, |
| 2416 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2417 | .type = HDA_FIXUP_FUNC, |
| 2418 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2419 | }, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2420 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
| 2421 | .type = HDA_FIXUP_FUNC, |
| 2422 | .v.func = alc1220_fixup_gb_dual_codecs, |
| 2423 | }, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2424 | [ALC1220_FIXUP_CLEVO_P950] = { |
| 2425 | .type = HDA_FIXUP_FUNC, |
| 2426 | .v.func = alc1220_fixup_clevo_p950, |
| 2427 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2428 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2429 | .type = HDA_FIXUP_FUNC, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2430 | .v.func = alc1220_fixup_clevo_pb51ed, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2431 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2432 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2433 | .type = HDA_FIXUP_PINS, |
| 2434 | .v.pins = (const struct hda_pintbl[]) { |
| 2435 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 2436 | {} |
| 2437 | }, |
| 2438 | .chained = true, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2439 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2440 | }, |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 2441 | [ALC887_FIXUP_ASUS_AUDIO] = { |
| 2442 | .type = HDA_FIXUP_PINS, |
| 2443 | .v.pins = (const struct hda_pintbl[]) { |
| 2444 | { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ |
| 2445 | { 0x19, 0x22219420 }, |
| 2446 | {} |
| 2447 | }, |
| 2448 | }, |
| 2449 | [ALC887_FIXUP_ASUS_HMIC] = { |
| 2450 | .type = HDA_FIXUP_FUNC, |
| 2451 | .v.func = alc887_fixup_asus_jack, |
| 2452 | .chained = true, |
| 2453 | .chain_id = ALC887_FIXUP_ASUS_AUDIO, |
| 2454 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2455 | }; |
| 2456 | |
| 2457 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2458 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2459 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | b5d724b | 2015-06-02 19:57:08 +0200 | [diff] [blame] | 2460 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2461 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2462 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2463 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2464 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2465 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2466 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2467 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2468 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2469 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2470 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2471 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2472 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
Takashi Iwai | b265047 | 2021-04-28 13:26:52 +0200 | [diff] [blame] | 2473 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2474 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2475 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2476 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2477 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2478 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2479 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2480 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2481 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2482 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2483 | 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] | 2484 | 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] | 2485 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2486 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2487 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 2488 | SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2489 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2490 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | 85bcf96 | 2016-12-06 16:20:36 +0100 | [diff] [blame] | 2491 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
Takashi Iwai | b7529c1 | 2021-04-28 13:26:53 +0200 | [diff] [blame] | 2492 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
| 2493 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2494 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2495 | 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] | 2496 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2497 | |
| 2498 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2499 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2500 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2501 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2502 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2503 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2504 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2505 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2506 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2507 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2508 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2509 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2510 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2511 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2512 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2513 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2514 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2515 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2516 | 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] | 2517 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2518 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2519 | 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] | 2520 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2521 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2522 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
PeiSen Hou | 4841b8e | 2021-02-02 10:30:22 +0100 | [diff] [blame] | 2523 | SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2524 | 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] | 2525 | 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] | 2526 | SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), |
Christian Lachner | d9e8fe0 | 2020-05-18 07:38:44 +0200 | [diff] [blame] | 2527 | SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | a0b0395 | 2020-06-16 15:21:50 +0200 | [diff] [blame] | 2528 | SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | a655e2b | 2020-02-17 16:19:47 +0100 | [diff] [blame] | 2529 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 0992620 | 2020-12-20 09:09:43 +0100 | [diff] [blame] | 2530 | SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 1d3aa4a | 2020-04-08 15:56:45 +0200 | [diff] [blame] | 2531 | SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 7dafba3 | 2020-02-12 09:10:47 +0100 | [diff] [blame] | 2532 | SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | cc5049a | 2020-02-18 09:09:15 +0100 | [diff] [blame] | 2533 | SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | d2c3b14 | 2017-06-01 09:35:30 +0200 | [diff] [blame] | 2534 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | 26af177 | 2021-03-03 15:23:46 +0100 | [diff] [blame] | 2535 | SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS), |
Takashi Iwai | 6369158 | 2017-05-22 16:32:46 +0200 | [diff] [blame] | 2536 | 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] | 2537 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2538 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
PeiSen Hou | 259eb82 | 2020-05-19 08:50:12 +0200 | [diff] [blame] | 2539 | SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 2540 | SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2541 | SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2542 | SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Eckhart Mohr | 970e301 | 2021-04-27 17:30:25 +0200 | [diff] [blame] | 2543 | SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 2544 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2545 | SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Eckhart Mohr | 970e301 | 2021-04-27 17:30:25 +0200 | [diff] [blame] | 2546 | SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
PeiSen Hou | 259eb82 | 2020-05-19 08:50:12 +0200 | [diff] [blame] | 2547 | SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2548 | SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Takashi Iwai | 13e1a4c | 2021-04-28 13:26:54 +0200 | [diff] [blame] | 2549 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
| 2550 | SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), |
| 2551 | SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), |
| 2552 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
| 2553 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
| 2554 | SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950), |
| 2555 | SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950), |
| 2556 | SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950), |
| 2557 | SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950), |
| 2558 | SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), |
| 2559 | SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), |
| 2560 | SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2561 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2562 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2563 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2564 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2565 | {} |
| 2566 | }; |
| 2567 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2568 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2569 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
| 2570 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, |
| 2571 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, |
| 2572 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, |
| 2573 | {.id = ALC889_FIXUP_CD, .name = "cd"}, |
| 2574 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, |
| 2575 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, |
| 2576 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, |
| 2577 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, |
| 2578 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, |
| 2579 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, |
| 2580 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, |
| 2581 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, |
| 2582 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, |
| 2583 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2584 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2585 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2586 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2587 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
| 2588 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, |
| 2589 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, |
| 2590 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, |
| 2591 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, |
| 2592 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, |
| 2593 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, |
| 2594 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2595 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2596 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2597 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 2598 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2599 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2600 | {} |
| 2601 | }; |
| 2602 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2603 | /* |
| 2604 | * BIOS auto configuration |
| 2605 | */ |
| 2606 | /* almost identical with ALC880 parser... */ |
| 2607 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2608 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2609 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2610 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2611 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2612 | } |
| 2613 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2614 | /* |
| 2615 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2616 | static int patch_alc882(struct hda_codec *codec) |
| 2617 | { |
| 2618 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2619 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2620 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2621 | err = alc_alloc_spec(codec, 0x0b); |
| 2622 | if (err < 0) |
| 2623 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2624 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2625 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2626 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 2627 | switch (codec->core.vendor_id) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2628 | case 0x10ec0882: |
| 2629 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2630 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 2631 | case 0x10ec0b00: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 2632 | case 0x10ec1220: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2633 | break; |
| 2634 | default: |
| 2635 | /* ALC883 and variants */ |
| 2636 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2637 | break; |
| 2638 | } |
| 2639 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2640 | alc_pre_init(codec); |
| 2641 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2642 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2643 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2644 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2645 | |
| 2646 | alc_auto_parse_customize_define(codec); |
| 2647 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2648 | if (has_cdefine_beep(codec)) |
| 2649 | spec->gen.beep_nid = 0x01; |
| 2650 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2651 | /* automatic parse from the BIOS config */ |
| 2652 | err = alc882_parse_auto_config(codec); |
| 2653 | if (err < 0) |
| 2654 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2655 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2656 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2657 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2658 | if (err < 0) |
| 2659 | goto error; |
| 2660 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2661 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2662 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2663 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2664 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2665 | |
| 2666 | error: |
| 2667 | alc_free(codec); |
| 2668 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2669 | } |
| 2670 | |
| 2671 | |
| 2672 | /* |
| 2673 | * ALC262 support |
| 2674 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2675 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2676 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2677 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2678 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2679 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2680 | } |
| 2681 | |
| 2682 | /* |
| 2683 | * Pin config fixes |
| 2684 | */ |
| 2685 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2686 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2687 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2688 | ALC262_FIXUP_HP_Z200, |
| 2689 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2690 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2691 | ALC262_FIXUP_BENQ, |
| 2692 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2693 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2694 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2695 | }; |
| 2696 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2697 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2698 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2699 | .type = HDA_FIXUP_PINS, |
| 2700 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2701 | { 0x14, 0x99130110 }, /* speaker */ |
| 2702 | { 0x15, 0x0221142f }, /* front HP */ |
| 2703 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2704 | { } |
| 2705 | } |
| 2706 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2707 | [ALC262_FIXUP_FSC_S7110] = { |
| 2708 | .type = HDA_FIXUP_PINS, |
| 2709 | .v.pins = (const struct hda_pintbl[]) { |
| 2710 | { 0x15, 0x90170110 }, /* speaker */ |
| 2711 | { } |
| 2712 | }, |
| 2713 | .chained = true, |
| 2714 | .chain_id = ALC262_FIXUP_BENQ, |
| 2715 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2716 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2717 | .type = HDA_FIXUP_PINS, |
| 2718 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2719 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2720 | { } |
| 2721 | } |
| 2722 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2723 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2724 | .type = HDA_FIXUP_PINS, |
| 2725 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2726 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2727 | { } |
| 2728 | } |
| 2729 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2730 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2731 | .type = HDA_FIXUP_PINCTLS, |
| 2732 | .v.pins = (const struct hda_pintbl[]) { |
| 2733 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2734 | {} |
| 2735 | }, |
| 2736 | .chained = true, |
| 2737 | .chain_id = ALC262_FIXUP_BENQ, |
| 2738 | }, |
| 2739 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2740 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2741 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2742 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2743 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2744 | {} |
| 2745 | } |
| 2746 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2747 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2748 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2749 | .v.verbs = (const struct hda_verb[]) { |
| 2750 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2751 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2752 | {} |
| 2753 | } |
| 2754 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2755 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2756 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2757 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2758 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2759 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2760 | .type = HDA_FIXUP_FUNC, |
| 2761 | .v.func = alc_fixup_no_depop_delay, |
| 2762 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2763 | }; |
| 2764 | |
| 2765 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2766 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2767 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2768 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2769 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
Takashi Iwai | 275ec0c | 2018-06-22 12:17:45 +0200 | [diff] [blame] | 2770 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2771 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2772 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2773 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2774 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2775 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2776 | {} |
| 2777 | }; |
| 2778 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2779 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2780 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e43c44d | 2018-06-26 17:02:08 +0200 | [diff] [blame] | 2781 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
| 2782 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, |
| 2783 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, |
| 2784 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, |
| 2785 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, |
| 2786 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, |
| 2787 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, |
| 2788 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2789 | {} |
| 2790 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2791 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2792 | /* |
| 2793 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2794 | static int patch_alc262(struct hda_codec *codec) |
| 2795 | { |
| 2796 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2797 | int err; |
| 2798 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2799 | err = alc_alloc_spec(codec, 0x0b); |
| 2800 | if (err < 0) |
| 2801 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2802 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2803 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2804 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2805 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2806 | spec->shutup = alc_eapd_shutup; |
| 2807 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2808 | #if 0 |
| 2809 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2810 | * under-run |
| 2811 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2812 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2813 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2814 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2815 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2816 | alc_pre_init(codec); |
| 2817 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2818 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2819 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2820 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2821 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2822 | alc_auto_parse_customize_define(codec); |
| 2823 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2824 | if (has_cdefine_beep(codec)) |
| 2825 | spec->gen.beep_nid = 0x01; |
| 2826 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2827 | /* automatic parse from the BIOS config */ |
| 2828 | err = alc262_parse_auto_config(codec); |
| 2829 | if (err < 0) |
| 2830 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2831 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2832 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2833 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2834 | if (err < 0) |
| 2835 | goto error; |
| 2836 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2837 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2838 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2839 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2840 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2841 | |
| 2842 | error: |
| 2843 | alc_free(codec); |
| 2844 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2845 | } |
| 2846 | |
| 2847 | /* |
| 2848 | * ALC268 |
| 2849 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2850 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2851 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 2852 | struct snd_ctl_elem_value *ucontrol) |
| 2853 | { |
| 2854 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2855 | unsigned long pval; |
| 2856 | int err; |
| 2857 | |
| 2858 | mutex_lock(&codec->control_mutex); |
| 2859 | pval = kcontrol->private_value; |
| 2860 | kcontrol->private_value = (pval & ~0xff) | 0x0f; |
| 2861 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2862 | if (err >= 0) { |
| 2863 | kcontrol->private_value = (pval & ~0xff) | 0x10; |
| 2864 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2865 | } |
| 2866 | kcontrol->private_value = pval; |
| 2867 | mutex_unlock(&codec->control_mutex); |
| 2868 | return err; |
| 2869 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2870 | |
| 2871 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2872 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2873 | { |
| 2874 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2875 | .name = "Beep Playback Switch", |
| 2876 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
| 2877 | .info = snd_hda_mixer_amp_switch_info, |
| 2878 | .get = snd_hda_mixer_amp_switch_get, |
| 2879 | .put = alc268_beep_switch_put, |
| 2880 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) |
| 2881 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2882 | }; |
| 2883 | |
| 2884 | /* set PCBEEP vol = 0, mute connections */ |
| 2885 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2886 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2887 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2888 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2889 | { } |
| 2890 | }; |
| 2891 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2892 | enum { |
| 2893 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2894 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2895 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2896 | }; |
| 2897 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2898 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2899 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2900 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2901 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2902 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2903 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2904 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2905 | .v.verbs = (const struct hda_verb[]) { |
| 2906 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2907 | {} |
| 2908 | } |
| 2909 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2910 | [ALC268_FIXUP_SPDIF] = { |
| 2911 | .type = HDA_FIXUP_PINS, |
| 2912 | .v.pins = (const struct hda_pintbl[]) { |
| 2913 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2914 | {} |
| 2915 | } |
| 2916 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2917 | }; |
| 2918 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2919 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2920 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2921 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
Takashi Iwai | 03bf11c | 2018-06-26 16:56:41 +0200 | [diff] [blame] | 2922 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2923 | {} |
| 2924 | }; |
| 2925 | |
| 2926 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2927 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2928 | 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] | 2929 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2930 | * same PCI SSID 1179:ff00 |
| 2931 | */ |
| 2932 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2933 | {} |
| 2934 | }; |
| 2935 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2936 | /* |
| 2937 | * BIOS auto configuration |
| 2938 | */ |
| 2939 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2940 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2941 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2942 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2943 | } |
| 2944 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2945 | /* |
| 2946 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2947 | static int patch_alc268(struct hda_codec *codec) |
| 2948 | { |
| 2949 | struct alc_spec *spec; |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2950 | int i, err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2951 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2952 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2953 | err = alc_alloc_spec(codec, 0); |
| 2954 | if (err < 0) |
| 2955 | return err; |
| 2956 | |
| 2957 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 2958 | if (has_cdefine_beep(codec)) |
| 2959 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2960 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2961 | spec->shutup = alc_eapd_shutup; |
| 2962 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2963 | alc_pre_init(codec); |
| 2964 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2965 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2966 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2967 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2968 | /* automatic parse from the BIOS config */ |
| 2969 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2970 | if (err < 0) |
| 2971 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2972 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2973 | if (err > 0 && !spec->gen.no_analog && |
| 2974 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2975 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
| 2976 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 2977 | &alc268_beep_mixer[i])) { |
| 2978 | err = -ENOMEM; |
| 2979 | goto error; |
| 2980 | } |
| 2981 | } |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2982 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2983 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2984 | /* override the amp caps for beep generator */ |
| 2985 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2986 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2987 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2988 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2989 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2990 | } |
| 2991 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2992 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2993 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2994 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2995 | |
| 2996 | error: |
| 2997 | alc_free(codec); |
| 2998 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2999 | } |
| 3000 | |
| 3001 | /* |
| 3002 | * ALC269 |
| 3003 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3004 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3005 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3006 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3007 | }; |
| 3008 | |
| 3009 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3010 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3011 | }; |
| 3012 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3013 | /* different alc269-variants */ |
| 3014 | enum { |
| 3015 | ALC269_TYPE_ALC269VA, |
| 3016 | ALC269_TYPE_ALC269VB, |
| 3017 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3018 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3019 | ALC269_TYPE_ALC280, |
| 3020 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3021 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3022 | ALC269_TYPE_ALC284, |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 3023 | ALC269_TYPE_ALC293, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 3024 | ALC269_TYPE_ALC286, |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 3025 | ALC269_TYPE_ALC298, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 3026 | ALC269_TYPE_ALC255, |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 3027 | ALC269_TYPE_ALC256, |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 3028 | ALC269_TYPE_ALC257, |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 3029 | ALC269_TYPE_ALC215, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 3030 | ALC269_TYPE_ALC225, |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 3031 | ALC269_TYPE_ALC294, |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 3032 | ALC269_TYPE_ALC300, |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 3033 | ALC269_TYPE_ALC623, |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 3034 | ALC269_TYPE_ALC700, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3035 | }; |
| 3036 | |
| 3037 | /* |
| 3038 | * BIOS auto configuration |
| 3039 | */ |
| 3040 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 3041 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3042 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 3043 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 3044 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 3045 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3046 | const hda_nid_t *ssids; |
| 3047 | |
| 3048 | switch (spec->codec_variant) { |
| 3049 | case ALC269_TYPE_ALC269VA: |
| 3050 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3051 | case ALC269_TYPE_ALC280: |
| 3052 | case ALC269_TYPE_ALC284: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 3053 | case ALC269_TYPE_ALC293: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3054 | ssids = alc269va_ssids; |
| 3055 | break; |
| 3056 | case ALC269_TYPE_ALC269VB: |
| 3057 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3058 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3059 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 3060 | case ALC269_TYPE_ALC286: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 3061 | case ALC269_TYPE_ALC298: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 3062 | case ALC269_TYPE_ALC255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 3063 | case ALC269_TYPE_ALC256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 3064 | case ALC269_TYPE_ALC257: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 3065 | case ALC269_TYPE_ALC215: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 3066 | case ALC269_TYPE_ALC225: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 3067 | case ALC269_TYPE_ALC294: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 3068 | case ALC269_TYPE_ALC300: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 3069 | case ALC269_TYPE_ALC623: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 3070 | case ALC269_TYPE_ALC700: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3071 | ssids = alc269_ssids; |
| 3072 | break; |
| 3073 | default: |
| 3074 | ssids = alc269_ssids; |
| 3075 | break; |
| 3076 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3077 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 3078 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3079 | } |
| 3080 | |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3081 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
| 3082 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, |
| 3083 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, |
| 3084 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, |
| 3085 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, |
| 3086 | {} |
| 3087 | }; |
| 3088 | |
| 3089 | static void alc_headset_btn_callback(struct hda_codec *codec, |
| 3090 | struct hda_jack_callback *jack) |
| 3091 | { |
| 3092 | int report = 0; |
| 3093 | |
| 3094 | if (jack->unsol_res & (7 << 13)) |
| 3095 | report |= SND_JACK_BTN_0; |
| 3096 | |
| 3097 | if (jack->unsol_res & (1 << 16 | 3 << 8)) |
| 3098 | report |= SND_JACK_BTN_1; |
| 3099 | |
| 3100 | /* Volume up key */ |
| 3101 | if (jack->unsol_res & (7 << 23)) |
| 3102 | report |= SND_JACK_BTN_2; |
| 3103 | |
| 3104 | /* Volume down key */ |
| 3105 | if (jack->unsol_res & (7 << 10)) |
| 3106 | report |= SND_JACK_BTN_3; |
| 3107 | |
Hui Wang | 04f7791 | 2021-03-05 17:26:08 +0800 | [diff] [blame] | 3108 | snd_hda_jack_set_button_state(codec, jack->nid, report); |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3109 | } |
| 3110 | |
| 3111 | static void alc_disable_headset_jack_key(struct hda_codec *codec) |
| 3112 | { |
| 3113 | struct alc_spec *spec = codec->spec; |
| 3114 | |
| 3115 | if (!spec->has_hs_key) |
| 3116 | return; |
| 3117 | |
| 3118 | switch (codec->core.vendor_id) { |
| 3119 | case 0x10ec0215: |
| 3120 | case 0x10ec0225: |
| 3121 | case 0x10ec0285: |
Hui Wang | c72b9bf | 2020-12-05 13:11:30 +0800 | [diff] [blame] | 3122 | case 0x10ec0287: |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3123 | case 0x10ec0295: |
| 3124 | case 0x10ec0289: |
| 3125 | case 0x10ec0299: |
| 3126 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3127 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3128 | alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); |
| 3129 | break; |
| 3130 | case 0x10ec0236: |
| 3131 | case 0x10ec0256: |
| 3132 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3133 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3134 | break; |
| 3135 | } |
| 3136 | } |
| 3137 | |
| 3138 | static void alc_enable_headset_jack_key(struct hda_codec *codec) |
| 3139 | { |
| 3140 | struct alc_spec *spec = codec->spec; |
| 3141 | |
| 3142 | if (!spec->has_hs_key) |
| 3143 | return; |
| 3144 | |
| 3145 | switch (codec->core.vendor_id) { |
| 3146 | case 0x10ec0215: |
| 3147 | case 0x10ec0225: |
| 3148 | case 0x10ec0285: |
Hui Wang | c72b9bf | 2020-12-05 13:11:30 +0800 | [diff] [blame] | 3149 | case 0x10ec0287: |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3150 | case 0x10ec0295: |
| 3151 | case 0x10ec0289: |
| 3152 | case 0x10ec0299: |
| 3153 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3154 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3155 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); |
| 3156 | break; |
| 3157 | case 0x10ec0236: |
| 3158 | case 0x10ec0256: |
| 3159 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3160 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3161 | break; |
| 3162 | } |
| 3163 | } |
| 3164 | |
| 3165 | static void alc_fixup_headset_jack(struct hda_codec *codec, |
| 3166 | const struct hda_fixup *fix, int action) |
| 3167 | { |
| 3168 | struct alc_spec *spec = codec->spec; |
Hui Wang | 04f7791 | 2021-03-05 17:26:08 +0800 | [diff] [blame] | 3169 | hda_nid_t hp_pin; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3170 | |
| 3171 | switch (action) { |
| 3172 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 3173 | spec->has_hs_key = 1; |
| 3174 | snd_hda_jack_detect_enable_callback(codec, 0x55, |
| 3175 | alc_headset_btn_callback); |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3176 | break; |
Hui Wang | 04f7791 | 2021-03-05 17:26:08 +0800 | [diff] [blame] | 3177 | case HDA_FIXUP_ACT_BUILD: |
| 3178 | hp_pin = alc_get_hp_pin(spec); |
| 3179 | if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55, |
| 3180 | alc_headset_btn_keymap, |
| 3181 | hp_pin)) |
| 3182 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", |
| 3183 | false, SND_JACK_HEADSET, |
| 3184 | alc_headset_btn_keymap); |
| 3185 | |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3186 | alc_enable_headset_jack_key(codec); |
| 3187 | break; |
| 3188 | } |
| 3189 | } |
| 3190 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3191 | 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] | 3192 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3193 | 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] | 3194 | } |
| 3195 | |
| 3196 | static void alc269_shutup(struct hda_codec *codec) |
| 3197 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3198 | struct alc_spec *spec = codec->spec; |
| 3199 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3200 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3201 | alc269vb_toggle_power_output(codec, 0); |
| 3202 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 3203 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3204 | msleep(150); |
| 3205 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3206 | alc_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3207 | } |
| 3208 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3209 | static const struct coef_fw alc282_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3210 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 3211 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3212 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3213 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3214 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3215 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3216 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3217 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 3218 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3219 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3220 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 3221 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 3222 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 3223 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 3224 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3225 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3226 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3227 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 3228 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 3229 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 3230 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 3231 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 3232 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 3233 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 3234 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3235 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 3236 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 3237 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 3238 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 3239 | {} |
| 3240 | }; |
| 3241 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3242 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 3243 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3244 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3245 | } |
| 3246 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3247 | static void alc282_init(struct hda_codec *codec) |
| 3248 | { |
| 3249 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3250 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3251 | bool hp_pin_sense; |
| 3252 | int coef78; |
| 3253 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3254 | alc282_restore_default_value(codec); |
| 3255 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3256 | if (!hp_pin) |
| 3257 | return; |
| 3258 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3259 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3260 | |
| 3261 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 3262 | /* Headphone capless set to high power mode */ |
| 3263 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3264 | |
| 3265 | if (hp_pin_sense) |
| 3266 | msleep(2); |
| 3267 | |
| 3268 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3269 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3270 | |
| 3271 | if (hp_pin_sense) |
| 3272 | msleep(85); |
| 3273 | |
| 3274 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3275 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3276 | |
| 3277 | if (hp_pin_sense) |
| 3278 | msleep(100); |
| 3279 | |
| 3280 | /* Headphone capless set to normal mode */ |
| 3281 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3282 | } |
| 3283 | |
| 3284 | static void alc282_shutup(struct hda_codec *codec) |
| 3285 | { |
| 3286 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3287 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3288 | bool hp_pin_sense; |
| 3289 | int coef78; |
| 3290 | |
| 3291 | if (!hp_pin) { |
| 3292 | alc269_shutup(codec); |
| 3293 | return; |
| 3294 | } |
| 3295 | |
| 3296 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3297 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3298 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3299 | |
| 3300 | if (hp_pin_sense) |
| 3301 | msleep(2); |
| 3302 | |
| 3303 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3304 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3305 | |
| 3306 | if (hp_pin_sense) |
| 3307 | msleep(85); |
| 3308 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3309 | if (!spec->no_shutup_pins) |
| 3310 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3311 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3312 | |
| 3313 | if (hp_pin_sense) |
| 3314 | msleep(100); |
| 3315 | |
| 3316 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3317 | alc_shutup_pins(codec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3318 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3319 | } |
| 3320 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3321 | static const struct coef_fw alc283_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3322 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3323 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3324 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3325 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3326 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3327 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3328 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3329 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 3330 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3331 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3332 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 3333 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 3334 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 3335 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 3336 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3337 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3338 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3339 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 3340 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 3341 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 3342 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 3343 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 3344 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 3345 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 3346 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3347 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 3348 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 3349 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 3350 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 3351 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 3352 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 3353 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3354 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3355 | {} |
| 3356 | }; |
| 3357 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3358 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 3359 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3360 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3361 | } |
| 3362 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3363 | static void alc283_init(struct hda_codec *codec) |
| 3364 | { |
| 3365 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3366 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3367 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3368 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3369 | alc283_restore_default_value(codec); |
| 3370 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3371 | if (!hp_pin) |
| 3372 | return; |
Kailang Yang | a59d719 | 2015-04-08 16:34:00 +0800 | [diff] [blame] | 3373 | |
| 3374 | msleep(30); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3375 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3376 | |
| 3377 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 3378 | /* Headphone capless set to high power mode */ |
| 3379 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3380 | |
| 3381 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3382 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3383 | |
| 3384 | if (hp_pin_sense) |
| 3385 | msleep(85); |
| 3386 | |
| 3387 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3388 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3389 | |
| 3390 | if (hp_pin_sense) |
| 3391 | msleep(85); |
| 3392 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3393 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3394 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3395 | /* Headphone capless set to normal mode */ |
| 3396 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3397 | } |
| 3398 | |
| 3399 | static void alc283_shutup(struct hda_codec *codec) |
| 3400 | { |
| 3401 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3402 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3403 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3404 | |
| 3405 | if (!hp_pin) { |
| 3406 | alc269_shutup(codec); |
| 3407 | return; |
| 3408 | } |
| 3409 | |
| 3410 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3411 | |
| 3412 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3413 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 3414 | /*depop hp during suspend*/ |
| 3415 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 3416 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3417 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3418 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3419 | |
| 3420 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3421 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3422 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3423 | if (!spec->no_shutup_pins) |
| 3424 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3425 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3426 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3427 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3428 | |
| 3429 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3430 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3431 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3432 | alc_shutup_pins(codec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3433 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3434 | } |
| 3435 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3436 | static void alc256_init(struct hda_codec *codec) |
| 3437 | { |
| 3438 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3439 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3440 | bool hp_pin_sense; |
| 3441 | |
| 3442 | if (!hp_pin) |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3443 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3444 | |
| 3445 | msleep(30); |
| 3446 | |
| 3447 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3448 | |
| 3449 | if (hp_pin_sense) |
| 3450 | msleep(2); |
| 3451 | |
| 3452 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3453 | if (spec->ultra_low_power) { |
| 3454 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); |
| 3455 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); |
| 3456 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); |
| 3457 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); |
| 3458 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3459 | msleep(30); |
| 3460 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3461 | |
| 3462 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3463 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3464 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3465 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3466 | msleep(85); |
| 3467 | |
| 3468 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3469 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3470 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3471 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3472 | msleep(100); |
| 3473 | |
| 3474 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
| 3475 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 3476 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
| 3477 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 3478 | /* |
| 3479 | * Expose headphone mic (or possibly Line In on some machines) instead |
| 3480 | * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See |
| 3481 | * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of |
| 3482 | * this register. |
| 3483 | */ |
| 3484 | alc_write_coef_idx(codec, 0x36, 0x5757); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3485 | } |
| 3486 | |
| 3487 | static void alc256_shutup(struct hda_codec *codec) |
| 3488 | { |
| 3489 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3490 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3491 | bool hp_pin_sense; |
| 3492 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3493 | if (!hp_pin) |
| 3494 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3495 | |
| 3496 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3497 | |
| 3498 | if (hp_pin_sense) |
| 3499 | msleep(2); |
| 3500 | |
| 3501 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3502 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3503 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3504 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3505 | msleep(85); |
| 3506 | |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3507 | /* 3k pull low control for Headset jack. */ |
| 3508 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
Hui Wang | 3f74249 | 2020-09-14 14:51:18 +0800 | [diff] [blame] | 3509 | /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly |
| 3510 | * when booting with headset plugged. So skip setting it for the codec alc257 |
| 3511 | */ |
| 3512 | if (codec->core.vendor_id != 0x10ec0257) |
| 3513 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3514 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3515 | if (!spec->no_shutup_pins) |
| 3516 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3517 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3518 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3519 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3520 | msleep(100); |
| 3521 | |
| 3522 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3523 | alc_shutup_pins(codec); |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3524 | if (spec->ultra_low_power) { |
| 3525 | msleep(50); |
| 3526 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); |
| 3527 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); |
| 3528 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); |
| 3529 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); |
| 3530 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3531 | msleep(30); |
| 3532 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3533 | } |
| 3534 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3535 | static void alc225_init(struct hda_codec *codec) |
| 3536 | { |
| 3537 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3538 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3539 | bool hp1_pin_sense, hp2_pin_sense; |
| 3540 | |
| 3541 | if (!hp_pin) |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3542 | hp_pin = 0x21; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3543 | msleep(30); |
| 3544 | |
| 3545 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3546 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3547 | |
| 3548 | if (hp1_pin_sense || hp2_pin_sense) |
| 3549 | msleep(2); |
| 3550 | |
| 3551 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3552 | if (spec->ultra_low_power) { |
| 3553 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); |
| 3554 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3555 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); |
| 3556 | msleep(30); |
| 3557 | } |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3558 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3559 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3560 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3561 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3562 | if (hp2_pin_sense) |
| 3563 | snd_hda_codec_write(codec, 0x16, 0, |
| 3564 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3565 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3566 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3567 | msleep(85); |
| 3568 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3569 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3570 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3571 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3572 | if (hp2_pin_sense) |
| 3573 | snd_hda_codec_write(codec, 0x16, 0, |
| 3574 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3575 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3576 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3577 | msleep(100); |
| 3578 | |
| 3579 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3580 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
| 3581 | } |
| 3582 | |
| 3583 | static void alc225_shutup(struct hda_codec *codec) |
| 3584 | { |
| 3585 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3586 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3587 | bool hp1_pin_sense, hp2_pin_sense; |
| 3588 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3589 | if (!hp_pin) |
| 3590 | hp_pin = 0x21; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3591 | |
| 3592 | alc_disable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3593 | /* 3k pull low control for Headset jack. */ |
| 3594 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); |
| 3595 | |
| 3596 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3597 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3598 | |
| 3599 | if (hp1_pin_sense || hp2_pin_sense) |
| 3600 | msleep(2); |
| 3601 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3602 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3603 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3604 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3605 | if (hp2_pin_sense) |
| 3606 | snd_hda_codec_write(codec, 0x16, 0, |
| 3607 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3608 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3609 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3610 | msleep(85); |
| 3611 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3612 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3613 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3614 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3615 | if (hp2_pin_sense) |
| 3616 | snd_hda_codec_write(codec, 0x16, 0, |
| 3617 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3618 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3619 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3620 | msleep(100); |
| 3621 | |
| 3622 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3623 | alc_shutup_pins(codec); |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3624 | if (spec->ultra_low_power) { |
| 3625 | msleep(50); |
| 3626 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); |
| 3627 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3628 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); |
| 3629 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); |
| 3630 | msleep(30); |
| 3631 | } |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3632 | |
| 3633 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3634 | alc_enable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3635 | } |
| 3636 | |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3637 | static void alc_default_init(struct hda_codec *codec) |
| 3638 | { |
| 3639 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3640 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3641 | bool hp_pin_sense; |
| 3642 | |
| 3643 | if (!hp_pin) |
| 3644 | return; |
| 3645 | |
| 3646 | msleep(30); |
| 3647 | |
| 3648 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3649 | |
| 3650 | if (hp_pin_sense) |
| 3651 | msleep(2); |
| 3652 | |
| 3653 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3654 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3655 | |
| 3656 | if (hp_pin_sense) |
| 3657 | msleep(85); |
| 3658 | |
| 3659 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3660 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3661 | |
| 3662 | if (hp_pin_sense) |
| 3663 | msleep(100); |
| 3664 | } |
| 3665 | |
| 3666 | static void alc_default_shutup(struct hda_codec *codec) |
| 3667 | { |
| 3668 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3669 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3670 | bool hp_pin_sense; |
| 3671 | |
| 3672 | if (!hp_pin) { |
| 3673 | alc269_shutup(codec); |
| 3674 | return; |
| 3675 | } |
| 3676 | |
| 3677 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3678 | |
| 3679 | if (hp_pin_sense) |
| 3680 | msleep(2); |
| 3681 | |
| 3682 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3683 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3684 | |
| 3685 | if (hp_pin_sense) |
| 3686 | msleep(85); |
| 3687 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3688 | if (!spec->no_shutup_pins) |
| 3689 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3690 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3691 | |
| 3692 | if (hp_pin_sense) |
| 3693 | msleep(100); |
| 3694 | |
| 3695 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3696 | alc_shutup_pins(codec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3697 | } |
| 3698 | |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3699 | static void alc294_hp_init(struct hda_codec *codec) |
| 3700 | { |
| 3701 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3702 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3703 | int i, val; |
| 3704 | |
| 3705 | if (!hp_pin) |
| 3706 | return; |
| 3707 | |
| 3708 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3709 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3710 | |
| 3711 | msleep(100); |
| 3712 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3713 | if (!spec->no_shutup_pins) |
| 3714 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3715 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3716 | |
| 3717 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ |
| 3718 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ |
| 3719 | |
| 3720 | /* Wait for depop procedure finish */ |
| 3721 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3722 | for (i = 0; i < 20 && val & 0x0080; i++) { |
| 3723 | msleep(50); |
| 3724 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3725 | } |
| 3726 | /* Set HP depop to auto mode */ |
| 3727 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); |
| 3728 | msleep(50); |
| 3729 | } |
| 3730 | |
| 3731 | static void alc294_init(struct hda_codec *codec) |
| 3732 | { |
| 3733 | struct alc_spec *spec = codec->spec; |
| 3734 | |
Takashi Iwai | f6ef4e0 | 2019-01-29 14:14:51 +0100 | [diff] [blame] | 3735 | /* required only at boot or S4 resume time */ |
| 3736 | if (!spec->done_hp_init || |
| 3737 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3738 | alc294_hp_init(codec); |
| 3739 | spec->done_hp_init = true; |
| 3740 | } |
| 3741 | alc_default_init(codec); |
| 3742 | } |
| 3743 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3744 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3745 | unsigned int val) |
| 3746 | { |
| 3747 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3748 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3749 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3750 | } |
| 3751 | |
| 3752 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3753 | { |
| 3754 | unsigned int val; |
| 3755 | |
| 3756 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3757 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3758 | & 0xffff; |
| 3759 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3760 | << 16; |
| 3761 | return val; |
| 3762 | } |
| 3763 | |
| 3764 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3765 | { |
| 3766 | unsigned int val; |
| 3767 | |
| 3768 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3769 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3770 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3771 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3772 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3773 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3774 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3775 | val = alc5505_coef_get(codec, 0x6220); |
| 3776 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3777 | } |
| 3778 | |
| 3779 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3780 | { |
| 3781 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3782 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3783 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3784 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3785 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3786 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3787 | } |
| 3788 | |
| 3789 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3790 | { |
| 3791 | unsigned int val; |
| 3792 | |
| 3793 | alc5505_dsp_halt(codec); |
| 3794 | alc5505_dsp_back_from_halt(codec); |
| 3795 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3796 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3797 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3798 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3799 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3800 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3801 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3802 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3803 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3804 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3805 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3806 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3807 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3808 | |
| 3809 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3810 | if (val <= 3) |
| 3811 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3812 | else |
| 3813 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3814 | |
| 3815 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3816 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3817 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3818 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3819 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3820 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3821 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3822 | |
| 3823 | #ifdef HALT_REALTEK_ALC5505 |
| 3824 | alc5505_dsp_halt(codec); |
| 3825 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3826 | } |
| 3827 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3828 | #ifdef HALT_REALTEK_ALC5505 |
Pierre-Louis Bossart | 8a71821 | 2020-01-11 15:47:35 -0600 | [diff] [blame] | 3829 | #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ |
| 3830 | #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3831 | #else |
| 3832 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3833 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3834 | #endif |
| 3835 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3836 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3837 | static int alc269_suspend(struct hda_codec *codec) |
| 3838 | { |
| 3839 | struct alc_spec *spec = codec->spec; |
| 3840 | |
| 3841 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3842 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3843 | return alc_suspend(codec); |
| 3844 | } |
| 3845 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3846 | static int alc269_resume(struct hda_codec *codec) |
| 3847 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3848 | struct alc_spec *spec = codec->spec; |
| 3849 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3850 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3851 | alc269vb_toggle_power_output(codec, 0); |
| 3852 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3853 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3854 | msleep(150); |
| 3855 | } |
| 3856 | |
| 3857 | codec->patch_ops.init(codec); |
| 3858 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3859 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3860 | alc269vb_toggle_power_output(codec, 1); |
| 3861 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3862 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3863 | msleep(200); |
| 3864 | } |
| 3865 | |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 3866 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3867 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3868 | |
| 3869 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3870 | * suspend, and won't restore the data after resume, so we restore it |
| 3871 | * in the driver. |
| 3872 | */ |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 3873 | if (spec->gpio_data) |
| 3874 | alc_write_gpio_data(codec); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3875 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3876 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3877 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3878 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3879 | return 0; |
| 3880 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3881 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3882 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3883 | 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] | 3884 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3885 | { |
| 3886 | struct alc_spec *spec = codec->spec; |
| 3887 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3888 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3889 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3890 | } |
| 3891 | |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 3892 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
| 3893 | const struct hda_fixup *fix, |
| 3894 | int action) |
| 3895 | { |
| 3896 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); |
| 3897 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); |
| 3898 | |
| 3899 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) |
| 3900 | snd_hda_codec_set_pincfg(codec, 0x19, |
| 3901 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | |
| 3902 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); |
| 3903 | } |
| 3904 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3905 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3906 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3907 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3908 | if (action == HDA_FIXUP_ACT_INIT) |
| 3909 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3910 | } |
| 3911 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3912 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3913 | const struct hda_fixup *fix, int action) |
| 3914 | { |
| 3915 | struct alc_spec *spec = codec->spec; |
| 3916 | |
| 3917 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3918 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3919 | } |
| 3920 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3921 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3922 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3923 | { |
| 3924 | static const struct hda_verb verbs[] = { |
| 3925 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3926 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3927 | {} |
| 3928 | }; |
| 3929 | unsigned int cfg; |
| 3930 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3931 | if (strcmp(codec->core.chip_name, "ALC271X") && |
| 3932 | strcmp(codec->core.chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3933 | return; |
| 3934 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3935 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3936 | snd_hda_sequence_write(codec, verbs); |
| 3937 | } |
| 3938 | |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 3939 | /* Fix the speaker amp after resume, etc */ |
| 3940 | static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec, |
| 3941 | const struct hda_fixup *fix, |
| 3942 | int action) |
| 3943 | { |
| 3944 | if (action == HDA_FIXUP_ACT_INIT) |
| 3945 | alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000); |
| 3946 | } |
| 3947 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3948 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3949 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3950 | { |
| 3951 | struct alc_spec *spec = codec->spec; |
| 3952 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3953 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3954 | return; |
| 3955 | |
| 3956 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3957 | * fix the sample rate of analog I/O to 44.1kHz |
| 3958 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3959 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3960 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3961 | } |
| 3962 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3963 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3964 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3965 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3966 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3967 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3968 | * Below is a workaround specific to ALC269 to control the dmic |
| 3969 | * signal source as mono. |
| 3970 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3971 | if (action == HDA_FIXUP_ACT_INIT) |
| 3972 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3973 | } |
| 3974 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3975 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3976 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3977 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3978 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3979 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3980 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3981 | } |
| 3982 | |
| 3983 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3984 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3985 | { |
| 3986 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3987 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3988 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3989 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3990 | } |
| 3991 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3992 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3993 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3994 | { |
| 3995 | struct alc_spec *spec = codec->spec; |
| 3996 | int vref; |
| 3997 | msleep(200); |
| 3998 | snd_hda_gen_hp_automute(codec, jack); |
| 3999 | |
| 4000 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 4001 | msleep(100); |
| 4002 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 4003 | vref); |
| 4004 | msleep(500); |
| 4005 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 4006 | vref); |
| 4007 | } |
| 4008 | |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 4009 | /* |
| 4010 | * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) |
| 4011 | */ |
| 4012 | struct hda_alc298_mbxinit { |
| 4013 | unsigned char value_0x23; |
| 4014 | unsigned char value_0x25; |
| 4015 | }; |
| 4016 | |
| 4017 | static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, |
| 4018 | const struct hda_alc298_mbxinit *initval, |
| 4019 | bool first) |
| 4020 | { |
| 4021 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); |
| 4022 | alc_write_coef_idx(codec, 0x26, 0xb000); |
| 4023 | |
| 4024 | if (first) |
| 4025 | snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); |
| 4026 | |
| 4027 | snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 4028 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 4029 | alc_write_coef_idx(codec, 0x23, initval->value_0x23); |
| 4030 | |
| 4031 | if (initval->value_0x23 != 0x1e) |
| 4032 | alc_write_coef_idx(codec, 0x25, initval->value_0x25); |
| 4033 | |
| 4034 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 4035 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 4036 | } |
| 4037 | |
| 4038 | static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, |
| 4039 | const struct hda_fixup *fix, |
| 4040 | int action) |
| 4041 | { |
| 4042 | /* Initialization magic */ |
| 4043 | static const struct hda_alc298_mbxinit dac_init[] = { |
| 4044 | {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, |
| 4045 | {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, |
| 4046 | {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, |
| 4047 | {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, |
| 4048 | {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, |
| 4049 | {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, |
| 4050 | {0x2f, 0x00}, |
| 4051 | {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, |
| 4052 | {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, |
| 4053 | {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, |
| 4054 | {} |
| 4055 | }; |
| 4056 | const struct hda_alc298_mbxinit *seq; |
| 4057 | |
| 4058 | if (action != HDA_FIXUP_ACT_INIT) |
| 4059 | return; |
| 4060 | |
| 4061 | /* Start */ |
| 4062 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); |
| 4063 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 4064 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 4065 | alc_write_coef_idx(codec, 0x22, 0x31); |
| 4066 | alc_write_coef_idx(codec, 0x23, 0x0b); |
| 4067 | alc_write_coef_idx(codec, 0x25, 0x00); |
| 4068 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 4069 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 4070 | |
| 4071 | for (seq = dac_init; seq->value_0x23; seq++) |
| 4072 | alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); |
| 4073 | } |
| 4074 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4075 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 4076 | const struct hda_fixup *fix, int action) |
| 4077 | { |
| 4078 | struct alc_spec *spec = codec->spec; |
| 4079 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4080 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4081 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 4082 | } |
| 4083 | } |
| 4084 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4085 | static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, |
| 4086 | bool polarity, bool on) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4087 | { |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4088 | unsigned int pinval; |
| 4089 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4090 | if (!pin) |
| 4091 | return; |
| 4092 | if (polarity) |
| 4093 | on = !on; |
| 4094 | pinval = snd_hda_codec_get_pin_target(codec, pin); |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 4095 | pinval &= ~AC_PINCTL_VREFEN; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4096 | pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; |
| 4097 | /* temporarily power up/down for setting VREF */ |
| 4098 | snd_hda_power_up_pm(codec); |
| 4099 | snd_hda_set_pin_ctl_cache(codec, pin, pinval); |
| 4100 | snd_hda_power_down_pm(codec); |
| 4101 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4102 | |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4103 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4104 | static int vref_mute_led_set(struct led_classdev *led_cdev, |
| 4105 | enum led_brightness brightness) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4106 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4107 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4108 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4109 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4110 | alc_update_vref_led(codec, spec->mute_led_nid, |
| 4111 | spec->mute_led_polarity, brightness); |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4112 | return 0; |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4113 | } |
| 4114 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4115 | /* Make sure the led works even in runtime suspend */ |
| 4116 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 4117 | hda_nid_t nid, |
| 4118 | unsigned int power_state) |
| 4119 | { |
| 4120 | struct alc_spec *spec = codec->spec; |
| 4121 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4122 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 4123 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4124 | return power_state; |
| 4125 | |
| 4126 | /* Set pin ctl again, it might have just been set to 0 */ |
| 4127 | snd_hda_set_pin_ctl(codec, nid, |
| 4128 | snd_hda_codec_get_pin_target(codec, nid)); |
| 4129 | |
Takashi Iwai | cffd396 | 2015-04-09 10:30:25 +0200 | [diff] [blame] | 4130 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4131 | } |
| 4132 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4133 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 4134 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4135 | { |
| 4136 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4137 | const struct dmi_device *dev = NULL; |
| 4138 | |
| 4139 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4140 | return; |
| 4141 | |
| 4142 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 4143 | int pol, pin; |
| 4144 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 4145 | continue; |
| 4146 | if (pin < 0x0a || pin >= 0x10) |
| 4147 | break; |
| 4148 | spec->mute_led_polarity = pol; |
| 4149 | spec->mute_led_nid = pin - 0x0a + 0x18; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4150 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4151 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4152 | codec_dbg(codec, |
| 4153 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4154 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4155 | break; |
| 4156 | } |
| 4157 | } |
| 4158 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4159 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
| 4160 | const struct hda_fixup *fix, |
| 4161 | int action, hda_nid_t pin) |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4162 | { |
| 4163 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4164 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4165 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4166 | spec->mute_led_polarity = 0; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4167 | spec->mute_led_nid = pin; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4168 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4169 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4170 | } |
| 4171 | } |
| 4172 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4173 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 4174 | const struct hda_fixup *fix, int action) |
| 4175 | { |
| 4176 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); |
| 4177 | } |
| 4178 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4179 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 4180 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4181 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4182 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4183 | } |
| 4184 | |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4185 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
| 4186 | const struct hda_fixup *fix, int action) |
| 4187 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4188 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4189 | } |
| 4190 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4191 | /* update LED status via GPIO */ |
| 4192 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 4193 | int polarity, bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4194 | { |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 4195 | if (polarity) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4196 | enabled = !enabled; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 4197 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4198 | } |
| 4199 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4200 | /* turn on/off mute LED via GPIO per vmaster hook */ |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4201 | static int gpio_mute_led_set(struct led_classdev *led_cdev, |
| 4202 | enum led_brightness brightness) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4203 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4204 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4205 | struct alc_spec *spec = codec->spec; |
| 4206 | |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 4207 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4208 | spec->mute_led_polarity, !brightness); |
| 4209 | return 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4210 | } |
| 4211 | |
| 4212 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
Kai-Heng Feng | 87dc364 | 2020-04-30 21:52:07 +0800 | [diff] [blame] | 4213 | static int micmute_led_set(struct led_classdev *led_cdev, |
| 4214 | enum led_brightness brightness) |
| 4215 | { |
| 4216 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
| 4217 | struct alc_spec *spec = codec->spec; |
| 4218 | |
| 4219 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
Hui Wang | 4046906 | 2020-08-11 20:24:30 +0800 | [diff] [blame] | 4220 | spec->micmute_led_polarity, !brightness); |
Kai-Heng Feng | 87dc364 | 2020-04-30 21:52:07 +0800 | [diff] [blame] | 4221 | return 0; |
| 4222 | } |
| 4223 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4224 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
| 4225 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4226 | int action, |
| 4227 | unsigned int mute_mask, |
| 4228 | unsigned int micmute_mask) |
| 4229 | { |
| 4230 | struct alc_spec *spec = codec->spec; |
| 4231 | |
| 4232 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
| 4233 | |
| 4234 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4235 | return; |
| 4236 | if (mute_mask) { |
| 4237 | spec->gpio_mute_led_mask = mute_mask; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4238 | snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4239 | } |
| 4240 | if (micmute_mask) { |
| 4241 | spec->gpio_mic_led_mask = micmute_mask; |
Takashi Iwai | 7cdf8c4 | 2020-06-18 13:08:31 +0200 | [diff] [blame] | 4242 | snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4243 | } |
| 4244 | } |
| 4245 | |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 4246 | static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4247 | const struct hda_fixup *fix, int action) |
| 4248 | { |
| 4249 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); |
| 4250 | } |
| 4251 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4252 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4253 | const struct hda_fixup *fix, int action) |
| 4254 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4255 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4256 | } |
| 4257 | |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 4258 | static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4259 | const struct hda_fixup *fix, int action) |
| 4260 | { |
Kai-Heng Feng | 3e0650a | 2020-04-30 16:32:52 +0800 | [diff] [blame] | 4261 | alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 4262 | } |
| 4263 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 4264 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4265 | const struct hda_fixup *fix, int action) |
| 4266 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4267 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4268 | } |
| 4269 | |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 4270 | static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4271 | const struct hda_fixup *fix, int action) |
| 4272 | { |
| 4273 | alc_fixup_hp_gpio_led(codec, action, 0x10, 0); |
| 4274 | } |
| 4275 | |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4276 | /* turn on/off mic-mute LED per capture hook via VREF change */ |
| 4277 | static int vref_micmute_led_set(struct led_classdev *led_cdev, |
| 4278 | enum led_brightness brightness) |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4279 | { |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4280 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4281 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4282 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4283 | alc_update_vref_led(codec, spec->cap_mute_led_nid, |
| 4284 | spec->micmute_led_polarity, brightness); |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4285 | return 0; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4286 | } |
| 4287 | |
| 4288 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 4289 | const struct hda_fixup *fix, int action) |
| 4290 | { |
| 4291 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4292 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4293 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4294 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4295 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
| 4296 | * enable headphone amp |
| 4297 | */ |
| 4298 | spec->gpio_mask |= 0x10; |
| 4299 | spec->gpio_dir |= 0x10; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4300 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4301 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4302 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4303 | } |
| 4304 | } |
| 4305 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4306 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 4307 | const struct hda_fixup *fix, int action) |
| 4308 | { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4309 | struct alc_spec *spec = codec->spec; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4310 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4311 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4312 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4313 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4314 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4315 | codec->power_filter = led_power_filter; |
| 4316 | } |
| 4317 | } |
| 4318 | |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 4319 | /* HP Spectre x360 14 model needs a unique workaround for enabling the amp; |
| 4320 | * it needs to toggle the GPIO0 once on and off at each time (bko#210633) |
| 4321 | */ |
| 4322 | static void alc245_fixup_hp_x360_amp(struct hda_codec *codec, |
| 4323 | const struct hda_fixup *fix, int action) |
| 4324 | { |
| 4325 | struct alc_spec *spec = codec->spec; |
| 4326 | |
| 4327 | switch (action) { |
| 4328 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 4329 | spec->gpio_mask |= 0x01; |
| 4330 | spec->gpio_dir |= 0x01; |
| 4331 | break; |
| 4332 | case HDA_FIXUP_ACT_INIT: |
| 4333 | /* need to toggle GPIO to enable the amp */ |
| 4334 | alc_update_gpio_data(codec, 0x01, true); |
| 4335 | msleep(100); |
| 4336 | alc_update_gpio_data(codec, 0x01, false); |
| 4337 | break; |
| 4338 | } |
| 4339 | } |
| 4340 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4341 | static void alc_update_coef_led(struct hda_codec *codec, |
| 4342 | struct alc_coef_led *led, |
| 4343 | bool polarity, bool on) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4344 | { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4345 | if (polarity) |
| 4346 | on = !on; |
| 4347 | /* temporarily power up/down for setting COEF bit */ |
| 4348 | alc_update_coef_idx(codec, led->idx, led->mask, |
| 4349 | on ? led->on : led->off); |
| 4350 | } |
| 4351 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4352 | /* update mute-LED according to the speaker mute state via COEF bit */ |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4353 | static int coef_mute_led_set(struct led_classdev *led_cdev, |
| 4354 | enum led_brightness brightness) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4355 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4356 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4357 | struct alc_spec *spec = codec->spec; |
| 4358 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4359 | alc_update_coef_led(codec, &spec->mute_led_coef, |
| 4360 | spec->mute_led_polarity, brightness); |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4361 | return 0; |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4362 | } |
| 4363 | |
| 4364 | static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4365 | const struct hda_fixup *fix, |
| 4366 | int action) |
| 4367 | { |
| 4368 | struct alc_spec *spec = codec->spec; |
| 4369 | |
| 4370 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4371 | spec->mute_led_polarity = 0; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4372 | spec->mute_led_coef.idx = 0x0b; |
| 4373 | spec->mute_led_coef.mask = 1 << 3; |
| 4374 | spec->mute_led_coef.on = 1 << 3; |
| 4375 | spec->mute_led_coef.off = 0; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4376 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4377 | } |
| 4378 | } |
| 4379 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4380 | static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4381 | const struct hda_fixup *fix, |
| 4382 | int action) |
| 4383 | { |
| 4384 | struct alc_spec *spec = codec->spec; |
| 4385 | |
| 4386 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4387 | spec->mute_led_polarity = 0; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4388 | spec->mute_led_coef.idx = 0x34; |
| 4389 | spec->mute_led_coef.mask = 1 << 5; |
| 4390 | spec->mute_led_coef.on = 0; |
| 4391 | spec->mute_led_coef.off = 1 << 5; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4392 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4393 | } |
| 4394 | } |
| 4395 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4396 | /* turn on/off mic-mute LED per capture hook by coef bit */ |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4397 | static int coef_micmute_led_set(struct led_classdev *led_cdev, |
| 4398 | enum led_brightness brightness) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4399 | { |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4400 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4401 | struct alc_spec *spec = codec->spec; |
| 4402 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4403 | alc_update_coef_led(codec, &spec->mic_led_coef, |
| 4404 | spec->micmute_led_polarity, brightness); |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4405 | return 0; |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4406 | } |
| 4407 | |
| 4408 | static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4409 | const struct hda_fixup *fix, int action) |
| 4410 | { |
| 4411 | struct alc_spec *spec = codec->spec; |
| 4412 | |
| 4413 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4414 | spec->mic_led_coef.idx = 0x19; |
| 4415 | spec->mic_led_coef.mask = 1 << 13; |
| 4416 | spec->mic_led_coef.on = 1 << 13; |
| 4417 | spec->mic_led_coef.off = 0; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4418 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4419 | } |
| 4420 | } |
| 4421 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4422 | static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4423 | const struct hda_fixup *fix, int action) |
| 4424 | { |
| 4425 | struct alc_spec *spec = codec->spec; |
| 4426 | |
| 4427 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4428 | spec->mic_led_coef.idx = 0x35; |
| 4429 | spec->mic_led_coef.mask = 3 << 2; |
| 4430 | spec->mic_led_coef.on = 2 << 2; |
| 4431 | spec->mic_led_coef.off = 1 << 2; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4432 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4433 | } |
| 4434 | } |
| 4435 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4436 | static void alc285_fixup_hp_mute_led(struct hda_codec *codec, |
| 4437 | const struct hda_fixup *fix, int action) |
| 4438 | { |
| 4439 | alc285_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4440 | alc285_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4441 | } |
| 4442 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4443 | static void alc236_fixup_hp_mute_led(struct hda_codec *codec, |
| 4444 | const struct hda_fixup *fix, int action) |
| 4445 | { |
| 4446 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4447 | alc236_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4448 | } |
| 4449 | |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 4450 | static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec, |
| 4451 | const struct hda_fixup *fix, int action) |
| 4452 | { |
| 4453 | struct alc_spec *spec = codec->spec; |
| 4454 | |
| 4455 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4456 | spec->cap_mute_led_nid = 0x1a; |
| 4457 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
| 4458 | codec->power_filter = led_power_filter; |
| 4459 | } |
| 4460 | } |
| 4461 | |
| 4462 | static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec, |
| 4463 | const struct hda_fixup *fix, int action) |
| 4464 | { |
| 4465 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4466 | alc236_fixup_hp_micmute_led_vref(codec, fix, action); |
| 4467 | } |
| 4468 | |
Takashi Iwai | 6a30aba | 2018-04-27 17:17:35 +0200 | [diff] [blame] | 4469 | #if IS_REACHABLE(CONFIG_INPUT) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4470 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 4471 | struct hda_jack_callback *event) |
| 4472 | { |
| 4473 | struct alc_spec *spec = codec->spec; |
| 4474 | |
| 4475 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore |
| 4476 | send both key on and key off event for every interrupt. */ |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4477 | 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] | 4478 | input_sync(spec->kb_dev); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4479 | 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] | 4480 | input_sync(spec->kb_dev); |
| 4481 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4482 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4483 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
| 4484 | { |
| 4485 | struct alc_spec *spec = codec->spec; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4486 | int i; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4487 | |
| 4488 | spec->kb_dev = input_allocate_device(); |
| 4489 | if (!spec->kb_dev) { |
| 4490 | codec_err(codec, "Out of memory (input_allocate_device)\n"); |
| 4491 | return -ENOMEM; |
| 4492 | } |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4493 | |
| 4494 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; |
| 4495 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4496 | spec->kb_dev->name = "Microphone Mute Button"; |
| 4497 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4498 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
| 4499 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); |
| 4500 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; |
| 4501 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) |
| 4502 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4503 | |
| 4504 | if (input_register_device(spec->kb_dev)) { |
| 4505 | codec_err(codec, "input_register_device failed\n"); |
| 4506 | input_free_device(spec->kb_dev); |
| 4507 | spec->kb_dev = NULL; |
| 4508 | return -ENOMEM; |
| 4509 | } |
| 4510 | |
| 4511 | return 0; |
| 4512 | } |
| 4513 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4514 | /* GPIO1 = set according to SKU external amp |
| 4515 | * GPIO2 = mic mute hotkey |
| 4516 | * GPIO3 = mute LED |
| 4517 | * GPIO4 = mic mute LED |
| 4518 | */ |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4519 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
| 4520 | const struct hda_fixup *fix, int action) |
| 4521 | { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4522 | struct alc_spec *spec = codec->spec; |
| 4523 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4524 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4525 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4526 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4527 | if (alc_register_micmute_input_device(codec) != 0) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4528 | return; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4529 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4530 | spec->gpio_mask |= 0x06; |
| 4531 | spec->gpio_dir |= 0x02; |
| 4532 | spec->gpio_data |= 0x02; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4533 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4534 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4535 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4536 | gpio2_mic_hotkey_event); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4537 | return; |
| 4538 | } |
| 4539 | |
| 4540 | if (!spec->kb_dev) |
| 4541 | return; |
| 4542 | |
| 4543 | switch (action) { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4544 | case HDA_FIXUP_ACT_FREE: |
| 4545 | input_unregister_device(spec->kb_dev); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4546 | spec->kb_dev = NULL; |
| 4547 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4548 | } |
| 4549 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4550 | /* Line2 = mic mute hotkey |
| 4551 | * GPIO2 = mic mute LED |
| 4552 | */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4553 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
| 4554 | const struct hda_fixup *fix, int action) |
| 4555 | { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4556 | struct alc_spec *spec = codec->spec; |
| 4557 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4558 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4559 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4560 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4561 | if (alc_register_micmute_input_device(codec) != 0) |
| 4562 | return; |
| 4563 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4564 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 4565 | gpio2_mic_hotkey_event); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4566 | return; |
| 4567 | } |
| 4568 | |
| 4569 | if (!spec->kb_dev) |
| 4570 | return; |
| 4571 | |
| 4572 | switch (action) { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4573 | case HDA_FIXUP_ACT_FREE: |
| 4574 | input_unregister_device(spec->kb_dev); |
| 4575 | spec->kb_dev = NULL; |
| 4576 | } |
| 4577 | } |
Takashi Iwai | c469652 | 2018-01-15 10:44:35 +0100 | [diff] [blame] | 4578 | #else /* INPUT */ |
| 4579 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL |
| 4580 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL |
| 4581 | #endif /* INPUT */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4582 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4583 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 4584 | const struct hda_fixup *fix, int action) |
| 4585 | { |
| 4586 | struct alc_spec *spec = codec->spec; |
| 4587 | |
Takashi Iwai | 1bce62a | 2018-06-19 23:15:59 +0200 | [diff] [blame] | 4588 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4589 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4590 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4591 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4592 | } |
| 4593 | } |
| 4594 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4595 | static const struct coef_fw alc225_pre_hsmode[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4596 | UPDATE_COEF(0x4a, 1<<8, 0), |
| 4597 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), |
| 4598 | UPDATE_COEF(0x63, 3<<14, 3<<14), |
| 4599 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4600 | UPDATE_COEF(0x4a, 3<<10, 3<<10), |
| 4601 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), |
| 4602 | UPDATE_COEF(0x4a, 3<<10, 0), |
| 4603 | {} |
| 4604 | }; |
| 4605 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4606 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 4607 | { |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 4608 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4609 | static const struct coef_fw coef0255[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4610 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4611 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4612 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4613 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4614 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 4615 | {} |
| 4616 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4617 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4618 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4619 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4620 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4621 | WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ |
| 4622 | 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] | 4623 | {} |
| 4624 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4625 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4626 | WRITE_COEF(0x1b, 0x0c0b), |
| 4627 | WRITE_COEF(0x45, 0xc429), |
| 4628 | UPDATE_COEF(0x35, 0x4000, 0), |
| 4629 | WRITE_COEF(0x06, 0x2104), |
| 4630 | WRITE_COEF(0x1a, 0x0001), |
| 4631 | WRITE_COEF(0x26, 0x0004), |
| 4632 | WRITE_COEF(0x32, 0x42a3), |
| 4633 | {} |
| 4634 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4635 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4636 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4637 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4638 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4639 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4640 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4641 | {} |
| 4642 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4643 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4644 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
| 4645 | {} |
| 4646 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4647 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4648 | WRITE_COEF(0x76, 0x000e), |
| 4649 | WRITE_COEF(0x6c, 0x2400), |
| 4650 | WRITE_COEF(0x18, 0x7308), |
| 4651 | WRITE_COEF(0x6b, 0xc429), |
| 4652 | {} |
| 4653 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4654 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4655 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 4656 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 4657 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 4658 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 4659 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 4660 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4661 | {} |
| 4662 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4663 | static const struct coef_fw coef0668[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4664 | WRITE_COEF(0x15, 0x0d40), |
| 4665 | WRITE_COEF(0xb7, 0x802b), |
| 4666 | {} |
| 4667 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4668 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4669 | UPDATE_COEF(0x63, 3<<14, 0), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4670 | {} |
| 4671 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4672 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4673 | UPDATE_COEF(0x4a, 0x0100, 0), |
| 4674 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), |
| 4675 | UPDATE_COEF(0x6b, 0xf000, 0x5000), |
| 4676 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4677 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), |
| 4678 | WRITE_COEF(0x45, 0x5289), |
| 4679 | UPDATE_COEF(0x4a, 0x0c00, 0), |
| 4680 | {} |
| 4681 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4682 | |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 4683 | if (spec->no_internal_mic_pin) { |
| 4684 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); |
| 4685 | return; |
| 4686 | } |
| 4687 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4688 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4689 | case 0x10ec0255: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4690 | alc_process_coef_fw(codec, coef0255); |
| 4691 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4692 | case 0x10ec0236: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4693 | case 0x10ec0256: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4694 | alc_process_coef_fw(codec, coef0256); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4695 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4696 | case 0x10ec0234: |
| 4697 | case 0x10ec0274: |
| 4698 | case 0x10ec0294: |
| 4699 | alc_process_coef_fw(codec, coef0274); |
| 4700 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4701 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4702 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4703 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4704 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4705 | case 0x10ec0286: |
| 4706 | case 0x10ec0288: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4707 | alc_process_coef_fw(codec, coef0288); |
| 4708 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4709 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4710 | alc_process_coef_fw(codec, coef0298); |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4711 | alc_process_coef_fw(codec, coef0288); |
| 4712 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4713 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4714 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4715 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4716 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4717 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4718 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4719 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4720 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4721 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4722 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4723 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4724 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4725 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4726 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4727 | case 0x10ec0299: |
Kailang Yang | 4d4b0c5 | 2019-01-09 16:23:37 +0800 | [diff] [blame] | 4728 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4729 | alc_process_coef_fw(codec, coef0225); |
| 4730 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4731 | case 0x10ec0867: |
| 4732 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4733 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4734 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4735 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4736 | } |
| 4737 | |
| 4738 | |
| 4739 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 4740 | hda_nid_t mic_pin) |
| 4741 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4742 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4743 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 4744 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4745 | {} |
| 4746 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4747 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4748 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4749 | WRITE_COEFEX(0x57, 0x03, 0x09a3), |
| 4750 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4751 | {} |
| 4752 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4753 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4754 | UPDATE_COEF(0x35, 0, 1<<14), |
| 4755 | WRITE_COEF(0x06, 0x2100), |
| 4756 | WRITE_COEF(0x1a, 0x0021), |
| 4757 | WRITE_COEF(0x26, 0x008c), |
| 4758 | {} |
| 4759 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4760 | static const struct coef_fw coef0288[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4761 | UPDATE_COEF(0x4f, 0x00c0, 0), |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4762 | UPDATE_COEF(0x50, 0x2000, 0), |
| 4763 | UPDATE_COEF(0x56, 0x0006, 0), |
| 4764 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4765 | UPDATE_COEF(0x66, 0x0008, 0x0008), |
| 4766 | UPDATE_COEF(0x67, 0x2000, 0x2000), |
| 4767 | {} |
| 4768 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4769 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4770 | WRITE_COEF(0x19, 0xa208), |
| 4771 | WRITE_COEF(0x2e, 0xacf0), |
| 4772 | {} |
| 4773 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4774 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4775 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 4776 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 4777 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4778 | {} |
| 4779 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4780 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4781 | WRITE_COEF(0xb7, 0x802b), |
| 4782 | WRITE_COEF(0xb5, 0x1040), |
| 4783 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 4784 | {} |
| 4785 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4786 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4787 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
| 4788 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4789 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4790 | {} |
| 4791 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4792 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4793 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
| 4794 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4795 | UPDATE_COEF(0x6b, 0xf000, 0), |
| 4796 | {} |
| 4797 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4798 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4799 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4800 | case 0x10ec0255: |
| 4801 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4802 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4803 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4804 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4805 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4806 | case 0x10ec0236: |
| 4807 | case 0x10ec0256: |
| 4808 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4809 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4810 | alc_process_coef_fw(codec, coef0256); |
| 4811 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4812 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4813 | case 0x10ec0234: |
| 4814 | case 0x10ec0274: |
| 4815 | case 0x10ec0294: |
| 4816 | alc_write_coef_idx(codec, 0x45, 0x4689); |
| 4817 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4818 | alc_process_coef_fw(codec, coef0274); |
| 4819 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4820 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4821 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4822 | case 0x10ec0283: |
| 4823 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4824 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4825 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4826 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4827 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4828 | case 0x10ec0286: |
| 4829 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4830 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4831 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4832 | alc_process_coef_fw(codec, coef0288); |
| 4833 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4834 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4835 | case 0x10ec0292: |
| 4836 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4837 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4838 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4839 | case 0x10ec0293: |
| 4840 | /* Set to TRS mode */ |
| 4841 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4842 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4843 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4844 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4845 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4846 | case 0x10ec0867: |
| 4847 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); |
Gustavo A. R. Silva | c0dbbda | 2020-07-08 15:32:36 -0500 | [diff] [blame] | 4848 | fallthrough; |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 4849 | case 0x10ec0221: |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4850 | case 0x10ec0662: |
| 4851 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4852 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4853 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4854 | case 0x10ec0668: |
| 4855 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 4856 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4857 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4858 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4859 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4860 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4861 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4862 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4863 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4864 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4865 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4866 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4867 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
| 4868 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4869 | alc_process_coef_fw(codec, coef0225); |
| 4870 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4871 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4872 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4873 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4874 | } |
| 4875 | |
| 4876 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 4877 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4878 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4879 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
| 4880 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), |
| 4881 | UPDATE_COEF(0x49, 3<<8, 0<<8), |
| 4882 | UPDATE_COEF(0x4a, 3<<4, 3<<4), |
| 4883 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4884 | UPDATE_COEF(0x67, 0xf000, 0x3000), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4885 | {} |
| 4886 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4887 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4888 | WRITE_COEF(0x45, 0xc089), |
| 4889 | WRITE_COEF(0x45, 0xc489), |
| 4890 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4891 | WRITE_COEF(0x49, 0x0049), |
| 4892 | {} |
| 4893 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4894 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4895 | WRITE_COEF(0x45, 0xc489), |
| 4896 | WRITE_COEFEX(0x57, 0x03, 0x0da3), |
| 4897 | WRITE_COEF(0x49, 0x0049), |
| 4898 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4899 | WRITE_COEF(0x06, 0x6100), |
| 4900 | {} |
| 4901 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4902 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4903 | WRITE_COEF(0x06, 0x2100), |
| 4904 | WRITE_COEF(0x32, 0x4ea3), |
| 4905 | {} |
| 4906 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4907 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4908 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
| 4909 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4910 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4911 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4912 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4913 | {} |
| 4914 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4915 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4916 | WRITE_COEF(0x76, 0x000e), |
| 4917 | WRITE_COEF(0x6c, 0x2400), |
| 4918 | WRITE_COEF(0x6b, 0xc429), |
| 4919 | WRITE_COEF(0x18, 0x7308), |
| 4920 | {} |
| 4921 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4922 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4923 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4924 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 4925 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4926 | {} |
| 4927 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4928 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4929 | WRITE_COEF(0x11, 0x0041), |
| 4930 | WRITE_COEF(0x15, 0x0d40), |
| 4931 | WRITE_COEF(0xb7, 0x802b), |
| 4932 | {} |
| 4933 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4934 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4935 | WRITE_COEF(0x45, 0x4289), |
| 4936 | UPDATE_COEF(0x4a, 0x0010, 0x0010), |
| 4937 | UPDATE_COEF(0x6b, 0x0f00, 0), |
| 4938 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4939 | {} |
| 4940 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4941 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4942 | switch (codec->core.vendor_id) { |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4943 | case 0x10ec0215: |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4944 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4945 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4946 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4947 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4948 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4949 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4950 | alc_process_coef_fw(codec, coef0225); |
| 4951 | break; |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4952 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4953 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4954 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4955 | case 0x10ec0236: |
| 4956 | case 0x10ec0256: |
| 4957 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 4958 | alc_write_coef_idx(codec, 0x45, 0xc089); |
| 4959 | msleep(50); |
| 4960 | alc_process_coef_fw(codec, coef0256); |
| 4961 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4962 | case 0x10ec0234: |
| 4963 | case 0x10ec0274: |
| 4964 | case 0x10ec0294: |
| 4965 | alc_process_coef_fw(codec, coef0274); |
| 4966 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4967 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4968 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4969 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4970 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4971 | case 0x10ec0286: |
| 4972 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4973 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4974 | alc_process_coef_fw(codec, coef0288); |
| 4975 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4976 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4977 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4978 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4979 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4980 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4981 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4982 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4983 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4984 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4985 | case 0x10ec0867: |
| 4986 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4987 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4988 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4989 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4990 | } |
| 4991 | |
| 4992 | /* Iphone type */ |
| 4993 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 4994 | { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4995 | int val; |
| 4996 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4997 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4998 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4999 | WRITE_COEF(0x1b, 0x0c2b), |
| 5000 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 5001 | {} |
| 5002 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5003 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5004 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5005 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5006 | {} |
| 5007 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5008 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5009 | WRITE_COEF(0x45, 0xd429), |
| 5010 | WRITE_COEF(0x1b, 0x0c2b), |
| 5011 | WRITE_COEF(0x32, 0x4ea3), |
| 5012 | {} |
| 5013 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5014 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5015 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5016 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5017 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5018 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5019 | {} |
| 5020 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5021 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5022 | WRITE_COEF(0x6b, 0xd429), |
| 5023 | WRITE_COEF(0x76, 0x0008), |
| 5024 | WRITE_COEF(0x18, 0x7388), |
| 5025 | {} |
| 5026 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5027 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5028 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 5029 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 5030 | {} |
| 5031 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5032 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5033 | WRITE_COEF(0x11, 0x0001), |
| 5034 | WRITE_COEF(0x15, 0x0d60), |
| 5035 | WRITE_COEF(0xc3, 0x0000), |
| 5036 | {} |
| 5037 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5038 | static const struct coef_fw coef0225_1[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5039 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5040 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
| 5041 | {} |
| 5042 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5043 | static const struct coef_fw coef0225_2[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5044 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
| 5045 | UPDATE_COEF(0x63, 3<<14, 1<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5046 | {} |
| 5047 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5048 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5049 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5050 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5051 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5052 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5053 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5054 | case 0x10ec0256: |
| 5055 | alc_process_coef_fw(codec, coef0256); |
| 5056 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5057 | case 0x10ec0234: |
| 5058 | case 0x10ec0274: |
| 5059 | case 0x10ec0294: |
| 5060 | alc_write_coef_idx(codec, 0x45, 0xd689); |
| 5061 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5062 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5063 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5064 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5065 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5066 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5067 | val = alc_read_coef_idx(codec, 0x50); |
| 5068 | if (val & (1 << 12)) { |
| 5069 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 5070 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 5071 | msleep(300); |
| 5072 | } else { |
| 5073 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 5074 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 5075 | msleep(300); |
| 5076 | } |
| 5077 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5078 | case 0x10ec0286: |
| 5079 | case 0x10ec0288: |
| 5080 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 5081 | msleep(300); |
| 5082 | alc_process_coef_fw(codec, coef0288); |
| 5083 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5084 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5085 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5086 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5087 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5088 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5089 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5090 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5091 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5092 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5093 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5094 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5095 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5096 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5097 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5098 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5099 | val = alc_read_coef_idx(codec, 0x45); |
| 5100 | if (val & (1 << 9)) |
| 5101 | alc_process_coef_fw(codec, coef0225_2); |
| 5102 | else |
| 5103 | alc_process_coef_fw(codec, coef0225_1); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5104 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5105 | case 0x10ec0867: |
| 5106 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 5107 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5108 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5109 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5110 | } |
| 5111 | |
| 5112 | /* Nokia type */ |
| 5113 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 5114 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5115 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5116 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 5117 | WRITE_COEF(0x1b, 0x0c2b), |
| 5118 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 5119 | {} |
| 5120 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5121 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5122 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5123 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5124 | {} |
| 5125 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5126 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5127 | WRITE_COEF(0x45, 0xe429), |
| 5128 | WRITE_COEF(0x1b, 0x0c2b), |
| 5129 | WRITE_COEF(0x32, 0x4ea3), |
| 5130 | {} |
| 5131 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5132 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5133 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5134 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5135 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5136 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5137 | {} |
| 5138 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5139 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5140 | WRITE_COEF(0x6b, 0xe429), |
| 5141 | WRITE_COEF(0x76, 0x0008), |
| 5142 | WRITE_COEF(0x18, 0x7388), |
| 5143 | {} |
| 5144 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5145 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5146 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 5147 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 5148 | {} |
| 5149 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5150 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5151 | WRITE_COEF(0x11, 0x0001), |
| 5152 | WRITE_COEF(0x15, 0x0d50), |
| 5153 | WRITE_COEF(0xc3, 0x0000), |
| 5154 | {} |
| 5155 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5156 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5157 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5158 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5159 | {} |
| 5160 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5161 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5162 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5163 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5164 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5165 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5166 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5167 | case 0x10ec0256: |
| 5168 | alc_process_coef_fw(codec, coef0256); |
| 5169 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5170 | case 0x10ec0234: |
| 5171 | case 0x10ec0274: |
| 5172 | case 0x10ec0294: |
| 5173 | alc_write_coef_idx(codec, 0x45, 0xe689); |
| 5174 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5175 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5176 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5177 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5178 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5179 | case 0x10ec0298: |
| 5180 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5181 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5182 | msleep(300); |
| 5183 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5184 | case 0x10ec0286: |
| 5185 | case 0x10ec0288: |
| 5186 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5187 | msleep(300); |
| 5188 | alc_process_coef_fw(codec, coef0288); |
| 5189 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5190 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5191 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5192 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5193 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5194 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5195 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5196 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5197 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5198 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5199 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5200 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5201 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5202 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5203 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5204 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5205 | alc_process_coef_fw(codec, coef0225); |
| 5206 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5207 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5208 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5209 | } |
| 5210 | |
| 5211 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 5212 | { |
| 5213 | int val; |
| 5214 | bool is_ctia = false; |
| 5215 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5216 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5217 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 5218 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 5219 | conteol) */ |
| 5220 | {} |
| 5221 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5222 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5223 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
| 5224 | {} |
| 5225 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5226 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5227 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5228 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5229 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5230 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5231 | UPDATE_COEF(0x19, 0x1300, 0x1300), |
| 5232 | {} |
| 5233 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5234 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5235 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 5236 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 5237 | {} |
| 5238 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5239 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5240 | WRITE_COEF(0x11, 0x0001), |
| 5241 | WRITE_COEF(0xb7, 0x802b), |
| 5242 | WRITE_COEF(0x15, 0x0d60), |
| 5243 | WRITE_COEF(0xc3, 0x0c00), |
| 5244 | {} |
| 5245 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5246 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5247 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 5248 | UPDATE_COEF(0x4a, 0x8000, 0), |
| 5249 | WRITE_COEF(0x45, 0xd289), |
| 5250 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 5251 | {} |
| 5252 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5253 | |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 5254 | if (spec->no_internal_mic_pin) { |
| 5255 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); |
| 5256 | return; |
| 5257 | } |
| 5258 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5259 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5260 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5261 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5262 | msleep(300); |
| 5263 | val = alc_read_coef_idx(codec, 0x46); |
| 5264 | is_ctia = (val & 0x0070) == 0x0070; |
| 5265 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5266 | case 0x10ec0236: |
| 5267 | case 0x10ec0256: |
| 5268 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 5269 | alc_write_coef_idx(codec, 0x06, 0x6104); |
| 5270 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); |
| 5271 | |
| 5272 | snd_hda_codec_write(codec, 0x21, 0, |
| 5273 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5274 | msleep(80); |
| 5275 | snd_hda_codec_write(codec, 0x21, 0, |
| 5276 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5277 | |
| 5278 | alc_process_coef_fw(codec, coef0255); |
| 5279 | msleep(300); |
| 5280 | val = alc_read_coef_idx(codec, 0x46); |
| 5281 | is_ctia = (val & 0x0070) == 0x0070; |
| 5282 | |
| 5283 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); |
| 5284 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 5285 | |
| 5286 | snd_hda_codec_write(codec, 0x21, 0, |
| 5287 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5288 | msleep(80); |
| 5289 | snd_hda_codec_write(codec, 0x21, 0, |
| 5290 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5291 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5292 | case 0x10ec0234: |
| 5293 | case 0x10ec0274: |
| 5294 | case 0x10ec0294: |
| 5295 | alc_process_coef_fw(codec, coef0274); |
Hui Wang | febf2256 | 2021-03-20 17:15:41 +0800 | [diff] [blame] | 5296 | msleep(850); |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5297 | val = alc_read_coef_idx(codec, 0x46); |
| 5298 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5299 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5300 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5301 | case 0x10ec0283: |
| 5302 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 5303 | msleep(300); |
| 5304 | val = alc_read_coef_idx(codec, 0x46); |
| 5305 | is_ctia = (val & 0x0070) == 0x0070; |
| 5306 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5307 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5308 | snd_hda_codec_write(codec, 0x21, 0, |
| 5309 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5310 | msleep(100); |
| 5311 | snd_hda_codec_write(codec, 0x21, 0, |
| 5312 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5313 | msleep(200); |
| 5314 | |
| 5315 | val = alc_read_coef_idx(codec, 0x50); |
| 5316 | if (val & (1 << 12)) { |
| 5317 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 5318 | alc_process_coef_fw(codec, coef0288); |
| 5319 | msleep(350); |
| 5320 | val = alc_read_coef_idx(codec, 0x50); |
| 5321 | is_ctia = (val & 0x0070) == 0x0070; |
| 5322 | } else { |
| 5323 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 5324 | alc_process_coef_fw(codec, coef0288); |
| 5325 | msleep(350); |
| 5326 | val = alc_read_coef_idx(codec, 0x50); |
| 5327 | is_ctia = (val & 0x0070) == 0x0070; |
| 5328 | } |
| 5329 | alc_process_coef_fw(codec, coef0298); |
| 5330 | snd_hda_codec_write(codec, 0x21, 0, |
| 5331 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); |
| 5332 | msleep(75); |
| 5333 | snd_hda_codec_write(codec, 0x21, 0, |
| 5334 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5335 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5336 | case 0x10ec0286: |
| 5337 | case 0x10ec0288: |
| 5338 | alc_process_coef_fw(codec, coef0288); |
| 5339 | msleep(350); |
| 5340 | val = alc_read_coef_idx(codec, 0x50); |
| 5341 | is_ctia = (val & 0x0070) == 0x0070; |
| 5342 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5343 | case 0x10ec0292: |
| 5344 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 5345 | msleep(300); |
| 5346 | val = alc_read_coef_idx(codec, 0x6c); |
| 5347 | is_ctia = (val & 0x001c) == 0x001c; |
| 5348 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5349 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5350 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5351 | msleep(300); |
| 5352 | val = alc_read_coef_idx(codec, 0x46); |
| 5353 | is_ctia = (val & 0x0070) == 0x0070; |
| 5354 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5355 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5356 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5357 | msleep(300); |
| 5358 | val = alc_read_coef_idx(codec, 0xbe); |
| 5359 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 5360 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5361 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5362 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5363 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5364 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5365 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5366 | case 0x10ec0299: |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5367 | snd_hda_codec_write(codec, 0x21, 0, |
| 5368 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5369 | msleep(80); |
| 5370 | snd_hda_codec_write(codec, 0x21, 0, |
| 5371 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5372 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5373 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
| 5374 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
| 5375 | val = alc_read_coef_idx(codec, 0x45); |
| 5376 | if (val & (1 << 9)) { |
| 5377 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5378 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); |
| 5379 | msleep(800); |
| 5380 | val = alc_read_coef_idx(codec, 0x46); |
| 5381 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5382 | } else { |
| 5383 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5384 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); |
| 5385 | msleep(800); |
| 5386 | val = alc_read_coef_idx(codec, 0x46); |
| 5387 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5388 | } |
| 5389 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); |
| 5390 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); |
| 5391 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5392 | |
| 5393 | snd_hda_codec_write(codec, 0x21, 0, |
| 5394 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5395 | msleep(80); |
| 5396 | snd_hda_codec_write(codec, 0x21, 0, |
| 5397 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5398 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5399 | case 0x10ec0867: |
| 5400 | is_ctia = true; |
| 5401 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5402 | } |
| 5403 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5404 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5405 | is_ctia ? "yes" : "no"); |
| 5406 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 5407 | } |
| 5408 | |
| 5409 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 5410 | { |
| 5411 | struct alc_spec *spec = codec->spec; |
| 5412 | |
| 5413 | 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] | 5414 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5415 | |
| 5416 | int new_headset_mode; |
| 5417 | |
| 5418 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 5419 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 5420 | else if (mux_pin == spec->headset_mic_pin) |
| 5421 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 5422 | else if (mux_pin == spec->headphone_mic_pin) |
| 5423 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 5424 | else |
| 5425 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 5426 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5427 | if (new_headset_mode == spec->current_headset_mode) { |
| 5428 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5429 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5430 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5431 | |
| 5432 | switch (new_headset_mode) { |
| 5433 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 5434 | alc_headset_mode_unplugged(codec); |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5435 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5436 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5437 | spec->gen.hp_jack_present = false; |
| 5438 | break; |
| 5439 | case ALC_HEADSET_MODE_HEADSET: |
| 5440 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 5441 | alc_determine_headset_type(codec); |
| 5442 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 5443 | alc_headset_mode_ctia(codec); |
| 5444 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 5445 | alc_headset_mode_omtp(codec); |
| 5446 | spec->gen.hp_jack_present = true; |
| 5447 | break; |
| 5448 | case ALC_HEADSET_MODE_MIC: |
| 5449 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 5450 | spec->gen.hp_jack_present = false; |
| 5451 | break; |
| 5452 | case ALC_HEADSET_MODE_HEADPHONE: |
| 5453 | alc_headset_mode_default(codec); |
| 5454 | spec->gen.hp_jack_present = true; |
| 5455 | break; |
| 5456 | } |
| 5457 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 5458 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 5459 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5460 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5461 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 5462 | PIN_VREFHIZ); |
| 5463 | } |
| 5464 | spec->current_headset_mode = new_headset_mode; |
| 5465 | |
| 5466 | snd_hda_gen_update_outputs(codec); |
| 5467 | } |
| 5468 | |
| 5469 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 5470 | struct snd_kcontrol *kcontrol, |
| 5471 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5472 | { |
| 5473 | alc_update_headset_mode(codec); |
| 5474 | } |
| 5475 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5476 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 5477 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5478 | { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5479 | snd_hda_gen_hp_automute(codec, jack); |
Hui Wang | e54f30b | 2021-03-20 17:15:42 +0800 | [diff] [blame] | 5480 | alc_update_headset_mode(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5481 | } |
| 5482 | |
| 5483 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 5484 | { |
| 5485 | int i; |
| 5486 | struct alc_spec *spec = codec->spec; |
| 5487 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5488 | |
| 5489 | /* Find mic pins */ |
| 5490 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5491 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 5492 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 5493 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 5494 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 5495 | } |
| 5496 | |
Takashi Iwai | 0bed2aa | 2018-06-19 12:45:53 +0200 | [diff] [blame] | 5497 | WARN_ON(spec->gen.cap_sync_hook); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5498 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 5499 | spec->gen.automute_hook = alc_update_headset_mode; |
| 5500 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 5501 | } |
| 5502 | |
| 5503 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 5504 | const struct hda_fixup *fix, int action) |
| 5505 | { |
| 5506 | struct alc_spec *spec = codec->spec; |
| 5507 | |
| 5508 | switch (action) { |
| 5509 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5510 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 5511 | break; |
| 5512 | case HDA_FIXUP_ACT_PROBE: |
| 5513 | alc_probe_headset_mode(codec); |
| 5514 | break; |
| 5515 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5516 | if (is_s3_resume(codec) || is_s4_resume(codec)) { |
| 5517 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5518 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
| 5519 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5520 | alc_update_headset_mode(codec); |
| 5521 | break; |
| 5522 | } |
| 5523 | } |
| 5524 | |
| 5525 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 5526 | const struct hda_fixup *fix, int action) |
| 5527 | { |
| 5528 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5529 | struct alc_spec *spec = codec->spec; |
| 5530 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5531 | } |
| 5532 | else |
| 5533 | alc_fixup_headset_mode(codec, fix, action); |
| 5534 | } |
| 5535 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5536 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 5537 | { |
| 5538 | /* Set to iphone type */ |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5539 | static const struct coef_fw alc255fw[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5540 | WRITE_COEF(0x1b, 0x880b), |
| 5541 | WRITE_COEF(0x45, 0xd089), |
| 5542 | WRITE_COEF(0x1b, 0x080b), |
| 5543 | WRITE_COEF(0x46, 0x0004), |
| 5544 | WRITE_COEF(0x1b, 0x0c0b), |
| 5545 | {} |
| 5546 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5547 | static const struct coef_fw alc256fw[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5548 | WRITE_COEF(0x1b, 0x884b), |
| 5549 | WRITE_COEF(0x45, 0xd089), |
| 5550 | WRITE_COEF(0x1b, 0x084b), |
| 5551 | WRITE_COEF(0x46, 0x0004), |
| 5552 | WRITE_COEF(0x1b, 0x0c4b), |
| 5553 | {} |
| 5554 | }; |
| 5555 | switch (codec->core.vendor_id) { |
| 5556 | case 0x10ec0255: |
| 5557 | alc_process_coef_fw(codec, alc255fw); |
| 5558 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5559 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5560 | case 0x10ec0256: |
| 5561 | alc_process_coef_fw(codec, alc256fw); |
| 5562 | break; |
| 5563 | } |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5564 | msleep(30); |
| 5565 | } |
| 5566 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5567 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 5568 | const struct hda_fixup *fix, int action) |
| 5569 | { |
| 5570 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5571 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5572 | } |
| 5573 | alc_fixup_headset_mode(codec, fix, action); |
| 5574 | } |
| 5575 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5576 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 5577 | const struct hda_fixup *fix, int action) |
| 5578 | { |
| 5579 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5580 | struct alc_spec *spec = codec->spec; |
| 5581 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5582 | alc255_set_default_jack_type(codec); |
| 5583 | } |
| 5584 | else |
| 5585 | alc_fixup_headset_mode(codec, fix, action); |
| 5586 | } |
| 5587 | |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5588 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
| 5589 | struct hda_jack_callback *jack) |
| 5590 | { |
| 5591 | struct alc_spec *spec = codec->spec; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5592 | |
| 5593 | alc_update_headset_jack_cb(codec, jack); |
| 5594 | /* Headset Mic enable or disable, only for Dell Dino */ |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5595 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5596 | } |
| 5597 | |
| 5598 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, |
| 5599 | const struct hda_fixup *fix, int action) |
| 5600 | { |
| 5601 | alc_fixup_headset_mode(codec, fix, action); |
| 5602 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 5603 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5604 | /* toggled via hp_automute_hook */ |
| 5605 | spec->gpio_mask |= 0x40; |
| 5606 | spec->gpio_dir |= 0x40; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5607 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
| 5608 | } |
| 5609 | } |
| 5610 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5611 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 5612 | const struct hda_fixup *fix, int action) |
| 5613 | { |
| 5614 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5615 | struct alc_spec *spec = codec->spec; |
| 5616 | spec->gen.auto_mute_via_amp = 1; |
| 5617 | } |
| 5618 | } |
| 5619 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5620 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 5621 | const struct hda_fixup *fix, int action) |
| 5622 | { |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5623 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5624 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 5625 | spec->no_shutup_pins = 1; |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5626 | } |
| 5627 | } |
| 5628 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5629 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 5630 | const struct hda_fixup *fix, int action) |
| 5631 | { |
| 5632 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5633 | struct alc_spec *spec = codec->spec; |
| 5634 | /* Disable AA-loopback as it causes white noise */ |
| 5635 | spec->gen.mixer_nid = 0; |
| 5636 | } |
| 5637 | } |
| 5638 | |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5639 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
| 5640 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, |
| 5641 | const struct hda_fixup *fix, int action) |
| 5642 | { |
| 5643 | static const struct hda_pintbl pincfgs[] = { |
| 5644 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 5645 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5646 | { } |
| 5647 | }; |
| 5648 | struct alc_spec *spec = codec->spec; |
| 5649 | |
| 5650 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Hui Wang | 871b906 | 2019-08-14 12:09:08 +0800 | [diff] [blame] | 5651 | spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */ |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5652 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5653 | codec->power_save_node = 0; /* avoid click noises */ |
| 5654 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5655 | } |
| 5656 | } |
| 5657 | |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5658 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
| 5659 | const struct hda_fixup *fix, int action) |
| 5660 | { |
| 5661 | static const struct hda_pintbl pincfgs[] = { |
| 5662 | { 0x17, 0x21211010 }, /* dock headphone */ |
| 5663 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5664 | { } |
| 5665 | }; |
| 5666 | struct alc_spec *spec = codec->spec; |
| 5667 | |
| 5668 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5669 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
Takashi Iwai | 71db96d | 2018-02-26 15:36:38 +0100 | [diff] [blame] | 5670 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5671 | } else if (action == HDA_FIXUP_ACT_INIT) { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5672 | /* Enable DOCK device */ |
| 5673 | snd_hda_codec_write(codec, 0x17, 0, |
| 5674 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
| 5675 | /* Enable DOCK device */ |
| 5676 | snd_hda_codec_write(codec, 0x19, 0, |
| 5677 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5678 | } |
| 5679 | } |
| 5680 | |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 5681 | static void alc_fixup_tpt470_dacs(struct hda_codec *codec, |
| 5682 | const struct hda_fixup *fix, int action) |
| 5683 | { |
| 5684 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise |
| 5685 | * the speaker output becomes too low by some reason on Thinkpads with |
| 5686 | * ALC298 codec |
| 5687 | */ |
| 5688 | static const hda_nid_t preferred_pairs[] = { |
| 5689 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, |
| 5690 | 0 |
| 5691 | }; |
| 5692 | struct alc_spec *spec = codec->spec; |
| 5693 | |
| 5694 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5695 | spec->gen.preferred_dacs = preferred_pairs; |
| 5696 | } |
| 5697 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5698 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5699 | { |
| 5700 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5701 | int hp_pin = alc_get_hp_pin(spec); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5702 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5703 | /* Prevent pop noises when headphones are plugged in */ |
| 5704 | snd_hda_codec_write(codec, hp_pin, 0, |
| 5705 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5706 | msleep(20); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5707 | } |
| 5708 | |
| 5709 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 5710 | const struct hda_fixup *fix, int action) |
| 5711 | { |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5712 | struct alc_spec *spec = codec->spec; |
| 5713 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 5714 | int i; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5715 | |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5716 | switch (action) { |
| 5717 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5718 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise |
| 5719 | * it causes a click noise at start up |
| 5720 | */ |
| 5721 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5722 | spec->shutup = alc_shutup_dell_xps13; |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5723 | break; |
| 5724 | case HDA_FIXUP_ACT_PROBE: |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5725 | /* Make the internal mic the default input source. */ |
| 5726 | for (i = 0; i < imux->num_items; i++) { |
| 5727 | if (spec->gen.imux_pins[i] == 0x12) { |
| 5728 | spec->gen.cur_mux[0] = i; |
| 5729 | break; |
| 5730 | } |
| 5731 | } |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5732 | break; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5733 | } |
| 5734 | } |
| 5735 | |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5736 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
| 5737 | const struct hda_fixup *fix, int action) |
| 5738 | { |
| 5739 | struct alc_spec *spec = codec->spec; |
| 5740 | |
| 5741 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5742 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5743 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ |
David Henningsson | b40eda6 | 2015-05-28 09:40:23 +0200 | [diff] [blame] | 5744 | |
| 5745 | /* Disable boost for mic-in permanently. (This code is only called |
| 5746 | from quirks that guarantee that the headphone is at NID 0x1b.) */ |
| 5747 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); |
| 5748 | 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] | 5749 | } else |
| 5750 | alc_fixup_headset_mode(codec, fix, action); |
| 5751 | } |
| 5752 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5753 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 5754 | const struct hda_fixup *fix, int action) |
| 5755 | { |
| 5756 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5757 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5758 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5759 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 5760 | } |
| 5761 | alc_fixup_headset_mode(codec, fix, action); |
| 5762 | } |
| 5763 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5764 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 5765 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 5766 | { |
| 5767 | struct alc_spec *spec = codec->spec; |
| 5768 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5769 | hda_nid_t nid; |
| 5770 | unsigned int defcfg; |
| 5771 | int i; |
| 5772 | |
| 5773 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5774 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5775 | continue; |
| 5776 | nid = cfg->inputs[i].pin; |
| 5777 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5778 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 5779 | continue; |
| 5780 | return nid; |
| 5781 | } |
| 5782 | |
| 5783 | return 0; |
| 5784 | } |
| 5785 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5786 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5787 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5788 | int action) |
| 5789 | { |
| 5790 | struct alc_spec *spec = codec->spec; |
| 5791 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5792 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5793 | int mic_pin = find_ext_mic_pin(codec); |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5794 | int hp_pin = alc_get_hp_pin(spec); |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5795 | |
| 5796 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5797 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5798 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5799 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5800 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5801 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5802 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 5803 | const struct hda_fixup *fix, |
| 5804 | int action) |
| 5805 | { |
| 5806 | struct alc_spec *spec = codec->spec; |
| 5807 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5808 | int i; |
| 5809 | |
| 5810 | /* The mic boosts on level 2 and 3 are too noisy |
| 5811 | on the internal mic input. |
| 5812 | Therefore limit the boost to 0 or 1. */ |
| 5813 | |
| 5814 | if (action != HDA_FIXUP_ACT_PROBE) |
| 5815 | return; |
| 5816 | |
| 5817 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5818 | hda_nid_t nid = cfg->inputs[i].pin; |
| 5819 | unsigned int defcfg; |
| 5820 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5821 | continue; |
| 5822 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5823 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 5824 | continue; |
| 5825 | |
| 5826 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 5827 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 5828 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5829 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5830 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 5831 | } |
| 5832 | } |
| 5833 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5834 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5835 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5836 | { |
| 5837 | struct alc_spec *spec = codec->spec; |
| 5838 | int vref; |
| 5839 | |
| 5840 | msleep(200); |
| 5841 | snd_hda_gen_hp_automute(codec, jack); |
| 5842 | |
| 5843 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 5844 | |
| 5845 | msleep(600); |
| 5846 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 5847 | vref); |
| 5848 | } |
| 5849 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5850 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 5851 | const struct hda_fixup *fix, int action) |
| 5852 | { |
| 5853 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5854 | |
| 5855 | switch (action) { |
| 5856 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5857 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 5858 | /* Disable AA-loopback as it causes white noise */ |
| 5859 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 5860 | break; |
| 5861 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 5862 | /* MIC2-VREF control */ |
| 5863 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5864 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5865 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5866 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5867 | break; |
| 5868 | } |
| 5869 | } |
| 5870 | |
| 5871 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 5872 | const struct hda_fixup *fix, int action) |
| 5873 | { |
| 5874 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5875 | |
| 5876 | switch (action) { |
| 5877 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5878 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 5879 | break; |
| 5880 | case HDA_FIXUP_ACT_INIT: |
| 5881 | /* MIC2-VREF control */ |
| 5882 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5883 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5884 | break; |
| 5885 | } |
| 5886 | } |
| 5887 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5888 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 5889 | static void asus_tx300_automute(struct hda_codec *codec) |
| 5890 | { |
| 5891 | struct alc_spec *spec = codec->spec; |
| 5892 | snd_hda_gen_update_outputs(codec); |
| 5893 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 5894 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 5895 | } |
| 5896 | |
| 5897 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 5898 | const struct hda_fixup *fix, int action) |
| 5899 | { |
| 5900 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5901 | static const struct hda_pintbl dock_pins[] = { |
| 5902 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 5903 | {} |
| 5904 | }; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5905 | |
| 5906 | switch (action) { |
| 5907 | case HDA_FIXUP_ACT_PRE_PROBE: |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 5908 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5909 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 5910 | alc_setup_gpio(codec, 0x04); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5911 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 5912 | spec->gen.auto_mute_via_amp = 1; |
| 5913 | spec->gen.automute_hook = asus_tx300_automute; |
| 5914 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5915 | snd_hda_gen_hp_automute); |
| 5916 | break; |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 5917 | case HDA_FIXUP_ACT_PROBE: |
| 5918 | spec->init_amp = ALC_INIT_DEFAULT; |
| 5919 | break; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5920 | case HDA_FIXUP_ACT_BUILD: |
| 5921 | /* this is a bit tricky; give more sane names for the main |
| 5922 | * (tablet) speaker and the dock speaker, respectively |
| 5923 | */ |
Takashi Iwai | 56798e6 | 2017-04-11 08:10:52 +0200 | [diff] [blame] | 5924 | rename_ctl(codec, "Speaker Playback Switch", |
| 5925 | "Dock Speaker Playback Switch"); |
| 5926 | rename_ctl(codec, "Bass Speaker Playback Switch", |
| 5927 | "Speaker Playback Switch"); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5928 | break; |
| 5929 | } |
| 5930 | } |
| 5931 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5932 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 5933 | const struct hda_fixup *fix, int action) |
| 5934 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5935 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5936 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 5937 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 5938 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5939 | static const hda_nid_t conn1[] = { 0x0c }; |
| 5940 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 5941 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5942 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5943 | } |
| 5944 | |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5945 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
| 5946 | const struct hda_fixup *fix, int action) |
| 5947 | { |
| 5948 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5949 | /* The speaker is routed to the Node 0x06 by a mistake, as a result |
| 5950 | we can't adjust the speaker's volume since this node does not has |
| 5951 | Amp-out capability. we change the speaker's route to: |
| 5952 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( |
| 5953 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust |
| 5954 | speaker's volume now. */ |
| 5955 | |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5956 | static const hda_nid_t conn1[] = { 0x0c }; |
| 5957 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5958 | } |
| 5959 | } |
| 5960 | |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5961 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
| 5962 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, |
| 5963 | const struct hda_fixup *fix, int action) |
| 5964 | { |
| 5965 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5966 | static const hda_nid_t conn[] = { 0x02, 0x03 }; |
| 5967 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5968 | } |
| 5969 | } |
| 5970 | |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 5971 | /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ |
| 5972 | static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, |
| 5973 | const struct hda_fixup *fix, int action) |
| 5974 | { |
| 5975 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5976 | static const hda_nid_t conn[] = { 0x02 }; |
| 5977 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 5978 | } |
| 5979 | } |
| 5980 | |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5981 | /* Hook to update amp GPIO4 for automute */ |
| 5982 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, |
| 5983 | struct hda_jack_callback *jack) |
| 5984 | { |
| 5985 | struct alc_spec *spec = codec->spec; |
| 5986 | |
| 5987 | snd_hda_gen_hp_automute(codec, jack); |
| 5988 | /* mute_led_polarity is set to 0, so we pass inverted value here */ |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 5989 | alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, |
| 5990 | !spec->gen.hp_jack_present); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5991 | } |
| 5992 | |
| 5993 | /* Manage GPIOs for HP EliteBook Folio 9480m. |
| 5994 | * |
| 5995 | * GPIO4 is the headphone amplifier power control |
| 5996 | * GPIO3 is the audio output mute indicator LED |
| 5997 | */ |
| 5998 | |
| 5999 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, |
| 6000 | const struct hda_fixup *fix, |
| 6001 | int action) |
| 6002 | { |
| 6003 | struct alc_spec *spec = codec->spec; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6004 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 6005 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6006 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 6007 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
| 6008 | spec->gpio_mask |= 0x10; |
| 6009 | spec->gpio_dir |= 0x10; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6010 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6011 | } |
| 6012 | } |
| 6013 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6014 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
| 6015 | const struct hda_fixup *fix, |
| 6016 | int action) |
| 6017 | { |
| 6018 | struct alc_spec *spec = codec->spec; |
| 6019 | |
| 6020 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 6021 | spec->gpio_mask |= 0x04; |
| 6022 | spec->gpio_dir |= 0x04; |
| 6023 | /* set data bit low */ |
| 6024 | } |
| 6025 | } |
| 6026 | |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 6027 | /* Quirk for Thinkpad X1 7th and 8th Gen |
| 6028 | * The following fixed routing needed |
| 6029 | * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly |
| 6030 | * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC |
| 6031 | * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp |
| 6032 | */ |
| 6033 | static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, |
| 6034 | const struct hda_fixup *fix, int action) |
| 6035 | { |
| 6036 | static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ |
| 6037 | static const hda_nid_t preferred_pairs[] = { |
| 6038 | 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 |
| 6039 | }; |
| 6040 | struct alc_spec *spec = codec->spec; |
| 6041 | |
| 6042 | switch (action) { |
| 6043 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6044 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
| 6045 | spec->gen.preferred_dacs = preferred_pairs; |
| 6046 | break; |
| 6047 | case HDA_FIXUP_ACT_BUILD: |
| 6048 | /* The generic parser creates somewhat unintuitive volume ctls |
| 6049 | * with the fixed routing above, and the shared DAC2 may be |
| 6050 | * confusing for PA. |
| 6051 | * Rename those to unique names so that PA doesn't touch them |
| 6052 | * and use only Master volume. |
| 6053 | */ |
| 6054 | rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); |
| 6055 | rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); |
| 6056 | break; |
| 6057 | } |
| 6058 | } |
| 6059 | |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6060 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
| 6061 | const struct hda_fixup *fix, |
| 6062 | int action) |
| 6063 | { |
| 6064 | alc_fixup_dual_codecs(codec, fix, action); |
| 6065 | switch (action) { |
| 6066 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6067 | /* override card longname to provide a unique UCM profile */ |
| 6068 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); |
| 6069 | break; |
| 6070 | case HDA_FIXUP_ACT_BUILD: |
| 6071 | /* rename Capture controls depending on the codec */ |
| 6072 | rename_ctl(codec, "Capture Volume", |
| 6073 | codec->addr == 0 ? |
| 6074 | "Rear-Panel Capture Volume" : |
| 6075 | "Front-Panel Capture Volume"); |
| 6076 | rename_ctl(codec, "Capture Switch", |
| 6077 | codec->addr == 0 ? |
| 6078 | "Rear-Panel Capture Switch" : |
| 6079 | "Front-Panel Capture Switch"); |
| 6080 | break; |
| 6081 | } |
| 6082 | } |
| 6083 | |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 6084 | static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, |
| 6085 | const struct hda_fixup *fix, int action) |
| 6086 | { |
| 6087 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 6088 | return; |
| 6089 | |
| 6090 | codec->power_save_node = 1; |
| 6091 | } |
| 6092 | |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6093 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
| 6094 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
| 6095 | const struct hda_fixup *fix, int action) |
| 6096 | { |
| 6097 | struct alc_spec *spec = codec->spec; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 6098 | static const hda_nid_t preferred_pairs[] = { |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6099 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
| 6100 | 0 |
| 6101 | }; |
| 6102 | |
| 6103 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 6104 | return; |
| 6105 | |
| 6106 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 0700d3d | 2019-04-26 16:13:54 +0800 | [diff] [blame] | 6107 | spec->gen.auto_mute_via_amp = 1; |
| 6108 | codec->power_save_node = 0; |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6109 | } |
| 6110 | |
Takashi Iwai | c84bfed | 2020-11-27 15:11:04 +0100 | [diff] [blame] | 6111 | /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */ |
| 6112 | static void alc289_fixup_asus_ga401(struct hda_codec *codec, |
| 6113 | const struct hda_fixup *fix, int action) |
| 6114 | { |
| 6115 | static const hda_nid_t preferred_pairs[] = { |
| 6116 | 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0 |
| 6117 | }; |
| 6118 | struct alc_spec *spec = codec->spec; |
| 6119 | |
| 6120 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 6121 | spec->gen.preferred_dacs = preferred_pairs; |
| 6122 | spec->gen.obey_preferred_dacs = 1; |
| 6123 | } |
| 6124 | } |
| 6125 | |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6126 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
| 6127 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, |
| 6128 | const struct hda_fixup *fix, int action) |
| 6129 | { |
| 6130 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 6131 | return; |
| 6132 | |
| 6133 | snd_hda_override_wcaps(codec, 0x03, 0); |
| 6134 | } |
| 6135 | |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6136 | static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) |
| 6137 | { |
| 6138 | switch (codec->core.vendor_id) { |
| 6139 | case 0x10ec0274: |
| 6140 | case 0x10ec0294: |
| 6141 | case 0x10ec0225: |
| 6142 | case 0x10ec0295: |
| 6143 | case 0x10ec0299: |
| 6144 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ |
| 6145 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); |
| 6146 | break; |
| 6147 | case 0x10ec0235: |
| 6148 | case 0x10ec0236: |
| 6149 | case 0x10ec0255: |
| 6150 | case 0x10ec0256: |
| 6151 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ |
| 6152 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); |
| 6153 | break; |
| 6154 | } |
| 6155 | } |
| 6156 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6157 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
| 6158 | const struct hda_fixup *fix, int action) |
| 6159 | { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 6160 | struct alc_spec *spec = codec->spec; |
| 6161 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6162 | switch (action) { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 6163 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6164 | spec->ultra_low_power = true; |
| 6165 | break; |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6166 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6167 | alc_combo_jack_hp_jd_restart(codec); |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6168 | break; |
| 6169 | } |
| 6170 | } |
| 6171 | |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6172 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
| 6173 | const struct hda_fixup *fix, int action) |
| 6174 | { |
| 6175 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 6176 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
| 6177 | } |
| 6178 | |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 6179 | |
| 6180 | static void alc294_gx502_toggle_output(struct hda_codec *codec, |
| 6181 | struct hda_jack_callback *cb) |
| 6182 | { |
| 6183 | /* The Windows driver sets the codec up in a very different way where |
| 6184 | * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it |
| 6185 | */ |
| 6186 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) |
| 6187 | alc_write_coef_idx(codec, 0x10, 0x8a20); |
| 6188 | else |
| 6189 | alc_write_coef_idx(codec, 0x10, 0x0a20); |
| 6190 | } |
| 6191 | |
| 6192 | static void alc294_fixup_gx502_hp(struct hda_codec *codec, |
| 6193 | const struct hda_fixup *fix, int action) |
| 6194 | { |
| 6195 | /* Pin 0x21: headphones/headset mic */ |
| 6196 | if (!is_jack_detectable(codec, 0x21)) |
| 6197 | return; |
| 6198 | |
| 6199 | switch (action) { |
| 6200 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6201 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 6202 | alc294_gx502_toggle_output); |
| 6203 | break; |
| 6204 | case HDA_FIXUP_ACT_INIT: |
| 6205 | /* Make sure to start in a correct state, i.e. if |
| 6206 | * headphones have been plugged in before powering up the system |
| 6207 | */ |
| 6208 | alc294_gx502_toggle_output(codec, NULL); |
| 6209 | break; |
| 6210 | } |
| 6211 | } |
| 6212 | |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 6213 | static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, |
| 6214 | const struct hda_fixup *fix, int action) |
| 6215 | { |
| 6216 | if (action != HDA_FIXUP_ACT_INIT) |
| 6217 | return; |
| 6218 | |
| 6219 | msleep(100); |
| 6220 | alc_write_coef_idx(codec, 0x65, 0x0); |
| 6221 | } |
| 6222 | |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6223 | static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, |
| 6224 | const struct hda_fixup *fix, int action) |
| 6225 | { |
| 6226 | switch (action) { |
| 6227 | case HDA_FIXUP_ACT_INIT: |
| 6228 | alc_combo_jack_hp_jd_restart(codec); |
| 6229 | break; |
| 6230 | } |
| 6231 | } |
| 6232 | |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 6233 | static void alc_fixup_no_int_mic(struct hda_codec *codec, |
| 6234 | const struct hda_fixup *fix, int action) |
| 6235 | { |
| 6236 | struct alc_spec *spec = codec->spec; |
| 6237 | |
| 6238 | switch (action) { |
| 6239 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6240 | /* Mic RING SLEEVE swap for combo jack */ |
| 6241 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); |
| 6242 | spec->no_internal_mic_pin = true; |
| 6243 | break; |
| 6244 | case HDA_FIXUP_ACT_INIT: |
| 6245 | alc_combo_jack_hp_jd_restart(codec); |
| 6246 | break; |
| 6247 | } |
| 6248 | } |
| 6249 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 6250 | /* for hda_fixup_thinkpad_acpi() */ |
| 6251 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6252 | |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6253 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
| 6254 | const struct hda_fixup *fix, int action) |
| 6255 | { |
| 6256 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ |
| 6257 | hda_fixup_thinkpad_acpi(codec, fix, action); |
| 6258 | } |
| 6259 | |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6260 | /* for alc295_fixup_hp_top_speakers */ |
| 6261 | #include "hp_x360_helper.c" |
| 6262 | |
Takashi Iwai | 26928ca | 2021-04-16 10:12:11 +0200 | [diff] [blame] | 6263 | /* for alc285_fixup_ideapad_s740_coef() */ |
| 6264 | #include "ideapad_s740_helper.c" |
| 6265 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6266 | enum { |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame] | 6267 | ALC269_FIXUP_GPIO2, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6268 | ALC269_FIXUP_SONY_VAIO, |
| 6269 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 6270 | ALC269_FIXUP_DELL_M101Z, |
| 6271 | ALC269_FIXUP_SKU_IGNORE, |
| 6272 | ALC269_FIXUP_ASUS_G73JW, |
| 6273 | ALC269_FIXUP_LENOVO_EAPD, |
| 6274 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6275 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6276 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6277 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6278 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 6279 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6280 | ALC269_FIXUP_QUANTA_MUTE, |
| 6281 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 6282 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 6283 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6284 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 6285 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6286 | ALC269_FIXUP_AMIC, |
| 6287 | ALC269_FIXUP_DMIC, |
| 6288 | ALC269VB_FIXUP_AMIC, |
| 6289 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6290 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 6291 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6292 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6293 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6294 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6295 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 6296 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6297 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6298 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 6299 | ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6300 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6301 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6302 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6303 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6304 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6305 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 6306 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6307 | ALC269_FIXUP_HEADSET_MODE, |
| 6308 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6309 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6310 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 6311 | ALC269_FIXUP_ASUS_X101_VERB, |
| 6312 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6313 | ALC271_FIXUP_AMIC_MIC2, |
| 6314 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6315 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6316 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6317 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6318 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6319 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6320 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6321 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6322 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6323 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6324 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6325 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6326 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6327 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6328 | ALC290_FIXUP_SUBWOOFER, |
| 6329 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6330 | ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6331 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6332 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6333 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6334 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6335 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6336 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6337 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6338 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6339 | ALC292_FIXUP_TPT440_DOCK, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6340 | ALC292_FIXUP_TPT440, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6341 | ALC283_FIXUP_HEADSET_MIC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6342 | ALC255_FIXUP_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6343 | ALC282_FIXUP_ASPIRE_V5_PINS, |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 6344 | ALC269VB_FIXUP_ASPIRE_E1_COEF, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6345 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6346 | ALC286_FIXUP_HP_GPIO_LED, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6347 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6348 | ALC280_FIXUP_HP_DOCK_PINS, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6349 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6350 | ALC280_FIXUP_HP_9480M, |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 6351 | ALC245_FIXUP_HP_X360_AMP, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6352 | ALC288_FIXUP_DELL_HEADSET_MODE, |
| 6353 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6354 | ALC288_FIXUP_DELL_XPS_13, |
| 6355 | ALC288_FIXUP_DISABLE_AAMIX, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6356 | ALC292_FIXUP_DELL_E7X_AAMIX, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6357 | ALC292_FIXUP_DELL_E7X, |
| 6358 | ALC292_FIXUP_DISABLE_AAMIX, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6359 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 6360 | ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6361 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6362 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6363 | ALC275_FIXUP_DELL_XPS, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6364 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6365 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6366 | ALC255_FIXUP_DELL_SPK_NOISE, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6367 | ALC225_FIXUP_DISABLE_MIC_VREF, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6368 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6369 | ALC295_FIXUP_DISABLE_DAC3, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6370 | ALC285_FIXUP_SPEAKER2_TO_DAC1, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6371 | ALC280_FIXUP_HP_HEADSET_MIC, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6372 | ALC221_FIXUP_HP_FRONT_MIC, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6373 | ALC292_FIXUP_TPT460, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6374 | ALC298_FIXUP_SPK_VOLUME, |
Kailang Yang | f86de9b | 2020-10-23 14:46:47 +0800 | [diff] [blame] | 6375 | ALC298_FIXUP_LENOVO_SPK_VOLUME, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6376 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6377 | ALC269_FIXUP_ATIV_BOOK_8, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6378 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6379 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
| 6380 | ALC256_FIXUP_ASUS_MIC, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6381 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6382 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 6383 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6384 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 6385 | ALC233_FIXUP_ACER_HEADSET_MIC, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6386 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6387 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 6388 | ALC225_FIXUP_S3_POP_NOISE, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6389 | ALC700_FIXUP_INTEL_REFERENCE, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6390 | ALC274_FIXUP_DELL_BIND_DACS, |
| 6391 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 6392 | ALC298_FIXUP_TPT470_DOCK_FIX, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6393 | ALC298_FIXUP_TPT470_DOCK, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6394 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6395 | ALC255_FIXUP_DELL_HEADSET_MIC, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 6396 | ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 6397 | ALC298_FIXUP_HUAWEI_MBX_STEREO, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6398 | ALC295_FIXUP_HP_X360, |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 6399 | ALC221_FIXUP_HP_HEADSET_MIC, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6400 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6401 | ALC295_FIXUP_HP_AUTO_MUTE, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 6402 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 6403 | ALC294_FIXUP_ASUS_MIC, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6404 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
| 6405 | ALC294_FIXUP_ASUS_SPK, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 6406 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 6407 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6408 | ALC255_FIXUP_ACER_HEADSET_MIC, |
Kailang Yang | 10f5b1b | 2019-02-21 16:10:22 +0800 | [diff] [blame] | 6409 | ALC295_FIXUP_CHROME_BOOK, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6410 | ALC225_FIXUP_HEADSET_JACK, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 6411 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
| 6412 | ALC225_FIXUP_WYSE_AUTO_MUTE, |
| 6413 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6414 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 6415 | ALC256_FIXUP_ASUS_HEADSET_MIC, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 6416 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 6417 | ALC299_FIXUP_PREDATOR_SPK, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 6418 | ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 6419 | ALC289_FIXUP_DELL_SPK2, |
| 6420 | ALC289_FIXUP_DUAL_SPK, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 6421 | ALC294_FIXUP_SPK2_TO_DAC1, |
| 6422 | ALC294_FIXUP_ASUS_DUAL_SPK, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 6423 | ALC285_FIXUP_THINKPAD_X1_GEN7, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 6424 | ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 6425 | ALC294_FIXUP_ASUS_HPE, |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 6426 | ALC294_FIXUP_ASUS_COEF_1B, |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 6427 | ALC294_FIXUP_ASUS_GX502_HP, |
| 6428 | ALC294_FIXUP_ASUS_GX502_PINS, |
| 6429 | ALC294_FIXUP_ASUS_GX502_VERBS, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 6430 | ALC285_FIXUP_HP_GPIO_LED, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 6431 | ALC285_FIXUP_HP_MUTE_LED, |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 6432 | ALC236_FIXUP_HP_GPIO_LED, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 6433 | ALC236_FIXUP_HP_MUTE_LED, |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 6434 | ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, |
Mike Pozulp | 14425f1 | 2020-05-09 20:28:37 -0700 | [diff] [blame] | 6435 | ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 6436 | ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | 8eae7e9 | 2020-07-06 15:18:25 +0800 | [diff] [blame] | 6437 | ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, |
Jian-Hong Pan | 6e15d12 | 2020-07-06 15:18:27 +0800 | [diff] [blame] | 6438 | ALC269VC_FIXUP_ACER_HEADSET_MIC, |
Jian-Hong Pan | 781c90c | 2020-07-06 15:18:29 +0800 | [diff] [blame] | 6439 | ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 6440 | ALC289_FIXUP_ASUS_GA401, |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 6441 | ALC289_FIXUP_ASUS_GA502, |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 6442 | ALC256_FIXUP_ACER_MIC_NO_PRESENCE, |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 6443 | ALC285_FIXUP_HP_GPIO_AMP_INIT, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 6444 | ALC269_FIXUP_CZC_B20, |
| 6445 | ALC269_FIXUP_CZC_TMI, |
| 6446 | ALC269_FIXUP_CZC_L101, |
| 6447 | ALC269_FIXUP_LEMOTE_A1802, |
| 6448 | ALC269_FIXUP_LEMOTE_A190X, |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 6449 | ALC256_FIXUP_INTEL_NUC8_RUGGED, |
Phil Calvin | d1ee66c | 2021-04-15 18:01:29 -0400 | [diff] [blame] | 6450 | ALC233_FIXUP_INTEL_NUC8_DMIC, |
| 6451 | ALC233_FIXUP_INTEL_NUC8_BOOST, |
Werner Sembach | 73e7161 | 2021-03-02 19:04:14 +0100 | [diff] [blame] | 6452 | ALC256_FIXUP_INTEL_NUC10, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 6453 | ALC255_FIXUP_XIAOMI_HEADSET_MIC, |
Hui Wang | 13468bf | 2020-09-28 16:01:17 +0800 | [diff] [blame] | 6454 | ALC274_FIXUP_HP_MIC, |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6455 | ALC274_FIXUP_HP_HEADSET_MIC, |
Kailang Yang | ef9ce66 | 2020-11-03 15:40:35 +0800 | [diff] [blame] | 6456 | ALC256_FIXUP_ASUS_HPE, |
Kailang Yang | 446b818 | 2020-11-02 15:00:12 +0800 | [diff] [blame] | 6457 | ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 6458 | ALC287_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 6459 | ALC256_FIXUP_HP_HEADSET_MIC, |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 6460 | ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
Chris Chiu | 34cdf40 | 2020-12-16 20:52:00 +0800 | [diff] [blame] | 6461 | ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
Chris Chiu | 495dc76 | 2021-01-14 16:27:28 +0800 | [diff] [blame] | 6462 | ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST, |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 6463 | ALC256_FIXUP_ACER_HEADSET_MIC, |
Takashi Iwai | 26928ca | 2021-04-16 10:12:11 +0200 | [diff] [blame] | 6464 | ALC285_FIXUP_IDEAPAD_S740_COEF, |
Kai-Heng Feng | bd15b15 | 2021-04-20 19:55:29 +0800 | [diff] [blame] | 6465 | ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6466 | }; |
| 6467 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6468 | static const struct hda_fixup alc269_fixups[] = { |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame] | 6469 | [ALC269_FIXUP_GPIO2] = { |
| 6470 | .type = HDA_FIXUP_FUNC, |
| 6471 | .v.func = alc_fixup_gpio2, |
| 6472 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6473 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 6474 | .type = HDA_FIXUP_PINCTLS, |
| 6475 | .v.pins = (const struct hda_pintbl[]) { |
| 6476 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6477 | {} |
| 6478 | } |
| 6479 | }, |
| 6480 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6481 | .type = HDA_FIXUP_FUNC, |
| 6482 | .v.func = alc275_fixup_gpio4_off, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6483 | .chained = true, |
| 6484 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 6485 | }, |
| 6486 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6487 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6488 | .v.verbs = (const struct hda_verb[]) { |
| 6489 | /* Enables internal speaker */ |
| 6490 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 6491 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 6492 | {} |
| 6493 | } |
| 6494 | }, |
| 6495 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6496 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 6497 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6498 | }, |
| 6499 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6500 | .type = HDA_FIXUP_PINS, |
| 6501 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6502 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 6503 | { } |
| 6504 | } |
| 6505 | }, |
| 6506 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6507 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6508 | .v.verbs = (const struct hda_verb[]) { |
| 6509 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 6510 | {} |
| 6511 | } |
| 6512 | }, |
| 6513 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6514 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6515 | .v.func = alc269_fixup_hweq, |
| 6516 | .chained = true, |
| 6517 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 6518 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6519 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 6520 | .type = HDA_FIXUP_FUNC, |
| 6521 | .v.func = alc_fixup_disable_aamix, |
| 6522 | .chained = true, |
| 6523 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 6524 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6525 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6526 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6527 | .v.func = alc271_fixup_dmic, |
| 6528 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6529 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6530 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6531 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 6532 | .chained = true, |
| 6533 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6534 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6535 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6536 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6537 | .v.func = alc269_fixup_stereo_dmic, |
| 6538 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 6539 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 6540 | .type = HDA_FIXUP_FUNC, |
| 6541 | .v.func = alc269_fixup_headset_mic, |
| 6542 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6543 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6544 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6545 | .v.func = alc269_fixup_quanta_mute, |
| 6546 | }, |
| 6547 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6548 | .type = HDA_FIXUP_PINS, |
| 6549 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6550 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 6551 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 6552 | { } |
| 6553 | }, |
| 6554 | .chained = true, |
| 6555 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 6556 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 6557 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 6558 | .type = HDA_FIXUP_PINS, |
| 6559 | .v.pins = (const struct hda_pintbl[]) { |
| 6560 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 6561 | { } |
| 6562 | }, |
| 6563 | }, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 6564 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
| 6565 | .type = HDA_FIXUP_PINS, |
| 6566 | .v.pins = (const struct hda_pintbl[]) { |
| 6567 | { 0x21, 0x0221102f }, /* HP out */ |
| 6568 | { } |
| 6569 | }, |
| 6570 | }, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6571 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
| 6572 | .type = HDA_FIXUP_FUNC, |
| 6573 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
| 6574 | }, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 6575 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
| 6576 | .type = HDA_FIXUP_FUNC, |
| 6577 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, |
| 6578 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6579 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6580 | .type = HDA_FIXUP_PINS, |
| 6581 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6582 | { 0x14, 0x99130110 }, /* speaker */ |
| 6583 | { 0x15, 0x0121401f }, /* HP out */ |
| 6584 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6585 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 6586 | { } |
| 6587 | }, |
| 6588 | }, |
| 6589 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6590 | .type = HDA_FIXUP_PINS, |
| 6591 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6592 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6593 | { 0x14, 0x99130110 }, /* speaker */ |
| 6594 | { 0x15, 0x0121401f }, /* HP out */ |
| 6595 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6596 | { } |
| 6597 | }, |
| 6598 | }, |
| 6599 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6600 | .type = HDA_FIXUP_PINS, |
| 6601 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6602 | { 0x14, 0x99130110 }, /* speaker */ |
| 6603 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6604 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 6605 | { 0x21, 0x0121401f }, /* HP out */ |
| 6606 | { } |
| 6607 | }, |
| 6608 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 6609 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6610 | .type = HDA_FIXUP_PINS, |
| 6611 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6612 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6613 | { 0x14, 0x99130110 }, /* speaker */ |
| 6614 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6615 | { 0x21, 0x0121401f }, /* HP out */ |
| 6616 | { } |
| 6617 | }, |
| 6618 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6619 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6620 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6621 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 6622 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 6623 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 6624 | .type = HDA_FIXUP_FUNC, |
| 6625 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 6626 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6627 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6628 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6629 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 6630 | }, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6631 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
| 6632 | .type = HDA_FIXUP_FUNC, |
| 6633 | .v.func = alc269_fixup_hp_mute_led_mic3, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6634 | .chained = true, |
| 6635 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6636 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6637 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 6638 | .type = HDA_FIXUP_FUNC, |
| 6639 | .v.func = alc269_fixup_hp_gpio_led, |
| 6640 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6641 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 6642 | .type = HDA_FIXUP_FUNC, |
| 6643 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 6644 | }, |
| 6645 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 6646 | .type = HDA_FIXUP_FUNC, |
| 6647 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 6648 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6649 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6650 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 6651 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6652 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6653 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 6654 | .type = HDA_FIXUP_FUNC, |
| 6655 | .v.func = alc_fixup_no_shutup, |
| 6656 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6657 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6658 | .type = HDA_FIXUP_PINS, |
| 6659 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6660 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 6661 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 6662 | { } |
| 6663 | }, |
| 6664 | .chained = true, |
| 6665 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 6666 | }, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 6667 | [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { |
| 6668 | .type = HDA_FIXUP_FUNC, |
| 6669 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6670 | .chained = true, |
| 6671 | .chain_id = ALC269_FIXUP_LENOVO_DOCK, |
| 6672 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6673 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6674 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6675 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 6676 | .chained = true, |
| 6677 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6678 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6679 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6680 | .type = HDA_FIXUP_PINS, |
| 6681 | .v.pins = (const struct hda_pintbl[]) { |
| 6682 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6683 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6684 | { } |
| 6685 | }, |
| 6686 | .chained = true, |
| 6687 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6688 | }, |
| 6689 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6690 | .type = HDA_FIXUP_PINS, |
| 6691 | .v.pins = (const struct hda_pintbl[]) { |
| 6692 | { 0x16, 0x21014020 }, /* dock line out */ |
| 6693 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 6694 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6695 | { } |
| 6696 | }, |
| 6697 | .chained = true, |
| 6698 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6699 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6700 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 6701 | .type = HDA_FIXUP_PINS, |
| 6702 | .v.pins = (const struct hda_pintbl[]) { |
| 6703 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6704 | { } |
| 6705 | }, |
| 6706 | .chained = true, |
| 6707 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6708 | }, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 6709 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
| 6710 | .type = HDA_FIXUP_PINS, |
| 6711 | .v.pins = (const struct hda_pintbl[]) { |
| 6712 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6713 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6714 | { } |
| 6715 | }, |
| 6716 | .chained = true, |
| 6717 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6718 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6719 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 6720 | .type = HDA_FIXUP_FUNC, |
| 6721 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 6722 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6723 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6724 | }, |
| 6725 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6726 | .type = HDA_FIXUP_FUNC, |
| 6727 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 6728 | }, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6729 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
| 6730 | .type = HDA_FIXUP_PINS, |
| 6731 | .v.pins = (const struct hda_pintbl[]) { |
| 6732 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 6733 | { } |
| 6734 | }, |
| 6735 | .chained = true, |
| 6736 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 6737 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6738 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 6739 | .type = HDA_FIXUP_PINS, |
| 6740 | .v.pins = (const struct hda_pintbl[]) { |
| 6741 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6742 | { } |
| 6743 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 6744 | .chained = true, |
| 6745 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6746 | }, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 6747 | [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6748 | .type = HDA_FIXUP_PINS, |
| 6749 | .v.pins = (const struct hda_pintbl[]) { |
| 6750 | {0x12, 0x90a60130}, |
| 6751 | {0x13, 0x40000000}, |
| 6752 | {0x14, 0x90170110}, |
| 6753 | {0x18, 0x411111f0}, |
| 6754 | {0x19, 0x04a11040}, |
| 6755 | {0x1a, 0x411111f0}, |
| 6756 | {0x1b, 0x90170112}, |
| 6757 | {0x1d, 0x40759a05}, |
| 6758 | {0x1e, 0x411111f0}, |
| 6759 | {0x21, 0x04211020}, |
| 6760 | { } |
| 6761 | }, |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 6762 | .chained = true, |
| 6763 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6764 | }, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 6765 | [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { |
| 6766 | .type = HDA_FIXUP_FUNC, |
| 6767 | .v.func = alc298_fixup_huawei_mbx_stereo, |
| 6768 | .chained = true, |
| 6769 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
| 6770 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6771 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 6772 | .type = HDA_FIXUP_FUNC, |
| 6773 | .v.func = alc269_fixup_x101_headset_mic, |
| 6774 | }, |
| 6775 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 6776 | .type = HDA_FIXUP_VERBS, |
| 6777 | .v.verbs = (const struct hda_verb[]) { |
| 6778 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 6779 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 6780 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 6781 | { } |
| 6782 | }, |
| 6783 | .chained = true, |
| 6784 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 6785 | }, |
| 6786 | [ALC269_FIXUP_ASUS_X101] = { |
| 6787 | .type = HDA_FIXUP_PINS, |
| 6788 | .v.pins = (const struct hda_pintbl[]) { |
| 6789 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 6790 | { } |
| 6791 | }, |
| 6792 | .chained = true, |
| 6793 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 6794 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6795 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6796 | .type = HDA_FIXUP_PINS, |
| 6797 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6798 | { 0x14, 0x99130110 }, /* speaker */ |
| 6799 | { 0x19, 0x01a19c20 }, /* mic */ |
| 6800 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 6801 | { 0x21, 0x0121401f }, /* HP out */ |
| 6802 | { } |
| 6803 | }, |
| 6804 | }, |
| 6805 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6806 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6807 | .v.func = alc271_hp_gate_mic_jack, |
| 6808 | .chained = true, |
| 6809 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 6810 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6811 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 6812 | .type = HDA_FIXUP_FUNC, |
| 6813 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6814 | .chained = true, |
| 6815 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 6816 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6817 | [ALC269_FIXUP_ACER_AC700] = { |
| 6818 | .type = HDA_FIXUP_PINS, |
| 6819 | .v.pins = (const struct hda_pintbl[]) { |
| 6820 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6821 | { 0x14, 0x99130110 }, /* speaker */ |
| 6822 | { 0x18, 0x03a11c20 }, /* mic */ |
| 6823 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 6824 | { 0x21, 0x0321101f }, /* HP out */ |
| 6825 | { } |
| 6826 | }, |
| 6827 | .chained = true, |
| 6828 | .chain_id = ALC271_FIXUP_DMIC, |
| 6829 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6830 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 6831 | .type = HDA_FIXUP_FUNC, |
| 6832 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 6833 | .chained = true, |
| 6834 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6835 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6836 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 6837 | .type = HDA_FIXUP_FUNC, |
| 6838 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6839 | .chained = true, |
| 6840 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 6841 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6842 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 6843 | .type = HDA_FIXUP_VERBS, |
| 6844 | .v.verbs = (const struct hda_verb[]) { |
| 6845 | /* class-D output amp +5dB */ |
| 6846 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 6847 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 6848 | {} |
| 6849 | }, |
| 6850 | .chained = true, |
| 6851 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 6852 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6853 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 6854 | .type = HDA_FIXUP_FUNC, |
| 6855 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6856 | .chained = true, |
| 6857 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 6858 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6859 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 6860 | .type = HDA_FIXUP_PINS, |
| 6861 | .v.pins = (const struct hda_pintbl[]) { |
| 6862 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6863 | { 0x18, 0x03a11d20 }, /* mic */ |
| 6864 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 6865 | { } |
| 6866 | }, |
| 6867 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6868 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 6869 | .type = HDA_FIXUP_FUNC, |
| 6870 | .v.func = alc283_fixup_chromebook, |
| 6871 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6872 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 6873 | .type = HDA_FIXUP_FUNC, |
| 6874 | .v.func = alc283_fixup_sense_combo_jack, |
| 6875 | .chained = true, |
| 6876 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 6877 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6878 | [ALC282_FIXUP_ASUS_TX300] = { |
| 6879 | .type = HDA_FIXUP_FUNC, |
| 6880 | .v.func = alc282_fixup_asus_tx300, |
| 6881 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6882 | [ALC283_FIXUP_INT_MIC] = { |
| 6883 | .type = HDA_FIXUP_VERBS, |
| 6884 | .v.verbs = (const struct hda_verb[]) { |
| 6885 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 6886 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 6887 | { } |
| 6888 | }, |
| 6889 | .chained = true, |
| 6890 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6891 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6892 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 6893 | .type = HDA_FIXUP_PINS, |
| 6894 | .v.pins = (const struct hda_pintbl[]) { |
| 6895 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6896 | { } |
| 6897 | }, |
| 6898 | .chained = true, |
| 6899 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6900 | }, |
| 6901 | [ALC290_FIXUP_SUBWOOFER] = { |
| 6902 | .type = HDA_FIXUP_PINS, |
| 6903 | .v.pins = (const struct hda_pintbl[]) { |
| 6904 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6905 | { } |
| 6906 | }, |
| 6907 | .chained = true, |
| 6908 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 6909 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6910 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 6911 | .type = HDA_FIXUP_FUNC, |
| 6912 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6913 | }, |
| 6914 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 6915 | .type = HDA_FIXUP_FUNC, |
| 6916 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6917 | .chained = true, |
| 6918 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 6919 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6920 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 6921 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6922 | .v.func = alc_fixup_thinkpad_acpi, |
Takashi Iwai | 09da111 | 2016-09-08 12:15:02 +0200 | [diff] [blame] | 6923 | .chained = true, |
| 6924 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6925 | }, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6926 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
| 6927 | .type = HDA_FIXUP_FUNC, |
| 6928 | .v.func = alc_fixup_inv_dmic, |
| 6929 | .chained = true, |
| 6930 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 6931 | }, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6932 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 6933 | .type = HDA_FIXUP_PINS, |
| 6934 | .v.pins = (const struct hda_pintbl[]) { |
| 6935 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6936 | { } |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6937 | }, |
| 6938 | .chained = true, |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 6939 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6940 | }, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6941 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6942 | .type = HDA_FIXUP_PINS, |
| 6943 | .v.pins = (const struct hda_pintbl[]) { |
| 6944 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6945 | { } |
| 6946 | }, |
| 6947 | .chained = true, |
| 6948 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6949 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6950 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6951 | .type = HDA_FIXUP_PINS, |
| 6952 | .v.pins = (const struct hda_pintbl[]) { |
| 6953 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6954 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6955 | { } |
| 6956 | }, |
| 6957 | .chained = true, |
| 6958 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6959 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6960 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6961 | .type = HDA_FIXUP_PINS, |
| 6962 | .v.pins = (const struct hda_pintbl[]) { |
| 6963 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6964 | { } |
| 6965 | }, |
| 6966 | .chained = true, |
| 6967 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6968 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6969 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 6970 | .type = HDA_FIXUP_FUNC, |
| 6971 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 6972 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6973 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6974 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6975 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6976 | .type = HDA_FIXUP_FUNC, |
| 6977 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 6978 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6979 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6980 | .type = HDA_FIXUP_PINS, |
| 6981 | .v.pins = (const struct hda_pintbl[]) { |
| 6982 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6983 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6984 | { } |
| 6985 | }, |
| 6986 | .chained = true, |
| 6987 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6988 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6989 | [ALC292_FIXUP_TPT440_DOCK] = { |
David Henningsson | ec56af6 | 2015-06-24 10:46:33 +0200 | [diff] [blame] | 6990 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 6991 | .v.func = alc_fixup_tpt440_dock, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6992 | .chained = true, |
| 6993 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6994 | }, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6995 | [ALC292_FIXUP_TPT440] = { |
| 6996 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 157f0b7 | 2015-12-10 23:30:43 +0100 | [diff] [blame] | 6997 | .v.func = alc_fixup_disable_aamix, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6998 | .chained = true, |
| 6999 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
| 7000 | }, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 7001 | [ALC283_FIXUP_HEADSET_MIC] = { |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 7002 | .type = HDA_FIXUP_PINS, |
| 7003 | .v.pins = (const struct hda_pintbl[]) { |
| 7004 | { 0x19, 0x04a110f0 }, |
| 7005 | { }, |
| 7006 | }, |
| 7007 | }, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7008 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 7009 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 7010 | .v.func = alc_fixup_micmute_led, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 7011 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 7012 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 7013 | .type = HDA_FIXUP_PINS, |
| 7014 | .v.pins = (const struct hda_pintbl[]) { |
| 7015 | { 0x12, 0x90a60130 }, |
| 7016 | { 0x14, 0x90170110 }, |
| 7017 | { 0x17, 0x40000008 }, |
| 7018 | { 0x18, 0x411111f0 }, |
Mateusz Sylwestrzak | 0420694 | 2015-07-19 17:38:56 +0200 | [diff] [blame] | 7019 | { 0x19, 0x01a1913c }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 7020 | { 0x1a, 0x411111f0 }, |
| 7021 | { 0x1b, 0x411111f0 }, |
| 7022 | { 0x1d, 0x40f89b2d }, |
| 7023 | { 0x1e, 0x411111f0 }, |
| 7024 | { 0x21, 0x0321101f }, |
| 7025 | { }, |
| 7026 | }, |
| 7027 | }, |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 7028 | [ALC269VB_FIXUP_ASPIRE_E1_COEF] = { |
| 7029 | .type = HDA_FIXUP_FUNC, |
| 7030 | .v.func = alc269vb_fixup_aspire_e1_coef, |
| 7031 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 7032 | [ALC280_FIXUP_HP_GPIO4] = { |
| 7033 | .type = HDA_FIXUP_FUNC, |
| 7034 | .v.func = alc280_fixup_hp_gpio4, |
| 7035 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 7036 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 7037 | .type = HDA_FIXUP_FUNC, |
| 7038 | .v.func = alc286_fixup_hp_gpio_led, |
| 7039 | }, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 7040 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
| 7041 | .type = HDA_FIXUP_FUNC, |
| 7042 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, |
| 7043 | }, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 7044 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
| 7045 | .type = HDA_FIXUP_PINS, |
| 7046 | .v.pins = (const struct hda_pintbl[]) { |
| 7047 | { 0x1b, 0x21011020 }, /* line-out */ |
| 7048 | { 0x1a, 0x01a1903c }, /* headset mic */ |
| 7049 | { 0x18, 0x2181103f }, /* line-in */ |
| 7050 | { }, |
| 7051 | }, |
| 7052 | .chained = true, |
| 7053 | .chain_id = ALC280_FIXUP_HP_GPIO4 |
| 7054 | }, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7055 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
| 7056 | .type = HDA_FIXUP_PINS, |
| 7057 | .v.pins = (const struct hda_pintbl[]) { |
| 7058 | { 0x1b, 0x21011020 }, /* line-out */ |
| 7059 | { 0x18, 0x2181103f }, /* line-in */ |
| 7060 | { }, |
| 7061 | }, |
| 7062 | .chained = true, |
| 7063 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED |
| 7064 | }, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 7065 | [ALC280_FIXUP_HP_9480M] = { |
| 7066 | .type = HDA_FIXUP_FUNC, |
| 7067 | .v.func = alc280_fixup_hp_9480m, |
| 7068 | }, |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 7069 | [ALC245_FIXUP_HP_X360_AMP] = { |
| 7070 | .type = HDA_FIXUP_FUNC, |
| 7071 | .v.func = alc245_fixup_hp_x360_amp, |
| 7072 | }, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7073 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
| 7074 | .type = HDA_FIXUP_FUNC, |
| 7075 | .v.func = alc_fixup_headset_mode_dell_alc288, |
| 7076 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7077 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7078 | }, |
| 7079 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7080 | .type = HDA_FIXUP_PINS, |
| 7081 | .v.pins = (const struct hda_pintbl[]) { |
| 7082 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7083 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7084 | { } |
| 7085 | }, |
| 7086 | .chained = true, |
| 7087 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE |
| 7088 | }, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7089 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
| 7090 | .type = HDA_FIXUP_FUNC, |
| 7091 | .v.func = alc_fixup_disable_aamix, |
| 7092 | .chained = true, |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 7093 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7094 | }, |
| 7095 | [ALC288_FIXUP_DELL_XPS_13] = { |
| 7096 | .type = HDA_FIXUP_FUNC, |
| 7097 | .v.func = alc_fixup_dell_xps13, |
| 7098 | .chained = true, |
| 7099 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX |
| 7100 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7101 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
| 7102 | .type = HDA_FIXUP_FUNC, |
| 7103 | .v.func = alc_fixup_disable_aamix, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7104 | .chained = true, |
| 7105 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7106 | }, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 7107 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
| 7108 | .type = HDA_FIXUP_FUNC, |
| 7109 | .v.func = alc_fixup_disable_aamix, |
| 7110 | .chained = true, |
| 7111 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7112 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 7113 | [ALC292_FIXUP_DELL_E7X_AAMIX] = { |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7114 | .type = HDA_FIXUP_FUNC, |
| 7115 | .v.func = alc_fixup_dell_xps13, |
| 7116 | .chained = true, |
| 7117 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX |
| 7118 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 7119 | [ALC292_FIXUP_DELL_E7X] = { |
| 7120 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 7121 | .v.func = alc_fixup_micmute_led, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 7122 | /* micmute fixup must be applied at last */ |
| 7123 | .chained_before = true, |
| 7124 | .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, |
| 7125 | }, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 7126 | [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { |
| 7127 | .type = HDA_FIXUP_PINS, |
| 7128 | .v.pins = (const struct hda_pintbl[]) { |
| 7129 | { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 7130 | { } |
| 7131 | }, |
| 7132 | .chained_before = true, |
| 7133 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 7134 | }, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7135 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7136 | .type = HDA_FIXUP_PINS, |
| 7137 | .v.pins = (const struct hda_pintbl[]) { |
| 7138 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7139 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7140 | { } |
| 7141 | }, |
| 7142 | .chained = true, |
| 7143 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7144 | }, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 7145 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
| 7146 | .type = HDA_FIXUP_PINS, |
| 7147 | .v.pins = (const struct hda_pintbl[]) { |
| 7148 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7149 | { } |
| 7150 | }, |
| 7151 | .chained = true, |
| 7152 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7153 | }, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 7154 | [ALC275_FIXUP_DELL_XPS] = { |
| 7155 | .type = HDA_FIXUP_VERBS, |
| 7156 | .v.verbs = (const struct hda_verb[]) { |
| 7157 | /* Enables internal speaker */ |
| 7158 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, |
| 7159 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, |
| 7160 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, |
| 7161 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, |
| 7162 | {} |
| 7163 | } |
| 7164 | }, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 7165 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
| 7166 | .type = HDA_FIXUP_FUNC, |
| 7167 | .v.func = alc_fixup_disable_aamix, |
| 7168 | .chained = true, |
| 7169 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 7170 | }, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 7171 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
| 7172 | .type = HDA_FIXUP_FUNC, |
| 7173 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, |
| 7174 | }, |
Phil Calvin | d1ee66c | 2021-04-15 18:01:29 -0400 | [diff] [blame] | 7175 | [ALC233_FIXUP_INTEL_NUC8_DMIC] = { |
| 7176 | .type = HDA_FIXUP_FUNC, |
| 7177 | .v.func = alc_fixup_inv_dmic, |
| 7178 | .chained = true, |
| 7179 | .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST, |
| 7180 | }, |
| 7181 | [ALC233_FIXUP_INTEL_NUC8_BOOST] = { |
| 7182 | .type = HDA_FIXUP_FUNC, |
| 7183 | .v.func = alc269_fixup_limit_int_mic_boost |
| 7184 | }, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 7185 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
| 7186 | .type = HDA_FIXUP_FUNC, |
| 7187 | .v.func = alc_fixup_disable_aamix, |
| 7188 | .chained = true, |
| 7189 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7190 | }, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 7191 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
| 7192 | .type = HDA_FIXUP_FUNC, |
| 7193 | .v.func = alc_fixup_disable_mic_vref, |
| 7194 | .chained = true, |
| 7195 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7196 | }, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7197 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7198 | .type = HDA_FIXUP_VERBS, |
| 7199 | .v.verbs = (const struct hda_verb[]) { |
| 7200 | /* Disable pass-through path for FRONT 14h */ |
| 7201 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 7202 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 7203 | {} |
| 7204 | }, |
| 7205 | .chained = true, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 7206 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7207 | }, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 7208 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
| 7209 | .type = HDA_FIXUP_FUNC, |
| 7210 | .v.func = alc_fixup_disable_aamix, |
| 7211 | .chained = true, |
| 7212 | .chain_id = ALC269_FIXUP_HEADSET_MIC, |
| 7213 | }, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 7214 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
| 7215 | .type = HDA_FIXUP_PINS, |
| 7216 | .v.pins = (const struct hda_pintbl[]) { |
| 7217 | { 0x19, 0x02a19020 }, /* Front Mic */ |
| 7218 | { } |
| 7219 | }, |
| 7220 | }, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7221 | [ALC292_FIXUP_TPT460] = { |
| 7222 | .type = HDA_FIXUP_FUNC, |
| 7223 | .v.func = alc_fixup_tpt440_dock, |
| 7224 | .chained = true, |
| 7225 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, |
| 7226 | }, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 7227 | [ALC298_FIXUP_SPK_VOLUME] = { |
| 7228 | .type = HDA_FIXUP_FUNC, |
| 7229 | .v.func = alc298_fixup_speaker_volume, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 7230 | .chained = true, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 7231 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 7232 | }, |
Kailang Yang | f86de9b | 2020-10-23 14:46:47 +0800 | [diff] [blame] | 7233 | [ALC298_FIXUP_LENOVO_SPK_VOLUME] = { |
| 7234 | .type = HDA_FIXUP_FUNC, |
| 7235 | .v.func = alc298_fixup_speaker_volume, |
| 7236 | }, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 7237 | [ALC295_FIXUP_DISABLE_DAC3] = { |
| 7238 | .type = HDA_FIXUP_FUNC, |
| 7239 | .v.func = alc295_fixup_disable_dac3, |
| 7240 | }, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 7241 | [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { |
| 7242 | .type = HDA_FIXUP_FUNC, |
| 7243 | .v.func = alc285_fixup_speaker2_to_dac1, |
Hui Wang | c37c0ab | 2020-02-19 13:23:06 +0800 | [diff] [blame] | 7244 | .chained = true, |
| 7245 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 7246 | }, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 7247 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
| 7248 | .type = HDA_FIXUP_PINS, |
| 7249 | .v.pins = (const struct hda_pintbl[]) { |
| 7250 | { 0x1b, 0x90170151 }, |
| 7251 | { } |
| 7252 | }, |
| 7253 | .chained = true, |
| 7254 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7255 | }, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 7256 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
| 7257 | .type = HDA_FIXUP_FUNC, |
| 7258 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7259 | .chained = true, |
| 7260 | .chain_id = ALC269_FIXUP_NO_SHUTUP |
| 7261 | }, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 7262 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
| 7263 | .type = HDA_FIXUP_PINS, |
| 7264 | .v.pins = (const struct hda_pintbl[]) { |
| 7265 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7266 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7267 | { } |
| 7268 | }, |
| 7269 | .chained = true, |
| 7270 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7271 | }, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7272 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
| 7273 | .type = HDA_FIXUP_FUNC, |
| 7274 | .v.func = alc_fixup_headset_mode, |
| 7275 | }, |
| 7276 | [ALC256_FIXUP_ASUS_MIC] = { |
| 7277 | .type = HDA_FIXUP_PINS, |
| 7278 | .v.pins = (const struct hda_pintbl[]) { |
| 7279 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 7280 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7281 | { } |
| 7282 | }, |
| 7283 | .chained = true, |
| 7284 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7285 | }, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7286 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 7287 | .type = HDA_FIXUP_FUNC, |
| 7288 | /* Set up GPIO2 for the speaker amp */ |
| 7289 | .v.func = alc_fixup_gpio4, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7290 | }, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 7291 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7292 | .type = HDA_FIXUP_PINS, |
| 7293 | .v.pins = (const struct hda_pintbl[]) { |
| 7294 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7295 | { } |
| 7296 | }, |
| 7297 | .chained = true, |
| 7298 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7299 | }, |
| 7300 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { |
| 7301 | .type = HDA_FIXUP_VERBS, |
| 7302 | .v.verbs = (const struct hda_verb[]) { |
| 7303 | /* Enables internal speaker */ |
| 7304 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, |
| 7305 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, |
| 7306 | {} |
| 7307 | }, |
| 7308 | .chained = true, |
| 7309 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 7310 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7311 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
| 7312 | .type = HDA_FIXUP_FUNC, |
| 7313 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame] | 7314 | .chained = true, |
| 7315 | .chain_id = ALC269_FIXUP_GPIO2 |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7316 | }, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 7317 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
| 7318 | .type = HDA_FIXUP_VERBS, |
| 7319 | .v.verbs = (const struct hda_verb[]) { |
| 7320 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 7321 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 7322 | { } |
| 7323 | }, |
| 7324 | .chained = true, |
| 7325 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 7326 | }, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 7327 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
| 7328 | .type = HDA_FIXUP_PINS, |
| 7329 | .v.pins = (const struct hda_pintbl[]) { |
| 7330 | /* Change the mic location from front to right, otherwise there are |
| 7331 | two front mics with the same name, pulseaudio can't handle them. |
| 7332 | This is just a temporary workaround, after applying this fixup, |
| 7333 | there will be one "Front Mic" and one "Mic" in this machine. |
| 7334 | */ |
| 7335 | { 0x1a, 0x04a19040 }, |
| 7336 | { } |
| 7337 | }, |
| 7338 | }, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 7339 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
| 7340 | .type = HDA_FIXUP_PINS, |
| 7341 | .v.pins = (const struct hda_pintbl[]) { |
| 7342 | { 0x16, 0x0101102f }, /* Rear Headset HP */ |
| 7343 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 7344 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ |
| 7345 | { 0x1b, 0x02011020 }, |
| 7346 | { } |
| 7347 | }, |
| 7348 | .chained = true, |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 7349 | .chain_id = ALC225_FIXUP_S3_POP_NOISE |
| 7350 | }, |
| 7351 | [ALC225_FIXUP_S3_POP_NOISE] = { |
| 7352 | .type = HDA_FIXUP_FUNC, |
| 7353 | .v.func = alc225_fixup_s3_pop_noise, |
| 7354 | .chained = true, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 7355 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7356 | }, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 7357 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
| 7358 | .type = HDA_FIXUP_VERBS, |
| 7359 | .v.verbs = (const struct hda_verb[]) { |
| 7360 | /* Enables internal speaker */ |
| 7361 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, |
| 7362 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, |
| 7363 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, |
| 7364 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, |
| 7365 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, |
| 7366 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, |
| 7367 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, |
| 7368 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, |
| 7369 | {} |
| 7370 | } |
| 7371 | }, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 7372 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
| 7373 | .type = HDA_FIXUP_FUNC, |
| 7374 | .v.func = alc274_fixup_bind_dacs, |
| 7375 | .chained = true, |
| 7376 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7377 | }, |
| 7378 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { |
| 7379 | .type = HDA_FIXUP_PINS, |
| 7380 | .v.pins = (const struct hda_pintbl[]) { |
| 7381 | { 0x1b, 0x0401102f }, |
| 7382 | { } |
| 7383 | }, |
| 7384 | .chained = true, |
| 7385 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS |
| 7386 | }, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 7387 | [ALC298_FIXUP_TPT470_DOCK_FIX] = { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7388 | .type = HDA_FIXUP_FUNC, |
| 7389 | .v.func = alc_fixup_tpt470_dock, |
| 7390 | .chained = true, |
| 7391 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE |
| 7392 | }, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 7393 | [ALC298_FIXUP_TPT470_DOCK] = { |
| 7394 | .type = HDA_FIXUP_FUNC, |
| 7395 | .v.func = alc_fixup_tpt470_dacs, |
| 7396 | .chained = true, |
| 7397 | .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX |
| 7398 | }, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 7399 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
| 7400 | .type = HDA_FIXUP_PINS, |
| 7401 | .v.pins = (const struct hda_pintbl[]) { |
| 7402 | { 0x14, 0x0201101f }, |
| 7403 | { } |
| 7404 | }, |
| 7405 | .chained = true, |
| 7406 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7407 | }, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7408 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
| 7409 | .type = HDA_FIXUP_PINS, |
| 7410 | .v.pins = (const struct hda_pintbl[]) { |
| 7411 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7412 | { } |
| 7413 | }, |
Hui Wang | 3ce0d5a | 2018-04-19 13:29:04 +0800 | [diff] [blame] | 7414 | .chained = true, |
| 7415 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7416 | }, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 7417 | [ALC295_FIXUP_HP_X360] = { |
| 7418 | .type = HDA_FIXUP_FUNC, |
| 7419 | .v.func = alc295_fixup_hp_top_speakers, |
| 7420 | .chained = true, |
| 7421 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 7422 | }, |
| 7423 | [ALC221_FIXUP_HP_HEADSET_MIC] = { |
| 7424 | .type = HDA_FIXUP_PINS, |
| 7425 | .v.pins = (const struct hda_pintbl[]) { |
| 7426 | { 0x19, 0x0181313f}, |
| 7427 | { } |
| 7428 | }, |
| 7429 | .chained = true, |
| 7430 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7431 | }, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7432 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
| 7433 | .type = HDA_FIXUP_FUNC, |
| 7434 | .v.func = alc285_fixup_invalidate_dacs, |
Hui Wang | 6ba189c | 2018-12-09 09:16:43 +0800 | [diff] [blame] | 7435 | .chained = true, |
| 7436 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7437 | }, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 7438 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
| 7439 | .type = HDA_FIXUP_FUNC, |
| 7440 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7441 | }, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 7442 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
| 7443 | .type = HDA_FIXUP_PINS, |
| 7444 | .v.pins = (const struct hda_pintbl[]) { |
| 7445 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7446 | { } |
| 7447 | }, |
| 7448 | .chained = true, |
| 7449 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7450 | }, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7451 | [ALC294_FIXUP_ASUS_MIC] = { |
| 7452 | .type = HDA_FIXUP_PINS, |
| 7453 | .v.pins = (const struct hda_pintbl[]) { |
| 7454 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 7455 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7456 | { } |
| 7457 | }, |
| 7458 | .chained = true, |
Kailang Yang | ef9ddb9 | 2020-07-10 15:31:11 +0800 | [diff] [blame] | 7459 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7460 | }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7461 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
| 7462 | .type = HDA_FIXUP_PINS, |
| 7463 | .v.pins = (const struct hda_pintbl[]) { |
Jian-Hong Pan | 82b0114 | 2018-12-27 16:46:31 +0800 | [diff] [blame] | 7464 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7465 | { } |
| 7466 | }, |
| 7467 | .chained = true, |
Kailang Yang | ef9ddb9 | 2020-07-10 15:31:11 +0800 | [diff] [blame] | 7468 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7469 | }, |
| 7470 | [ALC294_FIXUP_ASUS_SPK] = { |
| 7471 | .type = HDA_FIXUP_VERBS, |
| 7472 | .v.verbs = (const struct hda_verb[]) { |
| 7473 | /* Set EAPD high */ |
| 7474 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, |
| 7475 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, |
Kailang Yang | 473fbe13 | 2020-07-16 14:42:33 +0800 | [diff] [blame] | 7476 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 7477 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7478 | { } |
| 7479 | }, |
| 7480 | .chained = true, |
| 7481 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7482 | }, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 7483 | [ALC295_FIXUP_CHROME_BOOK] = { |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 7484 | .type = HDA_FIXUP_FUNC, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 7485 | .v.func = alc295_fixup_chromebook, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 7486 | .chained = true, |
| 7487 | .chain_id = ALC225_FIXUP_HEADSET_JACK |
| 7488 | }, |
| 7489 | [ALC225_FIXUP_HEADSET_JACK] = { |
| 7490 | .type = HDA_FIXUP_FUNC, |
| 7491 | .v.func = alc_fixup_headset_jack, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 7492 | }, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 7493 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
| 7494 | .type = HDA_FIXUP_PINS, |
| 7495 | .v.pins = (const struct hda_pintbl[]) { |
| 7496 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7497 | { } |
| 7498 | }, |
| 7499 | .chained = true, |
| 7500 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7501 | }, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 7502 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
| 7503 | .type = HDA_FIXUP_VERBS, |
| 7504 | .v.verbs = (const struct hda_verb[]) { |
| 7505 | /* Disable PCBEEP-IN passthrough */ |
| 7506 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 7507 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 7508 | { } |
| 7509 | }, |
| 7510 | .chained = true, |
| 7511 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
| 7512 | }, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 7513 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
| 7514 | .type = HDA_FIXUP_PINS, |
| 7515 | .v.pins = (const struct hda_pintbl[]) { |
| 7516 | { 0x19, 0x03a11130 }, |
| 7517 | { 0x1a, 0x90a60140 }, /* use as internal mic */ |
| 7518 | { } |
| 7519 | }, |
| 7520 | .chained = true, |
| 7521 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7522 | }, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 7523 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
| 7524 | .type = HDA_FIXUP_PINS, |
| 7525 | .v.pins = (const struct hda_pintbl[]) { |
| 7526 | { 0x16, 0x01011020 }, /* Rear Line out */ |
| 7527 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 7528 | { } |
| 7529 | }, |
| 7530 | .chained = true, |
| 7531 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE |
| 7532 | }, |
| 7533 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { |
| 7534 | .type = HDA_FIXUP_FUNC, |
| 7535 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7536 | .chained = true, |
| 7537 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF |
| 7538 | }, |
| 7539 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { |
| 7540 | .type = HDA_FIXUP_FUNC, |
| 7541 | .v.func = alc_fixup_disable_mic_vref, |
| 7542 | .chained = true, |
| 7543 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7544 | }, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 7545 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
| 7546 | .type = HDA_FIXUP_VERBS, |
| 7547 | .v.verbs = (const struct hda_verb[]) { |
| 7548 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, |
| 7549 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, |
| 7550 | { } |
| 7551 | }, |
| 7552 | .chained = true, |
| 7553 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE |
| 7554 | }, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 7555 | [ALC256_FIXUP_ASUS_HEADSET_MIC] = { |
| 7556 | .type = HDA_FIXUP_PINS, |
| 7557 | .v.pins = (const struct hda_pintbl[]) { |
| 7558 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 7559 | { } |
| 7560 | }, |
| 7561 | .chained = true, |
| 7562 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7563 | }, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 7564 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7565 | .type = HDA_FIXUP_PINS, |
| 7566 | .v.pins = (const struct hda_pintbl[]) { |
| 7567 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7568 | { } |
| 7569 | }, |
| 7570 | .chained = true, |
| 7571 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7572 | }, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7573 | [ALC299_FIXUP_PREDATOR_SPK] = { |
| 7574 | .type = HDA_FIXUP_PINS, |
| 7575 | .v.pins = (const struct hda_pintbl[]) { |
| 7576 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ |
| 7577 | { } |
| 7578 | } |
| 7579 | }, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 7580 | [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { |
| 7581 | .type = HDA_FIXUP_PINS, |
| 7582 | .v.pins = (const struct hda_pintbl[]) { |
| 7583 | { 0x19, 0x04a11040 }, |
| 7584 | { 0x21, 0x04211020 }, |
| 7585 | { } |
| 7586 | }, |
| 7587 | .chained = true, |
| 7588 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7589 | }, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 7590 | [ALC289_FIXUP_DELL_SPK2] = { |
| 7591 | .type = HDA_FIXUP_PINS, |
| 7592 | .v.pins = (const struct hda_pintbl[]) { |
| 7593 | { 0x17, 0x90170130 }, /* bass spk */ |
| 7594 | { } |
| 7595 | }, |
| 7596 | .chained = true, |
| 7597 | .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE |
| 7598 | }, |
| 7599 | [ALC289_FIXUP_DUAL_SPK] = { |
| 7600 | .type = HDA_FIXUP_FUNC, |
| 7601 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 7602 | .chained = true, |
| 7603 | .chain_id = ALC289_FIXUP_DELL_SPK2 |
| 7604 | }, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7605 | [ALC294_FIXUP_SPK2_TO_DAC1] = { |
| 7606 | .type = HDA_FIXUP_FUNC, |
| 7607 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 7608 | .chained = true, |
| 7609 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7610 | }, |
| 7611 | [ALC294_FIXUP_ASUS_DUAL_SPK] = { |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 7612 | .type = HDA_FIXUP_FUNC, |
| 7613 | /* The GPIO must be pulled to initialize the AMP */ |
| 7614 | .v.func = alc_fixup_gpio4, |
| 7615 | .chained = true, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7616 | .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 7617 | }, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 7618 | [ALC285_FIXUP_THINKPAD_X1_GEN7] = { |
| 7619 | .type = HDA_FIXUP_FUNC, |
| 7620 | .v.func = alc285_fixup_thinkpad_x1_gen7, |
| 7621 | .chained = true, |
| 7622 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 7623 | }, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 7624 | [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { |
| 7625 | .type = HDA_FIXUP_FUNC, |
| 7626 | .v.func = alc_fixup_headset_jack, |
| 7627 | .chained = true, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 7628 | .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 7629 | }, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 7630 | [ALC294_FIXUP_ASUS_HPE] = { |
| 7631 | .type = HDA_FIXUP_VERBS, |
| 7632 | .v.verbs = (const struct hda_verb[]) { |
| 7633 | /* Set EAPD high */ |
| 7634 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 7635 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, |
| 7636 | { } |
| 7637 | }, |
| 7638 | .chained = true, |
| 7639 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7640 | }, |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 7641 | [ALC294_FIXUP_ASUS_GX502_PINS] = { |
| 7642 | .type = HDA_FIXUP_PINS, |
| 7643 | .v.pins = (const struct hda_pintbl[]) { |
| 7644 | { 0x19, 0x03a11050 }, /* front HP mic */ |
| 7645 | { 0x1a, 0x01a11830 }, /* rear external mic */ |
| 7646 | { 0x21, 0x03211020 }, /* front HP out */ |
| 7647 | { } |
| 7648 | }, |
| 7649 | .chained = true, |
| 7650 | .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS |
| 7651 | }, |
| 7652 | [ALC294_FIXUP_ASUS_GX502_VERBS] = { |
| 7653 | .type = HDA_FIXUP_VERBS, |
| 7654 | .v.verbs = (const struct hda_verb[]) { |
| 7655 | /* set 0x15 to HP-OUT ctrl */ |
| 7656 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, |
| 7657 | /* unmute the 0x15 amp */ |
| 7658 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, |
| 7659 | { } |
| 7660 | }, |
| 7661 | .chained = true, |
| 7662 | .chain_id = ALC294_FIXUP_ASUS_GX502_HP |
| 7663 | }, |
| 7664 | [ALC294_FIXUP_ASUS_GX502_HP] = { |
| 7665 | .type = HDA_FIXUP_FUNC, |
| 7666 | .v.func = alc294_fixup_gx502_hp, |
| 7667 | }, |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 7668 | [ALC294_FIXUP_ASUS_COEF_1B] = { |
| 7669 | .type = HDA_FIXUP_VERBS, |
| 7670 | .v.verbs = (const struct hda_verb[]) { |
| 7671 | /* Set bit 10 to correct noisy output after reboot from |
| 7672 | * Windows 10 (due to pop noise reduction?) |
| 7673 | */ |
| 7674 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, |
| 7675 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, |
| 7676 | { } |
| 7677 | }, |
| 7678 | }, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 7679 | [ALC285_FIXUP_HP_GPIO_LED] = { |
| 7680 | .type = HDA_FIXUP_FUNC, |
| 7681 | .v.func = alc285_fixup_hp_gpio_led, |
| 7682 | }, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 7683 | [ALC285_FIXUP_HP_MUTE_LED] = { |
| 7684 | .type = HDA_FIXUP_FUNC, |
| 7685 | .v.func = alc285_fixup_hp_mute_led, |
| 7686 | }, |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 7687 | [ALC236_FIXUP_HP_GPIO_LED] = { |
| 7688 | .type = HDA_FIXUP_FUNC, |
| 7689 | .v.func = alc236_fixup_hp_gpio_led, |
| 7690 | }, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 7691 | [ALC236_FIXUP_HP_MUTE_LED] = { |
| 7692 | .type = HDA_FIXUP_FUNC, |
| 7693 | .v.func = alc236_fixup_hp_mute_led, |
| 7694 | }, |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 7695 | [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = { |
| 7696 | .type = HDA_FIXUP_FUNC, |
| 7697 | .v.func = alc236_fixup_hp_mute_led_micmute_vref, |
| 7698 | }, |
Mike Pozulp | 14425f1 | 2020-05-09 20:28:37 -0700 | [diff] [blame] | 7699 | [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { |
| 7700 | .type = HDA_FIXUP_VERBS, |
| 7701 | .v.verbs = (const struct hda_verb[]) { |
| 7702 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, |
| 7703 | { } |
| 7704 | }, |
| 7705 | }, |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 7706 | [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7707 | .type = HDA_FIXUP_PINS, |
| 7708 | .v.pins = (const struct hda_pintbl[]) { |
| 7709 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7710 | { } |
| 7711 | }, |
| 7712 | .chained = true, |
| 7713 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7714 | }, |
Jian-Hong Pan | 8eae7e9 | 2020-07-06 15:18:25 +0800 | [diff] [blame] | 7715 | [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { |
| 7716 | .type = HDA_FIXUP_PINS, |
| 7717 | .v.pins = (const struct hda_pintbl[]) { |
| 7718 | { 0x14, 0x90100120 }, /* use as internal speaker */ |
| 7719 | { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ |
| 7720 | { 0x1a, 0x01011020 }, /* use as line out */ |
| 7721 | { }, |
| 7722 | }, |
| 7723 | .chained = true, |
| 7724 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7725 | }, |
Jian-Hong Pan | 6e15d12 | 2020-07-06 15:18:27 +0800 | [diff] [blame] | 7726 | [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { |
| 7727 | .type = HDA_FIXUP_PINS, |
| 7728 | .v.pins = (const struct hda_pintbl[]) { |
| 7729 | { 0x18, 0x02a11030 }, /* use as headset mic */ |
| 7730 | { } |
| 7731 | }, |
| 7732 | .chained = true, |
| 7733 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7734 | }, |
Jian-Hong Pan | 781c90c | 2020-07-06 15:18:29 +0800 | [diff] [blame] | 7735 | [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 7736 | .type = HDA_FIXUP_PINS, |
| 7737 | .v.pins = (const struct hda_pintbl[]) { |
| 7738 | { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ |
| 7739 | { } |
| 7740 | }, |
| 7741 | .chained = true, |
| 7742 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7743 | }, |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 7744 | [ALC289_FIXUP_ASUS_GA401] = { |
Takashi Iwai | c84bfed | 2020-11-27 15:11:04 +0100 | [diff] [blame] | 7745 | .type = HDA_FIXUP_FUNC, |
| 7746 | .v.func = alc289_fixup_asus_ga401, |
| 7747 | .chained = true, |
| 7748 | .chain_id = ALC289_FIXUP_ASUS_GA502, |
Armas Spann | ff53664 | 2020-07-11 13:05:57 +0200 | [diff] [blame] | 7749 | }, |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 7750 | [ALC289_FIXUP_ASUS_GA502] = { |
| 7751 | .type = HDA_FIXUP_PINS, |
| 7752 | .v.pins = (const struct hda_pintbl[]) { |
| 7753 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 7754 | { } |
| 7755 | }, |
| 7756 | }, |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 7757 | [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 7758 | .type = HDA_FIXUP_PINS, |
| 7759 | .v.pins = (const struct hda_pintbl[]) { |
| 7760 | { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ |
| 7761 | { } |
| 7762 | }, |
| 7763 | .chained = true, |
| 7764 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7765 | }, |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 7766 | [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { |
| 7767 | .type = HDA_FIXUP_FUNC, |
| 7768 | .v.func = alc285_fixup_hp_gpio_amp_init, |
| 7769 | .chained = true, |
| 7770 | .chain_id = ALC285_FIXUP_HP_GPIO_LED |
| 7771 | }, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 7772 | [ALC269_FIXUP_CZC_B20] = { |
| 7773 | .type = HDA_FIXUP_PINS, |
| 7774 | .v.pins = (const struct hda_pintbl[]) { |
| 7775 | { 0x12, 0x411111f0 }, |
| 7776 | { 0x14, 0x90170110 }, /* speaker */ |
| 7777 | { 0x15, 0x032f1020 }, /* HP out */ |
| 7778 | { 0x17, 0x411111f0 }, |
| 7779 | { 0x18, 0x03ab1040 }, /* mic */ |
| 7780 | { 0x19, 0xb7a7013f }, |
| 7781 | { 0x1a, 0x0181305f }, |
| 7782 | { 0x1b, 0x411111f0 }, |
| 7783 | { 0x1d, 0x411111f0 }, |
| 7784 | { 0x1e, 0x411111f0 }, |
| 7785 | { } |
| 7786 | }, |
| 7787 | .chain_id = ALC269_FIXUP_DMIC, |
| 7788 | }, |
| 7789 | [ALC269_FIXUP_CZC_TMI] = { |
| 7790 | .type = HDA_FIXUP_PINS, |
| 7791 | .v.pins = (const struct hda_pintbl[]) { |
| 7792 | { 0x12, 0x4000c000 }, |
| 7793 | { 0x14, 0x90170110 }, /* speaker */ |
| 7794 | { 0x15, 0x0421401f }, /* HP out */ |
| 7795 | { 0x17, 0x411111f0 }, |
| 7796 | { 0x18, 0x04a19020 }, /* mic */ |
| 7797 | { 0x19, 0x411111f0 }, |
| 7798 | { 0x1a, 0x411111f0 }, |
| 7799 | { 0x1b, 0x411111f0 }, |
| 7800 | { 0x1d, 0x40448505 }, |
| 7801 | { 0x1e, 0x411111f0 }, |
| 7802 | { 0x20, 0x8000ffff }, |
| 7803 | { } |
| 7804 | }, |
| 7805 | .chain_id = ALC269_FIXUP_DMIC, |
| 7806 | }, |
| 7807 | [ALC269_FIXUP_CZC_L101] = { |
| 7808 | .type = HDA_FIXUP_PINS, |
| 7809 | .v.pins = (const struct hda_pintbl[]) { |
| 7810 | { 0x12, 0x40000000 }, |
| 7811 | { 0x14, 0x01014010 }, /* speaker */ |
| 7812 | { 0x15, 0x411111f0 }, /* HP out */ |
| 7813 | { 0x16, 0x411111f0 }, |
| 7814 | { 0x18, 0x01a19020 }, /* mic */ |
| 7815 | { 0x19, 0x02a19021 }, |
| 7816 | { 0x1a, 0x0181302f }, |
| 7817 | { 0x1b, 0x0221401f }, |
| 7818 | { 0x1c, 0x411111f0 }, |
| 7819 | { 0x1d, 0x4044c601 }, |
| 7820 | { 0x1e, 0x411111f0 }, |
| 7821 | { } |
| 7822 | }, |
| 7823 | .chain_id = ALC269_FIXUP_DMIC, |
| 7824 | }, |
| 7825 | [ALC269_FIXUP_LEMOTE_A1802] = { |
| 7826 | .type = HDA_FIXUP_PINS, |
| 7827 | .v.pins = (const struct hda_pintbl[]) { |
| 7828 | { 0x12, 0x40000000 }, |
| 7829 | { 0x14, 0x90170110 }, /* speaker */ |
| 7830 | { 0x17, 0x411111f0 }, |
| 7831 | { 0x18, 0x03a19040 }, /* mic1 */ |
| 7832 | { 0x19, 0x90a70130 }, /* mic2 */ |
| 7833 | { 0x1a, 0x411111f0 }, |
| 7834 | { 0x1b, 0x411111f0 }, |
| 7835 | { 0x1d, 0x40489d2d }, |
| 7836 | { 0x1e, 0x411111f0 }, |
| 7837 | { 0x20, 0x0003ffff }, |
| 7838 | { 0x21, 0x03214020 }, |
| 7839 | { } |
| 7840 | }, |
| 7841 | .chain_id = ALC269_FIXUP_DMIC, |
| 7842 | }, |
| 7843 | [ALC269_FIXUP_LEMOTE_A190X] = { |
| 7844 | .type = HDA_FIXUP_PINS, |
| 7845 | .v.pins = (const struct hda_pintbl[]) { |
| 7846 | { 0x14, 0x99130110 }, /* speaker */ |
| 7847 | { 0x15, 0x0121401f }, /* HP out */ |
| 7848 | { 0x18, 0x01a19c20 }, /* rear mic */ |
| 7849 | { 0x19, 0x99a3092f }, /* front mic */ |
| 7850 | { 0x1b, 0x0201401f }, /* front lineout */ |
| 7851 | { } |
| 7852 | }, |
| 7853 | .chain_id = ALC269_FIXUP_DMIC, |
| 7854 | }, |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 7855 | [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { |
| 7856 | .type = HDA_FIXUP_PINS, |
| 7857 | .v.pins = (const struct hda_pintbl[]) { |
| 7858 | { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7859 | { } |
| 7860 | }, |
| 7861 | .chained = true, |
| 7862 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7863 | }, |
Werner Sembach | 73e7161 | 2021-03-02 19:04:14 +0100 | [diff] [blame] | 7864 | [ALC256_FIXUP_INTEL_NUC10] = { |
| 7865 | .type = HDA_FIXUP_PINS, |
| 7866 | .v.pins = (const struct hda_pintbl[]) { |
| 7867 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7868 | { } |
| 7869 | }, |
| 7870 | .chained = true, |
| 7871 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7872 | }, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 7873 | [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { |
| 7874 | .type = HDA_FIXUP_VERBS, |
| 7875 | .v.verbs = (const struct hda_verb[]) { |
| 7876 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 7877 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 7878 | { } |
| 7879 | }, |
| 7880 | .chained = true, |
Takashi Iwai | c84bfed | 2020-11-27 15:11:04 +0100 | [diff] [blame] | 7881 | .chain_id = ALC289_FIXUP_ASUS_GA502 |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 7882 | }, |
Hui Wang | 13468bf | 2020-09-28 16:01:17 +0800 | [diff] [blame] | 7883 | [ALC274_FIXUP_HP_MIC] = { |
| 7884 | .type = HDA_FIXUP_VERBS, |
| 7885 | .v.verbs = (const struct hda_verb[]) { |
| 7886 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 7887 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 7888 | { } |
| 7889 | }, |
| 7890 | }, |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 7891 | [ALC274_FIXUP_HP_HEADSET_MIC] = { |
| 7892 | .type = HDA_FIXUP_FUNC, |
| 7893 | .v.func = alc274_fixup_hp_headset_mic, |
| 7894 | .chained = true, |
| 7895 | .chain_id = ALC274_FIXUP_HP_MIC |
| 7896 | }, |
Kailang Yang | ef9ce66 | 2020-11-03 15:40:35 +0800 | [diff] [blame] | 7897 | [ALC256_FIXUP_ASUS_HPE] = { |
| 7898 | .type = HDA_FIXUP_VERBS, |
| 7899 | .v.verbs = (const struct hda_verb[]) { |
| 7900 | /* Set EAPD high */ |
| 7901 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 7902 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, |
| 7903 | { } |
| 7904 | }, |
| 7905 | .chained = true, |
| 7906 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7907 | }, |
Kailang Yang | 446b818 | 2020-11-02 15:00:12 +0800 | [diff] [blame] | 7908 | [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = { |
| 7909 | .type = HDA_FIXUP_FUNC, |
| 7910 | .v.func = alc_fixup_headset_jack, |
| 7911 | .chained = true, |
| 7912 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 7913 | }, |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 7914 | [ALC287_FIXUP_HP_GPIO_LED] = { |
| 7915 | .type = HDA_FIXUP_FUNC, |
| 7916 | .v.func = alc287_fixup_hp_gpio_led, |
| 7917 | }, |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 7918 | [ALC256_FIXUP_HP_HEADSET_MIC] = { |
| 7919 | .type = HDA_FIXUP_FUNC, |
| 7920 | .v.func = alc274_fixup_hp_headset_mic, |
| 7921 | }, |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 7922 | [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = { |
| 7923 | .type = HDA_FIXUP_FUNC, |
| 7924 | .v.func = alc_fixup_no_int_mic, |
| 7925 | .chained = true, |
| 7926 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7927 | }, |
Chris Chiu | 34cdf40 | 2020-12-16 20:52:00 +0800 | [diff] [blame] | 7928 | [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = { |
| 7929 | .type = HDA_FIXUP_PINS, |
| 7930 | .v.pins = (const struct hda_pintbl[]) { |
| 7931 | { 0x1b, 0x411111f0 }, |
| 7932 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7933 | { }, |
| 7934 | }, |
| 7935 | .chained = true, |
| 7936 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7937 | }, |
Chris Chiu | 495dc76 | 2021-01-14 16:27:28 +0800 | [diff] [blame] | 7938 | [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = { |
| 7939 | .type = HDA_FIXUP_FUNC, |
| 7940 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 7941 | .chained = true, |
| 7942 | .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 7943 | }, |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 7944 | [ALC256_FIXUP_ACER_HEADSET_MIC] = { |
| 7945 | .type = HDA_FIXUP_PINS, |
| 7946 | .v.pins = (const struct hda_pintbl[]) { |
| 7947 | { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */ |
| 7948 | { 0x1a, 0x90a1092f }, /* use as internal mic */ |
| 7949 | { } |
| 7950 | }, |
| 7951 | .chained = true, |
| 7952 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7953 | }, |
Takashi Iwai | 26928ca | 2021-04-16 10:12:11 +0200 | [diff] [blame] | 7954 | [ALC285_FIXUP_IDEAPAD_S740_COEF] = { |
| 7955 | .type = HDA_FIXUP_FUNC, |
| 7956 | .v.func = alc285_fixup_ideapad_s740_coef, |
| 7957 | .chained = true, |
| 7958 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 7959 | }, |
Kai-Heng Feng | bd15b15 | 2021-04-20 19:55:29 +0800 | [diff] [blame] | 7960 | [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { |
| 7961 | .type = HDA_FIXUP_FUNC, |
| 7962 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 7963 | .chained = true, |
| 7964 | .chain_id = ALC285_FIXUP_HP_MUTE_LED, |
| 7965 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7966 | }; |
| 7967 | |
| 7968 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 7969 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 7970 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 7971 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7972 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 7973 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7974 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 7975 | 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] | 7976 | 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] | 7977 | 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] | 7978 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
Takashi Iwai | 433f894 | 2021-04-28 13:26:56 +0200 | [diff] [blame] | 7979 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 7980 | SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF), |
Chris Chiu | 13be30f | 2020-12-22 23:04:59 +0800 | [diff] [blame] | 7981 | SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK), |
Chris Chiu | 705b65f | 2018-12-05 14:48:54 +0800 | [diff] [blame] | 7982 | SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
Jian-Hong Pan | 6e15d12 | 2020-07-06 15:18:27 +0800 | [diff] [blame] | 7983 | SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), |
Takashi Iwai | b9c2fa5 | 2015-11-19 16:39:50 +0100 | [diff] [blame] | 7984 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
Chris Chiu | 495dc76 | 2021-01-14 16:27:28 +0800 | [diff] [blame] | 7985 | SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), |
Chris Chiu | c7531e3 | 2019-03-21 17:17:31 +0800 | [diff] [blame] | 7986 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
| 7987 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Chris Chiu | 13be30f | 2020-12-22 23:04:59 +0800 | [diff] [blame] | 7988 | SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK), |
| 7989 | SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK), |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7990 | SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), |
Jian-Hong Pan | 8eae7e9 | 2020-07-06 15:18:25 +0800 | [diff] [blame] | 7991 | SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), |
Jian-Hong Pan | 781c90c | 2020-07-06 15:18:29 +0800 | [diff] [blame] | 7992 | SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 7993 | SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC), |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 7994 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 7995 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 7996 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 7997 | SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC), |
Jian-Hong Pan | 2733cce | 2019-03-21 16:39:04 +0800 | [diff] [blame] | 7998 | 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] | 7999 | 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] | 8000 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 8001 | SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 8002 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 8003 | 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] | 8004 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | cf52103 | 2016-01-15 12:59:25 +0100 | [diff] [blame] | 8005 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 8006 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
| 8007 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 8008 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8009 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8010 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8011 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 8012 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 8013 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Takashi Iwai | 9807057 | 2016-01-12 21:06:39 +0100 | [diff] [blame] | 8014 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 4275554 | 2015-06-29 10:56:53 +0200 | [diff] [blame] | 8015 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 8016 | 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] | 8017 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8018 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 8019 | 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] | 8020 | 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] | 8021 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Kailang Yang | 8b72415 | 2014-12-17 17:08:59 +0800 | [diff] [blame] | 8022 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 8023 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8024 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 8025 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8026 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8027 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8028 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8029 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 8030 | 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] | 8031 | 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] | 8032 | 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] | 8033 | 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] | 8034 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
Takashi Iwai | 493de34 | 2017-02-28 17:27:57 +0100 | [diff] [blame] | 8035 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
Takashi Iwai | aa143ad | 2021-04-28 13:26:57 +0200 | [diff] [blame] | 8036 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 8037 | 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] | 8038 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
| 8039 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 8040 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
| 8041 | 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] | 8042 | 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] | 8043 | 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] | 8044 | 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] | 8045 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 8046 | SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
Takashi Iwai | aa143ad | 2021-04-28 13:26:57 +0200 | [diff] [blame] | 8047 | SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
Kailang Yang | 78def22 | 2020-02-20 15:21:54 +0800 | [diff] [blame] | 8048 | SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 8049 | SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 8050 | SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), |
| 8051 | SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), |
Kailang Yang | c1e8952 | 2020-12-23 15:34:57 +0800 | [diff] [blame] | 8052 | SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 8053 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8054 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 8055 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 8056 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 8057 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
Hui Wang | 7976eb4 | 2015-02-13 11:14:41 +0800 | [diff] [blame] | 8058 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 8059 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 8060 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8061 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8062 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
| 8063 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8064 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8065 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 8066 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 8067 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 8068 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8069 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8070 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8071 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8072 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8073 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8074 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8075 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 8076 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8077 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8078 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8079 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8080 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8081 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8082 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8083 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8084 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8085 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8086 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8087 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8088 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8089 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8090 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8091 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8092 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8093 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8094 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8095 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8096 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8097 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8098 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8099 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8100 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8101 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8102 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8103 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8104 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8105 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
| 8106 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8107 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 8108 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8109 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8110 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8111 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 8112 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 8113 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
Kailang Yang | 1c9d9df | 2021-04-20 14:17:34 +0800 | [diff] [blame] | 8114 | SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC), |
| 8115 | SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC), |
Takashi Iwai | 563785e | 2018-11-12 09:43:12 +0100 | [diff] [blame] | 8116 | 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] | 8117 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 8118 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
Takashi Iwai | aeedad2 | 2020-11-28 10:00:15 +0100 | [diff] [blame] | 8119 | SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 8120 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 8121 | 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] | 8122 | 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] | 8123 | 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] | 8124 | SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Kai-Heng Feng | b2c2291 | 2020-06-17 18:29:02 +0800 | [diff] [blame] | 8125 | SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
Kai-Heng Feng | a598098 | 2020-12-30 20:56:35 +0800 | [diff] [blame] | 8126 | SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), |
Kai-Heng Feng | b2c2291 | 2020-06-17 18:29:02 +0800 | [diff] [blame] | 8127 | SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 8128 | SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 8129 | SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Qiu Wenbo | 08befca | 2020-10-02 20:44:54 +0800 | [diff] [blame] | 8130 | SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 8131 | SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 8132 | SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
Jeremy Szu | 91bc156 | 2021-01-06 21:05:46 +0800 | [diff] [blame] | 8133 | SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation", |
| 8134 | ALC285_FIXUP_HP_GPIO_AMP_INIT), |
| 8135 | SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", |
| 8136 | ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Manuel Jiménez | 4842295 | 2020-12-29 15:38:56 +0100 | [diff] [blame] | 8137 | SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 8138 | SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
Jeremy Szu | 417eadf | 2021-03-30 19:44:27 +0800 | [diff] [blame] | 8139 | SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 8140 | SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), |
| 8141 | SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 8142 | SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), |
Jeremy Szu | 53b861b | 2021-03-16 17:42:35 +0800 | [diff] [blame] | 8143 | SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
Jeremy Szu | ca68833 | 2021-03-16 14:54:50 +0800 | [diff] [blame] | 8144 | SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
Kai-Heng Feng | bd15b15 | 2021-04-20 19:55:29 +0800 | [diff] [blame] | 8145 | SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8146 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 8147 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 8148 | 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] | 8149 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8150 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 8151 | 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] | 8152 | 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] | 8153 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
Takashi Iwai | 3cd0ed6 | 2021-04-28 13:26:58 +0200 | [diff] [blame] | 8154 | SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
Chris Chiu | 5cfca59 | 2020-12-07 15:27:55 +0800 | [diff] [blame] | 8155 | SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 8156 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
| 8157 | 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] | 8158 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 3cd0ed6 | 2021-04-28 13:26:58 +0200 | [diff] [blame] | 8159 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8160 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 8161 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 8162 | 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] | 8163 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 8164 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), |
Takashi Iwai | 3cd0ed6 | 2021-04-28 13:26:58 +0200 | [diff] [blame] | 8165 | SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 8166 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Adam Barber | 4963d66 | 2020-04-10 17:00:32 +0800 | [diff] [blame] | 8167 | SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Kailang Yang | 158ae2f | 2020-07-16 15:21:59 +0800 | [diff] [blame] | 8168 | SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), |
Jian-Hong Pan | 5de3b94 | 2021-01-22 13:47:06 +0800 | [diff] [blame] | 8169 | SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 8170 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), |
Jian-Hong Pan | 7900e81 | 2020-05-12 14:15:28 +0800 | [diff] [blame] | 8171 | SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 8172 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
Chris Chiu | 28e8af8 | 2017-06-05 15:05:30 -0600 | [diff] [blame] | 8173 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 8174 | SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 8175 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 8176 | 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] | 8177 | 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] | 8178 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
Kailang Yang | ef9ce66 | 2020-11-03 15:40:35 +0800 | [diff] [blame] | 8179 | SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 8180 | SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), |
Luke D Jones | 76fae61 | 2021-04-19 15:04:11 +1200 | [diff] [blame] | 8181 | SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 8182 | SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 8183 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 8184 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 8185 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 8186 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 8187 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 8188 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8189 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 8190 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 8191 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 8192 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
Takashi Iwai | cab561f | 2021-04-28 13:26:59 +0200 | [diff] [blame] | 8193 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
| 8194 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 8195 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 8196 | 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] | 8197 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 8198 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 8199 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 8200 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 8201 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 8202 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
PeiSen Hou | 6fa38ef | 2020-07-27 13:56:47 +0200 | [diff] [blame] | 8203 | SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
PeiSen Hou | ce2e79b | 2020-12-31 11:57:28 +0100 | [diff] [blame] | 8204 | SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
| 8205 | SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
YOKOTA Hiroshi | 0fca97a | 2018-07-01 18:30:01 +0900 | [diff] [blame] | 8206 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 8207 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
Mike Pozulp | 14425f1 | 2020-05-09 20:28:37 -0700 | [diff] [blame] | 8208 | SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
| 8209 | SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Mike Pozulp | f70fff8 | 2020-08-13 21:53:44 -0700 | [diff] [blame] | 8210 | SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Adrien Crivelli | 8bcea6c | 2020-08-26 17:40:14 +0900 | [diff] [blame] | 8211 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 8212 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
Joonho Wohn | 568e4e8 | 2020-07-18 17:23:15 +0900 | [diff] [blame] | 8213 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 8214 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 8215 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
| 8216 | 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] | 8217 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
Chris Chiu | 6ca653e | 2020-12-22 23:04:58 +0800 | [diff] [blame] | 8218 | SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 8219 | SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 8220 | SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 8221 | SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8222 | SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8223 | SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8224 | SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8225 | SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8226 | SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8227 | SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8228 | SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8229 | SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8230 | SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8231 | SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8232 | SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8233 | SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8234 | SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8235 | SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8236 | SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8237 | SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8238 | SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8239 | SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8240 | SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8241 | SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8242 | SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8243 | SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8244 | SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8245 | SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8246 | SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8247 | SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 80a5052 | 2019-05-07 17:11:08 -0400 | [diff] [blame] | 8248 | 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] | 8249 | SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8250 | SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
| 8251 | SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
Eckhart Mohr | 48698c9 | 2021-03-02 17:25:22 +0100 | [diff] [blame] | 8252 | SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[5|7][0-9]RZ[Q]", ALC269_FIXUP_DMIC), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 8253 | SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8254 | SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8255 | SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8256 | SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8257 | SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8258 | SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8259 | SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8260 | SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8261 | SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 8262 | SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8263 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
Hui Wang | ef0b320 | 2020-04-27 11:00:39 +0800 | [diff] [blame] | 8264 | SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8265 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 8266 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 8267 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 8268 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 8269 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | f552ff5 | 2021-04-28 13:27:00 +0200 | [diff] [blame] | 8270 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 8271 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), |
Felix Kaechele | c8415a4 | 2012-08-06 23:02:01 +0200 | [diff] [blame] | 8272 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 8273 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 8274 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 8275 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 8276 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 8277 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 8278 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Rick Sherman | 59a51a6 | 2015-08-18 21:04:30 -0500 | [diff] [blame] | 8279 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 8280 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 8281 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 8282 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | b6903c0 | 2015-12-10 12:20:20 +0100 | [diff] [blame] | 8283 | 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] | 8284 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
Yves-Alexis Perez | c027866 | 2015-04-11 09:31:35 +0200 | [diff] [blame] | 8285 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 8286 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 8287 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Torsten Hilbrich | dab38e4 | 2016-06-07 13:14:21 +0200 | [diff] [blame] | 8288 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 8289 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 8290 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
| 8291 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 8292 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Dennis Wassenberg | e4c07b3 | 2018-03-08 13:17:54 +0100 | [diff] [blame] | 8293 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 8294 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 8295 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 8296 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Benjamin Berg | 85981df | 2018-02-14 13:29:39 +0100 | [diff] [blame] | 8297 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Benjamin Poirier | 9774dc2 | 2020-07-03 17:00:04 +0900 | [diff] [blame] | 8298 | SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
Hans de Goede | ca707b3 | 2020-04-02 19:43:11 +0200 | [diff] [blame] | 8299 | SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
Kailang Yang | 446b818 | 2020-11-02 15:00:12 +0800 | [diff] [blame] | 8300 | SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), |
| 8301 | SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 8302 | 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] | 8303 | 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] | 8304 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Dennis Wassenberg | bef33e1 | 2019-06-28 10:54:53 +0200 | [diff] [blame] | 8305 | SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 8306 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Kailang Yang | 6581183 | 2018-04-25 17:07:27 +0800 | [diff] [blame] | 8307 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 8da5bbf | 2017-12-22 11:17:46 +0800 | [diff] [blame] | 8308 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 8309 | SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Aaron Ma | 8a6c55d | 2019-10-24 19:44:39 +0800 | [diff] [blame] | 8310 | SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
| 8311 | SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Kailang Yang | f86de9b | 2020-10-23 14:46:47 +0800 | [diff] [blame] | 8312 | SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), |
Takashi Iwai | 26928ca | 2021-04-16 10:12:11 +0200 | [diff] [blame] | 8313 | SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 8314 | 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] | 8315 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Michał Wadowski | 56df90b | 2019-05-14 16:58:00 +0200 | [diff] [blame] | 8316 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
Takashi Iwai | f552ff5 | 2021-04-28 13:27:00 +0200 | [diff] [blame] | 8317 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 8318 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 8319 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 8320 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 8321 | 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] | 8322 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
Sebastian Wicki | 80b311d | 2015-03-23 17:23:11 +0100 | [diff] [blame] | 8323 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
Ansgar Hegerfeld | 09ea997 | 2015-05-14 12:31:32 +0200 | [diff] [blame] | 8324 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
Conrad Kostecki | 037e119 | 2016-04-26 10:08:10 +0200 | [diff] [blame] | 8325 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 8326 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 8327 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
Torsten Hilbrich | 9cd2574 | 2016-07-05 10:40:22 +0200 | [diff] [blame] | 8328 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 8329 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 8330 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 8331 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 8332 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 8333 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 8334 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 8335 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8336 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 8337 | SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 8338 | SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), |
| 8339 | SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), |
| 8340 | SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 8341 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 8342 | SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
| 8343 | SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 8344 | SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
Xiaoliang Yu | b95bc12 | 2021-03-16 00:49:00 +0800 | [diff] [blame] | 8345 | SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 695d1ec | 2019-11-21 10:54:27 +0800 | [diff] [blame] | 8346 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Xiaoliang Yu | e1c8621 | 2021-03-13 07:54:53 +0800 | [diff] [blame] | 8347 | SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
Phil Calvin | d1ee66c | 2021-04-15 18:01:29 -0400 | [diff] [blame] | 8348 | SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 8349 | SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), |
Werner Sembach | 73e7161 | 2021-03-02 19:04:14 +0100 | [diff] [blame] | 8350 | SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 8351 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 8352 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 8353 | /* Below is a quirk table taken from the old code. |
| 8354 | * Basically the device should work as is without the fixup table. |
| 8355 | * If BIOS doesn't give a proper info, enable the corresponding |
| 8356 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 8357 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 8358 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 8359 | ALC269_FIXUP_AMIC), |
| 8360 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 8361 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 8362 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 8363 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 8364 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 8365 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 8366 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 8367 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 8368 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 8369 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 8370 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 8371 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 8372 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 8373 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 8374 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 8375 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 8376 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 8377 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 8378 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 8379 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 8380 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 8381 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 8382 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 8383 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 8384 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 8385 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 8386 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 8387 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 8388 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 8389 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 8390 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 8391 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 8392 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 8393 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 8394 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 8395 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 8396 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 8397 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 8398 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 8399 | #endif |
| 8400 | {} |
| 8401 | }; |
| 8402 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 8403 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 8404 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 8405 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 8406 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 8407 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 8408 | SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 8409 | {} |
| 8410 | }; |
| 8411 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8412 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 8413 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 8414 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 8415 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 8416 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 8417 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 8418 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
Takashi Iwai | b016951 | 2015-05-19 10:20:13 +0200 | [diff] [blame] | 8419 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
| 8420 | {.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] | 8421 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 8422 | {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 8423 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 8424 | {.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] | 8425 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 8426 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8427 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
| 8428 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 8429 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 8430 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 8431 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 8432 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 8433 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 8434 | {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8435 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 8436 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 28d1d6d | 2017-10-18 14:01:58 +0200 | [diff] [blame] | 8437 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8438 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
| 8439 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, |
| 8440 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, |
| 8441 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, |
| 8442 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, |
| 8443 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, |
| 8444 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, |
| 8445 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, |
| 8446 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, |
| 8447 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, |
| 8448 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, |
| 8449 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, |
| 8450 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, |
| 8451 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, |
| 8452 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, |
| 8453 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, |
| 8454 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, |
| 8455 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, |
| 8456 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, |
| 8457 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, |
| 8458 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, |
| 8459 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, |
| 8460 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, |
| 8461 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, |
| 8462 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, |
| 8463 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, |
| 8464 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, |
| 8465 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, |
| 8466 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, |
| 8467 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, |
| 8468 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, |
| 8469 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, |
| 8470 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, |
| 8471 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, |
| 8472 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, |
| 8473 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, |
| 8474 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, |
| 8475 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, |
| 8476 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, |
| 8477 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 8478 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8479 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 8480 | {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8481 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
| 8482 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
| 8483 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, |
| 8484 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, |
| 8485 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, |
| 8486 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, |
| 8487 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, |
| 8488 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, |
| 8489 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, |
| 8490 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, |
| 8491 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, |
| 8492 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, |
| 8493 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, |
| 8494 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8495 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
| 8496 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, |
| 8497 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, |
Kailang Yang | 82aa0d7 | 2019-01-11 17:15:53 +0800 | [diff] [blame] | 8498 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8499 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 8500 | {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8501 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
| 8502 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, |
| 8503 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, |
| 8504 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, |
| 8505 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, |
| 8506 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, |
| 8507 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, |
| 8508 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, |
| 8509 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, |
| 8510 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, |
| 8511 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, |
| 8512 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, |
| 8513 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, |
| 8514 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, |
| 8515 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
| 8516 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
| 8517 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 8518 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
| 8519 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 8520 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 8521 | {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 8522 | {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, |
Mike Pozulp | 23dc958 | 2020-08-16 21:32:17 -0700 | [diff] [blame] | 8523 | {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 8524 | {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, |
Hui Wang | 13468bf | 2020-09-28 16:01:17 +0800 | [diff] [blame] | 8525 | {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 8526 | {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8527 | {} |
| 8528 | }; |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8529 | #define ALC225_STANDARD_PINS \ |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8530 | {0x21, 0x04211020} |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8531 | |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 8532 | #define ALC256_STANDARD_PINS \ |
| 8533 | {0x12, 0x90a60140}, \ |
| 8534 | {0x14, 0x90170110}, \ |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 8535 | {0x21, 0x02211020} |
| 8536 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 8537 | #define ALC282_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8538 | {0x14, 0x90170110} |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 8539 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 8540 | #define ALC290_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8541 | {0x12, 0x99a30130} |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 8542 | |
| 8543 | #define ALC292_STANDARD_PINS \ |
| 8544 | {0x14, 0x90170110}, \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8545 | {0x15, 0x0221401f} |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 8546 | |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 8547 | #define ALC295_STANDARD_PINS \ |
| 8548 | {0x12, 0xb7a60130}, \ |
| 8549 | {0x14, 0x90170110}, \ |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 8550 | {0x21, 0x04211020} |
| 8551 | |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 8552 | #define ALC298_STANDARD_PINS \ |
| 8553 | {0x12, 0x90a60130}, \ |
| 8554 | {0x21, 0x03211020} |
| 8555 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 8556 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 8557 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
| 8558 | {0x14, 0x01014020}, |
| 8559 | {0x17, 0x90170110}, |
| 8560 | {0x18, 0x02a11030}, |
| 8561 | {0x19, 0x0181303F}, |
| 8562 | {0x21, 0x0221102f}), |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 8563 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 8564 | {0x12, 0x90a601c0}, |
| 8565 | {0x14, 0x90171120}, |
| 8566 | {0x21, 0x02211030}), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 8567 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 8568 | {0x14, 0x90170110}, |
| 8569 | {0x1b, 0x90a70130}, |
| 8570 | {0x21, 0x03211020}), |
| 8571 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 8572 | {0x1a, 0x90a70130}, |
| 8573 | {0x1b, 0x90170110}, |
| 8574 | {0x21, 0x03211020}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 8575 | 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] | 8576 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 8577 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8578 | {0x14, 0x901701a0}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 8579 | 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] | 8580 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 8581 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8582 | {0x14, 0x901701b0}), |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 8583 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8584 | ALC225_STANDARD_PINS, |
| 8585 | {0x12, 0xb7a60150}, |
| 8586 | {0x14, 0x901701a0}), |
| 8587 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8588 | ALC225_STANDARD_PINS, |
| 8589 | {0x12, 0xb7a60150}, |
| 8590 | {0x14, 0x901701b0}), |
| 8591 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8592 | ALC225_STANDARD_PINS, |
| 8593 | {0x12, 0xb7a60130}, |
| 8594 | {0x1b, 0x90170110}), |
Kai-Heng Feng | 0ce48e1 | 2017-11-20 02:29:13 -0500 | [diff] [blame] | 8595 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8596 | {0x1b, 0x01111010}, |
| 8597 | {0x1e, 0x01451130}, |
| 8598 | {0x21, 0x02211020}), |
Hui Wang | 986376b | 2018-05-30 12:33:07 +0800 | [diff] [blame] | 8599 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
| 8600 | {0x12, 0x90a60140}, |
| 8601 | {0x14, 0x90170110}, |
| 8602 | {0x19, 0x02a11030}, |
| 8603 | {0x21, 0x02211020}), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 8604 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 8605 | {0x14, 0x90170110}, |
| 8606 | {0x19, 0x02a11030}, |
| 8607 | {0x1a, 0x02a11040}, |
| 8608 | {0x1b, 0x01014020}, |
| 8609 | {0x21, 0x0221101f}), |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 8610 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 8611 | {0x14, 0x90170110}, |
Hui Wang | d06fb56 | 2018-10-10 11:57:25 +0800 | [diff] [blame] | 8612 | {0x19, 0x02a11030}, |
| 8613 | {0x1a, 0x02a11040}, |
| 8614 | {0x1b, 0x01011020}, |
| 8615 | {0x21, 0x0221101f}), |
| 8616 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 8617 | {0x14, 0x90170110}, |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 8618 | {0x19, 0x02a11020}, |
| 8619 | {0x1a, 0x02a11030}, |
| 8620 | {0x21, 0x0221101f}), |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 8621 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
| 8622 | {0x21, 0x02211010}), |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 8623 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
| 8624 | {0x14, 0x90170110}, |
| 8625 | {0x19, 0x02a11020}, |
| 8626 | {0x21, 0x02211030}), |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 8627 | 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] | 8628 | {0x14, 0x90170110}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 8629 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8630 | 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] | 8631 | {0x14, 0x90170130}, |
| 8632 | {0x21, 0x02211040}), |
| 8633 | 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] | 8634 | {0x12, 0x90a60140}, |
| 8635 | {0x14, 0x90170110}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8636 | {0x21, 0x02211020}), |
| 8637 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8638 | {0x12, 0x90a60160}, |
| 8639 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8640 | {0x21, 0x02211030}), |
| 8641 | 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] | 8642 | {0x14, 0x90170110}, |
| 8643 | {0x1b, 0x02011020}, |
| 8644 | {0x21, 0x0221101f}), |
| 8645 | 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] | 8646 | {0x14, 0x90170110}, |
| 8647 | {0x1b, 0x01011020}, |
| 8648 | {0x21, 0x0221101f}), |
| 8649 | 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] | 8650 | {0x14, 0x90170130}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 8651 | {0x1b, 0x01014020}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 8652 | {0x21, 0x0221103f}), |
| 8653 | 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] | 8654 | {0x14, 0x90170130}, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 8655 | {0x1b, 0x01011020}, |
| 8656 | {0x21, 0x0221103f}), |
| 8657 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8658 | {0x14, 0x90170130}, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 8659 | {0x1b, 0x02011020}, |
| 8660 | {0x21, 0x0221103f}), |
| 8661 | 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] | 8662 | {0x14, 0x90170150}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8663 | {0x1b, 0x02011020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8664 | {0x21, 0x0221105f}), |
| 8665 | 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] | 8666 | {0x14, 0x90170110}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8667 | {0x1b, 0x01014020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8668 | {0x21, 0x0221101f}), |
| 8669 | 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] | 8670 | {0x12, 0x90a60160}, |
| 8671 | {0x14, 0x90170120}, |
| 8672 | {0x17, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8673 | {0x21, 0x0321102f}), |
| 8674 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8675 | {0x12, 0x90a60160}, |
| 8676 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8677 | {0x21, 0x02211040}), |
| 8678 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8679 | {0x12, 0x90a60160}, |
| 8680 | {0x14, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8681 | {0x21, 0x02211050}), |
| 8682 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8683 | {0x12, 0x90a60170}, |
| 8684 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8685 | {0x21, 0x02211030}), |
| 8686 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8687 | {0x12, 0x90a60170}, |
| 8688 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8689 | {0x21, 0x02211040}), |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 8690 | 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] | 8691 | {0x12, 0x90a60170}, |
Hui Wang | 0a1f90a | 2016-01-13 11:51:38 +0800 | [diff] [blame] | 8692 | {0x14, 0x90171130}, |
| 8693 | {0x21, 0x02211040}), |
| 8694 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8695 | {0x12, 0x90a60170}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 8696 | {0x14, 0x90170140}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 8697 | {0x21, 0x02211050}), |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 8698 | 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] | 8699 | {0x12, 0x90a60180}, |
| 8700 | {0x14, 0x90170130}, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 8701 | {0x21, 0x02211040}), |
AceLan Kao | f90d83b | 2016-06-03 14:45:25 +0800 | [diff] [blame] | 8702 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8703 | {0x12, 0x90a60180}, |
| 8704 | {0x14, 0x90170120}, |
| 8705 | {0x21, 0x02211030}), |
Hui Wang | 989dbe4 | 2016-11-23 16:05:38 +0800 | [diff] [blame] | 8706 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8707 | {0x1b, 0x01011020}, |
| 8708 | {0x21, 0x02211010}), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8709 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 8710 | {0x14, 0x90170110}, |
| 8711 | {0x1b, 0x90a70130}, |
| 8712 | {0x21, 0x04211020}), |
| 8713 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 8714 | {0x14, 0x90170110}, |
| 8715 | {0x1b, 0x90a70130}, |
| 8716 | {0x21, 0x03211020}), |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 8717 | 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] | 8718 | {0x12, 0x90a60130}, |
| 8719 | {0x14, 0x90170110}, |
| 8720 | {0x21, 0x03211020}), |
| 8721 | 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] | 8722 | {0x12, 0x90a60130}, |
| 8723 | {0x14, 0x90170110}, |
| 8724 | {0x21, 0x04211020}), |
| 8725 | 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] | 8726 | {0x1a, 0x90a70130}, |
| 8727 | {0x1b, 0x90170110}, |
| 8728 | {0x21, 0x03211020}), |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 8729 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
| 8730 | {0x14, 0x90170110}, |
| 8731 | {0x19, 0x02a11020}, |
| 8732 | {0x21, 0x0221101f}), |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 8733 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, |
| 8734 | {0x17, 0x90170110}, |
| 8735 | {0x19, 0x03a11030}, |
| 8736 | {0x21, 0x03211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 8737 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 8738 | {0x12, 0x90a60130}, |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 8739 | {0x14, 0x90170110}, |
| 8740 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8741 | {0x1a, 0x04a11020}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8742 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 8743 | {0x12, 0x90a60140}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8744 | {0x14, 0x90170110}, |
| 8745 | {0x15, 0x0421101f}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8746 | {0x18, 0x02811030}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8747 | {0x1a, 0x04a1103f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8748 | {0x1b, 0x02011020}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8749 | 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] | 8750 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8751 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8752 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8753 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8754 | 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] | 8755 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8756 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8757 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8758 | {0x21, 0x03211040}), |
| 8759 | 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] | 8760 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8761 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8762 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8763 | {0x21, 0x03211020}), |
| 8764 | 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] | 8765 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8766 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8767 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8768 | {0x21, 0x0421101f}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8769 | 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] | 8770 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8771 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8772 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8773 | {0x21, 0x04211020}), |
Chris Chiu | 34cdf40 | 2020-12-16 20:52:00 +0800 | [diff] [blame] | 8774 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
| 8775 | ALC282_STANDARD_PINS, |
| 8776 | {0x12, 0x90a609c0}, |
| 8777 | {0x18, 0x03a11830}, |
| 8778 | {0x19, 0x04a19831}, |
| 8779 | {0x1a, 0x0481303f}, |
| 8780 | {0x1b, 0x04211020}, |
| 8781 | {0x21, 0x0321101f}), |
| 8782 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
| 8783 | ALC282_STANDARD_PINS, |
| 8784 | {0x12, 0x90a60940}, |
| 8785 | {0x18, 0x03a11830}, |
| 8786 | {0x19, 0x04a19831}, |
| 8787 | {0x1a, 0x0481303f}, |
| 8788 | {0x1b, 0x04211020}, |
| 8789 | {0x21, 0x0321101f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8790 | 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] | 8791 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8792 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8793 | {0x21, 0x0321101f}), |
| 8794 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8795 | {0x12, 0x90a60160}, |
| 8796 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8797 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8798 | 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] | 8799 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8800 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8801 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8802 | {0x21, 0x0321101f}), |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 8803 | 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] | 8804 | {0x14, 0x90170110}, |
| 8805 | {0x19, 0x04a11040}, |
| 8806 | {0x21, 0x04211020}), |
Hui Wang | c72b9bf | 2020-12-05 13:11:30 +0800 | [diff] [blame] | 8807 | SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
| 8808 | {0x14, 0x90170110}, |
| 8809 | {0x17, 0x90170111}, |
| 8810 | {0x19, 0x03a11030}, |
| 8811 | {0x21, 0x03211020}), |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 8812 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
| 8813 | {0x12, 0x90a60130}, |
| 8814 | {0x17, 0x90170110}, |
| 8815 | {0x21, 0x02211020}), |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 8816 | 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] | 8817 | {0x12, 0x90a60120}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 8818 | {0x14, 0x90170110}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 8819 | {0x21, 0x0321101f}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8820 | 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] | 8821 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8822 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8823 | {0x18, 0x90170112}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8824 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8825 | 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] | 8826 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8827 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8828 | {0x18, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8829 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8830 | 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] | 8831 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8832 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8833 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8834 | 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] | 8835 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8836 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8837 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8838 | 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] | 8839 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8840 | {0x14, 0x90170110}, |
| 8841 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8842 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8843 | 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] | 8844 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8845 | {0x14, 0x90170110}, |
| 8846 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8847 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8848 | 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] | 8849 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8850 | {0x14, 0x90170110}, |
| 8851 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8852 | {0x1a, 0x04a11020}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8853 | 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] | 8854 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8855 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8856 | {0x16, 0x01014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8857 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8858 | 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] | 8859 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8860 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8861 | {0x16, 0x01014020}, |
| 8862 | {0x18, 0x02a19031}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8863 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8864 | 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] | 8865 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8866 | {0x12, 0x90a60140}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8867 | 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] | 8868 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8869 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8870 | {0x16, 0x21014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8871 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 8872 | 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] | 8873 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8874 | {0x13, 0x90a60140}), |
Jian-Hong Pan | eeacd80 | 2020-11-24 17:20:25 +0800 | [diff] [blame] | 8875 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE, |
| 8876 | {0x17, 0x90170110}, |
| 8877 | {0x21, 0x04211020}), |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 8878 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
| 8879 | {0x14, 0x90170110}, |
| 8880 | {0x1b, 0x90a70130}, |
| 8881 | {0x21, 0x04211020}), |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 8882 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 8883 | {0x12, 0x90a60130}, |
| 8884 | {0x17, 0x90170110}, |
Jian-Hong Pan | 8bb37a2 | 2019-02-21 17:00:18 +0800 | [diff] [blame] | 8885 | {0x21, 0x03211020}), |
| 8886 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 8887 | {0x12, 0x90a60130}, |
| 8888 | {0x17, 0x90170110}, |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 8889 | {0x21, 0x04211020}), |
Takashi Iwai | 3887c26 | 2019-04-30 15:10:01 +0200 | [diff] [blame] | 8890 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 8891 | {0x12, 0x90a60130}, |
| 8892 | {0x17, 0x90170110}, |
| 8893 | {0x21, 0x03211020}), |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 8894 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | ad97d66 | 2020-05-12 14:15:26 +0800 | [diff] [blame] | 8895 | {0x12, 0x90a60120}, |
| 8896 | {0x17, 0x90170110}, |
| 8897 | {0x21, 0x04211030}), |
| 8898 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 8899 | {0x12, 0x90a60130}, |
| 8900 | {0x17, 0x90170110}, |
| 8901 | {0x21, 0x03211020}), |
| 8902 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 8903 | {0x12, 0x90a60130}, |
| 8904 | {0x17, 0x90170110}, |
| 8905 | {0x21, 0x03211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 8906 | 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] | 8907 | {0x14, 0x90170110}, |
| 8908 | {0x21, 0x04211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 8909 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8910 | {0x14, 0x90170110}, |
| 8911 | {0x21, 0x04211030}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 8912 | 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] | 8913 | ALC295_STANDARD_PINS, |
| 8914 | {0x17, 0x21014020}, |
| 8915 | {0x18, 0x21a19030}), |
| 8916 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8917 | ALC295_STANDARD_PINS, |
| 8918 | {0x17, 0x21014040}, |
| 8919 | {0x18, 0x21a19050}), |
Hui Wang | 3f30783 | 2017-03-23 10:00:25 +0800 | [diff] [blame] | 8920 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8921 | ALC295_STANDARD_PINS), |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 8922 | 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] | 8923 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 8924 | {0x17, 0x90170110}), |
| 8925 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8926 | ALC298_STANDARD_PINS, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 8927 | {0x17, 0x90170140}), |
| 8928 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8929 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 8930 | {0x17, 0x90170150}), |
Kai-Heng Feng | 9f1bc2c4 | 2017-02-16 15:26:54 +0800 | [diff] [blame] | 8931 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
| 8932 | {0x12, 0xb7a60140}, |
| 8933 | {0x13, 0xb7a60150}, |
| 8934 | {0x17, 0x90170110}, |
| 8935 | {0x1a, 0x03011020}, |
| 8936 | {0x21, 0x03211030}), |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 8937 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
| 8938 | {0x12, 0xb7a60140}, |
| 8939 | {0x17, 0x90170110}, |
| 8940 | {0x1a, 0x03a11030}, |
| 8941 | {0x21, 0x03211020}), |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 8942 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8943 | ALC225_STANDARD_PINS, |
| 8944 | {0x12, 0xb7a60130}, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 8945 | {0x17, 0x90170110}), |
Hui Wang | 573fcbf | 2020-06-08 19:55:41 +0800 | [diff] [blame] | 8946 | SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, |
| 8947 | {0x14, 0x01014010}, |
| 8948 | {0x17, 0x90170120}, |
| 8949 | {0x18, 0x02a11030}, |
| 8950 | {0x19, 0x02a1103f}, |
| 8951 | {0x21, 0x0221101f}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 8952 | {} |
| 8953 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8954 | |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 8955 | /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match |
| 8956 | * more machines, don't need to match all valid pins, just need to match |
| 8957 | * all the pins defined in the tbl. Just because of this reason, it is possible |
| 8958 | * that a single machine matches multiple tbls, so there is one limitation: |
| 8959 | * at most one tbl is allowed to define for the same vendor and same codec |
| 8960 | */ |
| 8961 | static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { |
| 8962 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8963 | {0x19, 0x40000000}, |
| 8964 | {0x1b, 0x40000000}), |
Hui Wang | aed8c7f | 2019-11-21 10:26:43 +0800 | [diff] [blame] | 8965 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8966 | {0x19, 0x40000000}, |
| 8967 | {0x1a, 0x40000000}), |
Hui Wang | d64ebdb | 2019-11-21 10:26:44 +0800 | [diff] [blame] | 8968 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8969 | {0x19, 0x40000000}, |
| 8970 | {0x1a, 0x40000000}), |
Hui Wang | 5815bdf | 2019-12-11 13:13:21 +0800 | [diff] [blame] | 8971 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
| 8972 | {0x19, 0x40000000}, |
| 8973 | {0x1a, 0x40000000}), |
Sami Loone | 9bbb94e | 2021-04-25 22:37:12 +0200 | [diff] [blame] | 8974 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, |
| 8975 | {0x14, 0x90170110}, |
| 8976 | {0x19, 0x04a11040}, |
| 8977 | {0x21, 0x04211020}), |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 8978 | {} |
| 8979 | }; |
| 8980 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8981 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8982 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8983 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8984 | int val; |
| 8985 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8986 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8987 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8988 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8989 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8990 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 8991 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 8992 | } |
| 8993 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8994 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8995 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 8996 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 8997 | } |
| 8998 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8999 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9000 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 9001 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9002 | } |
| 9003 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9004 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9005 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 9006 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9007 | /* Capless ramp up clock control */ |
| 9008 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 9009 | } |
| 9010 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 9011 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9012 | /* Class D power on reset */ |
| 9013 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 9014 | } |
| 9015 | } |
| 9016 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 9017 | /* HP */ |
| 9018 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9019 | } |
| 9020 | |
| 9021 | /* |
| 9022 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9023 | static int patch_alc269(struct hda_codec *codec) |
| 9024 | { |
| 9025 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9026 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9027 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9028 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9029 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9030 | return err; |
| 9031 | |
| 9032 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 9033 | spec->gen.shared_mic_vref_pin = 0x18; |
Kailang Yang | 317d931 | 2019-05-23 14:43:04 +0800 | [diff] [blame] | 9034 | codec->power_save_node = 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9035 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9036 | #ifdef CONFIG_PM |
| 9037 | codec->patch_ops.suspend = alc269_suspend; |
| 9038 | codec->patch_ops.resume = alc269_resume; |
| 9039 | #endif |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 9040 | spec->shutup = alc_default_shutup; |
| 9041 | spec->init_hook = alc_default_init; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9042 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 9043 | switch (codec->core.vendor_id) { |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9044 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9045 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9046 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 9047 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 9048 | if (codec->bus->pci && |
| 9049 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9050 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 9051 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9052 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9053 | break; |
| 9054 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 9055 | if (codec->bus->pci && |
| 9056 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9057 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 9058 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9059 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9060 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 9061 | case 0x0030: |
| 9062 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 9063 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9064 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9065 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9066 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9067 | if (err < 0) |
| 9068 | goto error; |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 9069 | spec->shutup = alc269_shutup; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 9070 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9071 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9072 | break; |
| 9073 | |
| 9074 | case 0x10ec0280: |
| 9075 | case 0x10ec0290: |
| 9076 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 9077 | break; |
| 9078 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9079 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 9080 | spec->shutup = alc282_shutup; |
| 9081 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9082 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 9083 | case 0x10ec0233: |
| 9084 | case 0x10ec0283: |
| 9085 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 9086 | spec->shutup = alc283_shutup; |
| 9087 | spec->init_hook = alc283_init; |
| 9088 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9089 | case 0x10ec0284: |
| 9090 | case 0x10ec0292: |
| 9091 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 9092 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 9093 | case 0x10ec0293: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 9094 | spec->codec_variant = ALC269_TYPE_ALC293; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 9095 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 9096 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 9097 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 9098 | spec->codec_variant = ALC269_TYPE_ALC286; |
| 9099 | break; |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 9100 | case 0x10ec0298: |
| 9101 | spec->codec_variant = ALC269_TYPE_ALC298; |
| 9102 | break; |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 9103 | case 0x10ec0235: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 9104 | case 0x10ec0255: |
| 9105 | spec->codec_variant = ALC269_TYPE_ALC255; |
Kailang Yang | ab3b8e5 | 2018-04-25 16:05:27 +0800 | [diff] [blame] | 9106 | spec->shutup = alc256_shutup; |
| 9107 | spec->init_hook = alc256_init; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 9108 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 9109 | case 0x10ec0236: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 9110 | case 0x10ec0256: |
| 9111 | spec->codec_variant = ALC269_TYPE_ALC256; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 9112 | spec->shutup = alc256_shutup; |
| 9113 | spec->init_hook = alc256_init; |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 9114 | 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] | 9115 | break; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 9116 | case 0x10ec0257: |
| 9117 | spec->codec_variant = ALC269_TYPE_ALC257; |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 9118 | spec->shutup = alc256_shutup; |
| 9119 | spec->init_hook = alc256_init; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 9120 | spec->gen.mixer_nid = 0; |
| 9121 | break; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9122 | case 0x10ec0215: |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 9123 | case 0x10ec0245: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9124 | case 0x10ec0285: |
Kailang Yang | 630e361 | 2020-05-27 14:10:26 +0800 | [diff] [blame] | 9125 | case 0x10ec0287: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9126 | case 0x10ec0289: |
| 9127 | spec->codec_variant = ALC269_TYPE_ALC215; |
Kailang Yang | 1b6832be | 2018-01-17 15:32:03 +0800 | [diff] [blame] | 9128 | spec->shutup = alc225_shutup; |
| 9129 | spec->init_hook = alc225_init; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9130 | spec->gen.mixer_nid = 0; |
| 9131 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 9132 | case 0x10ec0225: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 9133 | case 0x10ec0295: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 9134 | case 0x10ec0299: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 9135 | spec->codec_variant = ALC269_TYPE_ALC225; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 9136 | spec->shutup = alc225_shutup; |
| 9137 | spec->init_hook = alc225_init; |
Takashi Iwai | c1350bf | 2017-12-27 09:03:45 +0100 | [diff] [blame] | 9138 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 9139 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9140 | case 0x10ec0234: |
| 9141 | case 0x10ec0274: |
| 9142 | case 0x10ec0294: |
| 9143 | spec->codec_variant = ALC269_TYPE_ALC294; |
Hui Wang | 532a778 | 2017-06-26 12:30:32 +0800 | [diff] [blame] | 9144 | 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] | 9145 | 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] | 9146 | spec->init_hook = alc294_init; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9147 | break; |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 9148 | case 0x10ec0300: |
| 9149 | spec->codec_variant = ALC269_TYPE_ALC300; |
| 9150 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9151 | break; |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 9152 | case 0x10ec0623: |
| 9153 | spec->codec_variant = ALC269_TYPE_ALC623; |
| 9154 | break; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 9155 | case 0x10ec0700: |
| 9156 | case 0x10ec0701: |
| 9157 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 9158 | case 0x10ec0711: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 9159 | spec->codec_variant = ALC269_TYPE_ALC700; |
| 9160 | 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] | 9161 | 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] | 9162 | spec->init_hook = alc294_init; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 9163 | break; |
| 9164 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9165 | } |
| 9166 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 9167 | 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] | 9168 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 9169 | spec->init_hook = alc5505_dsp_init; |
| 9170 | } |
| 9171 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 9172 | alc_pre_init(codec); |
| 9173 | |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 9174 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
| 9175 | alc269_fixup_tbl, alc269_fixups); |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 9176 | 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] | 9177 | 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] | 9178 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 9179 | alc269_fixups); |
| 9180 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 9181 | |
| 9182 | alc_auto_parse_customize_define(codec); |
| 9183 | |
| 9184 | if (has_cdefine_beep(codec)) |
| 9185 | spec->gen.beep_nid = 0x01; |
| 9186 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 9187 | /* automatic parse from the BIOS config */ |
| 9188 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9189 | if (err < 0) |
| 9190 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9191 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9192 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
| 9193 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); |
| 9194 | if (err < 0) |
| 9195 | goto error; |
| 9196 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9197 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9198 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 9199 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9200 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9201 | |
| 9202 | error: |
| 9203 | alc_free(codec); |
| 9204 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9205 | } |
| 9206 | |
| 9207 | /* |
| 9208 | * ALC861 |
| 9209 | */ |
| 9210 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9211 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 9212 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9213 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 9214 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 9215 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9216 | } |
| 9217 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9218 | /* Pin config fixes */ |
| 9219 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9220 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 9221 | ALC861_FIXUP_AMP_VREF_0F, |
| 9222 | ALC861_FIXUP_NO_JACK_DETECT, |
| 9223 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 9224 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9225 | }; |
| 9226 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 9227 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 9228 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9229 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 9230 | { |
| 9231 | struct alc_spec *spec = codec->spec; |
| 9232 | unsigned int val; |
| 9233 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9234 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 9235 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 9236 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 9237 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 9238 | val |= AC_PINCTL_IN_EN; |
| 9239 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 9240 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 9241 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 9242 | } |
| 9243 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9244 | /* suppress the jack-detection */ |
| 9245 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9246 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9247 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9248 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9249 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 9250 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9251 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9252 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9253 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9254 | .type = HDA_FIXUP_PINS, |
| 9255 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9256 | { 0x0b, 0x0221101f }, /* HP */ |
| 9257 | { 0x0f, 0x90170310 }, /* speaker */ |
| 9258 | { } |
| 9259 | } |
| 9260 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9261 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9262 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 9263 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 9264 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9265 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9266 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9267 | .v.func = alc_fixup_no_jack_detect, |
| 9268 | }, |
| 9269 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9270 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9271 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 9272 | .chained = true, |
| 9273 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 9274 | }, |
| 9275 | [ALC660_FIXUP_ASUS_W7J] = { |
| 9276 | .type = HDA_FIXUP_VERBS, |
| 9277 | .v.verbs = (const struct hda_verb[]) { |
| 9278 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 9279 | * for enabling outputs |
| 9280 | */ |
| 9281 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 9282 | { } |
| 9283 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9284 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9285 | }; |
| 9286 | |
| 9287 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 9288 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 9289 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 9290 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 9291 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 9292 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 9293 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 9294 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 9295 | 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] | 9296 | {} |
| 9297 | }; |
| 9298 | |
| 9299 | /* |
| 9300 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9301 | static int patch_alc861(struct hda_codec *codec) |
| 9302 | { |
| 9303 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9304 | int err; |
| 9305 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9306 | err = alc_alloc_spec(codec, 0x15); |
| 9307 | if (err < 0) |
| 9308 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9309 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9310 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 9311 | if (has_cdefine_beep(codec)) |
| 9312 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9313 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9314 | #ifdef CONFIG_PM |
| 9315 | spec->power_hook = alc_power_eapd; |
| 9316 | #endif |
| 9317 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 9318 | alc_pre_init(codec); |
| 9319 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9320 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 9321 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9322 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 9323 | /* automatic parse from the BIOS config */ |
| 9324 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9325 | if (err < 0) |
| 9326 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9327 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9328 | if (!spec->gen.no_analog) { |
| 9329 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
| 9330 | if (err < 0) |
| 9331 | goto error; |
| 9332 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9333 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9334 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 9335 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9336 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9337 | |
| 9338 | error: |
| 9339 | alc_free(codec); |
| 9340 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9341 | } |
| 9342 | |
| 9343 | /* |
| 9344 | * ALC861-VD support |
| 9345 | * |
| 9346 | * Based on ALC882 |
| 9347 | * |
| 9348 | * In addition, an independent DAC |
| 9349 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9350 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 9351 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9352 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 9353 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 9354 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9355 | } |
| 9356 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9357 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9358 | ALC660VD_FIX_ASUS_GPIO1, |
| 9359 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9360 | }; |
| 9361 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9362 | /* exclude VREF80 */ |
| 9363 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9364 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9365 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9366 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 9367 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 9368 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9369 | } |
| 9370 | } |
| 9371 | |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 9372 | /* reset GPIO1 */ |
| 9373 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, |
| 9374 | const struct hda_fixup *fix, int action) |
| 9375 | { |
| 9376 | struct alc_spec *spec = codec->spec; |
| 9377 | |
| 9378 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 9379 | spec->gpio_mask |= 0x02; |
| 9380 | alc_fixup_gpio(codec, action, 0x01); |
| 9381 | } |
| 9382 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9383 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9384 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 9385 | .type = HDA_FIXUP_FUNC, |
| 9386 | .v.func = alc660vd_fixup_asus_gpio1, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9387 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9388 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9389 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9390 | .v.func = alc861vd_fixup_dallas, |
| 9391 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9392 | }; |
| 9393 | |
| 9394 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9395 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9396 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 9397 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9398 | {} |
| 9399 | }; |
| 9400 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9401 | /* |
| 9402 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9403 | static int patch_alc861vd(struct hda_codec *codec) |
| 9404 | { |
| 9405 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 9406 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9407 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9408 | err = alc_alloc_spec(codec, 0x0b); |
| 9409 | if (err < 0) |
| 9410 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9411 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9412 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 9413 | if (has_cdefine_beep(codec)) |
| 9414 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9415 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9416 | spec->shutup = alc_eapd_shutup; |
| 9417 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 9418 | alc_pre_init(codec); |
| 9419 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9420 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 9421 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9422 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 9423 | /* automatic parse from the BIOS config */ |
| 9424 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9425 | if (err < 0) |
| 9426 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9427 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9428 | if (!spec->gen.no_analog) { |
| 9429 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 9430 | if (err < 0) |
| 9431 | goto error; |
| 9432 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9433 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9434 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 9435 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9436 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9437 | |
| 9438 | error: |
| 9439 | alc_free(codec); |
| 9440 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9441 | } |
| 9442 | |
| 9443 | /* |
| 9444 | * ALC662 support |
| 9445 | * |
| 9446 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 9447 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 9448 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 9449 | * 6-channel independent captures. |
| 9450 | * |
| 9451 | * In addition, an independent DAC for the multi-playback (not used in this |
| 9452 | * driver yet). |
| 9453 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9454 | |
| 9455 | /* |
| 9456 | * BIOS auto configuration |
| 9457 | */ |
| 9458 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9459 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 9460 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 9461 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 9462 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 9463 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 9464 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 9465 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 9466 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
| 9467 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || |
| 9468 | codec->core.vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 9469 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 9470 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 9471 | ssids = alc662_ssids; |
| 9472 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9473 | } |
| 9474 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9475 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9476 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 9477 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 9478 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 9479 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9480 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 9481 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 9482 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 9483 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 9484 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 9485 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9486 | } |
| 9487 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9488 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 9489 | { .channels = 2, |
| 9490 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 9491 | { .channels = 4, |
| 9492 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 9493 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 9494 | { } |
| 9495 | }; |
| 9496 | |
| 9497 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 9498 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9499 | const struct hda_fixup *fix, int action) |
| 9500 | { |
| 9501 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 9502 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | bbbc7e8 | 2015-02-27 17:43:19 +0100 | [diff] [blame] | 9503 | 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] | 9504 | } |
| 9505 | } |
| 9506 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 9507 | /* avoid D3 for keeping GPIO up */ |
| 9508 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 9509 | hda_nid_t nid, |
| 9510 | unsigned int power_state) |
| 9511 | { |
| 9512 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 9513 | 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] | 9514 | return AC_PWRST_D0; |
| 9515 | return power_state; |
| 9516 | } |
| 9517 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9518 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 9519 | const struct hda_fixup *fix, int action) |
| 9520 | { |
| 9521 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9522 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 9523 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9524 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 9525 | spec->mute_led_polarity = 1; |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 9526 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9527 | } |
| 9528 | } |
| 9529 | |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9530 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
| 9531 | struct hda_jack_callback *jack) |
| 9532 | { |
| 9533 | struct alc_spec *spec = codec->spec; |
| 9534 | int vref; |
| 9535 | msleep(200); |
| 9536 | snd_hda_gen_hp_automute(codec, jack); |
| 9537 | |
| 9538 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 9539 | msleep(100); |
| 9540 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 9541 | vref); |
| 9542 | } |
| 9543 | |
| 9544 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, |
| 9545 | const struct hda_fixup *fix, int action) |
| 9546 | { |
| 9547 | struct alc_spec *spec = codec->spec; |
| 9548 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 9549 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 9550 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; |
| 9551 | } |
| 9552 | } |
| 9553 | |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9554 | static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, |
| 9555 | struct hda_jack_callback *cb) |
| 9556 | { |
| 9557 | /* surround speakers at 0x1b already get muted automatically when |
| 9558 | * headphones are plugged in, but we have to mute/unmute the remaining |
| 9559 | * channels manually: |
| 9560 | * 0x15 - front left/front right |
| 9561 | * 0x18 - front center/ LFE |
| 9562 | */ |
| 9563 | if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { |
| 9564 | snd_hda_set_pin_ctl_cache(codec, 0x15, 0); |
| 9565 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 9566 | } else { |
| 9567 | snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); |
| 9568 | snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); |
| 9569 | } |
| 9570 | } |
| 9571 | |
| 9572 | static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, |
| 9573 | const struct hda_fixup *fix, int action) |
| 9574 | { |
| 9575 | /* Pin 0x1b: shared headphones jack and surround speakers */ |
| 9576 | if (!is_jack_detectable(codec, 0x1b)) |
| 9577 | return; |
| 9578 | |
| 9579 | switch (action) { |
| 9580 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 9581 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 9582 | alc662_aspire_ethos_mute_speakers); |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 9583 | /* subwoofer needs an extra GPIO setting to become audible */ |
| 9584 | alc_setup_gpio(codec, 0x02); |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9585 | break; |
| 9586 | case HDA_FIXUP_ACT_INIT: |
| 9587 | /* Make sure to start in a correct state, i.e. if |
| 9588 | * headphones have been plugged in before powering up the system |
| 9589 | */ |
| 9590 | alc662_aspire_ethos_mute_speakers(codec, NULL); |
| 9591 | break; |
| 9592 | } |
| 9593 | } |
| 9594 | |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9595 | static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, |
| 9596 | const struct hda_fixup *fix, int action) |
| 9597 | { |
| 9598 | struct alc_spec *spec = codec->spec; |
| 9599 | |
| 9600 | static const struct hda_pintbl pincfgs[] = { |
| 9601 | { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ |
| 9602 | { 0x1b, 0x0181304f }, |
| 9603 | { } |
| 9604 | }; |
| 9605 | |
| 9606 | switch (action) { |
| 9607 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 9608 | spec->gen.mixer_nid = 0; |
| 9609 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 9610 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 9611 | break; |
| 9612 | case HDA_FIXUP_ACT_INIT: |
| 9613 | alc_write_coef_idx(codec, 0x19, 0xa054); |
| 9614 | break; |
| 9615 | } |
| 9616 | } |
| 9617 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 9618 | static const struct coef_fw alc668_coefs[] = { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 9619 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 9620 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 9621 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 9622 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 9623 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 9624 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 9625 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 9626 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 9627 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 9628 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 9629 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 9630 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 9631 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 9632 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 9633 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 9634 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 9635 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 9636 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 9637 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 9638 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 9639 | {} |
| 9640 | }; |
| 9641 | |
| 9642 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 9643 | { |
| 9644 | alc_process_coef_fw(codec, alc668_coefs); |
| 9645 | } |
| 9646 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9647 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9648 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9649 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9650 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9651 | ALC272_FIXUP_MARIO, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 9652 | ALC662_FIXUP_CZC_ET26, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9653 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 9654 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9655 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9656 | ALC662_FIXUP_ASUS_MODE1, |
| 9657 | ALC662_FIXUP_ASUS_MODE2, |
| 9658 | ALC662_FIXUP_ASUS_MODE3, |
| 9659 | ALC662_FIXUP_ASUS_MODE4, |
| 9660 | ALC662_FIXUP_ASUS_MODE5, |
| 9661 | ALC662_FIXUP_ASUS_MODE6, |
| 9662 | ALC662_FIXUP_ASUS_MODE7, |
| 9663 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9664 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9665 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9666 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9667 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 9668 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9669 | ALC662_FIXUP_HEADSET_MODE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 9670 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9671 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9672 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9673 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9674 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 9675 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 9676 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 9677 | ALC668_FIXUP_DELL_XPS13, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 9678 | ALC662_FIXUP_ASUS_Nx50, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9679 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9680 | ALC668_FIXUP_ASUS_Nx51, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9681 | ALC668_FIXUP_MIC_COEF, |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 9682 | ALC668_FIXUP_ASUS_G751, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9683 | ALC891_FIXUP_HEADSET_MODE, |
| 9684 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 9685 | ALC662_FIXUP_ACER_VERITON, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9686 | ALC892_FIXUP_ASROCK_MOBO, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9687 | ALC662_FIXUP_USI_FUNC, |
| 9688 | ALC662_FIXUP_USI_HEADSET_MODE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 9689 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9690 | ALC669_FIXUP_ACER_ASPIRE_ETHOS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9691 | ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9692 | ALC671_FIXUP_HP_HEADSET_MIC2, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 9693 | ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 9694 | ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9695 | }; |
| 9696 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9697 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9698 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9699 | .type = HDA_FIXUP_PINS, |
| 9700 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9701 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 9702 | { } |
| 9703 | } |
| 9704 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9705 | [ALC662_FIXUP_LED_GPIO1] = { |
| 9706 | .type = HDA_FIXUP_FUNC, |
| 9707 | .v.func = alc662_fixup_led_gpio1, |
| 9708 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9709 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9710 | .type = HDA_FIXUP_PINS, |
| 9711 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9712 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 9713 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9714 | }, |
| 9715 | .chained = true, |
| 9716 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9717 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9718 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9719 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 9720 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9721 | }, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 9722 | [ALC662_FIXUP_CZC_ET26] = { |
| 9723 | .type = HDA_FIXUP_PINS, |
| 9724 | .v.pins = (const struct hda_pintbl[]) { |
| 9725 | {0x12, 0x403cc000}, |
| 9726 | {0x14, 0x90170110}, /* speaker */ |
| 9727 | {0x15, 0x411111f0}, |
| 9728 | {0x16, 0x411111f0}, |
| 9729 | {0x18, 0x01a19030}, /* mic */ |
| 9730 | {0x19, 0x90a7013f}, /* int-mic */ |
| 9731 | {0x1a, 0x01014020}, |
| 9732 | {0x1b, 0x0121401f}, |
| 9733 | {0x1c, 0x411111f0}, |
| 9734 | {0x1d, 0x411111f0}, |
| 9735 | {0x1e, 0x40478e35}, |
| 9736 | {} |
| 9737 | }, |
| 9738 | .chained = true, |
| 9739 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9740 | }, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9741 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9742 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9743 | .v.verbs = (const struct hda_verb[]) { |
| 9744 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 9745 | {} |
| 9746 | } |
| 9747 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 9748 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9749 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 9750 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 9751 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9752 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9753 | .type = HDA_FIXUP_PINS, |
| 9754 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9755 | { 0x14, 0x0221201f }, /* HP out */ |
| 9756 | { } |
| 9757 | }, |
| 9758 | .chained = true, |
| 9759 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9760 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9761 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9762 | .type = HDA_FIXUP_PINS, |
| 9763 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9764 | { 0x14, 0x99130110 }, /* speaker */ |
| 9765 | { 0x18, 0x01a19c20 }, /* mic */ |
| 9766 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 9767 | { 0x21, 0x0121401f }, /* HP out */ |
| 9768 | { } |
| 9769 | }, |
| 9770 | .chained = true, |
| 9771 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9772 | }, |
| 9773 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9774 | .type = HDA_FIXUP_PINS, |
| 9775 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 9776 | { 0x14, 0x99130110 }, /* speaker */ |
| 9777 | { 0x18, 0x01a19820 }, /* mic */ |
| 9778 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 9779 | { 0x1b, 0x0121401f }, /* HP out */ |
| 9780 | { } |
| 9781 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9782 | .chained = true, |
| 9783 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9784 | }, |
| 9785 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9786 | .type = HDA_FIXUP_PINS, |
| 9787 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9788 | { 0x14, 0x99130110 }, /* speaker */ |
| 9789 | { 0x15, 0x0121441f }, /* HP */ |
| 9790 | { 0x18, 0x01a19840 }, /* mic */ |
| 9791 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9792 | { 0x21, 0x01211420 }, /* HP2 */ |
| 9793 | { } |
| 9794 | }, |
| 9795 | .chained = true, |
| 9796 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9797 | }, |
| 9798 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9799 | .type = HDA_FIXUP_PINS, |
| 9800 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9801 | { 0x14, 0x99130110 }, /* speaker */ |
| 9802 | { 0x16, 0x99130111 }, /* speaker */ |
| 9803 | { 0x18, 0x01a19840 }, /* mic */ |
| 9804 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9805 | { 0x21, 0x0121441f }, /* HP */ |
| 9806 | { } |
| 9807 | }, |
| 9808 | .chained = true, |
| 9809 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9810 | }, |
| 9811 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9812 | .type = HDA_FIXUP_PINS, |
| 9813 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9814 | { 0x14, 0x99130110 }, /* speaker */ |
| 9815 | { 0x15, 0x0121441f }, /* HP */ |
| 9816 | { 0x16, 0x99130111 }, /* speaker */ |
| 9817 | { 0x18, 0x01a19840 }, /* mic */ |
| 9818 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9819 | { } |
| 9820 | }, |
| 9821 | .chained = true, |
| 9822 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9823 | }, |
| 9824 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9825 | .type = HDA_FIXUP_PINS, |
| 9826 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9827 | { 0x14, 0x99130110 }, /* speaker */ |
| 9828 | { 0x15, 0x01211420 }, /* HP2 */ |
| 9829 | { 0x18, 0x01a19840 }, /* mic */ |
| 9830 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9831 | { 0x1b, 0x0121441f }, /* HP */ |
| 9832 | { } |
| 9833 | }, |
| 9834 | .chained = true, |
| 9835 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9836 | }, |
| 9837 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9838 | .type = HDA_FIXUP_PINS, |
| 9839 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9840 | { 0x14, 0x99130110 }, /* speaker */ |
| 9841 | { 0x17, 0x99130111 }, /* speaker */ |
| 9842 | { 0x18, 0x01a19840 }, /* mic */ |
| 9843 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9844 | { 0x1b, 0x01214020 }, /* HP */ |
| 9845 | { 0x21, 0x0121401f }, /* HP */ |
| 9846 | { } |
| 9847 | }, |
| 9848 | .chained = true, |
| 9849 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9850 | }, |
| 9851 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9852 | .type = HDA_FIXUP_PINS, |
| 9853 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9854 | { 0x14, 0x99130110 }, /* speaker */ |
| 9855 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 9856 | { 0x15, 0x01214020 }, /* HP */ |
| 9857 | { 0x17, 0x99130111 }, /* speaker */ |
| 9858 | { 0x18, 0x01a19840 }, /* mic */ |
| 9859 | { 0x21, 0x0121401f }, /* HP */ |
| 9860 | { } |
| 9861 | }, |
| 9862 | .chained = true, |
| 9863 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 9864 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9865 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9866 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9867 | .v.func = alc_fixup_no_jack_detect, |
| 9868 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9869 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9870 | .type = HDA_FIXUP_PINS, |
| 9871 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9872 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 9873 | { } |
| 9874 | } |
| 9875 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9876 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9877 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 9878 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9879 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 9880 | [ALC668_FIXUP_DELL_XPS13] = { |
| 9881 | .type = HDA_FIXUP_FUNC, |
| 9882 | .v.func = alc_fixup_dell_xps13, |
| 9883 | .chained = true, |
| 9884 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 9885 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 9886 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 9887 | .type = HDA_FIXUP_FUNC, |
| 9888 | .v.func = alc_fixup_disable_aamix, |
| 9889 | .chained = true, |
| 9890 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 9891 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 9892 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 9893 | .type = HDA_FIXUP_FUNC, |
| 9894 | .v.func = alc_fixup_auto_mute_via_amp, |
| 9895 | .chained = true, |
| 9896 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 9897 | }, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9898 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 9899 | .type = HDA_FIXUP_PINS, |
| 9900 | .v.pins = (const struct hda_pintbl[]) { |
| 9901 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 9902 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ |
| 9903 | { } |
| 9904 | }, |
| 9905 | .chained = true, |
| 9906 | .chain_id = ALC662_FIXUP_HEADSET_MODE |
| 9907 | }, |
| 9908 | [ALC662_FIXUP_HEADSET_MODE] = { |
| 9909 | .type = HDA_FIXUP_FUNC, |
| 9910 | .v.func = alc_fixup_headset_mode_alc662, |
| 9911 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 9912 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 9913 | .type = HDA_FIXUP_PINS, |
| 9914 | .v.pins = (const struct hda_pintbl[]) { |
| 9915 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 9916 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 9917 | { } |
| 9918 | }, |
| 9919 | .chained = true, |
| 9920 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 9921 | }, |
| 9922 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 9923 | .type = HDA_FIXUP_FUNC, |
| 9924 | .v.func = alc_fixup_headset_mode_alc668, |
| 9925 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9926 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9927 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 9928 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9929 | .chained = true, |
| 9930 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 9931 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9932 | [ALC662_FIXUP_BASS_16] = { |
| 9933 | .type = HDA_FIXUP_PINS, |
| 9934 | .v.pins = (const struct hda_pintbl[]) { |
| 9935 | {0x16, 0x80106111}, /* bass speaker */ |
| 9936 | {} |
| 9937 | }, |
| 9938 | .chained = true, |
| 9939 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 9940 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9941 | [ALC662_FIXUP_BASS_1A] = { |
| 9942 | .type = HDA_FIXUP_PINS, |
| 9943 | .v.pins = (const struct hda_pintbl[]) { |
| 9944 | {0x1a, 0x80106111}, /* bass speaker */ |
| 9945 | {} |
| 9946 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9947 | .chained = true, |
| 9948 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9949 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9950 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9951 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 9952 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9953 | }, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 9954 | [ALC662_FIXUP_ASUS_Nx50] = { |
| 9955 | .type = HDA_FIXUP_FUNC, |
| 9956 | .v.func = alc_fixup_auto_mute_via_amp, |
| 9957 | .chained = true, |
| 9958 | .chain_id = ALC662_FIXUP_BASS_1A |
| 9959 | }, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9960 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
| 9961 | .type = HDA_FIXUP_FUNC, |
| 9962 | .v.func = alc_fixup_headset_mode_alc668, |
| 9963 | .chain_id = ALC662_FIXUP_BASS_CHMAP |
| 9964 | }, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9965 | [ALC668_FIXUP_ASUS_Nx51] = { |
| 9966 | .type = HDA_FIXUP_PINS, |
| 9967 | .v.pins = (const struct hda_pintbl[]) { |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9968 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 9969 | { 0x1a, 0x90170151 }, /* bass speaker */ |
| 9970 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9971 | {} |
| 9972 | }, |
| 9973 | .chained = true, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9974 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9975 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9976 | [ALC668_FIXUP_MIC_COEF] = { |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 9977 | .type = HDA_FIXUP_VERBS, |
| 9978 | .v.verbs = (const struct hda_verb[]) { |
| 9979 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, |
| 9980 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, |
| 9981 | {} |
| 9982 | }, |
| 9983 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9984 | [ALC668_FIXUP_ASUS_G751] = { |
| 9985 | .type = HDA_FIXUP_PINS, |
| 9986 | .v.pins = (const struct hda_pintbl[]) { |
| 9987 | { 0x16, 0x0421101f }, /* HP */ |
| 9988 | {} |
| 9989 | }, |
| 9990 | .chained = true, |
| 9991 | .chain_id = ALC668_FIXUP_MIC_COEF |
| 9992 | }, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9993 | [ALC891_FIXUP_HEADSET_MODE] = { |
| 9994 | .type = HDA_FIXUP_FUNC, |
| 9995 | .v.func = alc_fixup_headset_mode, |
| 9996 | }, |
| 9997 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 9998 | .type = HDA_FIXUP_PINS, |
| 9999 | .v.pins = (const struct hda_pintbl[]) { |
| 10000 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 10001 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 10002 | { } |
| 10003 | }, |
| 10004 | .chained = true, |
| 10005 | .chain_id = ALC891_FIXUP_HEADSET_MODE |
| 10006 | }, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 10007 | [ALC662_FIXUP_ACER_VERITON] = { |
| 10008 | .type = HDA_FIXUP_PINS, |
| 10009 | .v.pins = (const struct hda_pintbl[]) { |
| 10010 | { 0x15, 0x50170120 }, /* no internal speaker */ |
| 10011 | { } |
| 10012 | } |
| 10013 | }, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 10014 | [ALC892_FIXUP_ASROCK_MOBO] = { |
| 10015 | .type = HDA_FIXUP_PINS, |
| 10016 | .v.pins = (const struct hda_pintbl[]) { |
| 10017 | { 0x15, 0x40f000f0 }, /* disabled */ |
| 10018 | { 0x16, 0x40f000f0 }, /* disabled */ |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 10019 | { } |
| 10020 | } |
| 10021 | }, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 10022 | [ALC662_FIXUP_USI_FUNC] = { |
| 10023 | .type = HDA_FIXUP_FUNC, |
| 10024 | .v.func = alc662_fixup_usi_headset_mic, |
| 10025 | }, |
| 10026 | [ALC662_FIXUP_USI_HEADSET_MODE] = { |
| 10027 | .type = HDA_FIXUP_PINS, |
| 10028 | .v.pins = (const struct hda_pintbl[]) { |
| 10029 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ |
| 10030 | { 0x18, 0x01a1903d }, |
| 10031 | { } |
| 10032 | }, |
| 10033 | .chained = true, |
| 10034 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 10035 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 10036 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
| 10037 | .type = HDA_FIXUP_FUNC, |
| 10038 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 10039 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10040 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { |
| 10041 | .type = HDA_FIXUP_FUNC, |
| 10042 | .v.func = alc662_fixup_aspire_ethos_hp, |
| 10043 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10044 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { |
| 10045 | .type = HDA_FIXUP_PINS, |
| 10046 | .v.pins = (const struct hda_pintbl[]) { |
| 10047 | { 0x15, 0x92130110 }, /* front speakers */ |
| 10048 | { 0x18, 0x99130111 }, /* center/subwoofer */ |
| 10049 | { 0x1b, 0x11130012 }, /* surround plus jack for HP */ |
| 10050 | { } |
| 10051 | }, |
| 10052 | .chained = true, |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 10053 | .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10054 | }, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 10055 | [ALC671_FIXUP_HP_HEADSET_MIC2] = { |
| 10056 | .type = HDA_FIXUP_FUNC, |
| 10057 | .v.func = alc671_fixup_hp_headset_mic2, |
| 10058 | }, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 10059 | [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { |
| 10060 | .type = HDA_FIXUP_PINS, |
| 10061 | .v.pins = (const struct hda_pintbl[]) { |
| 10062 | { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ |
| 10063 | { } |
| 10064 | }, |
| 10065 | .chained = true, |
| 10066 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 10067 | }, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 10068 | [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { |
| 10069 | .type = HDA_FIXUP_PINS, |
| 10070 | .v.pins = (const struct hda_pintbl[]) { |
| 10071 | { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ |
| 10072 | { 0x1b, 0x0221144f }, |
| 10073 | { } |
| 10074 | }, |
| 10075 | .chained = true, |
| 10076 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 10077 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10078 | }; |
| 10079 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 10080 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10081 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 10082 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | 02f6ff9 | 2015-12-07 11:29:31 +0100 | [diff] [blame] | 10083 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 10084 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 10085 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 10086 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 10087 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 10088 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
Takashi Iwai | 9edeb11 | 2021-04-28 13:27:02 +0200 | [diff] [blame^] | 10089 | SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 10090 | 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] | 10091 | 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] | 10092 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 10093 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 10094 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 10095 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
Niranjan Sivakumar | 467e143 | 2015-09-05 18:20:35 +0200 | [diff] [blame] | 10096 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 10097 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99e | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 10098 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 10099 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 10100 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 10101 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 10102 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
Jeremy Szu | 148ebf54 | 2020-10-08 18:56:44 +0800 | [diff] [blame] | 10103 | SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), |
Kaho Ng | 2da2dc9 | 2016-05-09 00:27:49 +0800 | [diff] [blame] | 10104 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
Bobi Mihalca | 83a9efb | 2016-03-23 13:32:33 +0200 | [diff] [blame] | 10105 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 10106 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 10107 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
Takashi Iwai | 9edeb11 | 2021-04-28 13:27:02 +0200 | [diff] [blame^] | 10108 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 10109 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 10110 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 10111 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
| 10112 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
Takashi Iwai | c7efff9 | 2017-01-04 21:38:16 +0100 | [diff] [blame] | 10113 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 10114 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 10115 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 10116 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10117 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 10118 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 10119 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 10120 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 10121 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10122 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 10123 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 10124 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 10125 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 10126 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 10127 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10128 | |
| 10129 | #if 0 |
| 10130 | /* Below is a quirk table taken from the old code. |
| 10131 | * Basically the device should work as is without the fixup table. |
| 10132 | * If BIOS doesn't give a proper info, enable the corresponding |
| 10133 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 10134 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10135 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 10136 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 10137 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 10138 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 10139 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 10140 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10141 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 10142 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 10143 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 10144 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10145 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 10146 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 10147 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 10148 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 10149 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 10150 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10151 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 10152 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 10153 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10154 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 10155 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 10156 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10157 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 10158 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 10159 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 10160 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10161 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 10162 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 10163 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10164 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 10165 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10166 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10167 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 10168 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 10169 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 10170 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 10171 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 10172 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 10173 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 10174 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 10175 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 10176 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 10177 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 10178 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 10179 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 10180 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 10181 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 10182 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 10183 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 10184 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 10185 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10186 | {} |
| 10187 | }; |
| 10188 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10189 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 10190 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
| 10191 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 10192 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 10193 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10194 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 10195 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 10196 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 10197 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 10198 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 10199 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 10200 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 10201 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 10202 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 10203 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 10204 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 10205 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 10206 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
| 10207 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, |
| 10208 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, |
| 10209 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, |
| 10210 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, |
| 10211 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, |
| 10212 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, |
| 10213 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, |
Takashi Iwai | 40c5167 | 2018-10-07 09:47:39 +0200 | [diff] [blame] | 10214 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 10215 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
| 10216 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, |
| 10217 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, |
| 10218 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, |
| 10219 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 10220 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10221 | {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 10222 | {} |
| 10223 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10224 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 10225 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 10226 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 10227 | {0x17, 0x02211010}, |
| 10228 | {0x18, 0x01a19030}, |
| 10229 | {0x1a, 0x01813040}, |
| 10230 | {0x21, 0x01014020}), |
Hui Wang | 4b4e0e3 | 2019-07-16 15:21:34 +0800 | [diff] [blame] | 10231 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 10232 | {0x16, 0x01813030}, |
| 10233 | {0x17, 0x02211010}, |
| 10234 | {0x18, 0x01a19040}, |
| 10235 | {0x21, 0x01014020}), |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 10236 | 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] | 10237 | {0x14, 0x01014010}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 10238 | {0x18, 0x01a19020}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 10239 | {0x1a, 0x0181302f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 10240 | {0x1b, 0x0221401f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 10241 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 10242 | {0x12, 0x99a30130}, |
| 10243 | {0x14, 0x90170110}, |
| 10244 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 10245 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 10246 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 10247 | {0x12, 0x99a30140}, |
| 10248 | {0x14, 0x90170110}, |
| 10249 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 10250 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 10251 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 10252 | {0x12, 0x99a30150}, |
| 10253 | {0x14, 0x90170110}, |
| 10254 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 10255 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 10256 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 10257 | {0x14, 0x90170110}, |
| 10258 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 10259 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 10260 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 10261 | {0x12, 0x90a60130}, |
| 10262 | {0x14, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 10263 | {0x15, 0x0321101f}), |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 10264 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 10265 | {0x14, 0x01014010}, |
| 10266 | {0x17, 0x90170150}, |
Kailang Yang | f2adbae | 2020-02-05 15:40:01 +0800 | [diff] [blame] | 10267 | {0x19, 0x02a11060}, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 10268 | {0x1b, 0x01813030}, |
| 10269 | {0x21, 0x02211020}), |
| 10270 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 10271 | {0x14, 0x01014010}, |
| 10272 | {0x18, 0x01a19040}, |
| 10273 | {0x1b, 0x01813030}, |
| 10274 | {0x21, 0x02211020}), |
| 10275 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 10276 | {0x14, 0x01014020}, |
| 10277 | {0x17, 0x90170110}, |
| 10278 | {0x18, 0x01a19050}, |
| 10279 | {0x1b, 0x01813040}, |
| 10280 | {0x21, 0x02211030}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 10281 | {} |
| 10282 | }; |
| 10283 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10284 | /* |
| 10285 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10286 | static int patch_alc662(struct hda_codec *codec) |
| 10287 | { |
| 10288 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10289 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10290 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10291 | err = alc_alloc_spec(codec, 0x0b); |
| 10292 | if (err < 0) |
| 10293 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10294 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10295 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 10296 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 10297 | spec->shutup = alc_eapd_shutup; |
| 10298 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10299 | /* handle multiple HPs as is */ |
| 10300 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 10301 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 10302 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 10303 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 10304 | switch (codec->core.vendor_id) { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 10305 | case 0x10ec0668: |
| 10306 | spec->init_hook = alc668_restore_default_value; |
| 10307 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 10308 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 10309 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 10310 | alc_pre_init(codec); |
| 10311 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10312 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 10313 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 10314 | 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] | 10315 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 10316 | |
| 10317 | alc_auto_parse_customize_define(codec); |
| 10318 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 10319 | if (has_cdefine_beep(codec)) |
| 10320 | spec->gen.beep_nid = 0x01; |
| 10321 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 10322 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 10323 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10324 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 10325 | err = alc_codec_rename(codec, "ALC272X"); |
| 10326 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10327 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 10328 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 10329 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 10330 | /* automatic parse from the BIOS config */ |
| 10331 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10332 | if (err < 0) |
| 10333 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10334 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 10335 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 10336 | switch (codec->core.vendor_id) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 10337 | case 0x10ec0662: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 10338 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 10339 | break; |
| 10340 | case 0x10ec0272: |
| 10341 | case 0x10ec0663: |
| 10342 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 10343 | case 0x10ec0668: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 10344 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 10345 | break; |
| 10346 | case 0x10ec0273: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 10347 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 10348 | break; |
| 10349 | } |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 10350 | if (err < 0) |
| 10351 | goto error; |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 10352 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 10353 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10354 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 10355 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10356 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10357 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10358 | error: |
| 10359 | alc_free(codec); |
| 10360 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 10361 | } |
| 10362 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10363 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10364 | * ALC680 support |
| 10365 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10366 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10367 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 10368 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 10369 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10370 | } |
| 10371 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10372 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10373 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10374 | static int patch_alc680(struct hda_codec *codec) |
| 10375 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10376 | int err; |
| 10377 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 10378 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10379 | err = alc_alloc_spec(codec, 0); |
| 10380 | if (err < 0) |
| 10381 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 10382 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 10383 | /* automatic parse from the BIOS config */ |
| 10384 | err = alc680_parse_auto_config(codec); |
| 10385 | if (err < 0) { |
| 10386 | alc_free(codec); |
| 10387 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10388 | } |
| 10389 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 10390 | return 0; |
| 10391 | } |
| 10392 | |
| 10393 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10394 | * patch entries |
| 10395 | */ |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10396 | static const struct hda_device_id snd_hda_id_realtek[] = { |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 10397 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10398 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 10399 | HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 10400 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10401 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
| 10402 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 10403 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10404 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 10405 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 10406 | HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10407 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
| 10408 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 10409 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10410 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
| 10411 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), |
| 10412 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), |
| 10413 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), |
| 10414 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), |
| 10415 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), |
| 10416 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 10417 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10418 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
| 10419 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), |
| 10420 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), |
| 10421 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), |
| 10422 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), |
| 10423 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 10424 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10425 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
Kailang Yang | 630e361 | 2020-05-27 14:10:26 +0800 | [diff] [blame] | 10426 | HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10427 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 10428 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10429 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
| 10430 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), |
| 10431 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 10432 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 10433 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10434 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 10435 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 10436 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 10437 | HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10438 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
| 10439 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
| 10440 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
| 10441 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), |
| 10442 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), |
| 10443 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), |
| 10444 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), |
| 10445 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), |
| 10446 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), |
| 10447 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), |
| 10448 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), |
| 10449 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), |
| 10450 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), |
| 10451 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 10452 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
| 10453 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), |
| 10454 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 10455 | HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 10456 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10457 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
| 10458 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), |
| 10459 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), |
| 10460 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), |
| 10461 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), |
| 10462 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), |
| 10463 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), |
| 10464 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), |
| 10465 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), |
| 10466 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), |
| 10467 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), |
Kailang Yang | e5782a5 | 2020-11-27 14:39:23 +0800 | [diff] [blame] | 10468 | HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10469 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
| 10470 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 10471 | HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 10472 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 10473 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10474 | {} /* terminator */ |
| 10475 | }; |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10476 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 10477 | |
| 10478 | MODULE_LICENSE("GPL"); |
| 10479 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 10480 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 10481 | static struct hda_codec_driver realtek_driver = { |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10482 | .id = snd_hda_id_realtek, |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 10483 | }; |
| 10484 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 10485 | module_hda_codec_driver(realtek_driver); |