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; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 122 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 123 | /* for PLL fix */ |
| 124 | hda_nid_t pll_nid; |
| 125 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 126 | unsigned int coef0; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 127 | struct input_dev *kb_dev; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 128 | u8 alc_mute_keycode_map[1]; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 129 | }; |
| 130 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 131 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 132 | * COEF access helper functions |
| 133 | */ |
| 134 | |
| 135 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 136 | unsigned int coef_idx) |
| 137 | { |
| 138 | unsigned int val; |
| 139 | |
| 140 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 141 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 142 | return val; |
| 143 | } |
| 144 | |
| 145 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 146 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 147 | |
| 148 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 149 | unsigned int coef_idx, unsigned int coef_val) |
| 150 | { |
| 151 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 153 | } |
| 154 | |
| 155 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 156 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 157 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 158 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 159 | unsigned int coef_idx, unsigned int mask, |
| 160 | unsigned int bits_set) |
| 161 | { |
| 162 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 163 | |
| 164 | if (val != -1) |
| 165 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 166 | (val & ~mask) | bits_set); |
| 167 | } |
| 168 | |
| 169 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 170 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 171 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 172 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 173 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 174 | { |
| 175 | struct alc_spec *spec = codec->spec; |
| 176 | |
| 177 | if (!spec->coef0) |
| 178 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 179 | return spec->coef0; |
| 180 | } |
| 181 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 182 | /* coef writes/updates batch */ |
| 183 | struct coef_fw { |
| 184 | unsigned char nid; |
| 185 | unsigned char idx; |
| 186 | unsigned short mask; |
| 187 | unsigned short val; |
| 188 | }; |
| 189 | |
| 190 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 191 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 192 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 193 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 194 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 195 | |
| 196 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 197 | const struct coef_fw *fw) |
| 198 | { |
| 199 | for (; fw->nid; fw++) { |
| 200 | if (fw->mask == (unsigned short)-1) |
| 201 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 202 | else |
| 203 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 204 | fw->mask, fw->val); |
| 205 | } |
| 206 | } |
| 207 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 208 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 209 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 210 | */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 211 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 212 | /* Enable GPIO mask and set output */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 213 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
| 214 | { |
| 215 | struct alc_spec *spec = codec->spec; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 216 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 217 | spec->gpio_mask |= mask; |
| 218 | spec->gpio_dir |= mask; |
| 219 | spec->gpio_data |= mask; |
| 220 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 221 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 222 | static void alc_write_gpio_data(struct hda_codec *codec) |
| 223 | { |
| 224 | struct alc_spec *spec = codec->spec; |
| 225 | |
| 226 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 227 | spec->gpio_data); |
| 228 | } |
| 229 | |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 230 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
| 231 | bool on) |
| 232 | { |
| 233 | struct alc_spec *spec = codec->spec; |
| 234 | unsigned int oldval = spec->gpio_data; |
| 235 | |
| 236 | if (on) |
| 237 | spec->gpio_data |= mask; |
| 238 | else |
| 239 | spec->gpio_data &= ~mask; |
| 240 | if (oldval != spec->gpio_data) |
| 241 | alc_write_gpio_data(codec); |
| 242 | } |
| 243 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 244 | static void alc_write_gpio(struct hda_codec *codec) |
| 245 | { |
| 246 | struct alc_spec *spec = codec->spec; |
| 247 | |
| 248 | if (!spec->gpio_mask) |
| 249 | return; |
| 250 | |
| 251 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 252 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); |
| 253 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 254 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 255 | if (spec->gpio_write_delay) |
| 256 | msleep(1); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 257 | alc_write_gpio_data(codec); |
| 258 | } |
| 259 | |
| 260 | static void alc_fixup_gpio(struct hda_codec *codec, int action, |
| 261 | unsigned int mask) |
| 262 | { |
| 263 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 264 | alc_setup_gpio(codec, mask); |
| 265 | } |
| 266 | |
| 267 | static void alc_fixup_gpio1(struct hda_codec *codec, |
| 268 | const struct hda_fixup *fix, int action) |
| 269 | { |
| 270 | alc_fixup_gpio(codec, action, 0x01); |
| 271 | } |
| 272 | |
| 273 | static void alc_fixup_gpio2(struct hda_codec *codec, |
| 274 | const struct hda_fixup *fix, int action) |
| 275 | { |
| 276 | alc_fixup_gpio(codec, action, 0x02); |
| 277 | } |
| 278 | |
| 279 | static void alc_fixup_gpio3(struct hda_codec *codec, |
| 280 | const struct hda_fixup *fix, int action) |
| 281 | { |
| 282 | alc_fixup_gpio(codec, action, 0x03); |
| 283 | } |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 284 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 285 | static void alc_fixup_gpio4(struct hda_codec *codec, |
| 286 | const struct hda_fixup *fix, int action) |
| 287 | { |
| 288 | alc_fixup_gpio(codec, action, 0x04); |
| 289 | } |
| 290 | |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 291 | static void alc_fixup_micmute_led(struct hda_codec *codec, |
| 292 | const struct hda_fixup *fix, int action) |
| 293 | { |
| 294 | if (action == HDA_FIXUP_ACT_PROBE) |
| 295 | snd_hda_gen_add_micmute_led_cdev(codec, NULL); |
| 296 | } |
| 297 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 298 | /* |
| 299 | * Fix hardware PLL issue |
| 300 | * On some codecs, the analog PLL gating control must be off while |
| 301 | * the default value is 1. |
| 302 | */ |
| 303 | static void alc_fix_pll(struct hda_codec *codec) |
| 304 | { |
| 305 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 306 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 307 | if (spec->pll_nid) |
| 308 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 309 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 313 | unsigned int coef_idx, unsigned int coef_bit) |
| 314 | { |
| 315 | struct alc_spec *spec = codec->spec; |
| 316 | spec->pll_nid = nid; |
| 317 | spec->pll_coef_idx = coef_idx; |
| 318 | spec->pll_coef_bit = coef_bit; |
| 319 | alc_fix_pll(codec); |
| 320 | } |
| 321 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 322 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 323 | static void alc_update_knob_master(struct hda_codec *codec, |
| 324 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 325 | { |
| 326 | unsigned int val; |
| 327 | struct snd_kcontrol *kctl; |
| 328 | struct snd_ctl_elem_value *uctl; |
| 329 | |
| 330 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 331 | if (!kctl) |
| 332 | return; |
| 333 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 334 | if (!uctl) |
| 335 | return; |
Takashi Iwai | 2ebab40 | 2016-02-09 10:23:52 +0100 | [diff] [blame] | 336 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 337 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 338 | val &= HDA_AMP_VOLMASK; |
| 339 | uctl->value.integer.value[0] = val; |
| 340 | uctl->value.integer.value[1] = val; |
| 341 | kctl->put(kctl, uctl); |
| 342 | kfree(uctl); |
| 343 | } |
| 344 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 345 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 346 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 347 | /* For some reason, the res given from ALC880 is broken. |
| 348 | Here we adjust it properly. */ |
| 349 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 350 | } |
| 351 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 352 | /* Change EAPD to verb control */ |
| 353 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 354 | { |
| 355 | int coef; |
| 356 | |
| 357 | coef = alc_get_coef0(codec); |
| 358 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 359 | switch (codec->core.vendor_id) { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 360 | case 0x10ec0262: |
| 361 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 362 | break; |
| 363 | case 0x10ec0267: |
| 364 | case 0x10ec0268: |
| 365 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 366 | break; |
| 367 | case 0x10ec0269: |
| 368 | if ((coef & 0x00f0) == 0x0010) |
| 369 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 370 | if ((coef & 0x00f0) == 0x0020) |
| 371 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 372 | if ((coef & 0x00f0) == 0x0030) |
| 373 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 374 | break; |
| 375 | case 0x10ec0280: |
| 376 | case 0x10ec0284: |
| 377 | case 0x10ec0290: |
| 378 | case 0x10ec0292: |
| 379 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 380 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 381 | case 0x10ec0225: |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 382 | case 0x10ec0295: |
| 383 | case 0x10ec0299: |
| 384 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Gustavo A. R. Silva | c0dbbda | 2020-07-08 15:32:36 -0500 | [diff] [blame] | 385 | fallthrough; |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 386 | case 0x10ec0215: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 387 | case 0x10ec0233: |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 388 | case 0x10ec0235: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 389 | case 0x10ec0236: |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 390 | case 0x10ec0245: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 391 | case 0x10ec0255: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 392 | case 0x10ec0256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 393 | case 0x10ec0257: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 394 | case 0x10ec0282: |
| 395 | case 0x10ec0283: |
| 396 | case 0x10ec0286: |
Kailang Yang | 630e361 | 2020-05-27 14:10:26 +0800 | [diff] [blame] | 397 | case 0x10ec0287: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 398 | case 0x10ec0288: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 399 | case 0x10ec0285: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 400 | case 0x10ec0298: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 401 | case 0x10ec0289: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 402 | case 0x10ec0300: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 403 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 404 | break; |
Kailang Yang | 3aabf94 | 2017-11-08 15:28:33 +0800 | [diff] [blame] | 405 | case 0x10ec0275: |
| 406 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); |
| 407 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 408 | case 0x10ec0293: |
| 409 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 410 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 411 | case 0x10ec0234: |
| 412 | case 0x10ec0274: |
| 413 | case 0x10ec0294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 414 | case 0x10ec0700: |
| 415 | case 0x10ec0701: |
| 416 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 417 | case 0x10ec0711: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 418 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
| 419 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 420 | case 0x10ec0662: |
| 421 | if ((coef & 0x00f0) == 0x0030) |
| 422 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 423 | break; |
| 424 | case 0x10ec0272: |
| 425 | case 0x10ec0273: |
| 426 | case 0x10ec0663: |
| 427 | case 0x10ec0665: |
| 428 | case 0x10ec0670: |
| 429 | case 0x10ec0671: |
| 430 | case 0x10ec0672: |
| 431 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 432 | break; |
Kailang Yang | 9194a1e | 2020-01-07 17:22:19 +0800 | [diff] [blame] | 433 | case 0x10ec0222: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 434 | case 0x10ec0623: |
| 435 | alc_update_coef_idx(codec, 0x19, 1<<13, 0); |
| 436 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 437 | case 0x10ec0668: |
| 438 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 439 | break; |
| 440 | case 0x10ec0867: |
| 441 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 442 | break; |
| 443 | case 0x10ec0888: |
| 444 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 445 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 446 | break; |
| 447 | case 0x10ec0892: |
| 448 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 449 | break; |
| 450 | case 0x10ec0899: |
| 451 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 452 | case 0x10ec0b00: |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 453 | case 0x10ec1168: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 454 | case 0x10ec1220: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 455 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 456 | break; |
| 457 | } |
| 458 | } |
| 459 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 460 | /* additional initialization for ALC888 variants */ |
| 461 | static void alc888_coef_init(struct hda_codec *codec) |
| 462 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 463 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 464 | /* alc888-VA */ |
| 465 | case 0x00: |
| 466 | /* alc888-VB */ |
| 467 | case 0x10: |
| 468 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 469 | break; |
| 470 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 471 | } |
| 472 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 473 | /* turn on/off EAPD control (only if available) */ |
| 474 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 475 | { |
| 476 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 477 | return; |
| 478 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 479 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 480 | on ? 2 : 0); |
| 481 | } |
| 482 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 483 | /* turn on/off EAPD controls of the codec */ |
| 484 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 485 | { |
| 486 | /* We currently only handle front, HP */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 487 | static const hda_nid_t pins[] = { |
Hui Wang | af95b41 | 2015-03-26 17:14:55 +0800 | [diff] [blame] | 488 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 489 | }; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 490 | const hda_nid_t *p; |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 491 | for (p = pins; *p; p++) |
| 492 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 493 | } |
| 494 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 495 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 496 | |
| 497 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) |
| 498 | { |
| 499 | const struct hda_pincfg *pin; |
| 500 | int mic_pin = find_ext_mic_pin(codec); |
| 501 | int i; |
| 502 | |
| 503 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 504 | * the default pin setup at the next load of the driver |
| 505 | */ |
| 506 | if (codec->bus->shutdown) |
| 507 | return; |
| 508 | |
| 509 | snd_array_for_each(&codec->init_pins, i, pin) { |
| 510 | /* use read here for syncing after issuing each verb */ |
| 511 | if (pin->nid != mic_pin) |
| 512 | snd_hda_codec_read(codec, pin->nid, 0, |
| 513 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 514 | } |
| 515 | |
| 516 | codec->pins_shutup = 1; |
| 517 | } |
| 518 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 519 | static void alc_shutup_pins(struct hda_codec *codec) |
| 520 | { |
| 521 | struct alc_spec *spec = codec->spec; |
| 522 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 523 | switch (codec->core.vendor_id) { |
Kailang Yang | 66c5d71 | 2019-12-09 15:56:15 +0800 | [diff] [blame] | 524 | case 0x10ec0283: |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 525 | case 0x10ec0286: |
| 526 | case 0x10ec0288: |
| 527 | case 0x10ec0298: |
| 528 | alc_headset_mic_no_shutup(codec); |
| 529 | break; |
| 530 | default: |
| 531 | if (!spec->no_shutup_pins) |
| 532 | snd_hda_shutup_pins(codec); |
| 533 | break; |
| 534 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 535 | } |
| 536 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 537 | /* generic shutup callback; |
Lars-Peter Clausen | 4ce8e6a | 2016-11-08 15:48:06 +0100 | [diff] [blame] | 538 | * just turning off EAPD and a little pause for avoiding pop-noise |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 539 | */ |
| 540 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 541 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 542 | struct alc_spec *spec = codec->spec; |
| 543 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 544 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 545 | if (!spec->no_depop_delay) |
| 546 | msleep(200); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 547 | alc_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 548 | } |
| 549 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 550 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 551 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 552 | { |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 553 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 554 | alc_write_gpio(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 555 | switch (type) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 556 | case ALC_INIT_DEFAULT: |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 557 | switch (codec->core.vendor_id) { |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 558 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 559 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 560 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 561 | case 0x10ec0880: |
| 562 | case 0x10ec0882: |
| 563 | case 0x10ec0883: |
| 564 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 565 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 566 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 567 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 568 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 569 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 570 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 571 | break; |
| 572 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 573 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 574 | |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 575 | /* get a primary headphone pin if available */ |
| 576 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) |
| 577 | { |
| 578 | if (spec->gen.autocfg.hp_pins[0]) |
| 579 | return spec->gen.autocfg.hp_pins[0]; |
| 580 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 581 | return spec->gen.autocfg.line_out_pins[0]; |
| 582 | return 0; |
| 583 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 584 | |
| 585 | /* |
| 586 | * Realtek SSID verification |
| 587 | */ |
| 588 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 589 | /* Could be any non-zero and even value. When used as fixup, tells |
| 590 | * the driver to ignore any present sku defines. |
| 591 | */ |
| 592 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 593 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 594 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 595 | const struct hda_fixup *fix, int action) |
| 596 | { |
| 597 | struct alc_spec *spec = codec->spec; |
| 598 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 599 | spec->cdefine.fixup = 1; |
| 600 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 601 | } |
| 602 | } |
| 603 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 604 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 605 | const struct hda_fixup *fix, int action) |
| 606 | { |
| 607 | struct alc_spec *spec = codec->spec; |
| 608 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 609 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 610 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 611 | codec->depop_delay = 0; |
| 612 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 613 | } |
| 614 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 615 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 616 | { |
| 617 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 618 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 619 | struct alc_spec *spec = codec->spec; |
| 620 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 621 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 622 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 623 | if (spec->cdefine.fixup) { |
| 624 | ass = spec->cdefine.sku_cfg; |
| 625 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 626 | return -1; |
| 627 | goto do_sku; |
| 628 | } |
| 629 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 630 | if (!codec->bus->pci) |
| 631 | return -1; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 632 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 633 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 634 | goto do_sku; |
| 635 | |
| 636 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 637 | if (codec->core.vendor_id == 0x10ec0260) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 638 | nid = 0x17; |
| 639 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 640 | |
| 641 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 642 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 643 | codec->core.chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 644 | return -1; |
| 645 | } |
| 646 | |
| 647 | /* check sum */ |
| 648 | tmp = 0; |
| 649 | for (i = 1; i < 16; i++) { |
| 650 | if ((ass >> i) & 1) |
| 651 | tmp++; |
| 652 | } |
| 653 | if (((ass >> 16) & 0xf) != tmp) |
| 654 | return -1; |
| 655 | |
| 656 | spec->cdefine.port_connectivity = ass >> 30; |
| 657 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 658 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 659 | spec->cdefine.customization = ass >> 8; |
| 660 | do_sku: |
| 661 | spec->cdefine.sku_cfg = ass; |
| 662 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 663 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 664 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 665 | spec->cdefine.override = ass & 0x1; |
| 666 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 667 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 668 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 669 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 670 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 671 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 672 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 673 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 674 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 675 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 676 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 677 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 678 | |
| 679 | return 0; |
| 680 | } |
| 681 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 682 | /* return the position of NID in the list, or -1 if not found */ |
| 683 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 684 | { |
| 685 | int i; |
| 686 | for (i = 0; i < nums; i++) |
| 687 | if (list[i] == nid) |
| 688 | return i; |
| 689 | return -1; |
| 690 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 691 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 692 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 693 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 694 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 695 | } |
| 696 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 697 | /* check subsystem ID and set up device-specific initialization; |
| 698 | * return 1 if initialized, 0 if invalid SSID |
| 699 | */ |
| 700 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 701 | * 31 ~ 16 : Manufacture ID |
| 702 | * 15 ~ 8 : SKU ID |
| 703 | * 7 ~ 0 : Assembly ID |
| 704 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 705 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 706 | 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] | 707 | { |
| 708 | unsigned int ass, tmp, i; |
| 709 | unsigned nid; |
| 710 | struct alc_spec *spec = codec->spec; |
| 711 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 712 | if (spec->cdefine.fixup) { |
| 713 | ass = spec->cdefine.sku_cfg; |
| 714 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 715 | return 0; |
| 716 | goto do_sku; |
| 717 | } |
| 718 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 719 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 720 | if (codec->bus->pci && |
| 721 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 722 | goto do_sku; |
| 723 | |
| 724 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 725 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 726 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 727 | * 29~21 : reserve |
| 728 | * 20 : PCBEEP input |
| 729 | * 19~16 : Check sum (15:1) |
| 730 | * 15~1 : Custom |
| 731 | * 0 : override |
| 732 | */ |
| 733 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 734 | if (codec->core.vendor_id == 0x10ec0260) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 735 | nid = 0x17; |
| 736 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 737 | codec_dbg(codec, |
| 738 | "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] | 739 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 740 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 741 | return 0; |
| 742 | if ((ass >> 30) != 1) /* no physical connection */ |
| 743 | return 0; |
| 744 | |
| 745 | /* check sum */ |
| 746 | tmp = 0; |
| 747 | for (i = 1; i < 16; i++) { |
| 748 | if ((ass >> i) & 1) |
| 749 | tmp++; |
| 750 | } |
| 751 | if (((ass >> 16) & 0xf) != tmp) |
| 752 | return 0; |
| 753 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 754 | 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] | 755 | ass & 0xffff, codec->core.vendor_id); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 756 | /* |
| 757 | * 0 : override |
| 758 | * 1 : Swap Jack |
| 759 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 760 | * 3~5 : External Amplifier control |
| 761 | * 7~6 : Reserved |
| 762 | */ |
| 763 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 764 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 765 | switch (tmp) { |
| 766 | case 1: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 767 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 768 | break; |
| 769 | case 3: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 770 | alc_setup_gpio(codec, 0x02); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 771 | break; |
| 772 | case 7: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 773 | alc_setup_gpio(codec, 0x03); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 774 | break; |
| 775 | case 5: |
| 776 | default: |
| 777 | spec->init_amp = ALC_INIT_DEFAULT; |
| 778 | break; |
| 779 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 780 | } |
| 781 | |
| 782 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 783 | * when the external headphone out jack is plugged" |
| 784 | */ |
| 785 | if (!(ass & 0x8000)) |
| 786 | return 1; |
| 787 | /* |
| 788 | * 10~8 : Jack location |
| 789 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 790 | * 14~13: Resvered |
| 791 | * 15 : 1 --> enable the function "Mute internal speaker |
| 792 | * when the external headphone out jack is plugged" |
| 793 | */ |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 794 | if (!alc_get_hp_pin(spec)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 795 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 796 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 797 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 798 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 799 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 800 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 801 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 802 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 803 | return 1; |
| 804 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 805 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 806 | /* Check the validity of ALC subsystem-id |
| 807 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 808 | 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] | 809 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 810 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 811 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6779120 | 2020-04-18 21:06:39 +0200 | [diff] [blame] | 812 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 813 | codec_dbg(codec, |
| 814 | "realtek: Enable default setup for auto mode as fallback\n"); |
| 815 | spec->init_amp = ALC_INIT_DEFAULT; |
| 816 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 817 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 818 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 819 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 820 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 821 | */ |
| 822 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 823 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 824 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 825 | { |
| 826 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 827 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 828 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 829 | } |
| 830 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 831 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 832 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 833 | { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 834 | int err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 835 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 836 | err = snd_hda_gen_build_controls(codec); |
| 837 | if (err < 0) |
| 838 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 839 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 840 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 841 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 842 | } |
| 843 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 844 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 845 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 846 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 847 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 848 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 849 | static void alc_pre_init(struct hda_codec *codec) |
| 850 | { |
| 851 | alc_fill_eapd_coef(codec); |
| 852 | } |
| 853 | |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 854 | #define is_s3_resume(codec) \ |
| 855 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 856 | #define is_s4_resume(codec) \ |
| 857 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) |
| 858 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 859 | static int alc_init(struct hda_codec *codec) |
| 860 | { |
| 861 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 862 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 863 | /* hibernation resume needs the full chip initialization */ |
| 864 | if (is_s4_resume(codec)) |
| 865 | alc_pre_init(codec); |
| 866 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 867 | if (spec->init_hook) |
| 868 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 869 | |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 870 | spec->gen.skip_verbs = 1; /* applied in below */ |
Kailang Yang | 607ca3b | 2019-04-26 16:35:41 +0800 | [diff] [blame] | 871 | snd_hda_gen_init(codec); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 872 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 873 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 874 | snd_hda_apply_verbs(codec); /* apply verbs here after own init */ |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 875 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 876 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 877 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 878 | return 0; |
| 879 | } |
| 880 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 881 | static inline void alc_shutup(struct hda_codec *codec) |
| 882 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 883 | struct alc_spec *spec = codec->spec; |
| 884 | |
Takashi Iwai | c7273bd | 2018-06-12 16:09:57 +0200 | [diff] [blame] | 885 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
| 886 | return; /* disabled explicitly by hints */ |
| 887 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 888 | if (spec && spec->shutup) |
| 889 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 890 | else |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 891 | alc_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 892 | } |
| 893 | |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 894 | static void alc_reboot_notify(struct hda_codec *codec) |
| 895 | { |
| 896 | struct alc_spec *spec = codec->spec; |
| 897 | |
| 898 | if (spec && spec->reboot_notify) |
| 899 | spec->reboot_notify(codec); |
| 900 | else |
| 901 | alc_shutup(codec); |
| 902 | } |
| 903 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 904 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 905 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 906 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 907 | static void alc_power_eapd(struct hda_codec *codec) |
| 908 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 909 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 910 | } |
| 911 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 912 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 913 | { |
| 914 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 915 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 916 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 917 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 918 | return 0; |
| 919 | } |
| 920 | #endif |
| 921 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 922 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 923 | static int alc_resume(struct hda_codec *codec) |
| 924 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 925 | struct alc_spec *spec = codec->spec; |
| 926 | |
| 927 | if (!spec->no_depop_delay) |
| 928 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 929 | codec->patch_ops.init(codec); |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 930 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 931 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 932 | return 0; |
| 933 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 934 | #endif |
| 935 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 936 | /* |
| 937 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 938 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 939 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 940 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 941 | .init = alc_init, |
| 942 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 943 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 944 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 945 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 946 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 947 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 948 | #endif |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 949 | .reboot_notify = alc_reboot_notify, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 950 | }; |
| 951 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 952 | |
Takashi Iwai | ded255b | 2015-10-01 17:59:43 +0200 | [diff] [blame] | 953 | #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] | 954 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 955 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 956 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 957 | */ |
| 958 | struct alc_codec_rename_table { |
| 959 | unsigned int vendor_id; |
| 960 | unsigned short coef_mask; |
| 961 | unsigned short coef_bits; |
| 962 | const char *name; |
| 963 | }; |
| 964 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 965 | struct alc_codec_rename_pci_table { |
| 966 | unsigned int codec_vendor_id; |
| 967 | unsigned short pci_subvendor; |
| 968 | unsigned short pci_subdevice; |
| 969 | const char *name; |
| 970 | }; |
| 971 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 972 | static const struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 973 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 974 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 975 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 976 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 977 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 978 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 979 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 980 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 981 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 982 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 983 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 984 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 985 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 986 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 987 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 988 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 989 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 990 | { } /* terminator */ |
| 991 | }; |
| 992 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 993 | static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 994 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 995 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 996 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 997 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 998 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 999 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1000 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 1001 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1002 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 1003 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
Kailang Yang | 2c674fa | 2015-05-05 15:02:42 +0800 | [diff] [blame] | 1004 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 1005 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
Kailang Yang | 8232450 | 2015-05-25 17:16:49 +0800 | [diff] [blame] | 1006 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 1007 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 1008 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 1009 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1010 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 1011 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 1012 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 1013 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 1014 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 1015 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 1016 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 1017 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 1018 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 1019 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 1020 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1021 | { } /* terminator */ |
| 1022 | }; |
| 1023 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1024 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 1025 | { |
| 1026 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1027 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1028 | |
| 1029 | for (p = rename_tbl; p->vendor_id; p++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1030 | if (p->vendor_id != codec->core.vendor_id) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1031 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 1032 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1033 | return alc_codec_rename(codec, p->name); |
| 1034 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1035 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 1036 | if (!codec->bus->pci) |
| 1037 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1038 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1039 | if (q->codec_vendor_id != codec->core.vendor_id) |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1040 | continue; |
| 1041 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 1042 | continue; |
| 1043 | if (!q->pci_subdevice || |
| 1044 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 1045 | return alc_codec_rename(codec, q->name); |
| 1046 | } |
| 1047 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1048 | return 0; |
| 1049 | } |
| 1050 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 1051 | |
| 1052 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1053 | * Digital-beep handlers |
| 1054 | */ |
| 1055 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1056 | |
| 1057 | /* additional beep mixers; private_value will be overwritten */ |
| 1058 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
| 1059 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
| 1060 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
| 1061 | }; |
| 1062 | |
| 1063 | /* set up and create beep controls */ |
| 1064 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, |
| 1065 | int idx, int dir) |
| 1066 | { |
| 1067 | struct snd_kcontrol_new *knew; |
| 1068 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); |
| 1069 | int i; |
| 1070 | |
| 1071 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { |
| 1072 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 1073 | &alc_beep_mixer[i]); |
| 1074 | if (!knew) |
| 1075 | return -ENOMEM; |
| 1076 | knew->private_value = beep_amp; |
| 1077 | } |
| 1078 | return 0; |
| 1079 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1080 | |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1081 | static const struct snd_pci_quirk beep_allow_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1082 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1083 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1084 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1085 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1086 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1087 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1088 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1089 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1090 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1091 | /* denylist -- no beep available */ |
Takashi Iwai | 051c78a | 2019-08-22 09:58:07 +0200 | [diff] [blame] | 1092 | SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
| 1093 | SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1094 | {} |
| 1095 | }; |
| 1096 | |
| 1097 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1098 | { |
| 1099 | struct alc_spec *spec = codec->spec; |
| 1100 | const struct snd_pci_quirk *q; |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1101 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1102 | if (q) |
| 1103 | return q->value; |
| 1104 | return spec->cdefine.enable_pcbeep; |
| 1105 | } |
| 1106 | #else |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1107 | #define set_beep_amp(spec, nid, idx, dir) 0 |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1108 | #define has_cdefine_beep(codec) 0 |
| 1109 | #endif |
| 1110 | |
| 1111 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1112 | /* return 1 if successful, 0 if the proper config is not found, |
| 1113 | * or a negative error code |
| 1114 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1115 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1116 | const hda_nid_t *ignore_nids, |
| 1117 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1118 | { |
| 1119 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1120 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1121 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1122 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1123 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1124 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1125 | if (err < 0) |
| 1126 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1127 | |
| 1128 | if (ssid_nids) |
| 1129 | alc_ssid_check(codec, ssid_nids); |
| 1130 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1131 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1132 | if (err < 0) |
| 1133 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1134 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1135 | return 1; |
| 1136 | } |
| 1137 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1138 | /* common preparation job for alc_spec */ |
| 1139 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1140 | { |
| 1141 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1142 | int err; |
| 1143 | |
| 1144 | if (!spec) |
| 1145 | return -ENOMEM; |
| 1146 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1147 | snd_hda_gen_spec_init(&spec->gen); |
| 1148 | spec->gen.mixer_nid = mixer_nid; |
| 1149 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1150 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1151 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1152 | codec->spdif_status_reset = 1; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1153 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1154 | |
| 1155 | err = alc_codec_rename_from_preset(codec); |
| 1156 | if (err < 0) { |
| 1157 | kfree(spec); |
| 1158 | return err; |
| 1159 | } |
| 1160 | return 0; |
| 1161 | } |
| 1162 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1163 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1164 | { |
| 1165 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1166 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1167 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1168 | } |
| 1169 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1170 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1171 | * ALC880 fix-ups |
| 1172 | */ |
| 1173 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1174 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1175 | ALC880_FIXUP_GPIO2, |
| 1176 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1177 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1178 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1179 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1180 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1181 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1182 | ALC880_FIXUP_VOL_KNOB, |
| 1183 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1184 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1185 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1186 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1187 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1188 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1189 | ALC880_FIXUP_3ST_BASE, |
| 1190 | ALC880_FIXUP_3ST, |
| 1191 | ALC880_FIXUP_3ST_DIG, |
| 1192 | ALC880_FIXUP_5ST_BASE, |
| 1193 | ALC880_FIXUP_5ST, |
| 1194 | ALC880_FIXUP_5ST_DIG, |
| 1195 | ALC880_FIXUP_6ST_BASE, |
| 1196 | ALC880_FIXUP_6ST, |
| 1197 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1198 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1199 | }; |
| 1200 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1201 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1202 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1203 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1204 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1205 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1206 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1207 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1208 | } |
| 1209 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1210 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1211 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1212 | .type = HDA_FIXUP_FUNC, |
| 1213 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1214 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1215 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1216 | .type = HDA_FIXUP_FUNC, |
| 1217 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1218 | }, |
| 1219 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1220 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1221 | .v.verbs = (const struct hda_verb[]) { |
| 1222 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1223 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1224 | { } |
| 1225 | }, |
| 1226 | .chained = true, |
| 1227 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1228 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1229 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1230 | .type = HDA_FIXUP_PINS, |
| 1231 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1232 | /* disable bogus unused pins */ |
| 1233 | { 0x16, 0x411111f0 }, |
| 1234 | { 0x18, 0x411111f0 }, |
| 1235 | { 0x1a, 0x411111f0 }, |
| 1236 | { } |
| 1237 | } |
| 1238 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1239 | [ALC880_FIXUP_LG_LW25] = { |
| 1240 | .type = HDA_FIXUP_PINS, |
| 1241 | .v.pins = (const struct hda_pintbl[]) { |
| 1242 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1243 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1244 | { } |
| 1245 | } |
| 1246 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1247 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1248 | .type = HDA_FIXUP_PINS, |
| 1249 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1250 | /* disable bogus unused pins */ |
| 1251 | { 0x17, 0x411111f0 }, |
| 1252 | { } |
| 1253 | }, |
| 1254 | .chained = true, |
| 1255 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1256 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1257 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1258 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1259 | .v.verbs = (const struct hda_verb[]) { |
| 1260 | /* change to EAPD mode */ |
| 1261 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1262 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1263 | {} |
| 1264 | }, |
| 1265 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1266 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1267 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1268 | .v.verbs = (const struct hda_verb[]) { |
| 1269 | /* change to EAPD mode */ |
| 1270 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1271 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1272 | {} |
| 1273 | }, |
| 1274 | .chained = true, |
| 1275 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1276 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1277 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1278 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1279 | .v.func = alc880_fixup_vol_knob, |
| 1280 | }, |
| 1281 | [ALC880_FIXUP_FUJITSU] = { |
| 1282 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1283 | .type = HDA_FIXUP_PINS, |
| 1284 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1285 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1286 | { 0x15, 0x99030120 }, /* speaker */ |
| 1287 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1288 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1289 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1290 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1291 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1292 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1293 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1294 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1295 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1296 | { } |
| 1297 | }, |
| 1298 | .chained = true, |
| 1299 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1300 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1301 | [ALC880_FIXUP_F1734] = { |
| 1302 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1303 | .type = HDA_FIXUP_PINS, |
| 1304 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1305 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1306 | { 0x15, 0x99030120 }, /* speaker */ |
| 1307 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1308 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1309 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1310 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1311 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1312 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1313 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1314 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1315 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1316 | { } |
| 1317 | }, |
| 1318 | .chained = true, |
| 1319 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1320 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1321 | [ALC880_FIXUP_UNIWILL] = { |
| 1322 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1323 | .type = HDA_FIXUP_PINS, |
| 1324 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1325 | { 0x14, 0x0121411f }, /* HP */ |
| 1326 | { 0x15, 0x99030120 }, /* speaker */ |
| 1327 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1328 | { } |
| 1329 | }, |
| 1330 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1331 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1332 | .type = HDA_FIXUP_PINS, |
| 1333 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1334 | /* disable bogus unused pins */ |
| 1335 | { 0x17, 0x411111f0 }, |
| 1336 | { 0x19, 0x411111f0 }, |
| 1337 | { 0x1b, 0x411111f0 }, |
| 1338 | { 0x1f, 0x411111f0 }, |
| 1339 | { } |
| 1340 | } |
| 1341 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1342 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1343 | .type = HDA_FIXUP_PINS, |
| 1344 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1345 | /* set up the whole pins as BIOS is utterly broken */ |
| 1346 | { 0x14, 0x99030120 }, /* speaker */ |
| 1347 | { 0x15, 0x0121411f }, /* HP */ |
| 1348 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1349 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1350 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1351 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1352 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1353 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1354 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1355 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1356 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1357 | { } |
| 1358 | } |
| 1359 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1360 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1361 | .type = HDA_FIXUP_PINS, |
| 1362 | .v.pins = (const struct hda_pintbl[]) { |
| 1363 | /* set up the whole pins as BIOS is utterly broken */ |
| 1364 | { 0x14, 0x0121411f }, /* HP */ |
| 1365 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1366 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1367 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1368 | { 0x18, 0x90a60160 }, /* mic */ |
| 1369 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1370 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1371 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1372 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1373 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1374 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1375 | { } |
| 1376 | }, |
| 1377 | .chained = true, |
| 1378 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1379 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1380 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1381 | .type = HDA_FIXUP_PINS, |
| 1382 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1383 | { 0x14, 0x01014010 }, /* line-out */ |
| 1384 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1385 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1386 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1387 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1388 | { 0x19, 0x0121411f }, /* HP */ |
| 1389 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1390 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1391 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1392 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1393 | /* 0x1e is filled in below */ |
| 1394 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1395 | { } |
| 1396 | } |
| 1397 | }, |
| 1398 | [ALC880_FIXUP_3ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1399 | .type = HDA_FIXUP_PINS, |
| 1400 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1401 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1402 | { } |
| 1403 | }, |
| 1404 | .chained = true, |
| 1405 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1406 | }, |
| 1407 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1408 | .type = HDA_FIXUP_PINS, |
| 1409 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1410 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1411 | { } |
| 1412 | }, |
| 1413 | .chained = true, |
| 1414 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1415 | }, |
| 1416 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1417 | .type = HDA_FIXUP_PINS, |
| 1418 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1419 | { 0x14, 0x01014010 }, /* front */ |
| 1420 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1421 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1422 | { 0x17, 0x01016412 }, /* surr */ |
| 1423 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1424 | { 0x19, 0x0121411f }, /* HP */ |
| 1425 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1426 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1427 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1428 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1429 | /* 0x1e is filled in below */ |
| 1430 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1431 | { } |
| 1432 | } |
| 1433 | }, |
| 1434 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1435 | .type = HDA_FIXUP_PINS, |
| 1436 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1437 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1438 | { } |
| 1439 | }, |
| 1440 | .chained = true, |
| 1441 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1442 | }, |
| 1443 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1444 | .type = HDA_FIXUP_PINS, |
| 1445 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1446 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1447 | { } |
| 1448 | }, |
| 1449 | .chained = true, |
| 1450 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1451 | }, |
| 1452 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1453 | .type = HDA_FIXUP_PINS, |
| 1454 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1455 | { 0x14, 0x01014010 }, /* front */ |
| 1456 | { 0x15, 0x01016412 }, /* surr */ |
| 1457 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1458 | { 0x17, 0x01012414 }, /* side */ |
| 1459 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1460 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1461 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1462 | { 0x1b, 0x0121411f }, /* HP */ |
| 1463 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1464 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1465 | /* 0x1e is filled in below */ |
| 1466 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1467 | { } |
| 1468 | } |
| 1469 | }, |
| 1470 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1471 | .type = HDA_FIXUP_PINS, |
| 1472 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1473 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1474 | { } |
| 1475 | }, |
| 1476 | .chained = true, |
| 1477 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1478 | }, |
| 1479 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1480 | .type = HDA_FIXUP_PINS, |
| 1481 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1482 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1483 | { } |
| 1484 | }, |
| 1485 | .chained = true, |
| 1486 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1487 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1488 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1489 | .type = HDA_FIXUP_PINS, |
| 1490 | .v.pins = (const struct hda_pintbl[]) { |
| 1491 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1492 | { } |
| 1493 | }, |
| 1494 | .chained_before = true, |
| 1495 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1496 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1497 | }; |
| 1498 | |
| 1499 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1500 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1501 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1502 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1503 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1504 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1505 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1506 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1507 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1508 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1509 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1510 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1511 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1512 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1513 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | a161574 | 2015-08-13 18:05:06 +0200 | [diff] [blame] | 1514 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1515 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1516 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1517 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1518 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1519 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1520 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1521 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1522 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1523 | |
| 1524 | /* Below is the copied entries from alc880_quirks.c. |
| 1525 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1526 | * on these machines, thus they are kept to be compatible with |
| 1527 | * the old static quirks. Once when it's confirmed to work without |
| 1528 | * these overrides, it'd be better to remove. |
| 1529 | */ |
| 1530 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1531 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1532 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1533 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1534 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1535 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1536 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1537 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1538 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1539 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1540 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1541 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1542 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1543 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1544 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1545 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1546 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1547 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1548 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1549 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1550 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1551 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1552 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1553 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1554 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1555 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1556 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1557 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1558 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1559 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1560 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1561 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1562 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1563 | /* default Intel */ |
| 1564 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1565 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1566 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1567 | {} |
| 1568 | }; |
| 1569 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1570 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1571 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1572 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1573 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1574 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1575 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1576 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1577 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1578 | {} |
| 1579 | }; |
| 1580 | |
| 1581 | |
| 1582 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1583 | * OK, here we have finally the patch for ALC880 |
| 1584 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1585 | static int patch_alc880(struct hda_codec *codec) |
| 1586 | { |
| 1587 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1588 | int err; |
| 1589 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1590 | err = alc_alloc_spec(codec, 0x0b); |
| 1591 | if (err < 0) |
| 1592 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1593 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1594 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1595 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1596 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1597 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1598 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1599 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1600 | alc_pre_init(codec); |
| 1601 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1602 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1603 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1604 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1605 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1606 | /* automatic parse from the BIOS config */ |
| 1607 | err = alc880_parse_auto_config(codec); |
| 1608 | if (err < 0) |
| 1609 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1610 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1611 | if (!spec->gen.no_analog) { |
| 1612 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 1613 | if (err < 0) |
| 1614 | goto error; |
| 1615 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1616 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1617 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1618 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1619 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1620 | |
| 1621 | error: |
| 1622 | alc_free(codec); |
| 1623 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1624 | } |
| 1625 | |
| 1626 | |
| 1627 | /* |
| 1628 | * ALC260 support |
| 1629 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1630 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1631 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1632 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1633 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1634 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1635 | } |
| 1636 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1637 | /* |
| 1638 | * Pin config fixes |
| 1639 | */ |
| 1640 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1641 | ALC260_FIXUP_HP_DC5750, |
| 1642 | ALC260_FIXUP_HP_PIN_0F, |
| 1643 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1644 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1645 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1646 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1647 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1648 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1649 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1650 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1651 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1652 | }; |
| 1653 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1654 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1655 | { |
| 1656 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 1657 | |
| 1658 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1659 | } |
| 1660 | |
| 1661 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1662 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1663 | { |
| 1664 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1665 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1666 | /* although the machine has only one output pin, we need to |
| 1667 | * toggle GPIO1 according to the jack state |
| 1668 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1669 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1670 | spec->gen.detect_hp = 1; |
| 1671 | spec->gen.automute_speaker = 1; |
| 1672 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1673 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1674 | snd_hda_gen_hp_automute); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1675 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1676 | } |
| 1677 | } |
| 1678 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1679 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1680 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1681 | { |
| 1682 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1683 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1684 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1685 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1686 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1687 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1688 | /* disable bogus I/O pins */ |
| 1689 | { 0x10, 0x411111f0 }, |
| 1690 | { 0x11, 0x411111f0 }, |
| 1691 | { 0x14, 0x411111f0 }, |
| 1692 | { 0x15, 0x411111f0 }, |
| 1693 | { 0x16, 0x411111f0 }, |
| 1694 | { 0x17, 0x411111f0 }, |
| 1695 | { 0x19, 0x411111f0 }, |
| 1696 | { } |
| 1697 | }; |
| 1698 | |
| 1699 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1700 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1701 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1702 | spec->init_amp = ALC_INIT_NONE; |
| 1703 | break; |
| 1704 | } |
| 1705 | } |
| 1706 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1707 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1708 | const struct hda_fixup *fix, int action) |
| 1709 | { |
| 1710 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 1711 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1712 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1713 | } |
| 1714 | |
| 1715 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1716 | const struct hda_fixup *fix, int action) |
| 1717 | { |
| 1718 | struct alc_spec *spec = codec->spec; |
| 1719 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1720 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1721 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1722 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1723 | } |
| 1724 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1725 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1726 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1727 | .type = HDA_FIXUP_PINS, |
| 1728 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1729 | { 0x11, 0x90130110 }, /* speaker */ |
| 1730 | { } |
| 1731 | } |
| 1732 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1733 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1734 | .type = HDA_FIXUP_PINS, |
| 1735 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1736 | { 0x0f, 0x01214000 }, /* HP */ |
| 1737 | { } |
| 1738 | } |
| 1739 | }, |
| 1740 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1741 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1742 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1743 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1744 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1745 | { } |
| 1746 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1747 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1748 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1749 | .type = HDA_FIXUP_FUNC, |
| 1750 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1751 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1752 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1753 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1754 | .v.func = alc260_fixup_gpio1_toggle, |
| 1755 | .chained = true, |
| 1756 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1757 | }, |
| 1758 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1759 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1760 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1761 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1762 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1763 | { } |
| 1764 | }, |
| 1765 | .chained = true, |
| 1766 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1767 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1768 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1769 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1770 | .v.func = alc260_fixup_gpio1_toggle, |
| 1771 | .chained = true, |
| 1772 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1773 | }, |
| 1774 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1775 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1776 | .v.func = alc260_fixup_kn1, |
| 1777 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1778 | [ALC260_FIXUP_FSC_S7020] = { |
| 1779 | .type = HDA_FIXUP_FUNC, |
| 1780 | .v.func = alc260_fixup_fsc_s7020, |
| 1781 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1782 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1783 | .type = HDA_FIXUP_FUNC, |
| 1784 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1785 | .chained = true, |
| 1786 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1787 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1788 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1789 | .type = HDA_FIXUP_PINS, |
| 1790 | .v.pins = (const struct hda_pintbl[]) { |
| 1791 | /* Pin configs are missing completely on some VAIOs */ |
| 1792 | { 0x0f, 0x01211020 }, |
| 1793 | { 0x10, 0x0001003f }, |
| 1794 | { 0x11, 0x411111f0 }, |
| 1795 | { 0x12, 0x01a15930 }, |
| 1796 | { 0x13, 0x411111f0 }, |
| 1797 | { 0x14, 0x411111f0 }, |
| 1798 | { 0x15, 0x411111f0 }, |
| 1799 | { 0x16, 0x411111f0 }, |
| 1800 | { 0x17, 0x411111f0 }, |
| 1801 | { 0x18, 0x411111f0 }, |
| 1802 | { 0x19, 0x411111f0 }, |
| 1803 | { } |
| 1804 | } |
| 1805 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1806 | }; |
| 1807 | |
| 1808 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1809 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1810 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1811 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1812 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1813 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1814 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1815 | 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] | 1816 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1817 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1818 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1819 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1820 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1821 | {} |
| 1822 | }; |
| 1823 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1824 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1825 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1826 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1827 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1828 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1829 | {} |
| 1830 | }; |
| 1831 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1832 | /* |
| 1833 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1834 | static int patch_alc260(struct hda_codec *codec) |
| 1835 | { |
| 1836 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1837 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1838 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1839 | err = alc_alloc_spec(codec, 0x07); |
| 1840 | if (err < 0) |
| 1841 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1842 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1843 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1844 | /* as quite a few machines require HP amp for speaker outputs, |
| 1845 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1846 | * it's almost harmless. |
| 1847 | */ |
| 1848 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1849 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1850 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1851 | spec->shutup = alc_eapd_shutup; |
| 1852 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1853 | alc_pre_init(codec); |
| 1854 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1855 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1856 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1857 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1858 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1859 | /* automatic parse from the BIOS config */ |
| 1860 | err = alc260_parse_auto_config(codec); |
| 1861 | if (err < 0) |
| 1862 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1863 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1864 | if (!spec->gen.no_analog) { |
| 1865 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
| 1866 | if (err < 0) |
| 1867 | goto error; |
| 1868 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1869 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1870 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1871 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1872 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1873 | |
| 1874 | error: |
| 1875 | alc_free(codec); |
| 1876 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1877 | } |
| 1878 | |
| 1879 | |
| 1880 | /* |
| 1881 | * ALC882/883/885/888/889 support |
| 1882 | * |
| 1883 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1884 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1885 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1886 | * 6-channel independent captures. |
| 1887 | * |
| 1888 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1889 | * driver yet). |
| 1890 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1891 | |
| 1892 | /* |
| 1893 | * Pin config fixes |
| 1894 | */ |
| 1895 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1896 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1897 | ALC882_FIXUP_LENOVO_Y530, |
| 1898 | ALC882_FIXUP_PB_M5210, |
| 1899 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1900 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1901 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1902 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1903 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1904 | ALC888_FIXUP_EEE1601, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1905 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1906 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1907 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1908 | ALC882_FIXUP_GPIO1, |
| 1909 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1910 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1911 | ALC889_FIXUP_COEF, |
| 1912 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1913 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1914 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1915 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1916 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1917 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1918 | ALC889_FIXUP_MBP_VREF, |
| 1919 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1920 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1921 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1922 | ALC889_FIXUP_MP11_VREF, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1923 | ALC889_FIXUP_MP41_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1924 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1925 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1926 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1927 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1928 | ALC1220_FIXUP_GB_DUAL_CODECS, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 1929 | ALC1220_FIXUP_CLEVO_P950, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 1930 | ALC1220_FIXUP_CLEVO_PB51ED, |
| 1931 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1932 | }; |
| 1933 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1934 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1935 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1936 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1937 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1938 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1939 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1940 | } |
| 1941 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1942 | /* set up GPIO at initialization */ |
| 1943 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1944 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1945 | { |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 1946 | struct alc_spec *spec = codec->spec; |
| 1947 | |
| 1948 | spec->gpio_write_delay = true; |
| 1949 | alc_fixup_gpio3(codec, fix, action); |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1950 | } |
| 1951 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1952 | /* Fix the connection of some pins for ALC889: |
| 1953 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1954 | * work correctly (bko#42740) |
| 1955 | */ |
| 1956 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1957 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1958 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1959 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1960 | /* fake the connections during parsing the tree */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1961 | static const hda_nid_t conn1[] = { 0x0c, 0x0d }; |
| 1962 | static const hda_nid_t conn2[] = { 0x0e, 0x0f }; |
| 1963 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 1964 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
| 1965 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); |
| 1966 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1967 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1968 | /* restore the connections */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1969 | static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1970 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); |
| 1971 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); |
| 1972 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); |
| 1973 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1974 | } |
| 1975 | } |
| 1976 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1977 | /* Set VREF on HP pin */ |
| 1978 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1979 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1980 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 1981 | static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1982 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1983 | int i; |
| 1984 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1985 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1986 | return; |
| 1987 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1988 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1989 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1990 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1991 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1992 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1993 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1994 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1995 | break; |
| 1996 | } |
| 1997 | } |
| 1998 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1999 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 2000 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2001 | { |
| 2002 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2003 | int i; |
| 2004 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2005 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2006 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 2007 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2008 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 2009 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2010 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2011 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2012 | } |
| 2013 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2014 | /* Set VREF on speaker pins on imac91 */ |
| 2015 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 2016 | const struct hda_fixup *fix, int action) |
| 2017 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2018 | static const hda_nid_t nids[] = { 0x18, 0x1a }; |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2019 | |
| 2020 | if (action == HDA_FIXUP_ACT_INIT) |
| 2021 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2022 | } |
| 2023 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2024 | /* Set VREF on speaker pins on mba11 */ |
| 2025 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 2026 | const struct hda_fixup *fix, int action) |
| 2027 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2028 | static const hda_nid_t nids[] = { 0x18 }; |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2029 | |
| 2030 | if (action == HDA_FIXUP_ACT_INIT) |
| 2031 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2032 | } |
| 2033 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2034 | /* Set VREF on speaker pins on mba21 */ |
| 2035 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 2036 | const struct hda_fixup *fix, int action) |
| 2037 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2038 | static const hda_nid_t nids[] = { 0x18, 0x19 }; |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2039 | |
| 2040 | if (action == HDA_FIXUP_ACT_INIT) |
| 2041 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2042 | } |
| 2043 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2044 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 2045 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 2046 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2047 | */ |
| 2048 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2049 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2050 | { |
| 2051 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2052 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2053 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2054 | spec->gen.no_multi_io = 1; |
| 2055 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2056 | } |
| 2057 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2058 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 2059 | const struct hda_fixup *fix, int action); |
| 2060 | |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2061 | /* For dual-codec configuration, we need to disable some features to avoid |
| 2062 | * conflicts of kctls and PCM streams |
| 2063 | */ |
| 2064 | static void alc_fixup_dual_codecs(struct hda_codec *codec, |
| 2065 | const struct hda_fixup *fix, int action) |
| 2066 | { |
| 2067 | struct alc_spec *spec = codec->spec; |
| 2068 | |
| 2069 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2070 | return; |
| 2071 | /* disable vmaster */ |
| 2072 | spec->gen.suppress_vmaster = 1; |
| 2073 | /* auto-mute and auto-mic switch don't work with multiple codecs */ |
| 2074 | spec->gen.suppress_auto_mute = 1; |
| 2075 | spec->gen.suppress_auto_mic = 1; |
| 2076 | /* disable aamix as well */ |
| 2077 | spec->gen.mixer_nid = 0; |
| 2078 | /* add location prefix to avoid conflicts */ |
| 2079 | codec->force_pin_prefix = 1; |
| 2080 | } |
| 2081 | |
| 2082 | static void rename_ctl(struct hda_codec *codec, const char *oldname, |
| 2083 | const char *newname) |
| 2084 | { |
| 2085 | struct snd_kcontrol *kctl; |
| 2086 | |
| 2087 | kctl = snd_hda_find_mixer_ctl(codec, oldname); |
| 2088 | if (kctl) |
| 2089 | strcpy(kctl->id.name, newname); |
| 2090 | } |
| 2091 | |
| 2092 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
| 2093 | const struct hda_fixup *fix, |
| 2094 | int action) |
| 2095 | { |
| 2096 | alc_fixup_dual_codecs(codec, fix, action); |
| 2097 | switch (action) { |
| 2098 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2099 | /* override card longname to provide a unique UCM profile */ |
| 2100 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); |
| 2101 | break; |
| 2102 | case HDA_FIXUP_ACT_BUILD: |
| 2103 | /* rename Capture controls depending on the codec */ |
| 2104 | rename_ctl(codec, "Capture Volume", |
| 2105 | codec->addr == 0 ? |
| 2106 | "Rear-Panel Capture Volume" : |
| 2107 | "Front-Panel Capture Volume"); |
| 2108 | rename_ctl(codec, "Capture Switch", |
| 2109 | codec->addr == 0 ? |
| 2110 | "Rear-Panel Capture Switch" : |
| 2111 | "Front-Panel Capture Switch"); |
| 2112 | break; |
| 2113 | } |
| 2114 | } |
| 2115 | |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2116 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
| 2117 | const struct hda_fixup *fix, |
| 2118 | int action) |
| 2119 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2120 | static const hda_nid_t conn1[] = { 0x0c }; |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2121 | |
| 2122 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2123 | return; |
| 2124 | |
| 2125 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); |
| 2126 | /* We therefore want to make sure 0x14 (front headphone) and |
| 2127 | * 0x1b (speakers) use the stereo DAC 0x02 |
| 2128 | */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2129 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 2130 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2131 | } |
| 2132 | |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2133 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 2134 | const struct hda_fixup *fix, int action); |
| 2135 | |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2136 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2137 | const struct hda_fixup *fix, |
| 2138 | int action) |
| 2139 | { |
| 2140 | alc1220_fixup_clevo_p950(codec, fix, action); |
| 2141 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); |
| 2142 | } |
| 2143 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2144 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2145 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2146 | .type = HDA_FIXUP_PINS, |
| 2147 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2148 | { 0x15, 0x01080104 }, /* side */ |
| 2149 | { 0x16, 0x01011012 }, /* rear */ |
| 2150 | { 0x17, 0x01016011 }, /* clfe */ |
| 2151 | { } |
| 2152 | } |
| 2153 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2154 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2155 | .type = HDA_FIXUP_PINS, |
| 2156 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2157 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2158 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2159 | { } |
| 2160 | } |
| 2161 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2162 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2163 | .type = HDA_FIXUP_PINCTLS, |
| 2164 | .v.pins = (const struct hda_pintbl[]) { |
| 2165 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2166 | {} |
| 2167 | } |
| 2168 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2169 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2170 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2171 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2172 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2173 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2174 | .type = HDA_FIXUP_PINS, |
| 2175 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2176 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2177 | { } |
| 2178 | } |
| 2179 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2180 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2181 | .type = HDA_FIXUP_PINS, |
| 2182 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2183 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2184 | { } |
| 2185 | } |
| 2186 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2187 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2188 | .type = HDA_FIXUP_PINS, |
| 2189 | .v.pins = (const struct hda_pintbl[]) { |
| 2190 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2191 | { } |
| 2192 | }, |
| 2193 | .chained = true, |
| 2194 | .chain_id = ALC889_FIXUP_CD, |
| 2195 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2196 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2197 | .type = HDA_FIXUP_PINS, |
| 2198 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2199 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2200 | { } |
| 2201 | } |
| 2202 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2203 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2204 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2205 | .v.verbs = (const struct hda_verb[]) { |
| 2206 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2207 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2208 | { } |
| 2209 | } |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2210 | }, |
| 2211 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2212 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2213 | .v.verbs = (const struct hda_verb[]) { |
| 2214 | /* change to EAPD mode */ |
| 2215 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2216 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2217 | { } |
| 2218 | } |
| 2219 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2220 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2221 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2222 | .v.verbs = (const struct hda_verb[]) { |
| 2223 | /* change to EAPD mode */ |
| 2224 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2225 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2226 | { } |
| 2227 | } |
| 2228 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2229 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2230 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2231 | .v.verbs = (const struct hda_verb[]) { |
| 2232 | /* eanable EAPD on Acer laptops */ |
| 2233 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2234 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2235 | { } |
| 2236 | } |
| 2237 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2238 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2239 | .type = HDA_FIXUP_FUNC, |
| 2240 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2241 | }, |
| 2242 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2243 | .type = HDA_FIXUP_FUNC, |
| 2244 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2245 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2246 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2247 | .type = HDA_FIXUP_FUNC, |
| 2248 | .v.func = alc_fixup_gpio3, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2249 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2250 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2251 | .type = HDA_FIXUP_FUNC, |
| 2252 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2253 | .chained = true, |
| 2254 | .chain_id = ALC882_FIXUP_EAPD, |
| 2255 | }, |
| 2256 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2257 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2258 | .v.func = alc889_fixup_coef, |
| 2259 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2260 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2261 | .type = HDA_FIXUP_PINS, |
| 2262 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2263 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2264 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2265 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2266 | }, |
| 2267 | .chained = true, |
| 2268 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2269 | }, |
| 2270 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2271 | .type = HDA_FIXUP_PINS, |
| 2272 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2273 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2274 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2275 | { } |
| 2276 | }, |
| 2277 | .chained = true, |
| 2278 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2279 | }, |
| 2280 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2281 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2282 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2283 | .v.verbs = (const struct hda_verb[]) { |
| 2284 | /* Enable all DACs */ |
| 2285 | /* DAC DISABLE/MUTE 1? */ |
| 2286 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2287 | * apparently. Init=0x38 */ |
| 2288 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2289 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2290 | /* DAC DISABLE/MUTE 2? */ |
| 2291 | /* some bit here disables the other DACs. |
| 2292 | * Init=0x4900 */ |
| 2293 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2294 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2295 | /* DMIC fix |
| 2296 | * This laptop has a stereo digital microphone. |
| 2297 | * The mics are only 1cm apart which makes the stereo |
| 2298 | * useless. However, either the mic or the ALC889 |
| 2299 | * makes the signal become a difference/sum signal |
| 2300 | * instead of standard stereo, which is annoying. |
| 2301 | * So instead we flip this bit which makes the |
| 2302 | * codec replicate the sum signal to both channels, |
| 2303 | * turning it into a normal mono mic. |
| 2304 | */ |
| 2305 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2306 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2307 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2308 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2309 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2310 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2311 | }, |
| 2312 | .chained = true, |
| 2313 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2314 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2315 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2316 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2317 | .v.func = alc885_fixup_macpro_gpio, |
| 2318 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2319 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2320 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2321 | .v.func = alc889_fixup_dac_route, |
| 2322 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2323 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2324 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2325 | .v.func = alc889_fixup_mbp_vref, |
| 2326 | .chained = true, |
| 2327 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2328 | }, |
| 2329 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2330 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2331 | .v.func = alc889_fixup_imac91_vref, |
| 2332 | .chained = true, |
| 2333 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2334 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2335 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2336 | .type = HDA_FIXUP_FUNC, |
| 2337 | .v.func = alc889_fixup_mba11_vref, |
| 2338 | .chained = true, |
| 2339 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2340 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2341 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2342 | .type = HDA_FIXUP_FUNC, |
| 2343 | .v.func = alc889_fixup_mba21_vref, |
| 2344 | .chained = true, |
| 2345 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2346 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2347 | [ALC889_FIXUP_MP11_VREF] = { |
| 2348 | .type = HDA_FIXUP_FUNC, |
| 2349 | .v.func = alc889_fixup_mba11_vref, |
| 2350 | .chained = true, |
| 2351 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2352 | }, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2353 | [ALC889_FIXUP_MP41_VREF] = { |
| 2354 | .type = HDA_FIXUP_FUNC, |
| 2355 | .v.func = alc889_fixup_mbp_vref, |
| 2356 | .chained = true, |
| 2357 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2358 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2359 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2360 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2361 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2362 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2363 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2364 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2365 | .v.func = alc882_fixup_no_primary_hp, |
| 2366 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2367 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2368 | .type = HDA_FIXUP_PINS, |
| 2369 | .v.pins = (const struct hda_pintbl[]) { |
| 2370 | {0x16, 0x99130130}, /* bass speaker */ |
| 2371 | {} |
| 2372 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2373 | .chained = true, |
| 2374 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2375 | }, |
| 2376 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2377 | .type = HDA_FIXUP_FUNC, |
| 2378 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2379 | }, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2380 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
| 2381 | .type = HDA_FIXUP_FUNC, |
| 2382 | .v.func = alc1220_fixup_gb_dual_codecs, |
| 2383 | }, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2384 | [ALC1220_FIXUP_CLEVO_P950] = { |
| 2385 | .type = HDA_FIXUP_FUNC, |
| 2386 | .v.func = alc1220_fixup_clevo_p950, |
| 2387 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2388 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2389 | .type = HDA_FIXUP_FUNC, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2390 | .v.func = alc1220_fixup_clevo_pb51ed, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2391 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2392 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2393 | .type = HDA_FIXUP_PINS, |
| 2394 | .v.pins = (const struct hda_pintbl[]) { |
| 2395 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 2396 | {} |
| 2397 | }, |
| 2398 | .chained = true, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2399 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2400 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2401 | }; |
| 2402 | |
| 2403 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2404 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2405 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | b5d724b | 2015-06-02 19:57:08 +0200 | [diff] [blame] | 2406 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2407 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2408 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2409 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2410 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2411 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2412 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2413 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2414 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2415 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2416 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2417 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2418 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2419 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2420 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2421 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2422 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2423 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2424 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2425 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2426 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2427 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2428 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2429 | 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] | 2430 | 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] | 2431 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2432 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2433 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2434 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2435 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | 85bcf96 | 2016-12-06 16:20:36 +0100 | [diff] [blame] | 2436 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2437 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2438 | 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] | 2439 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
Fernando Luis Vázquez Cao | 12e31a7 | 2013-02-12 16:47:44 +0900 | [diff] [blame] | 2440 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | c44d9b1 | 2016-02-07 09:38:26 +0100 | [diff] [blame] | 2441 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2442 | |
| 2443 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2444 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2445 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2446 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2447 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2448 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2449 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2450 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2451 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2452 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2453 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2454 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2455 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2456 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2457 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2458 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2459 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2460 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2461 | 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] | 2462 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2463 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2464 | 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] | 2465 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2466 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2467 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2468 | 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] | 2469 | 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] | 2470 | 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] | 2471 | 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] | 2472 | SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | a655e2b | 2020-02-17 16:19:47 +0100 | [diff] [blame] | 2473 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 1d3aa4a | 2020-04-08 15:56:45 +0200 | [diff] [blame] | 2474 | SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 7dafba3 | 2020-02-12 09:10:47 +0100 | [diff] [blame] | 2475 | SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | cc5049a | 2020-02-18 09:09:15 +0100 | [diff] [blame] | 2476 | SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | d2c3b14 | 2017-06-01 09:35:30 +0200 | [diff] [blame] | 2477 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Dan Crawford | 15cbff3 | 2020-08-29 12:49:46 +1000 | [diff] [blame] | 2478 | SND_PCI_QUIRK(0x1462, 0x9c37, "MSI X570-A PRO", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 6369158 | 2017-05-22 16:32:46 +0200 | [diff] [blame] | 2479 | 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] | 2480 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2481 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2482 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | f3d737b | 2018-07-17 17:08:32 +0200 | [diff] [blame] | 2483 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
Jeremy Soller | 2f0d520 | 2018-05-07 09:28:45 -0600 | [diff] [blame] | 2484 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
Richard Sailer | 503d90b | 2019-06-19 13:33:11 +0200 | [diff] [blame] | 2485 | SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), |
| 2486 | SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), |
| 2487 | SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2488 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
PeiSen Hou | 259eb82 | 2020-05-19 08:50:12 +0200 | [diff] [blame] | 2489 | SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2490 | SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2491 | SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2492 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2493 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2494 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2495 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2496 | {} |
| 2497 | }; |
| 2498 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2499 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2500 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
| 2501 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, |
| 2502 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, |
| 2503 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, |
| 2504 | {.id = ALC889_FIXUP_CD, .name = "cd"}, |
| 2505 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, |
| 2506 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, |
| 2507 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, |
| 2508 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, |
| 2509 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, |
| 2510 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, |
| 2511 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, |
| 2512 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, |
| 2513 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, |
| 2514 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2515 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2516 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2517 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2518 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
| 2519 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, |
| 2520 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, |
| 2521 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, |
| 2522 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, |
| 2523 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, |
| 2524 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, |
| 2525 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2526 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2527 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2528 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 2529 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2530 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2531 | {} |
| 2532 | }; |
| 2533 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2534 | /* |
| 2535 | * BIOS auto configuration |
| 2536 | */ |
| 2537 | /* almost identical with ALC880 parser... */ |
| 2538 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2539 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2540 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2541 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2542 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2543 | } |
| 2544 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2545 | /* |
| 2546 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2547 | static int patch_alc882(struct hda_codec *codec) |
| 2548 | { |
| 2549 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2550 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2551 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2552 | err = alc_alloc_spec(codec, 0x0b); |
| 2553 | if (err < 0) |
| 2554 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2555 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2556 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2557 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 2558 | switch (codec->core.vendor_id) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2559 | case 0x10ec0882: |
| 2560 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2561 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 2562 | case 0x10ec0b00: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 2563 | case 0x10ec1220: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2564 | break; |
| 2565 | default: |
| 2566 | /* ALC883 and variants */ |
| 2567 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2568 | break; |
| 2569 | } |
| 2570 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2571 | alc_pre_init(codec); |
| 2572 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2573 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2574 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2575 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2576 | |
| 2577 | alc_auto_parse_customize_define(codec); |
| 2578 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2579 | if (has_cdefine_beep(codec)) |
| 2580 | spec->gen.beep_nid = 0x01; |
| 2581 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2582 | /* automatic parse from the BIOS config */ |
| 2583 | err = alc882_parse_auto_config(codec); |
| 2584 | if (err < 0) |
| 2585 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2586 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2587 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2588 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2589 | if (err < 0) |
| 2590 | goto error; |
| 2591 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2592 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2593 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2594 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2595 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2596 | |
| 2597 | error: |
| 2598 | alc_free(codec); |
| 2599 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2600 | } |
| 2601 | |
| 2602 | |
| 2603 | /* |
| 2604 | * ALC262 support |
| 2605 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2606 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2607 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2608 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2609 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2610 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2611 | } |
| 2612 | |
| 2613 | /* |
| 2614 | * Pin config fixes |
| 2615 | */ |
| 2616 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2617 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2618 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2619 | ALC262_FIXUP_HP_Z200, |
| 2620 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2621 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2622 | ALC262_FIXUP_BENQ, |
| 2623 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2624 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2625 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2626 | }; |
| 2627 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2628 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2629 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2630 | .type = HDA_FIXUP_PINS, |
| 2631 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2632 | { 0x14, 0x99130110 }, /* speaker */ |
| 2633 | { 0x15, 0x0221142f }, /* front HP */ |
| 2634 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2635 | { } |
| 2636 | } |
| 2637 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2638 | [ALC262_FIXUP_FSC_S7110] = { |
| 2639 | .type = HDA_FIXUP_PINS, |
| 2640 | .v.pins = (const struct hda_pintbl[]) { |
| 2641 | { 0x15, 0x90170110 }, /* speaker */ |
| 2642 | { } |
| 2643 | }, |
| 2644 | .chained = true, |
| 2645 | .chain_id = ALC262_FIXUP_BENQ, |
| 2646 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2647 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2648 | .type = HDA_FIXUP_PINS, |
| 2649 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2650 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2651 | { } |
| 2652 | } |
| 2653 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2654 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2655 | .type = HDA_FIXUP_PINS, |
| 2656 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2657 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2658 | { } |
| 2659 | } |
| 2660 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2661 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2662 | .type = HDA_FIXUP_PINCTLS, |
| 2663 | .v.pins = (const struct hda_pintbl[]) { |
| 2664 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2665 | {} |
| 2666 | }, |
| 2667 | .chained = true, |
| 2668 | .chain_id = ALC262_FIXUP_BENQ, |
| 2669 | }, |
| 2670 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2671 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2672 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2673 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2674 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2675 | {} |
| 2676 | } |
| 2677 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2678 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2679 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2680 | .v.verbs = (const struct hda_verb[]) { |
| 2681 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2682 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2683 | {} |
| 2684 | } |
| 2685 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2686 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2687 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2688 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2689 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2690 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2691 | .type = HDA_FIXUP_FUNC, |
| 2692 | .v.func = alc_fixup_no_depop_delay, |
| 2693 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2694 | }; |
| 2695 | |
| 2696 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2697 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2698 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2699 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2700 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
Takashi Iwai | 275ec0c | 2018-06-22 12:17:45 +0200 | [diff] [blame] | 2701 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2702 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2703 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2704 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2705 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2706 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2707 | {} |
| 2708 | }; |
| 2709 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2710 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2711 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e43c44d | 2018-06-26 17:02:08 +0200 | [diff] [blame] | 2712 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
| 2713 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, |
| 2714 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, |
| 2715 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, |
| 2716 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, |
| 2717 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, |
| 2718 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, |
| 2719 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2720 | {} |
| 2721 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2722 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2723 | /* |
| 2724 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2725 | static int patch_alc262(struct hda_codec *codec) |
| 2726 | { |
| 2727 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2728 | int err; |
| 2729 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2730 | err = alc_alloc_spec(codec, 0x0b); |
| 2731 | if (err < 0) |
| 2732 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2733 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2734 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2735 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2736 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2737 | spec->shutup = alc_eapd_shutup; |
| 2738 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2739 | #if 0 |
| 2740 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2741 | * under-run |
| 2742 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2743 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2744 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2745 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2746 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2747 | alc_pre_init(codec); |
| 2748 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2749 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2750 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2751 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2752 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2753 | alc_auto_parse_customize_define(codec); |
| 2754 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2755 | if (has_cdefine_beep(codec)) |
| 2756 | spec->gen.beep_nid = 0x01; |
| 2757 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2758 | /* automatic parse from the BIOS config */ |
| 2759 | err = alc262_parse_auto_config(codec); |
| 2760 | if (err < 0) |
| 2761 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2762 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2763 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2764 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2765 | if (err < 0) |
| 2766 | goto error; |
| 2767 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2768 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2769 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2770 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2771 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2772 | |
| 2773 | error: |
| 2774 | alc_free(codec); |
| 2775 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2776 | } |
| 2777 | |
| 2778 | /* |
| 2779 | * ALC268 |
| 2780 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2781 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2782 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 2783 | struct snd_ctl_elem_value *ucontrol) |
| 2784 | { |
| 2785 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2786 | unsigned long pval; |
| 2787 | int err; |
| 2788 | |
| 2789 | mutex_lock(&codec->control_mutex); |
| 2790 | pval = kcontrol->private_value; |
| 2791 | kcontrol->private_value = (pval & ~0xff) | 0x0f; |
| 2792 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2793 | if (err >= 0) { |
| 2794 | kcontrol->private_value = (pval & ~0xff) | 0x10; |
| 2795 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2796 | } |
| 2797 | kcontrol->private_value = pval; |
| 2798 | mutex_unlock(&codec->control_mutex); |
| 2799 | return err; |
| 2800 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2801 | |
| 2802 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2803 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2804 | { |
| 2805 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2806 | .name = "Beep Playback Switch", |
| 2807 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
| 2808 | .info = snd_hda_mixer_amp_switch_info, |
| 2809 | .get = snd_hda_mixer_amp_switch_get, |
| 2810 | .put = alc268_beep_switch_put, |
| 2811 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) |
| 2812 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2813 | }; |
| 2814 | |
| 2815 | /* set PCBEEP vol = 0, mute connections */ |
| 2816 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2817 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2818 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2819 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2820 | { } |
| 2821 | }; |
| 2822 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2823 | enum { |
| 2824 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2825 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2826 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2827 | }; |
| 2828 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2829 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2830 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2831 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2832 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2833 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2834 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2835 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2836 | .v.verbs = (const struct hda_verb[]) { |
| 2837 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2838 | {} |
| 2839 | } |
| 2840 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2841 | [ALC268_FIXUP_SPDIF] = { |
| 2842 | .type = HDA_FIXUP_PINS, |
| 2843 | .v.pins = (const struct hda_pintbl[]) { |
| 2844 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2845 | {} |
| 2846 | } |
| 2847 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2848 | }; |
| 2849 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2850 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2851 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2852 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
Takashi Iwai | 03bf11c | 2018-06-26 16:56:41 +0200 | [diff] [blame] | 2853 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2854 | {} |
| 2855 | }; |
| 2856 | |
| 2857 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2858 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2859 | 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] | 2860 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2861 | * same PCI SSID 1179:ff00 |
| 2862 | */ |
| 2863 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2864 | {} |
| 2865 | }; |
| 2866 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2867 | /* |
| 2868 | * BIOS auto configuration |
| 2869 | */ |
| 2870 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2871 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2872 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2873 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2874 | } |
| 2875 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2876 | /* |
| 2877 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2878 | static int patch_alc268(struct hda_codec *codec) |
| 2879 | { |
| 2880 | struct alc_spec *spec; |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2881 | int i, err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2882 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2883 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2884 | err = alc_alloc_spec(codec, 0); |
| 2885 | if (err < 0) |
| 2886 | return err; |
| 2887 | |
| 2888 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 2889 | if (has_cdefine_beep(codec)) |
| 2890 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2891 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2892 | spec->shutup = alc_eapd_shutup; |
| 2893 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2894 | alc_pre_init(codec); |
| 2895 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2896 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2897 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2898 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2899 | /* automatic parse from the BIOS config */ |
| 2900 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2901 | if (err < 0) |
| 2902 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2903 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2904 | if (err > 0 && !spec->gen.no_analog && |
| 2905 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2906 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
| 2907 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 2908 | &alc268_beep_mixer[i])) { |
| 2909 | err = -ENOMEM; |
| 2910 | goto error; |
| 2911 | } |
| 2912 | } |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2913 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2914 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2915 | /* override the amp caps for beep generator */ |
| 2916 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2917 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2918 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2919 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2920 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2921 | } |
| 2922 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2923 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2924 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2925 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2926 | |
| 2927 | error: |
| 2928 | alc_free(codec); |
| 2929 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2930 | } |
| 2931 | |
| 2932 | /* |
| 2933 | * ALC269 |
| 2934 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2935 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2936 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2937 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2938 | }; |
| 2939 | |
| 2940 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2941 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2942 | }; |
| 2943 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2944 | /* different alc269-variants */ |
| 2945 | enum { |
| 2946 | ALC269_TYPE_ALC269VA, |
| 2947 | ALC269_TYPE_ALC269VB, |
| 2948 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2949 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2950 | ALC269_TYPE_ALC280, |
| 2951 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2952 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2953 | ALC269_TYPE_ALC284, |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2954 | ALC269_TYPE_ALC293, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2955 | ALC269_TYPE_ALC286, |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2956 | ALC269_TYPE_ALC298, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2957 | ALC269_TYPE_ALC255, |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2958 | ALC269_TYPE_ALC256, |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2959 | ALC269_TYPE_ALC257, |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2960 | ALC269_TYPE_ALC215, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2961 | ALC269_TYPE_ALC225, |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2962 | ALC269_TYPE_ALC294, |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2963 | ALC269_TYPE_ALC300, |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 2964 | ALC269_TYPE_ALC623, |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2965 | ALC269_TYPE_ALC700, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2966 | }; |
| 2967 | |
| 2968 | /* |
| 2969 | * BIOS auto configuration |
| 2970 | */ |
| 2971 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 2972 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2973 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2974 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 2975 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2976 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2977 | const hda_nid_t *ssids; |
| 2978 | |
| 2979 | switch (spec->codec_variant) { |
| 2980 | case ALC269_TYPE_ALC269VA: |
| 2981 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2982 | case ALC269_TYPE_ALC280: |
| 2983 | case ALC269_TYPE_ALC284: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2984 | case ALC269_TYPE_ALC293: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2985 | ssids = alc269va_ssids; |
| 2986 | break; |
| 2987 | case ALC269_TYPE_ALC269VB: |
| 2988 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2989 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2990 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2991 | case ALC269_TYPE_ALC286: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2992 | case ALC269_TYPE_ALC298: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2993 | case ALC269_TYPE_ALC255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2994 | case ALC269_TYPE_ALC256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2995 | case ALC269_TYPE_ALC257: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2996 | case ALC269_TYPE_ALC215: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2997 | case ALC269_TYPE_ALC225: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2998 | case ALC269_TYPE_ALC294: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2999 | case ALC269_TYPE_ALC300: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 3000 | case ALC269_TYPE_ALC623: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 3001 | case ALC269_TYPE_ALC700: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3002 | ssids = alc269_ssids; |
| 3003 | break; |
| 3004 | default: |
| 3005 | ssids = alc269_ssids; |
| 3006 | break; |
| 3007 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3008 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 3009 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3010 | } |
| 3011 | |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3012 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
| 3013 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, |
| 3014 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, |
| 3015 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, |
| 3016 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, |
| 3017 | {} |
| 3018 | }; |
| 3019 | |
| 3020 | static void alc_headset_btn_callback(struct hda_codec *codec, |
| 3021 | struct hda_jack_callback *jack) |
| 3022 | { |
| 3023 | int report = 0; |
| 3024 | |
| 3025 | if (jack->unsol_res & (7 << 13)) |
| 3026 | report |= SND_JACK_BTN_0; |
| 3027 | |
| 3028 | if (jack->unsol_res & (1 << 16 | 3 << 8)) |
| 3029 | report |= SND_JACK_BTN_1; |
| 3030 | |
| 3031 | /* Volume up key */ |
| 3032 | if (jack->unsol_res & (7 << 23)) |
| 3033 | report |= SND_JACK_BTN_2; |
| 3034 | |
| 3035 | /* Volume down key */ |
| 3036 | if (jack->unsol_res & (7 << 10)) |
| 3037 | report |= SND_JACK_BTN_3; |
| 3038 | |
| 3039 | jack->jack->button_state = report; |
| 3040 | } |
| 3041 | |
| 3042 | static void alc_disable_headset_jack_key(struct hda_codec *codec) |
| 3043 | { |
| 3044 | struct alc_spec *spec = codec->spec; |
| 3045 | |
| 3046 | if (!spec->has_hs_key) |
| 3047 | return; |
| 3048 | |
| 3049 | switch (codec->core.vendor_id) { |
| 3050 | case 0x10ec0215: |
| 3051 | case 0x10ec0225: |
| 3052 | case 0x10ec0285: |
| 3053 | case 0x10ec0295: |
| 3054 | case 0x10ec0289: |
| 3055 | case 0x10ec0299: |
| 3056 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3057 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3058 | alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); |
| 3059 | break; |
| 3060 | case 0x10ec0236: |
| 3061 | case 0x10ec0256: |
| 3062 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3063 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3064 | break; |
| 3065 | } |
| 3066 | } |
| 3067 | |
| 3068 | static void alc_enable_headset_jack_key(struct hda_codec *codec) |
| 3069 | { |
| 3070 | struct alc_spec *spec = codec->spec; |
| 3071 | |
| 3072 | if (!spec->has_hs_key) |
| 3073 | return; |
| 3074 | |
| 3075 | switch (codec->core.vendor_id) { |
| 3076 | case 0x10ec0215: |
| 3077 | case 0x10ec0225: |
| 3078 | case 0x10ec0285: |
| 3079 | case 0x10ec0295: |
| 3080 | case 0x10ec0289: |
| 3081 | case 0x10ec0299: |
| 3082 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3083 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3084 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); |
| 3085 | break; |
| 3086 | case 0x10ec0236: |
| 3087 | case 0x10ec0256: |
| 3088 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3089 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3090 | break; |
| 3091 | } |
| 3092 | } |
| 3093 | |
| 3094 | static void alc_fixup_headset_jack(struct hda_codec *codec, |
| 3095 | const struct hda_fixup *fix, int action) |
| 3096 | { |
| 3097 | struct alc_spec *spec = codec->spec; |
| 3098 | |
| 3099 | switch (action) { |
| 3100 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 3101 | spec->has_hs_key = 1; |
| 3102 | snd_hda_jack_detect_enable_callback(codec, 0x55, |
| 3103 | alc_headset_btn_callback); |
| 3104 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, |
| 3105 | SND_JACK_HEADSET, alc_headset_btn_keymap); |
| 3106 | break; |
| 3107 | case HDA_FIXUP_ACT_INIT: |
| 3108 | alc_enable_headset_jack_key(codec); |
| 3109 | break; |
| 3110 | } |
| 3111 | } |
| 3112 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3113 | 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] | 3114 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3115 | 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] | 3116 | } |
| 3117 | |
| 3118 | static void alc269_shutup(struct hda_codec *codec) |
| 3119 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3120 | struct alc_spec *spec = codec->spec; |
| 3121 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3122 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3123 | alc269vb_toggle_power_output(codec, 0); |
| 3124 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 3125 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3126 | msleep(150); |
| 3127 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3128 | alc_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3129 | } |
| 3130 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3131 | static const struct coef_fw alc282_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3132 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 3133 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3134 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3135 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3136 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3137 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3138 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3139 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 3140 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3141 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3142 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 3143 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 3144 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 3145 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 3146 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3147 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3148 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3149 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 3150 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 3151 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 3152 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 3153 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 3154 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 3155 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 3156 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3157 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 3158 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 3159 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 3160 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 3161 | {} |
| 3162 | }; |
| 3163 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3164 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 3165 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3166 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3167 | } |
| 3168 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3169 | static void alc282_init(struct hda_codec *codec) |
| 3170 | { |
| 3171 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3172 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3173 | bool hp_pin_sense; |
| 3174 | int coef78; |
| 3175 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3176 | alc282_restore_default_value(codec); |
| 3177 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3178 | if (!hp_pin) |
| 3179 | return; |
| 3180 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3181 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3182 | |
| 3183 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 3184 | /* Headphone capless set to high power mode */ |
| 3185 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3186 | |
| 3187 | if (hp_pin_sense) |
| 3188 | msleep(2); |
| 3189 | |
| 3190 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3191 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3192 | |
| 3193 | if (hp_pin_sense) |
| 3194 | msleep(85); |
| 3195 | |
| 3196 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3197 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3198 | |
| 3199 | if (hp_pin_sense) |
| 3200 | msleep(100); |
| 3201 | |
| 3202 | /* Headphone capless set to normal mode */ |
| 3203 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3204 | } |
| 3205 | |
| 3206 | static void alc282_shutup(struct hda_codec *codec) |
| 3207 | { |
| 3208 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3209 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3210 | bool hp_pin_sense; |
| 3211 | int coef78; |
| 3212 | |
| 3213 | if (!hp_pin) { |
| 3214 | alc269_shutup(codec); |
| 3215 | return; |
| 3216 | } |
| 3217 | |
| 3218 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3219 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3220 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3221 | |
| 3222 | if (hp_pin_sense) |
| 3223 | msleep(2); |
| 3224 | |
| 3225 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3226 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3227 | |
| 3228 | if (hp_pin_sense) |
| 3229 | msleep(85); |
| 3230 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3231 | if (!spec->no_shutup_pins) |
| 3232 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3233 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3234 | |
| 3235 | if (hp_pin_sense) |
| 3236 | msleep(100); |
| 3237 | |
| 3238 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3239 | alc_shutup_pins(codec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3240 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3241 | } |
| 3242 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3243 | static const struct coef_fw alc283_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3244 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3245 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3246 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3247 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3248 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3249 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3250 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3251 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 3252 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3253 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3254 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 3255 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 3256 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 3257 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 3258 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3259 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3260 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3261 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 3262 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 3263 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 3264 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 3265 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 3266 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 3267 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 3268 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3269 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 3270 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 3271 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 3272 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 3273 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 3274 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 3275 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3276 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3277 | {} |
| 3278 | }; |
| 3279 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3280 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 3281 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3282 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3283 | } |
| 3284 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3285 | static void alc283_init(struct hda_codec *codec) |
| 3286 | { |
| 3287 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3288 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3289 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3290 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3291 | alc283_restore_default_value(codec); |
| 3292 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3293 | if (!hp_pin) |
| 3294 | return; |
Kailang Yang | a59d719 | 2015-04-08 16:34:00 +0800 | [diff] [blame] | 3295 | |
| 3296 | msleep(30); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3297 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3298 | |
| 3299 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 3300 | /* Headphone capless set to high power mode */ |
| 3301 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 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 | |
| 3309 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3310 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3311 | |
| 3312 | if (hp_pin_sense) |
| 3313 | msleep(85); |
| 3314 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3315 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3316 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3317 | /* Headphone capless set to normal mode */ |
| 3318 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3319 | } |
| 3320 | |
| 3321 | static void alc283_shutup(struct hda_codec *codec) |
| 3322 | { |
| 3323 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3324 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3325 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3326 | |
| 3327 | if (!hp_pin) { |
| 3328 | alc269_shutup(codec); |
| 3329 | return; |
| 3330 | } |
| 3331 | |
| 3332 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3333 | |
| 3334 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3335 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 3336 | /*depop hp during suspend*/ |
| 3337 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 3338 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3339 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3340 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3341 | |
| 3342 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3343 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3344 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3345 | if (!spec->no_shutup_pins) |
| 3346 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3347 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3348 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3349 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3350 | |
| 3351 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3352 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3353 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3354 | alc_shutup_pins(codec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3355 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3356 | } |
| 3357 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3358 | static void alc256_init(struct hda_codec *codec) |
| 3359 | { |
| 3360 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3361 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3362 | bool hp_pin_sense; |
| 3363 | |
| 3364 | if (!hp_pin) |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3365 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3366 | |
| 3367 | msleep(30); |
| 3368 | |
| 3369 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3370 | |
| 3371 | if (hp_pin_sense) |
| 3372 | msleep(2); |
| 3373 | |
| 3374 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3375 | if (spec->ultra_low_power) { |
| 3376 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); |
| 3377 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); |
| 3378 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); |
| 3379 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); |
| 3380 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3381 | msleep(30); |
| 3382 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3383 | |
| 3384 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3385 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3386 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3387 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3388 | msleep(85); |
| 3389 | |
| 3390 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3391 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3392 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3393 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3394 | msleep(100); |
| 3395 | |
| 3396 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
| 3397 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 3398 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
| 3399 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 3400 | /* |
| 3401 | * Expose headphone mic (or possibly Line In on some machines) instead |
| 3402 | * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See |
| 3403 | * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of |
| 3404 | * this register. |
| 3405 | */ |
| 3406 | alc_write_coef_idx(codec, 0x36, 0x5757); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3407 | } |
| 3408 | |
| 3409 | static void alc256_shutup(struct hda_codec *codec) |
| 3410 | { |
| 3411 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3412 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3413 | bool hp_pin_sense; |
| 3414 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3415 | if (!hp_pin) |
| 3416 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3417 | |
| 3418 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3419 | |
| 3420 | if (hp_pin_sense) |
| 3421 | msleep(2); |
| 3422 | |
| 3423 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3424 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3425 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3426 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3427 | msleep(85); |
| 3428 | |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3429 | /* 3k pull low control for Headset jack. */ |
| 3430 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
Hui Wang | 3f74249 | 2020-09-14 14:51:18 +0800 | [diff] [blame] | 3431 | /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly |
| 3432 | * when booting with headset plugged. So skip setting it for the codec alc257 |
| 3433 | */ |
| 3434 | if (codec->core.vendor_id != 0x10ec0257) |
| 3435 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3436 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3437 | if (!spec->no_shutup_pins) |
| 3438 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3439 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3440 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3441 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3442 | msleep(100); |
| 3443 | |
| 3444 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3445 | alc_shutup_pins(codec); |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3446 | if (spec->ultra_low_power) { |
| 3447 | msleep(50); |
| 3448 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); |
| 3449 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); |
| 3450 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); |
| 3451 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); |
| 3452 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3453 | msleep(30); |
| 3454 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3455 | } |
| 3456 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3457 | static void alc225_init(struct hda_codec *codec) |
| 3458 | { |
| 3459 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3460 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3461 | bool hp1_pin_sense, hp2_pin_sense; |
| 3462 | |
| 3463 | if (!hp_pin) |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3464 | hp_pin = 0x21; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3465 | msleep(30); |
| 3466 | |
| 3467 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3468 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3469 | |
| 3470 | if (hp1_pin_sense || hp2_pin_sense) |
| 3471 | msleep(2); |
| 3472 | |
| 3473 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3474 | if (spec->ultra_low_power) { |
| 3475 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); |
| 3476 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3477 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); |
| 3478 | msleep(30); |
| 3479 | } |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3480 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3481 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3482 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3483 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3484 | if (hp2_pin_sense) |
| 3485 | snd_hda_codec_write(codec, 0x16, 0, |
| 3486 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3487 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3488 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3489 | msleep(85); |
| 3490 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3491 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3492 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3493 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3494 | if (hp2_pin_sense) |
| 3495 | snd_hda_codec_write(codec, 0x16, 0, |
| 3496 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3497 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3498 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3499 | msleep(100); |
| 3500 | |
| 3501 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3502 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
| 3503 | } |
| 3504 | |
| 3505 | static void alc225_shutup(struct hda_codec *codec) |
| 3506 | { |
| 3507 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3508 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3509 | bool hp1_pin_sense, hp2_pin_sense; |
| 3510 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3511 | if (!hp_pin) |
| 3512 | hp_pin = 0x21; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3513 | |
| 3514 | alc_disable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3515 | /* 3k pull low control for Headset jack. */ |
| 3516 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); |
| 3517 | |
| 3518 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3519 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3520 | |
| 3521 | if (hp1_pin_sense || hp2_pin_sense) |
| 3522 | msleep(2); |
| 3523 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3524 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3525 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3526 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3527 | if (hp2_pin_sense) |
| 3528 | snd_hda_codec_write(codec, 0x16, 0, |
| 3529 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3530 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3531 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3532 | msleep(85); |
| 3533 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3534 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3535 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3536 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3537 | if (hp2_pin_sense) |
| 3538 | snd_hda_codec_write(codec, 0x16, 0, |
| 3539 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3540 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3541 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3542 | msleep(100); |
| 3543 | |
| 3544 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3545 | alc_shutup_pins(codec); |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3546 | if (spec->ultra_low_power) { |
| 3547 | msleep(50); |
| 3548 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); |
| 3549 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3550 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); |
| 3551 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); |
| 3552 | msleep(30); |
| 3553 | } |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3554 | |
| 3555 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3556 | alc_enable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3557 | } |
| 3558 | |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3559 | static void alc_default_init(struct hda_codec *codec) |
| 3560 | { |
| 3561 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3562 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3563 | bool hp_pin_sense; |
| 3564 | |
| 3565 | if (!hp_pin) |
| 3566 | return; |
| 3567 | |
| 3568 | msleep(30); |
| 3569 | |
| 3570 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3571 | |
| 3572 | if (hp_pin_sense) |
| 3573 | msleep(2); |
| 3574 | |
| 3575 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3576 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3577 | |
| 3578 | if (hp_pin_sense) |
| 3579 | msleep(85); |
| 3580 | |
| 3581 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3582 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3583 | |
| 3584 | if (hp_pin_sense) |
| 3585 | msleep(100); |
| 3586 | } |
| 3587 | |
| 3588 | static void alc_default_shutup(struct hda_codec *codec) |
| 3589 | { |
| 3590 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3591 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3592 | bool hp_pin_sense; |
| 3593 | |
| 3594 | if (!hp_pin) { |
| 3595 | alc269_shutup(codec); |
| 3596 | return; |
| 3597 | } |
| 3598 | |
| 3599 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3600 | |
| 3601 | if (hp_pin_sense) |
| 3602 | msleep(2); |
| 3603 | |
| 3604 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3605 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3606 | |
| 3607 | if (hp_pin_sense) |
| 3608 | msleep(85); |
| 3609 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3610 | if (!spec->no_shutup_pins) |
| 3611 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3612 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3613 | |
| 3614 | if (hp_pin_sense) |
| 3615 | msleep(100); |
| 3616 | |
| 3617 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3618 | alc_shutup_pins(codec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3619 | } |
| 3620 | |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3621 | static void alc294_hp_init(struct hda_codec *codec) |
| 3622 | { |
| 3623 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3624 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3625 | int i, val; |
| 3626 | |
| 3627 | if (!hp_pin) |
| 3628 | return; |
| 3629 | |
| 3630 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3631 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3632 | |
| 3633 | msleep(100); |
| 3634 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3635 | if (!spec->no_shutup_pins) |
| 3636 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3637 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3638 | |
| 3639 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ |
| 3640 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ |
| 3641 | |
| 3642 | /* Wait for depop procedure finish */ |
| 3643 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3644 | for (i = 0; i < 20 && val & 0x0080; i++) { |
| 3645 | msleep(50); |
| 3646 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3647 | } |
| 3648 | /* Set HP depop to auto mode */ |
| 3649 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); |
| 3650 | msleep(50); |
| 3651 | } |
| 3652 | |
| 3653 | static void alc294_init(struct hda_codec *codec) |
| 3654 | { |
| 3655 | struct alc_spec *spec = codec->spec; |
| 3656 | |
Takashi Iwai | f6ef4e0 | 2019-01-29 14:14:51 +0100 | [diff] [blame] | 3657 | /* required only at boot or S4 resume time */ |
| 3658 | if (!spec->done_hp_init || |
| 3659 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3660 | alc294_hp_init(codec); |
| 3661 | spec->done_hp_init = true; |
| 3662 | } |
| 3663 | alc_default_init(codec); |
| 3664 | } |
| 3665 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3666 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3667 | unsigned int val) |
| 3668 | { |
| 3669 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3670 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3671 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3672 | } |
| 3673 | |
| 3674 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3675 | { |
| 3676 | unsigned int val; |
| 3677 | |
| 3678 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3679 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3680 | & 0xffff; |
| 3681 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3682 | << 16; |
| 3683 | return val; |
| 3684 | } |
| 3685 | |
| 3686 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3687 | { |
| 3688 | unsigned int val; |
| 3689 | |
| 3690 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3691 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3692 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3693 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3694 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3695 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3696 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3697 | val = alc5505_coef_get(codec, 0x6220); |
| 3698 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3699 | } |
| 3700 | |
| 3701 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3702 | { |
| 3703 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3704 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3705 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3706 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3707 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3708 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3709 | } |
| 3710 | |
| 3711 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3712 | { |
| 3713 | unsigned int val; |
| 3714 | |
| 3715 | alc5505_dsp_halt(codec); |
| 3716 | alc5505_dsp_back_from_halt(codec); |
| 3717 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3718 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3719 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3720 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3721 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3722 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3723 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3724 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3725 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3726 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3727 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3728 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3729 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3730 | |
| 3731 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3732 | if (val <= 3) |
| 3733 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3734 | else |
| 3735 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3736 | |
| 3737 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3738 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3739 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3740 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3741 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3742 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3743 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3744 | |
| 3745 | #ifdef HALT_REALTEK_ALC5505 |
| 3746 | alc5505_dsp_halt(codec); |
| 3747 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3748 | } |
| 3749 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3750 | #ifdef HALT_REALTEK_ALC5505 |
Pierre-Louis Bossart | 8a71821 | 2020-01-11 15:47:35 -0600 | [diff] [blame] | 3751 | #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ |
| 3752 | #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3753 | #else |
| 3754 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3755 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3756 | #endif |
| 3757 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3758 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3759 | static int alc269_suspend(struct hda_codec *codec) |
| 3760 | { |
| 3761 | struct alc_spec *spec = codec->spec; |
| 3762 | |
| 3763 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3764 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3765 | return alc_suspend(codec); |
| 3766 | } |
| 3767 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3768 | static int alc269_resume(struct hda_codec *codec) |
| 3769 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3770 | struct alc_spec *spec = codec->spec; |
| 3771 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3772 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3773 | alc269vb_toggle_power_output(codec, 0); |
| 3774 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3775 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3776 | msleep(150); |
| 3777 | } |
| 3778 | |
| 3779 | codec->patch_ops.init(codec); |
| 3780 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3781 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3782 | alc269vb_toggle_power_output(codec, 1); |
| 3783 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3784 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3785 | msleep(200); |
| 3786 | } |
| 3787 | |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 3788 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3789 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3790 | |
| 3791 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3792 | * suspend, and won't restore the data after resume, so we restore it |
| 3793 | * in the driver. |
| 3794 | */ |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 3795 | if (spec->gpio_data) |
| 3796 | alc_write_gpio_data(codec); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3797 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3798 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3799 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3800 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3801 | return 0; |
| 3802 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3803 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3804 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3805 | 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] | 3806 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3807 | { |
| 3808 | struct alc_spec *spec = codec->spec; |
| 3809 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3810 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3811 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3812 | } |
| 3813 | |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 3814 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
| 3815 | const struct hda_fixup *fix, |
| 3816 | int action) |
| 3817 | { |
| 3818 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); |
| 3819 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); |
| 3820 | |
| 3821 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) |
| 3822 | snd_hda_codec_set_pincfg(codec, 0x19, |
| 3823 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | |
| 3824 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); |
| 3825 | } |
| 3826 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3827 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3828 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3829 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3830 | if (action == HDA_FIXUP_ACT_INIT) |
| 3831 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3832 | } |
| 3833 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3834 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3835 | const struct hda_fixup *fix, int action) |
| 3836 | { |
| 3837 | struct alc_spec *spec = codec->spec; |
| 3838 | |
| 3839 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3840 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3841 | } |
| 3842 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3843 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3844 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3845 | { |
| 3846 | static const struct hda_verb verbs[] = { |
| 3847 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3848 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3849 | {} |
| 3850 | }; |
| 3851 | unsigned int cfg; |
| 3852 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3853 | if (strcmp(codec->core.chip_name, "ALC271X") && |
| 3854 | strcmp(codec->core.chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3855 | return; |
| 3856 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3857 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3858 | snd_hda_sequence_write(codec, verbs); |
| 3859 | } |
| 3860 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3861 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3862 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3863 | { |
| 3864 | struct alc_spec *spec = codec->spec; |
| 3865 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3866 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3867 | return; |
| 3868 | |
| 3869 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3870 | * fix the sample rate of analog I/O to 44.1kHz |
| 3871 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3872 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3873 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3874 | } |
| 3875 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3876 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3877 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3878 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3879 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3880 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3881 | * Below is a workaround specific to ALC269 to control the dmic |
| 3882 | * signal source as mono. |
| 3883 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3884 | if (action == HDA_FIXUP_ACT_INIT) |
| 3885 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3886 | } |
| 3887 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3888 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3889 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3890 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3891 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3892 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3893 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3894 | } |
| 3895 | |
| 3896 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3897 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3898 | { |
| 3899 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3900 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3901 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3902 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3903 | } |
| 3904 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3905 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3906 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3907 | { |
| 3908 | struct alc_spec *spec = codec->spec; |
| 3909 | int vref; |
| 3910 | msleep(200); |
| 3911 | snd_hda_gen_hp_automute(codec, jack); |
| 3912 | |
| 3913 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 3914 | msleep(100); |
| 3915 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3916 | vref); |
| 3917 | msleep(500); |
| 3918 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3919 | vref); |
| 3920 | } |
| 3921 | |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 3922 | /* |
| 3923 | * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) |
| 3924 | */ |
| 3925 | struct hda_alc298_mbxinit { |
| 3926 | unsigned char value_0x23; |
| 3927 | unsigned char value_0x25; |
| 3928 | }; |
| 3929 | |
| 3930 | static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, |
| 3931 | const struct hda_alc298_mbxinit *initval, |
| 3932 | bool first) |
| 3933 | { |
| 3934 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); |
| 3935 | alc_write_coef_idx(codec, 0x26, 0xb000); |
| 3936 | |
| 3937 | if (first) |
| 3938 | snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); |
| 3939 | |
| 3940 | snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 3941 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 3942 | alc_write_coef_idx(codec, 0x23, initval->value_0x23); |
| 3943 | |
| 3944 | if (initval->value_0x23 != 0x1e) |
| 3945 | alc_write_coef_idx(codec, 0x25, initval->value_0x25); |
| 3946 | |
| 3947 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 3948 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 3949 | } |
| 3950 | |
| 3951 | static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, |
| 3952 | const struct hda_fixup *fix, |
| 3953 | int action) |
| 3954 | { |
| 3955 | /* Initialization magic */ |
| 3956 | static const struct hda_alc298_mbxinit dac_init[] = { |
| 3957 | {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, |
| 3958 | {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, |
| 3959 | {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, |
| 3960 | {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, |
| 3961 | {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, |
| 3962 | {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, |
| 3963 | {0x2f, 0x00}, |
| 3964 | {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, |
| 3965 | {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, |
| 3966 | {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, |
| 3967 | {} |
| 3968 | }; |
| 3969 | const struct hda_alc298_mbxinit *seq; |
| 3970 | |
| 3971 | if (action != HDA_FIXUP_ACT_INIT) |
| 3972 | return; |
| 3973 | |
| 3974 | /* Start */ |
| 3975 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); |
| 3976 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 3977 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 3978 | alc_write_coef_idx(codec, 0x22, 0x31); |
| 3979 | alc_write_coef_idx(codec, 0x23, 0x0b); |
| 3980 | alc_write_coef_idx(codec, 0x25, 0x00); |
| 3981 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 3982 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 3983 | |
| 3984 | for (seq = dac_init; seq->value_0x23; seq++) |
| 3985 | alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); |
| 3986 | } |
| 3987 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3988 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 3989 | const struct hda_fixup *fix, int action) |
| 3990 | { |
| 3991 | struct alc_spec *spec = codec->spec; |
| 3992 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3993 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3994 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 3995 | } |
| 3996 | } |
| 3997 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 3998 | static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, |
| 3999 | bool polarity, bool on) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4000 | { |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4001 | unsigned int pinval; |
| 4002 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4003 | if (!pin) |
| 4004 | return; |
| 4005 | if (polarity) |
| 4006 | on = !on; |
| 4007 | pinval = snd_hda_codec_get_pin_target(codec, pin); |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 4008 | pinval &= ~AC_PINCTL_VREFEN; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4009 | pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; |
| 4010 | /* temporarily power up/down for setting VREF */ |
| 4011 | snd_hda_power_up_pm(codec); |
| 4012 | snd_hda_set_pin_ctl_cache(codec, pin, pinval); |
| 4013 | snd_hda_power_down_pm(codec); |
| 4014 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4015 | |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4016 | /* 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] | 4017 | static int vref_mute_led_set(struct led_classdev *led_cdev, |
| 4018 | enum led_brightness brightness) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4019 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4020 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4021 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4022 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4023 | alc_update_vref_led(codec, spec->mute_led_nid, |
| 4024 | spec->mute_led_polarity, brightness); |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4025 | return 0; |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4026 | } |
| 4027 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4028 | /* Make sure the led works even in runtime suspend */ |
| 4029 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 4030 | hda_nid_t nid, |
| 4031 | unsigned int power_state) |
| 4032 | { |
| 4033 | struct alc_spec *spec = codec->spec; |
| 4034 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4035 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 4036 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4037 | return power_state; |
| 4038 | |
| 4039 | /* Set pin ctl again, it might have just been set to 0 */ |
| 4040 | snd_hda_set_pin_ctl(codec, nid, |
| 4041 | snd_hda_codec_get_pin_target(codec, nid)); |
| 4042 | |
Takashi Iwai | cffd396 | 2015-04-09 10:30:25 +0200 | [diff] [blame] | 4043 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4044 | } |
| 4045 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4046 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 4047 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4048 | { |
| 4049 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4050 | const struct dmi_device *dev = NULL; |
| 4051 | |
| 4052 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4053 | return; |
| 4054 | |
| 4055 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 4056 | int pol, pin; |
| 4057 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 4058 | continue; |
| 4059 | if (pin < 0x0a || pin >= 0x10) |
| 4060 | break; |
| 4061 | spec->mute_led_polarity = pol; |
| 4062 | spec->mute_led_nid = pin - 0x0a + 0x18; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4063 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4064 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4065 | codec_dbg(codec, |
| 4066 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4067 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4068 | break; |
| 4069 | } |
| 4070 | } |
| 4071 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4072 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
| 4073 | const struct hda_fixup *fix, |
| 4074 | int action, hda_nid_t pin) |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4075 | { |
| 4076 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4077 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4078 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4079 | spec->mute_led_polarity = 0; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4080 | spec->mute_led_nid = pin; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4081 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4082 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4083 | } |
| 4084 | } |
| 4085 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4086 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 4087 | const struct hda_fixup *fix, int action) |
| 4088 | { |
| 4089 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); |
| 4090 | } |
| 4091 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4092 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 4093 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4094 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4095 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4096 | } |
| 4097 | |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4098 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
| 4099 | const struct hda_fixup *fix, int action) |
| 4100 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4101 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4102 | } |
| 4103 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4104 | /* update LED status via GPIO */ |
| 4105 | 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] | 4106 | int polarity, bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4107 | { |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 4108 | if (polarity) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4109 | enabled = !enabled; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 4110 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4111 | } |
| 4112 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4113 | /* turn on/off mute LED via GPIO per vmaster hook */ |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4114 | static int gpio_mute_led_set(struct led_classdev *led_cdev, |
| 4115 | enum led_brightness brightness) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4116 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4117 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4118 | struct alc_spec *spec = codec->spec; |
| 4119 | |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 4120 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4121 | spec->mute_led_polarity, !brightness); |
| 4122 | return 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4123 | } |
| 4124 | |
| 4125 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
Kai-Heng Feng | 87dc364 | 2020-04-30 21:52:07 +0800 | [diff] [blame] | 4126 | static int micmute_led_set(struct led_classdev *led_cdev, |
| 4127 | enum led_brightness brightness) |
| 4128 | { |
| 4129 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
| 4130 | struct alc_spec *spec = codec->spec; |
| 4131 | |
| 4132 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
Hui Wang | 4046906 | 2020-08-11 20:24:30 +0800 | [diff] [blame] | 4133 | spec->micmute_led_polarity, !brightness); |
Kai-Heng Feng | 87dc364 | 2020-04-30 21:52:07 +0800 | [diff] [blame] | 4134 | return 0; |
| 4135 | } |
| 4136 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4137 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
| 4138 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4139 | int action, |
| 4140 | unsigned int mute_mask, |
| 4141 | unsigned int micmute_mask) |
| 4142 | { |
| 4143 | struct alc_spec *spec = codec->spec; |
| 4144 | |
| 4145 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
| 4146 | |
| 4147 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4148 | return; |
| 4149 | if (mute_mask) { |
| 4150 | spec->gpio_mute_led_mask = mute_mask; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4151 | snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4152 | } |
| 4153 | if (micmute_mask) { |
| 4154 | spec->gpio_mic_led_mask = micmute_mask; |
Takashi Iwai | 7cdf8c4 | 2020-06-18 13:08:31 +0200 | [diff] [blame] | 4155 | snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4156 | } |
| 4157 | } |
| 4158 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4159 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4160 | const struct hda_fixup *fix, int action) |
| 4161 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4162 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4163 | } |
| 4164 | |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 4165 | static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4166 | const struct hda_fixup *fix, int action) |
| 4167 | { |
Kai-Heng Feng | 3e0650a | 2020-04-30 16:32:52 +0800 | [diff] [blame] | 4168 | alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 4169 | } |
| 4170 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 4171 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4172 | const struct hda_fixup *fix, int action) |
| 4173 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4174 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4175 | } |
| 4176 | |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4177 | /* turn on/off mic-mute LED per capture hook via VREF change */ |
| 4178 | static int vref_micmute_led_set(struct led_classdev *led_cdev, |
| 4179 | enum led_brightness brightness) |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4180 | { |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4181 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4182 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4183 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4184 | alc_update_vref_led(codec, spec->cap_mute_led_nid, |
| 4185 | spec->micmute_led_polarity, brightness); |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4186 | return 0; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4187 | } |
| 4188 | |
| 4189 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 4190 | const struct hda_fixup *fix, int action) |
| 4191 | { |
| 4192 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4193 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4194 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4195 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4196 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
| 4197 | * enable headphone amp |
| 4198 | */ |
| 4199 | spec->gpio_mask |= 0x10; |
| 4200 | spec->gpio_dir |= 0x10; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4201 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4202 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4203 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4204 | } |
| 4205 | } |
| 4206 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4207 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 4208 | const struct hda_fixup *fix, int action) |
| 4209 | { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4210 | struct alc_spec *spec = codec->spec; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4211 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4212 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4213 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4214 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4215 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4216 | codec->power_filter = led_power_filter; |
| 4217 | } |
| 4218 | } |
| 4219 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4220 | static void alc_update_coef_led(struct hda_codec *codec, |
| 4221 | struct alc_coef_led *led, |
| 4222 | bool polarity, bool on) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4223 | { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4224 | if (polarity) |
| 4225 | on = !on; |
| 4226 | /* temporarily power up/down for setting COEF bit */ |
| 4227 | alc_update_coef_idx(codec, led->idx, led->mask, |
| 4228 | on ? led->on : led->off); |
| 4229 | } |
| 4230 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4231 | /* update mute-LED according to the speaker mute state via COEF bit */ |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4232 | static int coef_mute_led_set(struct led_classdev *led_cdev, |
| 4233 | enum led_brightness brightness) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4234 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4235 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4236 | struct alc_spec *spec = codec->spec; |
| 4237 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4238 | alc_update_coef_led(codec, &spec->mute_led_coef, |
| 4239 | spec->mute_led_polarity, brightness); |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4240 | return 0; |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4241 | } |
| 4242 | |
| 4243 | static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4244 | const struct hda_fixup *fix, |
| 4245 | int action) |
| 4246 | { |
| 4247 | struct alc_spec *spec = codec->spec; |
| 4248 | |
| 4249 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4250 | spec->mute_led_polarity = 0; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4251 | spec->mute_led_coef.idx = 0x0b; |
| 4252 | spec->mute_led_coef.mask = 1 << 3; |
| 4253 | spec->mute_led_coef.on = 1 << 3; |
| 4254 | spec->mute_led_coef.off = 0; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4255 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4256 | } |
| 4257 | } |
| 4258 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4259 | static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4260 | const struct hda_fixup *fix, |
| 4261 | int action) |
| 4262 | { |
| 4263 | struct alc_spec *spec = codec->spec; |
| 4264 | |
| 4265 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4266 | spec->mute_led_polarity = 0; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4267 | spec->mute_led_coef.idx = 0x34; |
| 4268 | spec->mute_led_coef.mask = 1 << 5; |
| 4269 | spec->mute_led_coef.on = 0; |
| 4270 | spec->mute_led_coef.off = 1 << 5; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4271 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4272 | } |
| 4273 | } |
| 4274 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4275 | /* turn on/off mic-mute LED per capture hook by coef bit */ |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4276 | static int coef_micmute_led_set(struct led_classdev *led_cdev, |
| 4277 | enum led_brightness brightness) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4278 | { |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4279 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4280 | struct alc_spec *spec = codec->spec; |
| 4281 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4282 | alc_update_coef_led(codec, &spec->mic_led_coef, |
| 4283 | spec->micmute_led_polarity, brightness); |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4284 | return 0; |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4285 | } |
| 4286 | |
| 4287 | static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4288 | const struct hda_fixup *fix, int action) |
| 4289 | { |
| 4290 | struct alc_spec *spec = codec->spec; |
| 4291 | |
| 4292 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4293 | spec->mic_led_coef.idx = 0x19; |
| 4294 | spec->mic_led_coef.mask = 1 << 13; |
| 4295 | spec->mic_led_coef.on = 1 << 13; |
| 4296 | spec->mic_led_coef.off = 0; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4297 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4298 | } |
| 4299 | } |
| 4300 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4301 | static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4302 | const struct hda_fixup *fix, int action) |
| 4303 | { |
| 4304 | struct alc_spec *spec = codec->spec; |
| 4305 | |
| 4306 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4307 | spec->mic_led_coef.idx = 0x35; |
| 4308 | spec->mic_led_coef.mask = 3 << 2; |
| 4309 | spec->mic_led_coef.on = 2 << 2; |
| 4310 | spec->mic_led_coef.off = 1 << 2; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4311 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4312 | } |
| 4313 | } |
| 4314 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4315 | static void alc285_fixup_hp_mute_led(struct hda_codec *codec, |
| 4316 | const struct hda_fixup *fix, int action) |
| 4317 | { |
| 4318 | alc285_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4319 | alc285_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4320 | } |
| 4321 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4322 | static void alc236_fixup_hp_mute_led(struct hda_codec *codec, |
| 4323 | const struct hda_fixup *fix, int action) |
| 4324 | { |
| 4325 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4326 | alc236_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4327 | } |
| 4328 | |
Takashi Iwai | 6a30aba | 2018-04-27 17:17:35 +0200 | [diff] [blame] | 4329 | #if IS_REACHABLE(CONFIG_INPUT) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4330 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 4331 | struct hda_jack_callback *event) |
| 4332 | { |
| 4333 | struct alc_spec *spec = codec->spec; |
| 4334 | |
| 4335 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore |
| 4336 | send both key on and key off event for every interrupt. */ |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4337 | 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] | 4338 | input_sync(spec->kb_dev); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4339 | 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] | 4340 | input_sync(spec->kb_dev); |
| 4341 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4342 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4343 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
| 4344 | { |
| 4345 | struct alc_spec *spec = codec->spec; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4346 | int i; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4347 | |
| 4348 | spec->kb_dev = input_allocate_device(); |
| 4349 | if (!spec->kb_dev) { |
| 4350 | codec_err(codec, "Out of memory (input_allocate_device)\n"); |
| 4351 | return -ENOMEM; |
| 4352 | } |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4353 | |
| 4354 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; |
| 4355 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4356 | spec->kb_dev->name = "Microphone Mute Button"; |
| 4357 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4358 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
| 4359 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); |
| 4360 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; |
| 4361 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) |
| 4362 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4363 | |
| 4364 | if (input_register_device(spec->kb_dev)) { |
| 4365 | codec_err(codec, "input_register_device failed\n"); |
| 4366 | input_free_device(spec->kb_dev); |
| 4367 | spec->kb_dev = NULL; |
| 4368 | return -ENOMEM; |
| 4369 | } |
| 4370 | |
| 4371 | return 0; |
| 4372 | } |
| 4373 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4374 | /* GPIO1 = set according to SKU external amp |
| 4375 | * GPIO2 = mic mute hotkey |
| 4376 | * GPIO3 = mute LED |
| 4377 | * GPIO4 = mic mute LED |
| 4378 | */ |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4379 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
| 4380 | const struct hda_fixup *fix, int action) |
| 4381 | { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4382 | struct alc_spec *spec = codec->spec; |
| 4383 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4384 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4385 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4386 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4387 | if (alc_register_micmute_input_device(codec) != 0) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4388 | return; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4389 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4390 | spec->gpio_mask |= 0x06; |
| 4391 | spec->gpio_dir |= 0x02; |
| 4392 | spec->gpio_data |= 0x02; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4393 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4394 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4395 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4396 | gpio2_mic_hotkey_event); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4397 | return; |
| 4398 | } |
| 4399 | |
| 4400 | if (!spec->kb_dev) |
| 4401 | return; |
| 4402 | |
| 4403 | switch (action) { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4404 | case HDA_FIXUP_ACT_FREE: |
| 4405 | input_unregister_device(spec->kb_dev); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4406 | spec->kb_dev = NULL; |
| 4407 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4408 | } |
| 4409 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4410 | /* Line2 = mic mute hotkey |
| 4411 | * GPIO2 = mic mute LED |
| 4412 | */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4413 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
| 4414 | const struct hda_fixup *fix, int action) |
| 4415 | { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4416 | struct alc_spec *spec = codec->spec; |
| 4417 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4418 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4419 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4420 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4421 | if (alc_register_micmute_input_device(codec) != 0) |
| 4422 | return; |
| 4423 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4424 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 4425 | gpio2_mic_hotkey_event); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4426 | return; |
| 4427 | } |
| 4428 | |
| 4429 | if (!spec->kb_dev) |
| 4430 | return; |
| 4431 | |
| 4432 | switch (action) { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4433 | case HDA_FIXUP_ACT_FREE: |
| 4434 | input_unregister_device(spec->kb_dev); |
| 4435 | spec->kb_dev = NULL; |
| 4436 | } |
| 4437 | } |
Takashi Iwai | c469652 | 2018-01-15 10:44:35 +0100 | [diff] [blame] | 4438 | #else /* INPUT */ |
| 4439 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL |
| 4440 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL |
| 4441 | #endif /* INPUT */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4442 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4443 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 4444 | const struct hda_fixup *fix, int action) |
| 4445 | { |
| 4446 | struct alc_spec *spec = codec->spec; |
| 4447 | |
Takashi Iwai | 1bce62a | 2018-06-19 23:15:59 +0200 | [diff] [blame] | 4448 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4449 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4450 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4451 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4452 | } |
| 4453 | } |
| 4454 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4455 | static const struct coef_fw alc225_pre_hsmode[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4456 | UPDATE_COEF(0x4a, 1<<8, 0), |
| 4457 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), |
| 4458 | UPDATE_COEF(0x63, 3<<14, 3<<14), |
| 4459 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4460 | UPDATE_COEF(0x4a, 3<<10, 3<<10), |
| 4461 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), |
| 4462 | UPDATE_COEF(0x4a, 3<<10, 0), |
| 4463 | {} |
| 4464 | }; |
| 4465 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4466 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 4467 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4468 | static const struct coef_fw coef0255[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4469 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4470 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4471 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4472 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4473 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 4474 | {} |
| 4475 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4476 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4477 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4478 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4479 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4480 | WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ |
| 4481 | 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] | 4482 | {} |
| 4483 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4484 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4485 | WRITE_COEF(0x1b, 0x0c0b), |
| 4486 | WRITE_COEF(0x45, 0xc429), |
| 4487 | UPDATE_COEF(0x35, 0x4000, 0), |
| 4488 | WRITE_COEF(0x06, 0x2104), |
| 4489 | WRITE_COEF(0x1a, 0x0001), |
| 4490 | WRITE_COEF(0x26, 0x0004), |
| 4491 | WRITE_COEF(0x32, 0x42a3), |
| 4492 | {} |
| 4493 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4494 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4495 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4496 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4497 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4498 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4499 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4500 | {} |
| 4501 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4502 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4503 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
| 4504 | {} |
| 4505 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4506 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4507 | WRITE_COEF(0x76, 0x000e), |
| 4508 | WRITE_COEF(0x6c, 0x2400), |
| 4509 | WRITE_COEF(0x18, 0x7308), |
| 4510 | WRITE_COEF(0x6b, 0xc429), |
| 4511 | {} |
| 4512 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4513 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4514 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 4515 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 4516 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 4517 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 4518 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 4519 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4520 | {} |
| 4521 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4522 | static const struct coef_fw coef0668[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4523 | WRITE_COEF(0x15, 0x0d40), |
| 4524 | WRITE_COEF(0xb7, 0x802b), |
| 4525 | {} |
| 4526 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4527 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4528 | UPDATE_COEF(0x63, 3<<14, 0), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4529 | {} |
| 4530 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4531 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4532 | UPDATE_COEF(0x4a, 0x0100, 0), |
| 4533 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), |
| 4534 | UPDATE_COEF(0x6b, 0xf000, 0x5000), |
| 4535 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4536 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), |
| 4537 | WRITE_COEF(0x45, 0x5289), |
| 4538 | UPDATE_COEF(0x4a, 0x0c00, 0), |
| 4539 | {} |
| 4540 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4541 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4542 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4543 | case 0x10ec0255: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4544 | alc_process_coef_fw(codec, coef0255); |
| 4545 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4546 | case 0x10ec0236: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4547 | case 0x10ec0256: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4548 | alc_process_coef_fw(codec, coef0256); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4549 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4550 | case 0x10ec0234: |
| 4551 | case 0x10ec0274: |
| 4552 | case 0x10ec0294: |
| 4553 | alc_process_coef_fw(codec, coef0274); |
| 4554 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4555 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4556 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4557 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4558 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4559 | case 0x10ec0286: |
| 4560 | case 0x10ec0288: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4561 | alc_process_coef_fw(codec, coef0288); |
| 4562 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4563 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4564 | alc_process_coef_fw(codec, coef0298); |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4565 | alc_process_coef_fw(codec, coef0288); |
| 4566 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4567 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4568 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4569 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4570 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4571 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4572 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4573 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4574 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4575 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4576 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4577 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4578 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4579 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4580 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4581 | case 0x10ec0299: |
Kailang Yang | 4d4b0c5 | 2019-01-09 16:23:37 +0800 | [diff] [blame] | 4582 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4583 | alc_process_coef_fw(codec, coef0225); |
| 4584 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4585 | case 0x10ec0867: |
| 4586 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4587 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4588 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4589 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4590 | } |
| 4591 | |
| 4592 | |
| 4593 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 4594 | hda_nid_t mic_pin) |
| 4595 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4596 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4597 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 4598 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4599 | {} |
| 4600 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4601 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4602 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4603 | WRITE_COEFEX(0x57, 0x03, 0x09a3), |
| 4604 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4605 | {} |
| 4606 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4607 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4608 | UPDATE_COEF(0x35, 0, 1<<14), |
| 4609 | WRITE_COEF(0x06, 0x2100), |
| 4610 | WRITE_COEF(0x1a, 0x0021), |
| 4611 | WRITE_COEF(0x26, 0x008c), |
| 4612 | {} |
| 4613 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4614 | static const struct coef_fw coef0288[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4615 | UPDATE_COEF(0x4f, 0x00c0, 0), |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4616 | UPDATE_COEF(0x50, 0x2000, 0), |
| 4617 | UPDATE_COEF(0x56, 0x0006, 0), |
| 4618 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4619 | UPDATE_COEF(0x66, 0x0008, 0x0008), |
| 4620 | UPDATE_COEF(0x67, 0x2000, 0x2000), |
| 4621 | {} |
| 4622 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4623 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4624 | WRITE_COEF(0x19, 0xa208), |
| 4625 | WRITE_COEF(0x2e, 0xacf0), |
| 4626 | {} |
| 4627 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4628 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4629 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 4630 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 4631 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4632 | {} |
| 4633 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4634 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4635 | WRITE_COEF(0xb7, 0x802b), |
| 4636 | WRITE_COEF(0xb5, 0x1040), |
| 4637 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 4638 | {} |
| 4639 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4640 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4641 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
| 4642 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4643 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4644 | {} |
| 4645 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4646 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4647 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
| 4648 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4649 | UPDATE_COEF(0x6b, 0xf000, 0), |
| 4650 | {} |
| 4651 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4652 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4653 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4654 | case 0x10ec0255: |
| 4655 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4656 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4657 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4658 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4659 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4660 | case 0x10ec0236: |
| 4661 | case 0x10ec0256: |
| 4662 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4663 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4664 | alc_process_coef_fw(codec, coef0256); |
| 4665 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4666 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4667 | case 0x10ec0234: |
| 4668 | case 0x10ec0274: |
| 4669 | case 0x10ec0294: |
| 4670 | alc_write_coef_idx(codec, 0x45, 0x4689); |
| 4671 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4672 | alc_process_coef_fw(codec, coef0274); |
| 4673 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4674 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4675 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4676 | case 0x10ec0283: |
| 4677 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4678 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4679 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4680 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4681 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4682 | case 0x10ec0286: |
| 4683 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4684 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4685 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4686 | alc_process_coef_fw(codec, coef0288); |
| 4687 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4688 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4689 | case 0x10ec0292: |
| 4690 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4691 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4692 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4693 | case 0x10ec0293: |
| 4694 | /* Set to TRS mode */ |
| 4695 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4696 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4697 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4698 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4699 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4700 | case 0x10ec0867: |
| 4701 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); |
Gustavo A. R. Silva | c0dbbda | 2020-07-08 15:32:36 -0500 | [diff] [blame] | 4702 | fallthrough; |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 4703 | case 0x10ec0221: |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4704 | case 0x10ec0662: |
| 4705 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4706 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4707 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4708 | case 0x10ec0668: |
| 4709 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 4710 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4711 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4712 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4713 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4714 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4715 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4716 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4717 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4718 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4719 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4720 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4721 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
| 4722 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4723 | alc_process_coef_fw(codec, coef0225); |
| 4724 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4725 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4726 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4727 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4728 | } |
| 4729 | |
| 4730 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 4731 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4732 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4733 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
| 4734 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), |
| 4735 | UPDATE_COEF(0x49, 3<<8, 0<<8), |
| 4736 | UPDATE_COEF(0x4a, 3<<4, 3<<4), |
| 4737 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4738 | UPDATE_COEF(0x67, 0xf000, 0x3000), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4739 | {} |
| 4740 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4741 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4742 | WRITE_COEF(0x45, 0xc089), |
| 4743 | WRITE_COEF(0x45, 0xc489), |
| 4744 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4745 | WRITE_COEF(0x49, 0x0049), |
| 4746 | {} |
| 4747 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4748 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4749 | WRITE_COEF(0x45, 0xc489), |
| 4750 | WRITE_COEFEX(0x57, 0x03, 0x0da3), |
| 4751 | WRITE_COEF(0x49, 0x0049), |
| 4752 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4753 | WRITE_COEF(0x06, 0x6100), |
| 4754 | {} |
| 4755 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4756 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4757 | WRITE_COEF(0x06, 0x2100), |
| 4758 | WRITE_COEF(0x32, 0x4ea3), |
| 4759 | {} |
| 4760 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4761 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4762 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
| 4763 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4764 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4765 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4766 | UPDATE_COEF(0x67, 0x2000, 0), |
| 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(0x76, 0x000e), |
| 4771 | WRITE_COEF(0x6c, 0x2400), |
| 4772 | WRITE_COEF(0x6b, 0xc429), |
| 4773 | WRITE_COEF(0x18, 0x7308), |
| 4774 | {} |
| 4775 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4776 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4777 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4778 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 4779 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4780 | {} |
| 4781 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4782 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4783 | WRITE_COEF(0x11, 0x0041), |
| 4784 | WRITE_COEF(0x15, 0x0d40), |
| 4785 | WRITE_COEF(0xb7, 0x802b), |
| 4786 | {} |
| 4787 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4788 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4789 | WRITE_COEF(0x45, 0x4289), |
| 4790 | UPDATE_COEF(0x4a, 0x0010, 0x0010), |
| 4791 | UPDATE_COEF(0x6b, 0x0f00, 0), |
| 4792 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4793 | {} |
| 4794 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4795 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4796 | switch (codec->core.vendor_id) { |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4797 | case 0x10ec0215: |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4798 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4799 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4800 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4801 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4802 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4803 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4804 | alc_process_coef_fw(codec, coef0225); |
| 4805 | break; |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4806 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4807 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4808 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4809 | case 0x10ec0236: |
| 4810 | case 0x10ec0256: |
| 4811 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 4812 | alc_write_coef_idx(codec, 0x45, 0xc089); |
| 4813 | msleep(50); |
| 4814 | alc_process_coef_fw(codec, coef0256); |
| 4815 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4816 | case 0x10ec0234: |
| 4817 | case 0x10ec0274: |
| 4818 | case 0x10ec0294: |
| 4819 | alc_process_coef_fw(codec, coef0274); |
| 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: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4823 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4824 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4825 | case 0x10ec0286: |
| 4826 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4827 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4828 | alc_process_coef_fw(codec, coef0288); |
| 4829 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4830 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4831 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4832 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4833 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4834 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4835 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4836 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4837 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4838 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4839 | case 0x10ec0867: |
| 4840 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4841 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4842 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4843 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4844 | } |
| 4845 | |
| 4846 | /* Iphone type */ |
| 4847 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 4848 | { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4849 | int val; |
| 4850 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4851 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4852 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4853 | WRITE_COEF(0x1b, 0x0c2b), |
| 4854 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4855 | {} |
| 4856 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4857 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4858 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4859 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4860 | {} |
| 4861 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4862 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4863 | WRITE_COEF(0x45, 0xd429), |
| 4864 | WRITE_COEF(0x1b, 0x0c2b), |
| 4865 | WRITE_COEF(0x32, 0x4ea3), |
| 4866 | {} |
| 4867 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4868 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4869 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4870 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4871 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4872 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4873 | {} |
| 4874 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4875 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4876 | WRITE_COEF(0x6b, 0xd429), |
| 4877 | WRITE_COEF(0x76, 0x0008), |
| 4878 | WRITE_COEF(0x18, 0x7388), |
| 4879 | {} |
| 4880 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4881 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4882 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 4883 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4884 | {} |
| 4885 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4886 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4887 | WRITE_COEF(0x11, 0x0001), |
| 4888 | WRITE_COEF(0x15, 0x0d60), |
| 4889 | WRITE_COEF(0xc3, 0x0000), |
| 4890 | {} |
| 4891 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4892 | static const struct coef_fw coef0225_1[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4893 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4894 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
| 4895 | {} |
| 4896 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4897 | static const struct coef_fw coef0225_2[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4898 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
| 4899 | UPDATE_COEF(0x63, 3<<14, 1<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4900 | {} |
| 4901 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4902 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4903 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4904 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4905 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4906 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4907 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4908 | case 0x10ec0256: |
| 4909 | alc_process_coef_fw(codec, coef0256); |
| 4910 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4911 | case 0x10ec0234: |
| 4912 | case 0x10ec0274: |
| 4913 | case 0x10ec0294: |
| 4914 | alc_write_coef_idx(codec, 0x45, 0xd689); |
| 4915 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4916 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4917 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4918 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4919 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4920 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4921 | val = alc_read_coef_idx(codec, 0x50); |
| 4922 | if (val & (1 << 12)) { |
| 4923 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4924 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4925 | msleep(300); |
| 4926 | } else { |
| 4927 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4928 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4929 | msleep(300); |
| 4930 | } |
| 4931 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4932 | case 0x10ec0286: |
| 4933 | case 0x10ec0288: |
| 4934 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4935 | msleep(300); |
| 4936 | alc_process_coef_fw(codec, coef0288); |
| 4937 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4938 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4939 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4940 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4941 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4942 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4943 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4944 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4945 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4946 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4947 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4948 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4949 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4950 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4951 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4952 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4953 | val = alc_read_coef_idx(codec, 0x45); |
| 4954 | if (val & (1 << 9)) |
| 4955 | alc_process_coef_fw(codec, coef0225_2); |
| 4956 | else |
| 4957 | alc_process_coef_fw(codec, coef0225_1); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4958 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4959 | case 0x10ec0867: |
| 4960 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4961 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4962 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4963 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4964 | } |
| 4965 | |
| 4966 | /* Nokia type */ |
| 4967 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 4968 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4969 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4970 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4971 | WRITE_COEF(0x1b, 0x0c2b), |
| 4972 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4973 | {} |
| 4974 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4975 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4976 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4977 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4978 | {} |
| 4979 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4980 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4981 | WRITE_COEF(0x45, 0xe429), |
| 4982 | WRITE_COEF(0x1b, 0x0c2b), |
| 4983 | WRITE_COEF(0x32, 0x4ea3), |
| 4984 | {} |
| 4985 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4986 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4987 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4988 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4989 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4990 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4991 | {} |
| 4992 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4993 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4994 | WRITE_COEF(0x6b, 0xe429), |
| 4995 | WRITE_COEF(0x76, 0x0008), |
| 4996 | WRITE_COEF(0x18, 0x7388), |
| 4997 | {} |
| 4998 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4999 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5000 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 5001 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 5002 | {} |
| 5003 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5004 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5005 | WRITE_COEF(0x11, 0x0001), |
| 5006 | WRITE_COEF(0x15, 0x0d50), |
| 5007 | WRITE_COEF(0xc3, 0x0000), |
| 5008 | {} |
| 5009 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5010 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5011 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5012 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5013 | {} |
| 5014 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5015 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5016 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5017 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5018 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5019 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5020 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5021 | case 0x10ec0256: |
| 5022 | alc_process_coef_fw(codec, coef0256); |
| 5023 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5024 | case 0x10ec0234: |
| 5025 | case 0x10ec0274: |
| 5026 | case 0x10ec0294: |
| 5027 | alc_write_coef_idx(codec, 0x45, 0xe689); |
| 5028 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5029 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5030 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5031 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5032 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5033 | case 0x10ec0298: |
| 5034 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5035 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5036 | msleep(300); |
| 5037 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5038 | case 0x10ec0286: |
| 5039 | case 0x10ec0288: |
| 5040 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5041 | msleep(300); |
| 5042 | alc_process_coef_fw(codec, coef0288); |
| 5043 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5044 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5045 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5046 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5047 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5048 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5049 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5050 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5051 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5052 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5053 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5054 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5055 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5056 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5057 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5058 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5059 | alc_process_coef_fw(codec, coef0225); |
| 5060 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5061 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5062 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5063 | } |
| 5064 | |
| 5065 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 5066 | { |
| 5067 | int val; |
| 5068 | bool is_ctia = false; |
| 5069 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5070 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5071 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 5072 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 5073 | conteol) */ |
| 5074 | {} |
| 5075 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5076 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5077 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
| 5078 | {} |
| 5079 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5080 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5081 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5082 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5083 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5084 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5085 | UPDATE_COEF(0x19, 0x1300, 0x1300), |
| 5086 | {} |
| 5087 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5088 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5089 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 5090 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 5091 | {} |
| 5092 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5093 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5094 | WRITE_COEF(0x11, 0x0001), |
| 5095 | WRITE_COEF(0xb7, 0x802b), |
| 5096 | WRITE_COEF(0x15, 0x0d60), |
| 5097 | WRITE_COEF(0xc3, 0x0c00), |
| 5098 | {} |
| 5099 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5100 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5101 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 5102 | UPDATE_COEF(0x4a, 0x8000, 0), |
| 5103 | WRITE_COEF(0x45, 0xd289), |
| 5104 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 5105 | {} |
| 5106 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5107 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5108 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5109 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5110 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5111 | msleep(300); |
| 5112 | val = alc_read_coef_idx(codec, 0x46); |
| 5113 | is_ctia = (val & 0x0070) == 0x0070; |
| 5114 | break; |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5115 | case 0x10ec0236: |
| 5116 | case 0x10ec0256: |
| 5117 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 5118 | alc_write_coef_idx(codec, 0x06, 0x6104); |
| 5119 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); |
| 5120 | |
| 5121 | snd_hda_codec_write(codec, 0x21, 0, |
| 5122 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5123 | msleep(80); |
| 5124 | snd_hda_codec_write(codec, 0x21, 0, |
| 5125 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5126 | |
| 5127 | alc_process_coef_fw(codec, coef0255); |
| 5128 | msleep(300); |
| 5129 | val = alc_read_coef_idx(codec, 0x46); |
| 5130 | is_ctia = (val & 0x0070) == 0x0070; |
| 5131 | |
| 5132 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); |
| 5133 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 5134 | |
| 5135 | snd_hda_codec_write(codec, 0x21, 0, |
| 5136 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5137 | msleep(80); |
| 5138 | snd_hda_codec_write(codec, 0x21, 0, |
| 5139 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5140 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5141 | case 0x10ec0234: |
| 5142 | case 0x10ec0274: |
| 5143 | case 0x10ec0294: |
| 5144 | alc_process_coef_fw(codec, coef0274); |
| 5145 | msleep(80); |
| 5146 | val = alc_read_coef_idx(codec, 0x46); |
| 5147 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5148 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5149 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5150 | case 0x10ec0283: |
| 5151 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 5152 | msleep(300); |
| 5153 | val = alc_read_coef_idx(codec, 0x46); |
| 5154 | is_ctia = (val & 0x0070) == 0x0070; |
| 5155 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5156 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5157 | snd_hda_codec_write(codec, 0x21, 0, |
| 5158 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5159 | msleep(100); |
| 5160 | snd_hda_codec_write(codec, 0x21, 0, |
| 5161 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5162 | msleep(200); |
| 5163 | |
| 5164 | val = alc_read_coef_idx(codec, 0x50); |
| 5165 | if (val & (1 << 12)) { |
| 5166 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 5167 | alc_process_coef_fw(codec, coef0288); |
| 5168 | msleep(350); |
| 5169 | val = alc_read_coef_idx(codec, 0x50); |
| 5170 | is_ctia = (val & 0x0070) == 0x0070; |
| 5171 | } else { |
| 5172 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 5173 | alc_process_coef_fw(codec, coef0288); |
| 5174 | msleep(350); |
| 5175 | val = alc_read_coef_idx(codec, 0x50); |
| 5176 | is_ctia = (val & 0x0070) == 0x0070; |
| 5177 | } |
| 5178 | alc_process_coef_fw(codec, coef0298); |
| 5179 | snd_hda_codec_write(codec, 0x21, 0, |
| 5180 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); |
| 5181 | msleep(75); |
| 5182 | snd_hda_codec_write(codec, 0x21, 0, |
| 5183 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5184 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5185 | case 0x10ec0286: |
| 5186 | case 0x10ec0288: |
| 5187 | alc_process_coef_fw(codec, coef0288); |
| 5188 | msleep(350); |
| 5189 | val = alc_read_coef_idx(codec, 0x50); |
| 5190 | is_ctia = (val & 0x0070) == 0x0070; |
| 5191 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5192 | case 0x10ec0292: |
| 5193 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 5194 | msleep(300); |
| 5195 | val = alc_read_coef_idx(codec, 0x6c); |
| 5196 | is_ctia = (val & 0x001c) == 0x001c; |
| 5197 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5198 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5199 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5200 | msleep(300); |
| 5201 | val = alc_read_coef_idx(codec, 0x46); |
| 5202 | is_ctia = (val & 0x0070) == 0x0070; |
| 5203 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5204 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5205 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5206 | msleep(300); |
| 5207 | val = alc_read_coef_idx(codec, 0xbe); |
| 5208 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 5209 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5210 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5211 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5212 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5213 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5214 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5215 | case 0x10ec0299: |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5216 | snd_hda_codec_write(codec, 0x21, 0, |
| 5217 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5218 | msleep(80); |
| 5219 | snd_hda_codec_write(codec, 0x21, 0, |
| 5220 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5221 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5222 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
| 5223 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
| 5224 | val = alc_read_coef_idx(codec, 0x45); |
| 5225 | if (val & (1 << 9)) { |
| 5226 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5227 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); |
| 5228 | msleep(800); |
| 5229 | val = alc_read_coef_idx(codec, 0x46); |
| 5230 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5231 | } else { |
| 5232 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5233 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); |
| 5234 | msleep(800); |
| 5235 | val = alc_read_coef_idx(codec, 0x46); |
| 5236 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5237 | } |
| 5238 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); |
| 5239 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); |
| 5240 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5241 | |
| 5242 | snd_hda_codec_write(codec, 0x21, 0, |
| 5243 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5244 | msleep(80); |
| 5245 | snd_hda_codec_write(codec, 0x21, 0, |
| 5246 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5247 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5248 | case 0x10ec0867: |
| 5249 | is_ctia = true; |
| 5250 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5251 | } |
| 5252 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5253 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5254 | is_ctia ? "yes" : "no"); |
| 5255 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 5256 | } |
| 5257 | |
| 5258 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 5259 | { |
| 5260 | struct alc_spec *spec = codec->spec; |
| 5261 | |
| 5262 | 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] | 5263 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5264 | |
| 5265 | int new_headset_mode; |
| 5266 | |
| 5267 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 5268 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 5269 | else if (mux_pin == spec->headset_mic_pin) |
| 5270 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 5271 | else if (mux_pin == spec->headphone_mic_pin) |
| 5272 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 5273 | else |
| 5274 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 5275 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5276 | if (new_headset_mode == spec->current_headset_mode) { |
| 5277 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5278 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5279 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5280 | |
| 5281 | switch (new_headset_mode) { |
| 5282 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 5283 | alc_headset_mode_unplugged(codec); |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5284 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5285 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5286 | spec->gen.hp_jack_present = false; |
| 5287 | break; |
| 5288 | case ALC_HEADSET_MODE_HEADSET: |
| 5289 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 5290 | alc_determine_headset_type(codec); |
| 5291 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 5292 | alc_headset_mode_ctia(codec); |
| 5293 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 5294 | alc_headset_mode_omtp(codec); |
| 5295 | spec->gen.hp_jack_present = true; |
| 5296 | break; |
| 5297 | case ALC_HEADSET_MODE_MIC: |
| 5298 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 5299 | spec->gen.hp_jack_present = false; |
| 5300 | break; |
| 5301 | case ALC_HEADSET_MODE_HEADPHONE: |
| 5302 | alc_headset_mode_default(codec); |
| 5303 | spec->gen.hp_jack_present = true; |
| 5304 | break; |
| 5305 | } |
| 5306 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 5307 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 5308 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5309 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5310 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 5311 | PIN_VREFHIZ); |
| 5312 | } |
| 5313 | spec->current_headset_mode = new_headset_mode; |
| 5314 | |
| 5315 | snd_hda_gen_update_outputs(codec); |
| 5316 | } |
| 5317 | |
| 5318 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 5319 | struct snd_kcontrol *kcontrol, |
| 5320 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5321 | { |
| 5322 | alc_update_headset_mode(codec); |
| 5323 | } |
| 5324 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5325 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 5326 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5327 | { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5328 | snd_hda_gen_hp_automute(codec, jack); |
| 5329 | } |
| 5330 | |
| 5331 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 5332 | { |
| 5333 | int i; |
| 5334 | struct alc_spec *spec = codec->spec; |
| 5335 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5336 | |
| 5337 | /* Find mic pins */ |
| 5338 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5339 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 5340 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 5341 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 5342 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 5343 | } |
| 5344 | |
Takashi Iwai | 0bed2aa | 2018-06-19 12:45:53 +0200 | [diff] [blame] | 5345 | WARN_ON(spec->gen.cap_sync_hook); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5346 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 5347 | spec->gen.automute_hook = alc_update_headset_mode; |
| 5348 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 5349 | } |
| 5350 | |
| 5351 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 5352 | const struct hda_fixup *fix, int action) |
| 5353 | { |
| 5354 | struct alc_spec *spec = codec->spec; |
| 5355 | |
| 5356 | switch (action) { |
| 5357 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5358 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 5359 | break; |
| 5360 | case HDA_FIXUP_ACT_PROBE: |
| 5361 | alc_probe_headset_mode(codec); |
| 5362 | break; |
| 5363 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5364 | if (is_s3_resume(codec) || is_s4_resume(codec)) { |
| 5365 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5366 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
| 5367 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5368 | alc_update_headset_mode(codec); |
| 5369 | break; |
| 5370 | } |
| 5371 | } |
| 5372 | |
| 5373 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 5374 | const struct hda_fixup *fix, int action) |
| 5375 | { |
| 5376 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5377 | struct alc_spec *spec = codec->spec; |
| 5378 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5379 | } |
| 5380 | else |
| 5381 | alc_fixup_headset_mode(codec, fix, action); |
| 5382 | } |
| 5383 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5384 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 5385 | { |
| 5386 | /* Set to iphone type */ |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5387 | static const struct coef_fw alc255fw[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5388 | WRITE_COEF(0x1b, 0x880b), |
| 5389 | WRITE_COEF(0x45, 0xd089), |
| 5390 | WRITE_COEF(0x1b, 0x080b), |
| 5391 | WRITE_COEF(0x46, 0x0004), |
| 5392 | WRITE_COEF(0x1b, 0x0c0b), |
| 5393 | {} |
| 5394 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5395 | static const struct coef_fw alc256fw[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5396 | WRITE_COEF(0x1b, 0x884b), |
| 5397 | WRITE_COEF(0x45, 0xd089), |
| 5398 | WRITE_COEF(0x1b, 0x084b), |
| 5399 | WRITE_COEF(0x46, 0x0004), |
| 5400 | WRITE_COEF(0x1b, 0x0c4b), |
| 5401 | {} |
| 5402 | }; |
| 5403 | switch (codec->core.vendor_id) { |
| 5404 | case 0x10ec0255: |
| 5405 | alc_process_coef_fw(codec, alc255fw); |
| 5406 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5407 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5408 | case 0x10ec0256: |
| 5409 | alc_process_coef_fw(codec, alc256fw); |
| 5410 | break; |
| 5411 | } |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5412 | msleep(30); |
| 5413 | } |
| 5414 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5415 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 5416 | const struct hda_fixup *fix, int action) |
| 5417 | { |
| 5418 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5419 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5420 | } |
| 5421 | alc_fixup_headset_mode(codec, fix, action); |
| 5422 | } |
| 5423 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5424 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 5425 | const struct hda_fixup *fix, int action) |
| 5426 | { |
| 5427 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5428 | struct alc_spec *spec = codec->spec; |
| 5429 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5430 | alc255_set_default_jack_type(codec); |
| 5431 | } |
| 5432 | else |
| 5433 | alc_fixup_headset_mode(codec, fix, action); |
| 5434 | } |
| 5435 | |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5436 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
| 5437 | struct hda_jack_callback *jack) |
| 5438 | { |
| 5439 | struct alc_spec *spec = codec->spec; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5440 | |
| 5441 | alc_update_headset_jack_cb(codec, jack); |
| 5442 | /* Headset Mic enable or disable, only for Dell Dino */ |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5443 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5444 | } |
| 5445 | |
| 5446 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, |
| 5447 | const struct hda_fixup *fix, int action) |
| 5448 | { |
| 5449 | alc_fixup_headset_mode(codec, fix, action); |
| 5450 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 5451 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5452 | /* toggled via hp_automute_hook */ |
| 5453 | spec->gpio_mask |= 0x40; |
| 5454 | spec->gpio_dir |= 0x40; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5455 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
| 5456 | } |
| 5457 | } |
| 5458 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5459 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 5460 | const struct hda_fixup *fix, int action) |
| 5461 | { |
| 5462 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5463 | struct alc_spec *spec = codec->spec; |
| 5464 | spec->gen.auto_mute_via_amp = 1; |
| 5465 | } |
| 5466 | } |
| 5467 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5468 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 5469 | const struct hda_fixup *fix, int action) |
| 5470 | { |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5471 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5472 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 5473 | spec->no_shutup_pins = 1; |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5474 | } |
| 5475 | } |
| 5476 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5477 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 5478 | const struct hda_fixup *fix, int action) |
| 5479 | { |
| 5480 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5481 | struct alc_spec *spec = codec->spec; |
| 5482 | /* Disable AA-loopback as it causes white noise */ |
| 5483 | spec->gen.mixer_nid = 0; |
| 5484 | } |
| 5485 | } |
| 5486 | |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5487 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
| 5488 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, |
| 5489 | const struct hda_fixup *fix, int action) |
| 5490 | { |
| 5491 | static const struct hda_pintbl pincfgs[] = { |
| 5492 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 5493 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5494 | { } |
| 5495 | }; |
| 5496 | struct alc_spec *spec = codec->spec; |
| 5497 | |
| 5498 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Hui Wang | 871b906 | 2019-08-14 12:09:08 +0800 | [diff] [blame] | 5499 | spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */ |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5500 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5501 | codec->power_save_node = 0; /* avoid click noises */ |
| 5502 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5503 | } |
| 5504 | } |
| 5505 | |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5506 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
| 5507 | const struct hda_fixup *fix, int action) |
| 5508 | { |
| 5509 | static const struct hda_pintbl pincfgs[] = { |
| 5510 | { 0x17, 0x21211010 }, /* dock headphone */ |
| 5511 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5512 | { } |
| 5513 | }; |
| 5514 | struct alc_spec *spec = codec->spec; |
| 5515 | |
| 5516 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5517 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
Takashi Iwai | 71db96d | 2018-02-26 15:36:38 +0100 | [diff] [blame] | 5518 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5519 | } else if (action == HDA_FIXUP_ACT_INIT) { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5520 | /* Enable DOCK device */ |
| 5521 | snd_hda_codec_write(codec, 0x17, 0, |
| 5522 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
| 5523 | /* Enable DOCK device */ |
| 5524 | snd_hda_codec_write(codec, 0x19, 0, |
| 5525 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5526 | } |
| 5527 | } |
| 5528 | |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 5529 | static void alc_fixup_tpt470_dacs(struct hda_codec *codec, |
| 5530 | const struct hda_fixup *fix, int action) |
| 5531 | { |
| 5532 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise |
| 5533 | * the speaker output becomes too low by some reason on Thinkpads with |
| 5534 | * ALC298 codec |
| 5535 | */ |
| 5536 | static const hda_nid_t preferred_pairs[] = { |
| 5537 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, |
| 5538 | 0 |
| 5539 | }; |
| 5540 | struct alc_spec *spec = codec->spec; |
| 5541 | |
| 5542 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5543 | spec->gen.preferred_dacs = preferred_pairs; |
| 5544 | } |
| 5545 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5546 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5547 | { |
| 5548 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5549 | int hp_pin = alc_get_hp_pin(spec); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5550 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5551 | /* Prevent pop noises when headphones are plugged in */ |
| 5552 | snd_hda_codec_write(codec, hp_pin, 0, |
| 5553 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5554 | msleep(20); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5555 | } |
| 5556 | |
| 5557 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 5558 | const struct hda_fixup *fix, int action) |
| 5559 | { |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5560 | struct alc_spec *spec = codec->spec; |
| 5561 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 5562 | int i; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5563 | |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5564 | switch (action) { |
| 5565 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5566 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise |
| 5567 | * it causes a click noise at start up |
| 5568 | */ |
| 5569 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5570 | spec->shutup = alc_shutup_dell_xps13; |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5571 | break; |
| 5572 | case HDA_FIXUP_ACT_PROBE: |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5573 | /* Make the internal mic the default input source. */ |
| 5574 | for (i = 0; i < imux->num_items; i++) { |
| 5575 | if (spec->gen.imux_pins[i] == 0x12) { |
| 5576 | spec->gen.cur_mux[0] = i; |
| 5577 | break; |
| 5578 | } |
| 5579 | } |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5580 | break; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5581 | } |
| 5582 | } |
| 5583 | |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5584 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
| 5585 | const struct hda_fixup *fix, int action) |
| 5586 | { |
| 5587 | struct alc_spec *spec = codec->spec; |
| 5588 | |
| 5589 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5590 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5591 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ |
David Henningsson | b40eda6 | 2015-05-28 09:40:23 +0200 | [diff] [blame] | 5592 | |
| 5593 | /* Disable boost for mic-in permanently. (This code is only called |
| 5594 | from quirks that guarantee that the headphone is at NID 0x1b.) */ |
| 5595 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); |
| 5596 | 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] | 5597 | } else |
| 5598 | alc_fixup_headset_mode(codec, fix, action); |
| 5599 | } |
| 5600 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5601 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 5602 | const struct hda_fixup *fix, int action) |
| 5603 | { |
| 5604 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5605 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5606 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5607 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 5608 | } |
| 5609 | alc_fixup_headset_mode(codec, fix, action); |
| 5610 | } |
| 5611 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5612 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 5613 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 5614 | { |
| 5615 | struct alc_spec *spec = codec->spec; |
| 5616 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5617 | hda_nid_t nid; |
| 5618 | unsigned int defcfg; |
| 5619 | int i; |
| 5620 | |
| 5621 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5622 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5623 | continue; |
| 5624 | nid = cfg->inputs[i].pin; |
| 5625 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5626 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 5627 | continue; |
| 5628 | return nid; |
| 5629 | } |
| 5630 | |
| 5631 | return 0; |
| 5632 | } |
| 5633 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5634 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5635 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5636 | int action) |
| 5637 | { |
| 5638 | struct alc_spec *spec = codec->spec; |
| 5639 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5640 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5641 | int mic_pin = find_ext_mic_pin(codec); |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5642 | int hp_pin = alc_get_hp_pin(spec); |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5643 | |
| 5644 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5645 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5646 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5647 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5648 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5649 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5650 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 5651 | const struct hda_fixup *fix, |
| 5652 | int action) |
| 5653 | { |
| 5654 | struct alc_spec *spec = codec->spec; |
| 5655 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5656 | int i; |
| 5657 | |
| 5658 | /* The mic boosts on level 2 and 3 are too noisy |
| 5659 | on the internal mic input. |
| 5660 | Therefore limit the boost to 0 or 1. */ |
| 5661 | |
| 5662 | if (action != HDA_FIXUP_ACT_PROBE) |
| 5663 | return; |
| 5664 | |
| 5665 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5666 | hda_nid_t nid = cfg->inputs[i].pin; |
| 5667 | unsigned int defcfg; |
| 5668 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5669 | continue; |
| 5670 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5671 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 5672 | continue; |
| 5673 | |
| 5674 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 5675 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 5676 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5677 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5678 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 5679 | } |
| 5680 | } |
| 5681 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5682 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5683 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5684 | { |
| 5685 | struct alc_spec *spec = codec->spec; |
| 5686 | int vref; |
| 5687 | |
| 5688 | msleep(200); |
| 5689 | snd_hda_gen_hp_automute(codec, jack); |
| 5690 | |
| 5691 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 5692 | |
| 5693 | msleep(600); |
| 5694 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 5695 | vref); |
| 5696 | } |
| 5697 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5698 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 5699 | const struct hda_fixup *fix, int action) |
| 5700 | { |
| 5701 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5702 | |
| 5703 | switch (action) { |
| 5704 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5705 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 5706 | /* Disable AA-loopback as it causes white noise */ |
| 5707 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 5708 | break; |
| 5709 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 5710 | /* MIC2-VREF control */ |
| 5711 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5712 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5713 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5714 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5715 | break; |
| 5716 | } |
| 5717 | } |
| 5718 | |
| 5719 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 5720 | const struct hda_fixup *fix, int action) |
| 5721 | { |
| 5722 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5723 | |
| 5724 | switch (action) { |
| 5725 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5726 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 5727 | break; |
| 5728 | case HDA_FIXUP_ACT_INIT: |
| 5729 | /* MIC2-VREF control */ |
| 5730 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5731 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5732 | break; |
| 5733 | } |
| 5734 | } |
| 5735 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5736 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 5737 | static void asus_tx300_automute(struct hda_codec *codec) |
| 5738 | { |
| 5739 | struct alc_spec *spec = codec->spec; |
| 5740 | snd_hda_gen_update_outputs(codec); |
| 5741 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 5742 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 5743 | } |
| 5744 | |
| 5745 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 5746 | const struct hda_fixup *fix, int action) |
| 5747 | { |
| 5748 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5749 | static const struct hda_pintbl dock_pins[] = { |
| 5750 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 5751 | {} |
| 5752 | }; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5753 | |
| 5754 | switch (action) { |
| 5755 | case HDA_FIXUP_ACT_PRE_PROBE: |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 5756 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5757 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 5758 | alc_setup_gpio(codec, 0x04); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5759 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 5760 | spec->gen.auto_mute_via_amp = 1; |
| 5761 | spec->gen.automute_hook = asus_tx300_automute; |
| 5762 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5763 | snd_hda_gen_hp_automute); |
| 5764 | break; |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 5765 | case HDA_FIXUP_ACT_PROBE: |
| 5766 | spec->init_amp = ALC_INIT_DEFAULT; |
| 5767 | break; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5768 | case HDA_FIXUP_ACT_BUILD: |
| 5769 | /* this is a bit tricky; give more sane names for the main |
| 5770 | * (tablet) speaker and the dock speaker, respectively |
| 5771 | */ |
Takashi Iwai | 56798e6 | 2017-04-11 08:10:52 +0200 | [diff] [blame] | 5772 | rename_ctl(codec, "Speaker Playback Switch", |
| 5773 | "Dock Speaker Playback Switch"); |
| 5774 | rename_ctl(codec, "Bass Speaker Playback Switch", |
| 5775 | "Speaker Playback Switch"); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5776 | break; |
| 5777 | } |
| 5778 | } |
| 5779 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5780 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 5781 | const struct hda_fixup *fix, int action) |
| 5782 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5783 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5784 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 5785 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 5786 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5787 | static const hda_nid_t conn1[] = { 0x0c }; |
| 5788 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 5789 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5790 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5791 | } |
| 5792 | |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5793 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
| 5794 | const struct hda_fixup *fix, int action) |
| 5795 | { |
| 5796 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5797 | /* The speaker is routed to the Node 0x06 by a mistake, as a result |
| 5798 | we can't adjust the speaker's volume since this node does not has |
| 5799 | Amp-out capability. we change the speaker's route to: |
| 5800 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( |
| 5801 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust |
| 5802 | speaker's volume now. */ |
| 5803 | |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5804 | static const hda_nid_t conn1[] = { 0x0c }; |
| 5805 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5806 | } |
| 5807 | } |
| 5808 | |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5809 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
| 5810 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, |
| 5811 | const struct hda_fixup *fix, int action) |
| 5812 | { |
| 5813 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5814 | static const hda_nid_t conn[] = { 0x02, 0x03 }; |
| 5815 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5816 | } |
| 5817 | } |
| 5818 | |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 5819 | /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ |
| 5820 | static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, |
| 5821 | const struct hda_fixup *fix, int action) |
| 5822 | { |
| 5823 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5824 | static const hda_nid_t conn[] = { 0x02 }; |
| 5825 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 5826 | } |
| 5827 | } |
| 5828 | |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5829 | /* Hook to update amp GPIO4 for automute */ |
| 5830 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, |
| 5831 | struct hda_jack_callback *jack) |
| 5832 | { |
| 5833 | struct alc_spec *spec = codec->spec; |
| 5834 | |
| 5835 | snd_hda_gen_hp_automute(codec, jack); |
| 5836 | /* 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] | 5837 | alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, |
| 5838 | !spec->gen.hp_jack_present); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5839 | } |
| 5840 | |
| 5841 | /* Manage GPIOs for HP EliteBook Folio 9480m. |
| 5842 | * |
| 5843 | * GPIO4 is the headphone amplifier power control |
| 5844 | * GPIO3 is the audio output mute indicator LED |
| 5845 | */ |
| 5846 | |
| 5847 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, |
| 5848 | const struct hda_fixup *fix, |
| 5849 | int action) |
| 5850 | { |
| 5851 | struct alc_spec *spec = codec->spec; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5852 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5853 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5854 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5855 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
| 5856 | spec->gpio_mask |= 0x10; |
| 5857 | spec->gpio_dir |= 0x10; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5858 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5859 | } |
| 5860 | } |
| 5861 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5862 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
| 5863 | const struct hda_fixup *fix, |
| 5864 | int action) |
| 5865 | { |
| 5866 | struct alc_spec *spec = codec->spec; |
| 5867 | |
| 5868 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5869 | spec->gpio_mask |= 0x04; |
| 5870 | spec->gpio_dir |= 0x04; |
| 5871 | /* set data bit low */ |
| 5872 | } |
| 5873 | } |
| 5874 | |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 5875 | /* Quirk for Thinkpad X1 7th and 8th Gen |
| 5876 | * The following fixed routing needed |
| 5877 | * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly |
| 5878 | * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC |
| 5879 | * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp |
| 5880 | */ |
| 5881 | static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, |
| 5882 | const struct hda_fixup *fix, int action) |
| 5883 | { |
| 5884 | static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ |
| 5885 | static const hda_nid_t preferred_pairs[] = { |
| 5886 | 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 |
| 5887 | }; |
| 5888 | struct alc_spec *spec = codec->spec; |
| 5889 | |
| 5890 | switch (action) { |
| 5891 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5892 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
| 5893 | spec->gen.preferred_dacs = preferred_pairs; |
| 5894 | break; |
| 5895 | case HDA_FIXUP_ACT_BUILD: |
| 5896 | /* The generic parser creates somewhat unintuitive volume ctls |
| 5897 | * with the fixed routing above, and the shared DAC2 may be |
| 5898 | * confusing for PA. |
| 5899 | * Rename those to unique names so that PA doesn't touch them |
| 5900 | * and use only Master volume. |
| 5901 | */ |
| 5902 | rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); |
| 5903 | rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); |
| 5904 | break; |
| 5905 | } |
| 5906 | } |
| 5907 | |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5908 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
| 5909 | const struct hda_fixup *fix, |
| 5910 | int action) |
| 5911 | { |
| 5912 | alc_fixup_dual_codecs(codec, fix, action); |
| 5913 | switch (action) { |
| 5914 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5915 | /* override card longname to provide a unique UCM profile */ |
| 5916 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); |
| 5917 | break; |
| 5918 | case HDA_FIXUP_ACT_BUILD: |
| 5919 | /* rename Capture controls depending on the codec */ |
| 5920 | rename_ctl(codec, "Capture Volume", |
| 5921 | codec->addr == 0 ? |
| 5922 | "Rear-Panel Capture Volume" : |
| 5923 | "Front-Panel Capture Volume"); |
| 5924 | rename_ctl(codec, "Capture Switch", |
| 5925 | codec->addr == 0 ? |
| 5926 | "Rear-Panel Capture Switch" : |
| 5927 | "Front-Panel Capture Switch"); |
| 5928 | break; |
| 5929 | } |
| 5930 | } |
| 5931 | |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 5932 | static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, |
| 5933 | const struct hda_fixup *fix, int action) |
| 5934 | { |
| 5935 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5936 | return; |
| 5937 | |
| 5938 | codec->power_save_node = 1; |
| 5939 | } |
| 5940 | |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5941 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
| 5942 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
| 5943 | const struct hda_fixup *fix, int action) |
| 5944 | { |
| 5945 | struct alc_spec *spec = codec->spec; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 5946 | static const hda_nid_t preferred_pairs[] = { |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5947 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
| 5948 | 0 |
| 5949 | }; |
| 5950 | |
| 5951 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5952 | return; |
| 5953 | |
| 5954 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 0700d3d | 2019-04-26 16:13:54 +0800 | [diff] [blame] | 5955 | spec->gen.auto_mute_via_amp = 1; |
| 5956 | codec->power_save_node = 0; |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5957 | } |
| 5958 | |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 5959 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
| 5960 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, |
| 5961 | const struct hda_fixup *fix, int action) |
| 5962 | { |
| 5963 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5964 | return; |
| 5965 | |
| 5966 | snd_hda_override_wcaps(codec, 0x03, 0); |
| 5967 | } |
| 5968 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5969 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
| 5970 | const struct hda_fixup *fix, int action) |
| 5971 | { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 5972 | struct alc_spec *spec = codec->spec; |
| 5973 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5974 | switch (action) { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 5975 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5976 | spec->ultra_low_power = true; |
| 5977 | break; |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5978 | case HDA_FIXUP_ACT_INIT: |
| 5979 | switch (codec->core.vendor_id) { |
| 5980 | case 0x10ec0295: |
| 5981 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5982 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); |
| 5983 | break; |
| 5984 | case 0x10ec0236: |
| 5985 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5986 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); |
| 5987 | break; |
| 5988 | } |
| 5989 | break; |
| 5990 | } |
| 5991 | } |
| 5992 | |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 5993 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
| 5994 | const struct hda_fixup *fix, int action) |
| 5995 | { |
| 5996 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5997 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
| 5998 | } |
| 5999 | |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 6000 | |
| 6001 | static void alc294_gx502_toggle_output(struct hda_codec *codec, |
| 6002 | struct hda_jack_callback *cb) |
| 6003 | { |
| 6004 | /* The Windows driver sets the codec up in a very different way where |
| 6005 | * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it |
| 6006 | */ |
| 6007 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) |
| 6008 | alc_write_coef_idx(codec, 0x10, 0x8a20); |
| 6009 | else |
| 6010 | alc_write_coef_idx(codec, 0x10, 0x0a20); |
| 6011 | } |
| 6012 | |
| 6013 | static void alc294_fixup_gx502_hp(struct hda_codec *codec, |
| 6014 | const struct hda_fixup *fix, int action) |
| 6015 | { |
| 6016 | /* Pin 0x21: headphones/headset mic */ |
| 6017 | if (!is_jack_detectable(codec, 0x21)) |
| 6018 | return; |
| 6019 | |
| 6020 | switch (action) { |
| 6021 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6022 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 6023 | alc294_gx502_toggle_output); |
| 6024 | break; |
| 6025 | case HDA_FIXUP_ACT_INIT: |
| 6026 | /* Make sure to start in a correct state, i.e. if |
| 6027 | * headphones have been plugged in before powering up the system |
| 6028 | */ |
| 6029 | alc294_gx502_toggle_output(codec, NULL); |
| 6030 | break; |
| 6031 | } |
| 6032 | } |
| 6033 | |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 6034 | static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, |
| 6035 | const struct hda_fixup *fix, int action) |
| 6036 | { |
| 6037 | if (action != HDA_FIXUP_ACT_INIT) |
| 6038 | return; |
| 6039 | |
| 6040 | msleep(100); |
| 6041 | alc_write_coef_idx(codec, 0x65, 0x0); |
| 6042 | } |
| 6043 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 6044 | /* for hda_fixup_thinkpad_acpi() */ |
| 6045 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6046 | |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6047 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
| 6048 | const struct hda_fixup *fix, int action) |
| 6049 | { |
| 6050 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ |
| 6051 | hda_fixup_thinkpad_acpi(codec, fix, action); |
| 6052 | } |
| 6053 | |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6054 | /* for alc295_fixup_hp_top_speakers */ |
| 6055 | #include "hp_x360_helper.c" |
| 6056 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6057 | enum { |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame^] | 6058 | ALC269_FIXUP_GPIO2, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6059 | ALC269_FIXUP_SONY_VAIO, |
| 6060 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 6061 | ALC269_FIXUP_DELL_M101Z, |
| 6062 | ALC269_FIXUP_SKU_IGNORE, |
| 6063 | ALC269_FIXUP_ASUS_G73JW, |
| 6064 | ALC269_FIXUP_LENOVO_EAPD, |
| 6065 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6066 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6067 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6068 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6069 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 6070 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6071 | ALC269_FIXUP_QUANTA_MUTE, |
| 6072 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 6073 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 6074 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6075 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 6076 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6077 | ALC269_FIXUP_AMIC, |
| 6078 | ALC269_FIXUP_DMIC, |
| 6079 | ALC269VB_FIXUP_AMIC, |
| 6080 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6081 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 6082 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6083 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6084 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6085 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6086 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 6087 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6088 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6089 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 6090 | ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6091 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6092 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6093 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6094 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6095 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6096 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 6097 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6098 | ALC269_FIXUP_HEADSET_MODE, |
| 6099 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6100 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6101 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 6102 | ALC269_FIXUP_ASUS_X101_VERB, |
| 6103 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6104 | ALC271_FIXUP_AMIC_MIC2, |
| 6105 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6106 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6107 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6108 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6109 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6110 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6111 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6112 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6113 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6114 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6115 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6116 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6117 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6118 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6119 | ALC290_FIXUP_SUBWOOFER, |
| 6120 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6121 | ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6122 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6123 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6124 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6125 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6126 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6127 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6128 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6129 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6130 | ALC292_FIXUP_TPT440_DOCK, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6131 | ALC292_FIXUP_TPT440, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6132 | ALC283_FIXUP_HEADSET_MIC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6133 | ALC255_FIXUP_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6134 | ALC282_FIXUP_ASPIRE_V5_PINS, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6135 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6136 | ALC286_FIXUP_HP_GPIO_LED, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6137 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6138 | ALC280_FIXUP_HP_DOCK_PINS, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6139 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6140 | ALC280_FIXUP_HP_9480M, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6141 | ALC288_FIXUP_DELL_HEADSET_MODE, |
| 6142 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6143 | ALC288_FIXUP_DELL_XPS_13, |
| 6144 | ALC288_FIXUP_DISABLE_AAMIX, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6145 | ALC292_FIXUP_DELL_E7X_AAMIX, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6146 | ALC292_FIXUP_DELL_E7X, |
| 6147 | ALC292_FIXUP_DISABLE_AAMIX, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6148 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 6149 | ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6150 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6151 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6152 | ALC275_FIXUP_DELL_XPS, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6153 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6154 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6155 | ALC255_FIXUP_DELL_SPK_NOISE, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6156 | ALC225_FIXUP_DISABLE_MIC_VREF, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6157 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6158 | ALC295_FIXUP_DISABLE_DAC3, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6159 | ALC285_FIXUP_SPEAKER2_TO_DAC1, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6160 | ALC280_FIXUP_HP_HEADSET_MIC, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6161 | ALC221_FIXUP_HP_FRONT_MIC, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6162 | ALC292_FIXUP_TPT460, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6163 | ALC298_FIXUP_SPK_VOLUME, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6164 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6165 | ALC269_FIXUP_ATIV_BOOK_8, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6166 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6167 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
| 6168 | ALC256_FIXUP_ASUS_MIC, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6169 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6170 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 6171 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6172 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 6173 | ALC233_FIXUP_ACER_HEADSET_MIC, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6174 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6175 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 6176 | ALC225_FIXUP_S3_POP_NOISE, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6177 | ALC700_FIXUP_INTEL_REFERENCE, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6178 | ALC274_FIXUP_DELL_BIND_DACS, |
| 6179 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 6180 | ALC298_FIXUP_TPT470_DOCK_FIX, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6181 | ALC298_FIXUP_TPT470_DOCK, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6182 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6183 | ALC255_FIXUP_DELL_HEADSET_MIC, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 6184 | ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 6185 | ALC298_FIXUP_HUAWEI_MBX_STEREO, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6186 | ALC295_FIXUP_HP_X360, |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 6187 | ALC221_FIXUP_HP_HEADSET_MIC, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6188 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6189 | ALC295_FIXUP_HP_AUTO_MUTE, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 6190 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 6191 | ALC294_FIXUP_ASUS_MIC, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6192 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
| 6193 | ALC294_FIXUP_ASUS_SPK, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 6194 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 6195 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6196 | ALC255_FIXUP_ACER_HEADSET_MIC, |
Kailang Yang | 10f5b1b | 2019-02-21 16:10:22 +0800 | [diff] [blame] | 6197 | ALC295_FIXUP_CHROME_BOOK, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6198 | ALC225_FIXUP_HEADSET_JACK, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 6199 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
| 6200 | ALC225_FIXUP_WYSE_AUTO_MUTE, |
| 6201 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6202 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 6203 | ALC256_FIXUP_ASUS_HEADSET_MIC, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 6204 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 6205 | ALC299_FIXUP_PREDATOR_SPK, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 6206 | ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 6207 | ALC289_FIXUP_DELL_SPK2, |
| 6208 | ALC289_FIXUP_DUAL_SPK, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 6209 | ALC294_FIXUP_SPK2_TO_DAC1, |
| 6210 | ALC294_FIXUP_ASUS_DUAL_SPK, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 6211 | ALC285_FIXUP_THINKPAD_X1_GEN7, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 6212 | ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 6213 | ALC294_FIXUP_ASUS_HPE, |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 6214 | ALC294_FIXUP_ASUS_COEF_1B, |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 6215 | ALC294_FIXUP_ASUS_GX502_HP, |
| 6216 | ALC294_FIXUP_ASUS_GX502_PINS, |
| 6217 | ALC294_FIXUP_ASUS_GX502_VERBS, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 6218 | ALC285_FIXUP_HP_GPIO_LED, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 6219 | ALC285_FIXUP_HP_MUTE_LED, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 6220 | ALC236_FIXUP_HP_MUTE_LED, |
Mike Pozulp | 14425f1 | 2020-05-09 20:28:37 -0700 | [diff] [blame] | 6221 | ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 6222 | ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | 8eae7e9 | 2020-07-06 15:18:25 +0800 | [diff] [blame] | 6223 | ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, |
Jian-Hong Pan | 6e15d12 | 2020-07-06 15:18:27 +0800 | [diff] [blame] | 6224 | ALC269VC_FIXUP_ACER_HEADSET_MIC, |
Jian-Hong Pan | 781c90c | 2020-07-06 15:18:29 +0800 | [diff] [blame] | 6225 | ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 6226 | ALC289_FIXUP_ASUS_GA401, |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 6227 | ALC289_FIXUP_ASUS_GA502, |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 6228 | ALC256_FIXUP_ACER_MIC_NO_PRESENCE, |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 6229 | ALC285_FIXUP_HP_GPIO_AMP_INIT, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 6230 | ALC269_FIXUP_CZC_B20, |
| 6231 | ALC269_FIXUP_CZC_TMI, |
| 6232 | ALC269_FIXUP_CZC_L101, |
| 6233 | ALC269_FIXUP_LEMOTE_A1802, |
| 6234 | ALC269_FIXUP_LEMOTE_A190X, |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 6235 | ALC256_FIXUP_INTEL_NUC8_RUGGED, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 6236 | ALC255_FIXUP_XIAOMI_HEADSET_MIC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6237 | }; |
| 6238 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6239 | static const struct hda_fixup alc269_fixups[] = { |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame^] | 6240 | [ALC269_FIXUP_GPIO2] = { |
| 6241 | .type = HDA_FIXUP_FUNC, |
| 6242 | .v.func = alc_fixup_gpio2, |
| 6243 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6244 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 6245 | .type = HDA_FIXUP_PINCTLS, |
| 6246 | .v.pins = (const struct hda_pintbl[]) { |
| 6247 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6248 | {} |
| 6249 | } |
| 6250 | }, |
| 6251 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6252 | .type = HDA_FIXUP_FUNC, |
| 6253 | .v.func = alc275_fixup_gpio4_off, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6254 | .chained = true, |
| 6255 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 6256 | }, |
| 6257 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6258 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6259 | .v.verbs = (const struct hda_verb[]) { |
| 6260 | /* Enables internal speaker */ |
| 6261 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 6262 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 6263 | {} |
| 6264 | } |
| 6265 | }, |
| 6266 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6267 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 6268 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6269 | }, |
| 6270 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6271 | .type = HDA_FIXUP_PINS, |
| 6272 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6273 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 6274 | { } |
| 6275 | } |
| 6276 | }, |
| 6277 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6278 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6279 | .v.verbs = (const struct hda_verb[]) { |
| 6280 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 6281 | {} |
| 6282 | } |
| 6283 | }, |
| 6284 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6285 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6286 | .v.func = alc269_fixup_hweq, |
| 6287 | .chained = true, |
| 6288 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 6289 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6290 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 6291 | .type = HDA_FIXUP_FUNC, |
| 6292 | .v.func = alc_fixup_disable_aamix, |
| 6293 | .chained = true, |
| 6294 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 6295 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6296 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6297 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6298 | .v.func = alc271_fixup_dmic, |
| 6299 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6300 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6301 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6302 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 6303 | .chained = true, |
| 6304 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6305 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6306 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6307 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6308 | .v.func = alc269_fixup_stereo_dmic, |
| 6309 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 6310 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 6311 | .type = HDA_FIXUP_FUNC, |
| 6312 | .v.func = alc269_fixup_headset_mic, |
| 6313 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6314 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6315 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6316 | .v.func = alc269_fixup_quanta_mute, |
| 6317 | }, |
| 6318 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6319 | .type = HDA_FIXUP_PINS, |
| 6320 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6321 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 6322 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 6323 | { } |
| 6324 | }, |
| 6325 | .chained = true, |
| 6326 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 6327 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 6328 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 6329 | .type = HDA_FIXUP_PINS, |
| 6330 | .v.pins = (const struct hda_pintbl[]) { |
| 6331 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 6332 | { } |
| 6333 | }, |
| 6334 | }, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 6335 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
| 6336 | .type = HDA_FIXUP_PINS, |
| 6337 | .v.pins = (const struct hda_pintbl[]) { |
| 6338 | { 0x21, 0x0221102f }, /* HP out */ |
| 6339 | { } |
| 6340 | }, |
| 6341 | }, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6342 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
| 6343 | .type = HDA_FIXUP_FUNC, |
| 6344 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
| 6345 | }, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 6346 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
| 6347 | .type = HDA_FIXUP_FUNC, |
| 6348 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, |
| 6349 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6350 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6351 | .type = HDA_FIXUP_PINS, |
| 6352 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6353 | { 0x14, 0x99130110 }, /* speaker */ |
| 6354 | { 0x15, 0x0121401f }, /* HP out */ |
| 6355 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6356 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 6357 | { } |
| 6358 | }, |
| 6359 | }, |
| 6360 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6361 | .type = HDA_FIXUP_PINS, |
| 6362 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6363 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6364 | { 0x14, 0x99130110 }, /* speaker */ |
| 6365 | { 0x15, 0x0121401f }, /* HP out */ |
| 6366 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6367 | { } |
| 6368 | }, |
| 6369 | }, |
| 6370 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6371 | .type = HDA_FIXUP_PINS, |
| 6372 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6373 | { 0x14, 0x99130110 }, /* speaker */ |
| 6374 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6375 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 6376 | { 0x21, 0x0121401f }, /* HP out */ |
| 6377 | { } |
| 6378 | }, |
| 6379 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 6380 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6381 | .type = HDA_FIXUP_PINS, |
| 6382 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6383 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6384 | { 0x14, 0x99130110 }, /* speaker */ |
| 6385 | { 0x18, 0x01a19c20 }, /* mic */ |
| 6386 | { 0x21, 0x0121401f }, /* HP out */ |
| 6387 | { } |
| 6388 | }, |
| 6389 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6390 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6391 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6392 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 6393 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 6394 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 6395 | .type = HDA_FIXUP_FUNC, |
| 6396 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 6397 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6398 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6399 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6400 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 6401 | }, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6402 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
| 6403 | .type = HDA_FIXUP_FUNC, |
| 6404 | .v.func = alc269_fixup_hp_mute_led_mic3, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6405 | .chained = true, |
| 6406 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6407 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6408 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 6409 | .type = HDA_FIXUP_FUNC, |
| 6410 | .v.func = alc269_fixup_hp_gpio_led, |
| 6411 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6412 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 6413 | .type = HDA_FIXUP_FUNC, |
| 6414 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 6415 | }, |
| 6416 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 6417 | .type = HDA_FIXUP_FUNC, |
| 6418 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 6419 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6420 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6421 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 6422 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6423 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6424 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 6425 | .type = HDA_FIXUP_FUNC, |
| 6426 | .v.func = alc_fixup_no_shutup, |
| 6427 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6428 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6429 | .type = HDA_FIXUP_PINS, |
| 6430 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6431 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 6432 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 6433 | { } |
| 6434 | }, |
| 6435 | .chained = true, |
| 6436 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 6437 | }, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 6438 | [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { |
| 6439 | .type = HDA_FIXUP_FUNC, |
| 6440 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6441 | .chained = true, |
| 6442 | .chain_id = ALC269_FIXUP_LENOVO_DOCK, |
| 6443 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6444 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6445 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6446 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 6447 | .chained = true, |
| 6448 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6449 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6450 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6451 | .type = HDA_FIXUP_PINS, |
| 6452 | .v.pins = (const struct hda_pintbl[]) { |
| 6453 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6454 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6455 | { } |
| 6456 | }, |
| 6457 | .chained = true, |
| 6458 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6459 | }, |
| 6460 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6461 | .type = HDA_FIXUP_PINS, |
| 6462 | .v.pins = (const struct hda_pintbl[]) { |
| 6463 | { 0x16, 0x21014020 }, /* dock line out */ |
| 6464 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 6465 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6466 | { } |
| 6467 | }, |
| 6468 | .chained = true, |
| 6469 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6470 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6471 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 6472 | .type = HDA_FIXUP_PINS, |
| 6473 | .v.pins = (const struct hda_pintbl[]) { |
| 6474 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6475 | { } |
| 6476 | }, |
| 6477 | .chained = true, |
| 6478 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6479 | }, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 6480 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
| 6481 | .type = HDA_FIXUP_PINS, |
| 6482 | .v.pins = (const struct hda_pintbl[]) { |
| 6483 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6484 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6485 | { } |
| 6486 | }, |
| 6487 | .chained = true, |
| 6488 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6489 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6490 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 6491 | .type = HDA_FIXUP_FUNC, |
| 6492 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 6493 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6494 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6495 | }, |
| 6496 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6497 | .type = HDA_FIXUP_FUNC, |
| 6498 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 6499 | }, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6500 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
| 6501 | .type = HDA_FIXUP_PINS, |
| 6502 | .v.pins = (const struct hda_pintbl[]) { |
| 6503 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 6504 | { } |
| 6505 | }, |
| 6506 | .chained = true, |
| 6507 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 6508 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6509 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 6510 | .type = HDA_FIXUP_PINS, |
| 6511 | .v.pins = (const struct hda_pintbl[]) { |
| 6512 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6513 | { } |
| 6514 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 6515 | .chained = true, |
| 6516 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6517 | }, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 6518 | [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6519 | .type = HDA_FIXUP_PINS, |
| 6520 | .v.pins = (const struct hda_pintbl[]) { |
| 6521 | {0x12, 0x90a60130}, |
| 6522 | {0x13, 0x40000000}, |
| 6523 | {0x14, 0x90170110}, |
| 6524 | {0x18, 0x411111f0}, |
| 6525 | {0x19, 0x04a11040}, |
| 6526 | {0x1a, 0x411111f0}, |
| 6527 | {0x1b, 0x90170112}, |
| 6528 | {0x1d, 0x40759a05}, |
| 6529 | {0x1e, 0x411111f0}, |
| 6530 | {0x21, 0x04211020}, |
| 6531 | { } |
| 6532 | }, |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 6533 | .chained = true, |
| 6534 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6535 | }, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 6536 | [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { |
| 6537 | .type = HDA_FIXUP_FUNC, |
| 6538 | .v.func = alc298_fixup_huawei_mbx_stereo, |
| 6539 | .chained = true, |
| 6540 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
| 6541 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6542 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 6543 | .type = HDA_FIXUP_FUNC, |
| 6544 | .v.func = alc269_fixup_x101_headset_mic, |
| 6545 | }, |
| 6546 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 6547 | .type = HDA_FIXUP_VERBS, |
| 6548 | .v.verbs = (const struct hda_verb[]) { |
| 6549 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 6550 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 6551 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 6552 | { } |
| 6553 | }, |
| 6554 | .chained = true, |
| 6555 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 6556 | }, |
| 6557 | [ALC269_FIXUP_ASUS_X101] = { |
| 6558 | .type = HDA_FIXUP_PINS, |
| 6559 | .v.pins = (const struct hda_pintbl[]) { |
| 6560 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 6561 | { } |
| 6562 | }, |
| 6563 | .chained = true, |
| 6564 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 6565 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6566 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6567 | .type = HDA_FIXUP_PINS, |
| 6568 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6569 | { 0x14, 0x99130110 }, /* speaker */ |
| 6570 | { 0x19, 0x01a19c20 }, /* mic */ |
| 6571 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 6572 | { 0x21, 0x0121401f }, /* HP out */ |
| 6573 | { } |
| 6574 | }, |
| 6575 | }, |
| 6576 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6577 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6578 | .v.func = alc271_hp_gate_mic_jack, |
| 6579 | .chained = true, |
| 6580 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 6581 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6582 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 6583 | .type = HDA_FIXUP_FUNC, |
| 6584 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6585 | .chained = true, |
| 6586 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 6587 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6588 | [ALC269_FIXUP_ACER_AC700] = { |
| 6589 | .type = HDA_FIXUP_PINS, |
| 6590 | .v.pins = (const struct hda_pintbl[]) { |
| 6591 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6592 | { 0x14, 0x99130110 }, /* speaker */ |
| 6593 | { 0x18, 0x03a11c20 }, /* mic */ |
| 6594 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 6595 | { 0x21, 0x0321101f }, /* HP out */ |
| 6596 | { } |
| 6597 | }, |
| 6598 | .chained = true, |
| 6599 | .chain_id = ALC271_FIXUP_DMIC, |
| 6600 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6601 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 6602 | .type = HDA_FIXUP_FUNC, |
| 6603 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 6604 | .chained = true, |
| 6605 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6606 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6607 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 6608 | .type = HDA_FIXUP_FUNC, |
| 6609 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6610 | .chained = true, |
| 6611 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 6612 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6613 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 6614 | .type = HDA_FIXUP_VERBS, |
| 6615 | .v.verbs = (const struct hda_verb[]) { |
| 6616 | /* class-D output amp +5dB */ |
| 6617 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 6618 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 6619 | {} |
| 6620 | }, |
| 6621 | .chained = true, |
| 6622 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 6623 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6624 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 6625 | .type = HDA_FIXUP_FUNC, |
| 6626 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6627 | .chained = true, |
| 6628 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 6629 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6630 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 6631 | .type = HDA_FIXUP_PINS, |
| 6632 | .v.pins = (const struct hda_pintbl[]) { |
| 6633 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6634 | { 0x18, 0x03a11d20 }, /* mic */ |
| 6635 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 6636 | { } |
| 6637 | }, |
| 6638 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6639 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 6640 | .type = HDA_FIXUP_FUNC, |
| 6641 | .v.func = alc283_fixup_chromebook, |
| 6642 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6643 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 6644 | .type = HDA_FIXUP_FUNC, |
| 6645 | .v.func = alc283_fixup_sense_combo_jack, |
| 6646 | .chained = true, |
| 6647 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 6648 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6649 | [ALC282_FIXUP_ASUS_TX300] = { |
| 6650 | .type = HDA_FIXUP_FUNC, |
| 6651 | .v.func = alc282_fixup_asus_tx300, |
| 6652 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6653 | [ALC283_FIXUP_INT_MIC] = { |
| 6654 | .type = HDA_FIXUP_VERBS, |
| 6655 | .v.verbs = (const struct hda_verb[]) { |
| 6656 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 6657 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 6658 | { } |
| 6659 | }, |
| 6660 | .chained = true, |
| 6661 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6662 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6663 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 6664 | .type = HDA_FIXUP_PINS, |
| 6665 | .v.pins = (const struct hda_pintbl[]) { |
| 6666 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6667 | { } |
| 6668 | }, |
| 6669 | .chained = true, |
| 6670 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6671 | }, |
| 6672 | [ALC290_FIXUP_SUBWOOFER] = { |
| 6673 | .type = HDA_FIXUP_PINS, |
| 6674 | .v.pins = (const struct hda_pintbl[]) { |
| 6675 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6676 | { } |
| 6677 | }, |
| 6678 | .chained = true, |
| 6679 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 6680 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6681 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 6682 | .type = HDA_FIXUP_FUNC, |
| 6683 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6684 | }, |
| 6685 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 6686 | .type = HDA_FIXUP_FUNC, |
| 6687 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6688 | .chained = true, |
| 6689 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 6690 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6691 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 6692 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6693 | .v.func = alc_fixup_thinkpad_acpi, |
Takashi Iwai | 09da111 | 2016-09-08 12:15:02 +0200 | [diff] [blame] | 6694 | .chained = true, |
| 6695 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6696 | }, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6697 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
| 6698 | .type = HDA_FIXUP_FUNC, |
| 6699 | .v.func = alc_fixup_inv_dmic, |
| 6700 | .chained = true, |
| 6701 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 6702 | }, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6703 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 6704 | .type = HDA_FIXUP_PINS, |
| 6705 | .v.pins = (const struct hda_pintbl[]) { |
| 6706 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6707 | { } |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6708 | }, |
| 6709 | .chained = true, |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 6710 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6711 | }, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6712 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6713 | .type = HDA_FIXUP_PINS, |
| 6714 | .v.pins = (const struct hda_pintbl[]) { |
| 6715 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6716 | { } |
| 6717 | }, |
| 6718 | .chained = true, |
| 6719 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6720 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6721 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6722 | .type = HDA_FIXUP_PINS, |
| 6723 | .v.pins = (const struct hda_pintbl[]) { |
| 6724 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6725 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6726 | { } |
| 6727 | }, |
| 6728 | .chained = true, |
| 6729 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6730 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6731 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6732 | .type = HDA_FIXUP_PINS, |
| 6733 | .v.pins = (const struct hda_pintbl[]) { |
| 6734 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6735 | { } |
| 6736 | }, |
| 6737 | .chained = true, |
| 6738 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6739 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6740 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 6741 | .type = HDA_FIXUP_FUNC, |
| 6742 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 6743 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6744 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6745 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6746 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6747 | .type = HDA_FIXUP_FUNC, |
| 6748 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 6749 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6750 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6751 | .type = HDA_FIXUP_PINS, |
| 6752 | .v.pins = (const struct hda_pintbl[]) { |
| 6753 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6754 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6755 | { } |
| 6756 | }, |
| 6757 | .chained = true, |
| 6758 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6759 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6760 | [ALC292_FIXUP_TPT440_DOCK] = { |
David Henningsson | ec56af6 | 2015-06-24 10:46:33 +0200 | [diff] [blame] | 6761 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 6762 | .v.func = alc_fixup_tpt440_dock, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6763 | .chained = true, |
| 6764 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6765 | }, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6766 | [ALC292_FIXUP_TPT440] = { |
| 6767 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 157f0b7 | 2015-12-10 23:30:43 +0100 | [diff] [blame] | 6768 | .v.func = alc_fixup_disable_aamix, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6769 | .chained = true, |
| 6770 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
| 6771 | }, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6772 | [ALC283_FIXUP_HEADSET_MIC] = { |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 6773 | .type = HDA_FIXUP_PINS, |
| 6774 | .v.pins = (const struct hda_pintbl[]) { |
| 6775 | { 0x19, 0x04a110f0 }, |
| 6776 | { }, |
| 6777 | }, |
| 6778 | }, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6779 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6780 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 6781 | .v.func = alc_fixup_micmute_led, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6782 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6783 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 6784 | .type = HDA_FIXUP_PINS, |
| 6785 | .v.pins = (const struct hda_pintbl[]) { |
| 6786 | { 0x12, 0x90a60130 }, |
| 6787 | { 0x14, 0x90170110 }, |
| 6788 | { 0x17, 0x40000008 }, |
| 6789 | { 0x18, 0x411111f0 }, |
Mateusz Sylwestrzak | 0420694 | 2015-07-19 17:38:56 +0200 | [diff] [blame] | 6790 | { 0x19, 0x01a1913c }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6791 | { 0x1a, 0x411111f0 }, |
| 6792 | { 0x1b, 0x411111f0 }, |
| 6793 | { 0x1d, 0x40f89b2d }, |
| 6794 | { 0x1e, 0x411111f0 }, |
| 6795 | { 0x21, 0x0321101f }, |
| 6796 | { }, |
| 6797 | }, |
| 6798 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6799 | [ALC280_FIXUP_HP_GPIO4] = { |
| 6800 | .type = HDA_FIXUP_FUNC, |
| 6801 | .v.func = alc280_fixup_hp_gpio4, |
| 6802 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6803 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 6804 | .type = HDA_FIXUP_FUNC, |
| 6805 | .v.func = alc286_fixup_hp_gpio_led, |
| 6806 | }, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6807 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
| 6808 | .type = HDA_FIXUP_FUNC, |
| 6809 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, |
| 6810 | }, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6811 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
| 6812 | .type = HDA_FIXUP_PINS, |
| 6813 | .v.pins = (const struct hda_pintbl[]) { |
| 6814 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6815 | { 0x1a, 0x01a1903c }, /* headset mic */ |
| 6816 | { 0x18, 0x2181103f }, /* line-in */ |
| 6817 | { }, |
| 6818 | }, |
| 6819 | .chained = true, |
| 6820 | .chain_id = ALC280_FIXUP_HP_GPIO4 |
| 6821 | }, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6822 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
| 6823 | .type = HDA_FIXUP_PINS, |
| 6824 | .v.pins = (const struct hda_pintbl[]) { |
| 6825 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6826 | { 0x18, 0x2181103f }, /* line-in */ |
| 6827 | { }, |
| 6828 | }, |
| 6829 | .chained = true, |
| 6830 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED |
| 6831 | }, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6832 | [ALC280_FIXUP_HP_9480M] = { |
| 6833 | .type = HDA_FIXUP_FUNC, |
| 6834 | .v.func = alc280_fixup_hp_9480m, |
| 6835 | }, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6836 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
| 6837 | .type = HDA_FIXUP_FUNC, |
| 6838 | .v.func = alc_fixup_headset_mode_dell_alc288, |
| 6839 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6840 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6841 | }, |
| 6842 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6843 | .type = HDA_FIXUP_PINS, |
| 6844 | .v.pins = (const struct hda_pintbl[]) { |
| 6845 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6846 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6847 | { } |
| 6848 | }, |
| 6849 | .chained = true, |
| 6850 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE |
| 6851 | }, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6852 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
| 6853 | .type = HDA_FIXUP_FUNC, |
| 6854 | .v.func = alc_fixup_disable_aamix, |
| 6855 | .chained = true, |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 6856 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6857 | }, |
| 6858 | [ALC288_FIXUP_DELL_XPS_13] = { |
| 6859 | .type = HDA_FIXUP_FUNC, |
| 6860 | .v.func = alc_fixup_dell_xps13, |
| 6861 | .chained = true, |
| 6862 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX |
| 6863 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6864 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
| 6865 | .type = HDA_FIXUP_FUNC, |
| 6866 | .v.func = alc_fixup_disable_aamix, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6867 | .chained = true, |
| 6868 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6869 | }, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6870 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
| 6871 | .type = HDA_FIXUP_FUNC, |
| 6872 | .v.func = alc_fixup_disable_aamix, |
| 6873 | .chained = true, |
| 6874 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6875 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6876 | [ALC292_FIXUP_DELL_E7X_AAMIX] = { |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6877 | .type = HDA_FIXUP_FUNC, |
| 6878 | .v.func = alc_fixup_dell_xps13, |
| 6879 | .chained = true, |
| 6880 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX |
| 6881 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6882 | [ALC292_FIXUP_DELL_E7X] = { |
| 6883 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 6884 | .v.func = alc_fixup_micmute_led, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6885 | /* micmute fixup must be applied at last */ |
| 6886 | .chained_before = true, |
| 6887 | .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, |
| 6888 | }, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 6889 | [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { |
| 6890 | .type = HDA_FIXUP_PINS, |
| 6891 | .v.pins = (const struct hda_pintbl[]) { |
| 6892 | { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 6893 | { } |
| 6894 | }, |
| 6895 | .chained_before = true, |
| 6896 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 6897 | }, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6898 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6899 | .type = HDA_FIXUP_PINS, |
| 6900 | .v.pins = (const struct hda_pintbl[]) { |
| 6901 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6902 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6903 | { } |
| 6904 | }, |
| 6905 | .chained = true, |
| 6906 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6907 | }, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6908 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
| 6909 | .type = HDA_FIXUP_PINS, |
| 6910 | .v.pins = (const struct hda_pintbl[]) { |
| 6911 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6912 | { } |
| 6913 | }, |
| 6914 | .chained = true, |
| 6915 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6916 | }, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6917 | [ALC275_FIXUP_DELL_XPS] = { |
| 6918 | .type = HDA_FIXUP_VERBS, |
| 6919 | .v.verbs = (const struct hda_verb[]) { |
| 6920 | /* Enables internal speaker */ |
| 6921 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, |
| 6922 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, |
| 6923 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, |
| 6924 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, |
| 6925 | {} |
| 6926 | } |
| 6927 | }, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6928 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
| 6929 | .type = HDA_FIXUP_FUNC, |
| 6930 | .v.func = alc_fixup_disable_aamix, |
| 6931 | .chained = true, |
| 6932 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 6933 | }, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6934 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
| 6935 | .type = HDA_FIXUP_FUNC, |
| 6936 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, |
| 6937 | }, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6938 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
| 6939 | .type = HDA_FIXUP_FUNC, |
| 6940 | .v.func = alc_fixup_disable_aamix, |
| 6941 | .chained = true, |
| 6942 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6943 | }, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6944 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
| 6945 | .type = HDA_FIXUP_FUNC, |
| 6946 | .v.func = alc_fixup_disable_mic_vref, |
| 6947 | .chained = true, |
| 6948 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6949 | }, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6950 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6951 | .type = HDA_FIXUP_VERBS, |
| 6952 | .v.verbs = (const struct hda_verb[]) { |
| 6953 | /* Disable pass-through path for FRONT 14h */ |
| 6954 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 6955 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 6956 | {} |
| 6957 | }, |
| 6958 | .chained = true, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6959 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6960 | }, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6961 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
| 6962 | .type = HDA_FIXUP_FUNC, |
| 6963 | .v.func = alc_fixup_disable_aamix, |
| 6964 | .chained = true, |
| 6965 | .chain_id = ALC269_FIXUP_HEADSET_MIC, |
| 6966 | }, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6967 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
| 6968 | .type = HDA_FIXUP_PINS, |
| 6969 | .v.pins = (const struct hda_pintbl[]) { |
| 6970 | { 0x19, 0x02a19020 }, /* Front Mic */ |
| 6971 | { } |
| 6972 | }, |
| 6973 | }, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6974 | [ALC292_FIXUP_TPT460] = { |
| 6975 | .type = HDA_FIXUP_FUNC, |
| 6976 | .v.func = alc_fixup_tpt440_dock, |
| 6977 | .chained = true, |
| 6978 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, |
| 6979 | }, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6980 | [ALC298_FIXUP_SPK_VOLUME] = { |
| 6981 | .type = HDA_FIXUP_FUNC, |
| 6982 | .v.func = alc298_fixup_speaker_volume, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 6983 | .chained = true, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6984 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6985 | }, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6986 | [ALC295_FIXUP_DISABLE_DAC3] = { |
| 6987 | .type = HDA_FIXUP_FUNC, |
| 6988 | .v.func = alc295_fixup_disable_dac3, |
| 6989 | }, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6990 | [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { |
| 6991 | .type = HDA_FIXUP_FUNC, |
| 6992 | .v.func = alc285_fixup_speaker2_to_dac1, |
Hui Wang | c37c0ab | 2020-02-19 13:23:06 +0800 | [diff] [blame] | 6993 | .chained = true, |
| 6994 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6995 | }, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6996 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
| 6997 | .type = HDA_FIXUP_PINS, |
| 6998 | .v.pins = (const struct hda_pintbl[]) { |
| 6999 | { 0x1b, 0x90170151 }, |
| 7000 | { } |
| 7001 | }, |
| 7002 | .chained = true, |
| 7003 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7004 | }, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 7005 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
| 7006 | .type = HDA_FIXUP_FUNC, |
| 7007 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7008 | .chained = true, |
| 7009 | .chain_id = ALC269_FIXUP_NO_SHUTUP |
| 7010 | }, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 7011 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
| 7012 | .type = HDA_FIXUP_PINS, |
| 7013 | .v.pins = (const struct hda_pintbl[]) { |
| 7014 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7015 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7016 | { } |
| 7017 | }, |
| 7018 | .chained = true, |
| 7019 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7020 | }, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7021 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
| 7022 | .type = HDA_FIXUP_FUNC, |
| 7023 | .v.func = alc_fixup_headset_mode, |
| 7024 | }, |
| 7025 | [ALC256_FIXUP_ASUS_MIC] = { |
| 7026 | .type = HDA_FIXUP_PINS, |
| 7027 | .v.pins = (const struct hda_pintbl[]) { |
| 7028 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 7029 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7030 | { } |
| 7031 | }, |
| 7032 | .chained = true, |
| 7033 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7034 | }, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7035 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 7036 | .type = HDA_FIXUP_FUNC, |
| 7037 | /* Set up GPIO2 for the speaker amp */ |
| 7038 | .v.func = alc_fixup_gpio4, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7039 | }, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 7040 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7041 | .type = HDA_FIXUP_PINS, |
| 7042 | .v.pins = (const struct hda_pintbl[]) { |
| 7043 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7044 | { } |
| 7045 | }, |
| 7046 | .chained = true, |
| 7047 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7048 | }, |
| 7049 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { |
| 7050 | .type = HDA_FIXUP_VERBS, |
| 7051 | .v.verbs = (const struct hda_verb[]) { |
| 7052 | /* Enables internal speaker */ |
| 7053 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, |
| 7054 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, |
| 7055 | {} |
| 7056 | }, |
| 7057 | .chained = true, |
| 7058 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 7059 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7060 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
| 7061 | .type = HDA_FIXUP_FUNC, |
| 7062 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame^] | 7063 | .chained = true, |
| 7064 | .chain_id = ALC269_FIXUP_GPIO2 |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7065 | }, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 7066 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
| 7067 | .type = HDA_FIXUP_VERBS, |
| 7068 | .v.verbs = (const struct hda_verb[]) { |
| 7069 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 7070 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 7071 | { } |
| 7072 | }, |
| 7073 | .chained = true, |
| 7074 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 7075 | }, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 7076 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
| 7077 | .type = HDA_FIXUP_PINS, |
| 7078 | .v.pins = (const struct hda_pintbl[]) { |
| 7079 | /* Change the mic location from front to right, otherwise there are |
| 7080 | two front mics with the same name, pulseaudio can't handle them. |
| 7081 | This is just a temporary workaround, after applying this fixup, |
| 7082 | there will be one "Front Mic" and one "Mic" in this machine. |
| 7083 | */ |
| 7084 | { 0x1a, 0x04a19040 }, |
| 7085 | { } |
| 7086 | }, |
| 7087 | }, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 7088 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
| 7089 | .type = HDA_FIXUP_PINS, |
| 7090 | .v.pins = (const struct hda_pintbl[]) { |
| 7091 | { 0x16, 0x0101102f }, /* Rear Headset HP */ |
| 7092 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 7093 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ |
| 7094 | { 0x1b, 0x02011020 }, |
| 7095 | { } |
| 7096 | }, |
| 7097 | .chained = true, |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 7098 | .chain_id = ALC225_FIXUP_S3_POP_NOISE |
| 7099 | }, |
| 7100 | [ALC225_FIXUP_S3_POP_NOISE] = { |
| 7101 | .type = HDA_FIXUP_FUNC, |
| 7102 | .v.func = alc225_fixup_s3_pop_noise, |
| 7103 | .chained = true, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 7104 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7105 | }, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 7106 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
| 7107 | .type = HDA_FIXUP_VERBS, |
| 7108 | .v.verbs = (const struct hda_verb[]) { |
| 7109 | /* Enables internal speaker */ |
| 7110 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, |
| 7111 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, |
| 7112 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, |
| 7113 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, |
| 7114 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, |
| 7115 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, |
| 7116 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, |
| 7117 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, |
| 7118 | {} |
| 7119 | } |
| 7120 | }, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 7121 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
| 7122 | .type = HDA_FIXUP_FUNC, |
| 7123 | .v.func = alc274_fixup_bind_dacs, |
| 7124 | .chained = true, |
| 7125 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7126 | }, |
| 7127 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { |
| 7128 | .type = HDA_FIXUP_PINS, |
| 7129 | .v.pins = (const struct hda_pintbl[]) { |
| 7130 | { 0x1b, 0x0401102f }, |
| 7131 | { } |
| 7132 | }, |
| 7133 | .chained = true, |
| 7134 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS |
| 7135 | }, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 7136 | [ALC298_FIXUP_TPT470_DOCK_FIX] = { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7137 | .type = HDA_FIXUP_FUNC, |
| 7138 | .v.func = alc_fixup_tpt470_dock, |
| 7139 | .chained = true, |
| 7140 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE |
| 7141 | }, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 7142 | [ALC298_FIXUP_TPT470_DOCK] = { |
| 7143 | .type = HDA_FIXUP_FUNC, |
| 7144 | .v.func = alc_fixup_tpt470_dacs, |
| 7145 | .chained = true, |
| 7146 | .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX |
| 7147 | }, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 7148 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
| 7149 | .type = HDA_FIXUP_PINS, |
| 7150 | .v.pins = (const struct hda_pintbl[]) { |
| 7151 | { 0x14, 0x0201101f }, |
| 7152 | { } |
| 7153 | }, |
| 7154 | .chained = true, |
| 7155 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7156 | }, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7157 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
| 7158 | .type = HDA_FIXUP_PINS, |
| 7159 | .v.pins = (const struct hda_pintbl[]) { |
| 7160 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7161 | { } |
| 7162 | }, |
Hui Wang | 3ce0d5a | 2018-04-19 13:29:04 +0800 | [diff] [blame] | 7163 | .chained = true, |
| 7164 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7165 | }, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 7166 | [ALC295_FIXUP_HP_X360] = { |
| 7167 | .type = HDA_FIXUP_FUNC, |
| 7168 | .v.func = alc295_fixup_hp_top_speakers, |
| 7169 | .chained = true, |
| 7170 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 7171 | }, |
| 7172 | [ALC221_FIXUP_HP_HEADSET_MIC] = { |
| 7173 | .type = HDA_FIXUP_PINS, |
| 7174 | .v.pins = (const struct hda_pintbl[]) { |
| 7175 | { 0x19, 0x0181313f}, |
| 7176 | { } |
| 7177 | }, |
| 7178 | .chained = true, |
| 7179 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7180 | }, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7181 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
| 7182 | .type = HDA_FIXUP_FUNC, |
| 7183 | .v.func = alc285_fixup_invalidate_dacs, |
Hui Wang | 6ba189c | 2018-12-09 09:16:43 +0800 | [diff] [blame] | 7184 | .chained = true, |
| 7185 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7186 | }, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 7187 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
| 7188 | .type = HDA_FIXUP_FUNC, |
| 7189 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7190 | }, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 7191 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
| 7192 | .type = HDA_FIXUP_PINS, |
| 7193 | .v.pins = (const struct hda_pintbl[]) { |
| 7194 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7195 | { } |
| 7196 | }, |
| 7197 | .chained = true, |
| 7198 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7199 | }, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7200 | [ALC294_FIXUP_ASUS_MIC] = { |
| 7201 | .type = HDA_FIXUP_PINS, |
| 7202 | .v.pins = (const struct hda_pintbl[]) { |
| 7203 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 7204 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7205 | { } |
| 7206 | }, |
| 7207 | .chained = true, |
Kailang Yang | ef9ddb9 | 2020-07-10 15:31:11 +0800 | [diff] [blame] | 7208 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7209 | }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7210 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
| 7211 | .type = HDA_FIXUP_PINS, |
| 7212 | .v.pins = (const struct hda_pintbl[]) { |
Jian-Hong Pan | 82b0114 | 2018-12-27 16:46:31 +0800 | [diff] [blame] | 7213 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7214 | { } |
| 7215 | }, |
| 7216 | .chained = true, |
Kailang Yang | ef9ddb9 | 2020-07-10 15:31:11 +0800 | [diff] [blame] | 7217 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7218 | }, |
| 7219 | [ALC294_FIXUP_ASUS_SPK] = { |
| 7220 | .type = HDA_FIXUP_VERBS, |
| 7221 | .v.verbs = (const struct hda_verb[]) { |
| 7222 | /* Set EAPD high */ |
| 7223 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, |
| 7224 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, |
Kailang Yang | 473fbe13 | 2020-07-16 14:42:33 +0800 | [diff] [blame] | 7225 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 7226 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7227 | { } |
| 7228 | }, |
| 7229 | .chained = true, |
| 7230 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7231 | }, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 7232 | [ALC295_FIXUP_CHROME_BOOK] = { |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 7233 | .type = HDA_FIXUP_FUNC, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 7234 | .v.func = alc295_fixup_chromebook, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 7235 | .chained = true, |
| 7236 | .chain_id = ALC225_FIXUP_HEADSET_JACK |
| 7237 | }, |
| 7238 | [ALC225_FIXUP_HEADSET_JACK] = { |
| 7239 | .type = HDA_FIXUP_FUNC, |
| 7240 | .v.func = alc_fixup_headset_jack, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 7241 | }, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 7242 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
| 7243 | .type = HDA_FIXUP_PINS, |
| 7244 | .v.pins = (const struct hda_pintbl[]) { |
| 7245 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7246 | { } |
| 7247 | }, |
| 7248 | .chained = true, |
| 7249 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7250 | }, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 7251 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
| 7252 | .type = HDA_FIXUP_VERBS, |
| 7253 | .v.verbs = (const struct hda_verb[]) { |
| 7254 | /* Disable PCBEEP-IN passthrough */ |
| 7255 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 7256 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 7257 | { } |
| 7258 | }, |
| 7259 | .chained = true, |
| 7260 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
| 7261 | }, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 7262 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
| 7263 | .type = HDA_FIXUP_PINS, |
| 7264 | .v.pins = (const struct hda_pintbl[]) { |
| 7265 | { 0x19, 0x03a11130 }, |
| 7266 | { 0x1a, 0x90a60140 }, /* use as internal mic */ |
| 7267 | { } |
| 7268 | }, |
| 7269 | .chained = true, |
| 7270 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7271 | }, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 7272 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
| 7273 | .type = HDA_FIXUP_PINS, |
| 7274 | .v.pins = (const struct hda_pintbl[]) { |
| 7275 | { 0x16, 0x01011020 }, /* Rear Line out */ |
| 7276 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 7277 | { } |
| 7278 | }, |
| 7279 | .chained = true, |
| 7280 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE |
| 7281 | }, |
| 7282 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { |
| 7283 | .type = HDA_FIXUP_FUNC, |
| 7284 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7285 | .chained = true, |
| 7286 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF |
| 7287 | }, |
| 7288 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { |
| 7289 | .type = HDA_FIXUP_FUNC, |
| 7290 | .v.func = alc_fixup_disable_mic_vref, |
| 7291 | .chained = true, |
| 7292 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7293 | }, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 7294 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
| 7295 | .type = HDA_FIXUP_VERBS, |
| 7296 | .v.verbs = (const struct hda_verb[]) { |
| 7297 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, |
| 7298 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, |
| 7299 | { } |
| 7300 | }, |
| 7301 | .chained = true, |
| 7302 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE |
| 7303 | }, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 7304 | [ALC256_FIXUP_ASUS_HEADSET_MIC] = { |
| 7305 | .type = HDA_FIXUP_PINS, |
| 7306 | .v.pins = (const struct hda_pintbl[]) { |
| 7307 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 7308 | { } |
| 7309 | }, |
| 7310 | .chained = true, |
| 7311 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7312 | }, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 7313 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7314 | .type = HDA_FIXUP_PINS, |
| 7315 | .v.pins = (const struct hda_pintbl[]) { |
| 7316 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7317 | { } |
| 7318 | }, |
| 7319 | .chained = true, |
| 7320 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7321 | }, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7322 | [ALC299_FIXUP_PREDATOR_SPK] = { |
| 7323 | .type = HDA_FIXUP_PINS, |
| 7324 | .v.pins = (const struct hda_pintbl[]) { |
| 7325 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ |
| 7326 | { } |
| 7327 | } |
| 7328 | }, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 7329 | [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { |
| 7330 | .type = HDA_FIXUP_PINS, |
| 7331 | .v.pins = (const struct hda_pintbl[]) { |
| 7332 | { 0x19, 0x04a11040 }, |
| 7333 | { 0x21, 0x04211020 }, |
| 7334 | { } |
| 7335 | }, |
| 7336 | .chained = true, |
| 7337 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7338 | }, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 7339 | [ALC289_FIXUP_DELL_SPK2] = { |
| 7340 | .type = HDA_FIXUP_PINS, |
| 7341 | .v.pins = (const struct hda_pintbl[]) { |
| 7342 | { 0x17, 0x90170130 }, /* bass spk */ |
| 7343 | { } |
| 7344 | }, |
| 7345 | .chained = true, |
| 7346 | .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE |
| 7347 | }, |
| 7348 | [ALC289_FIXUP_DUAL_SPK] = { |
| 7349 | .type = HDA_FIXUP_FUNC, |
| 7350 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 7351 | .chained = true, |
| 7352 | .chain_id = ALC289_FIXUP_DELL_SPK2 |
| 7353 | }, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7354 | [ALC294_FIXUP_SPK2_TO_DAC1] = { |
| 7355 | .type = HDA_FIXUP_FUNC, |
| 7356 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 7357 | .chained = true, |
| 7358 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7359 | }, |
| 7360 | [ALC294_FIXUP_ASUS_DUAL_SPK] = { |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 7361 | .type = HDA_FIXUP_FUNC, |
| 7362 | /* The GPIO must be pulled to initialize the AMP */ |
| 7363 | .v.func = alc_fixup_gpio4, |
| 7364 | .chained = true, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7365 | .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 7366 | }, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 7367 | [ALC285_FIXUP_THINKPAD_X1_GEN7] = { |
| 7368 | .type = HDA_FIXUP_FUNC, |
| 7369 | .v.func = alc285_fixup_thinkpad_x1_gen7, |
| 7370 | .chained = true, |
| 7371 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 7372 | }, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 7373 | [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { |
| 7374 | .type = HDA_FIXUP_FUNC, |
| 7375 | .v.func = alc_fixup_headset_jack, |
| 7376 | .chained = true, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 7377 | .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 7378 | }, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 7379 | [ALC294_FIXUP_ASUS_HPE] = { |
| 7380 | .type = HDA_FIXUP_VERBS, |
| 7381 | .v.verbs = (const struct hda_verb[]) { |
| 7382 | /* Set EAPD high */ |
| 7383 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 7384 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, |
| 7385 | { } |
| 7386 | }, |
| 7387 | .chained = true, |
| 7388 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 7389 | }, |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 7390 | [ALC294_FIXUP_ASUS_GX502_PINS] = { |
| 7391 | .type = HDA_FIXUP_PINS, |
| 7392 | .v.pins = (const struct hda_pintbl[]) { |
| 7393 | { 0x19, 0x03a11050 }, /* front HP mic */ |
| 7394 | { 0x1a, 0x01a11830 }, /* rear external mic */ |
| 7395 | { 0x21, 0x03211020 }, /* front HP out */ |
| 7396 | { } |
| 7397 | }, |
| 7398 | .chained = true, |
| 7399 | .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS |
| 7400 | }, |
| 7401 | [ALC294_FIXUP_ASUS_GX502_VERBS] = { |
| 7402 | .type = HDA_FIXUP_VERBS, |
| 7403 | .v.verbs = (const struct hda_verb[]) { |
| 7404 | /* set 0x15 to HP-OUT ctrl */ |
| 7405 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, |
| 7406 | /* unmute the 0x15 amp */ |
| 7407 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, |
| 7408 | { } |
| 7409 | }, |
| 7410 | .chained = true, |
| 7411 | .chain_id = ALC294_FIXUP_ASUS_GX502_HP |
| 7412 | }, |
| 7413 | [ALC294_FIXUP_ASUS_GX502_HP] = { |
| 7414 | .type = HDA_FIXUP_FUNC, |
| 7415 | .v.func = alc294_fixup_gx502_hp, |
| 7416 | }, |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 7417 | [ALC294_FIXUP_ASUS_COEF_1B] = { |
| 7418 | .type = HDA_FIXUP_VERBS, |
| 7419 | .v.verbs = (const struct hda_verb[]) { |
| 7420 | /* Set bit 10 to correct noisy output after reboot from |
| 7421 | * Windows 10 (due to pop noise reduction?) |
| 7422 | */ |
| 7423 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, |
| 7424 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, |
| 7425 | { } |
| 7426 | }, |
| 7427 | }, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 7428 | [ALC285_FIXUP_HP_GPIO_LED] = { |
| 7429 | .type = HDA_FIXUP_FUNC, |
| 7430 | .v.func = alc285_fixup_hp_gpio_led, |
| 7431 | }, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 7432 | [ALC285_FIXUP_HP_MUTE_LED] = { |
| 7433 | .type = HDA_FIXUP_FUNC, |
| 7434 | .v.func = alc285_fixup_hp_mute_led, |
| 7435 | }, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 7436 | [ALC236_FIXUP_HP_MUTE_LED] = { |
| 7437 | .type = HDA_FIXUP_FUNC, |
| 7438 | .v.func = alc236_fixup_hp_mute_led, |
| 7439 | }, |
Mike Pozulp | 14425f1 | 2020-05-09 20:28:37 -0700 | [diff] [blame] | 7440 | [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { |
| 7441 | .type = HDA_FIXUP_VERBS, |
| 7442 | .v.verbs = (const struct hda_verb[]) { |
| 7443 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, |
| 7444 | { } |
| 7445 | }, |
| 7446 | }, |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 7447 | [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7448 | .type = HDA_FIXUP_PINS, |
| 7449 | .v.pins = (const struct hda_pintbl[]) { |
| 7450 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7451 | { } |
| 7452 | }, |
| 7453 | .chained = true, |
| 7454 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7455 | }, |
Jian-Hong Pan | 8eae7e9 | 2020-07-06 15:18:25 +0800 | [diff] [blame] | 7456 | [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { |
| 7457 | .type = HDA_FIXUP_PINS, |
| 7458 | .v.pins = (const struct hda_pintbl[]) { |
| 7459 | { 0x14, 0x90100120 }, /* use as internal speaker */ |
| 7460 | { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ |
| 7461 | { 0x1a, 0x01011020 }, /* use as line out */ |
| 7462 | { }, |
| 7463 | }, |
| 7464 | .chained = true, |
| 7465 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7466 | }, |
Jian-Hong Pan | 6e15d12 | 2020-07-06 15:18:27 +0800 | [diff] [blame] | 7467 | [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { |
| 7468 | .type = HDA_FIXUP_PINS, |
| 7469 | .v.pins = (const struct hda_pintbl[]) { |
| 7470 | { 0x18, 0x02a11030 }, /* use as headset mic */ |
| 7471 | { } |
| 7472 | }, |
| 7473 | .chained = true, |
| 7474 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7475 | }, |
Jian-Hong Pan | 781c90c | 2020-07-06 15:18:29 +0800 | [diff] [blame] | 7476 | [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 7477 | .type = HDA_FIXUP_PINS, |
| 7478 | .v.pins = (const struct hda_pintbl[]) { |
| 7479 | { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ |
| 7480 | { } |
| 7481 | }, |
| 7482 | .chained = true, |
| 7483 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7484 | }, |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 7485 | [ALC289_FIXUP_ASUS_GA401] = { |
Armas Spann | ff53664 | 2020-07-11 13:05:57 +0200 | [diff] [blame] | 7486 | .type = HDA_FIXUP_PINS, |
| 7487 | .v.pins = (const struct hda_pintbl[]) { |
| 7488 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 7489 | { } |
| 7490 | }, |
| 7491 | }, |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 7492 | [ALC289_FIXUP_ASUS_GA502] = { |
| 7493 | .type = HDA_FIXUP_PINS, |
| 7494 | .v.pins = (const struct hda_pintbl[]) { |
| 7495 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 7496 | { } |
| 7497 | }, |
| 7498 | }, |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 7499 | [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 7500 | .type = HDA_FIXUP_PINS, |
| 7501 | .v.pins = (const struct hda_pintbl[]) { |
| 7502 | { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ |
| 7503 | { } |
| 7504 | }, |
| 7505 | .chained = true, |
| 7506 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7507 | }, |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 7508 | [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { |
| 7509 | .type = HDA_FIXUP_FUNC, |
| 7510 | .v.func = alc285_fixup_hp_gpio_amp_init, |
| 7511 | .chained = true, |
| 7512 | .chain_id = ALC285_FIXUP_HP_GPIO_LED |
| 7513 | }, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 7514 | [ALC269_FIXUP_CZC_B20] = { |
| 7515 | .type = HDA_FIXUP_PINS, |
| 7516 | .v.pins = (const struct hda_pintbl[]) { |
| 7517 | { 0x12, 0x411111f0 }, |
| 7518 | { 0x14, 0x90170110 }, /* speaker */ |
| 7519 | { 0x15, 0x032f1020 }, /* HP out */ |
| 7520 | { 0x17, 0x411111f0 }, |
| 7521 | { 0x18, 0x03ab1040 }, /* mic */ |
| 7522 | { 0x19, 0xb7a7013f }, |
| 7523 | { 0x1a, 0x0181305f }, |
| 7524 | { 0x1b, 0x411111f0 }, |
| 7525 | { 0x1d, 0x411111f0 }, |
| 7526 | { 0x1e, 0x411111f0 }, |
| 7527 | { } |
| 7528 | }, |
| 7529 | .chain_id = ALC269_FIXUP_DMIC, |
| 7530 | }, |
| 7531 | [ALC269_FIXUP_CZC_TMI] = { |
| 7532 | .type = HDA_FIXUP_PINS, |
| 7533 | .v.pins = (const struct hda_pintbl[]) { |
| 7534 | { 0x12, 0x4000c000 }, |
| 7535 | { 0x14, 0x90170110 }, /* speaker */ |
| 7536 | { 0x15, 0x0421401f }, /* HP out */ |
| 7537 | { 0x17, 0x411111f0 }, |
| 7538 | { 0x18, 0x04a19020 }, /* mic */ |
| 7539 | { 0x19, 0x411111f0 }, |
| 7540 | { 0x1a, 0x411111f0 }, |
| 7541 | { 0x1b, 0x411111f0 }, |
| 7542 | { 0x1d, 0x40448505 }, |
| 7543 | { 0x1e, 0x411111f0 }, |
| 7544 | { 0x20, 0x8000ffff }, |
| 7545 | { } |
| 7546 | }, |
| 7547 | .chain_id = ALC269_FIXUP_DMIC, |
| 7548 | }, |
| 7549 | [ALC269_FIXUP_CZC_L101] = { |
| 7550 | .type = HDA_FIXUP_PINS, |
| 7551 | .v.pins = (const struct hda_pintbl[]) { |
| 7552 | { 0x12, 0x40000000 }, |
| 7553 | { 0x14, 0x01014010 }, /* speaker */ |
| 7554 | { 0x15, 0x411111f0 }, /* HP out */ |
| 7555 | { 0x16, 0x411111f0 }, |
| 7556 | { 0x18, 0x01a19020 }, /* mic */ |
| 7557 | { 0x19, 0x02a19021 }, |
| 7558 | { 0x1a, 0x0181302f }, |
| 7559 | { 0x1b, 0x0221401f }, |
| 7560 | { 0x1c, 0x411111f0 }, |
| 7561 | { 0x1d, 0x4044c601 }, |
| 7562 | { 0x1e, 0x411111f0 }, |
| 7563 | { } |
| 7564 | }, |
| 7565 | .chain_id = ALC269_FIXUP_DMIC, |
| 7566 | }, |
| 7567 | [ALC269_FIXUP_LEMOTE_A1802] = { |
| 7568 | .type = HDA_FIXUP_PINS, |
| 7569 | .v.pins = (const struct hda_pintbl[]) { |
| 7570 | { 0x12, 0x40000000 }, |
| 7571 | { 0x14, 0x90170110 }, /* speaker */ |
| 7572 | { 0x17, 0x411111f0 }, |
| 7573 | { 0x18, 0x03a19040 }, /* mic1 */ |
| 7574 | { 0x19, 0x90a70130 }, /* mic2 */ |
| 7575 | { 0x1a, 0x411111f0 }, |
| 7576 | { 0x1b, 0x411111f0 }, |
| 7577 | { 0x1d, 0x40489d2d }, |
| 7578 | { 0x1e, 0x411111f0 }, |
| 7579 | { 0x20, 0x0003ffff }, |
| 7580 | { 0x21, 0x03214020 }, |
| 7581 | { } |
| 7582 | }, |
| 7583 | .chain_id = ALC269_FIXUP_DMIC, |
| 7584 | }, |
| 7585 | [ALC269_FIXUP_LEMOTE_A190X] = { |
| 7586 | .type = HDA_FIXUP_PINS, |
| 7587 | .v.pins = (const struct hda_pintbl[]) { |
| 7588 | { 0x14, 0x99130110 }, /* speaker */ |
| 7589 | { 0x15, 0x0121401f }, /* HP out */ |
| 7590 | { 0x18, 0x01a19c20 }, /* rear mic */ |
| 7591 | { 0x19, 0x99a3092f }, /* front mic */ |
| 7592 | { 0x1b, 0x0201401f }, /* front lineout */ |
| 7593 | { } |
| 7594 | }, |
| 7595 | .chain_id = ALC269_FIXUP_DMIC, |
| 7596 | }, |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 7597 | [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { |
| 7598 | .type = HDA_FIXUP_PINS, |
| 7599 | .v.pins = (const struct hda_pintbl[]) { |
| 7600 | { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7601 | { } |
| 7602 | }, |
| 7603 | .chained = true, |
| 7604 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7605 | }, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 7606 | [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { |
| 7607 | .type = HDA_FIXUP_VERBS, |
| 7608 | .v.verbs = (const struct hda_verb[]) { |
| 7609 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 7610 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 7611 | { } |
| 7612 | }, |
| 7613 | .chained = true, |
| 7614 | .chain_id = ALC289_FIXUP_ASUS_GA401 |
| 7615 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7616 | }; |
| 7617 | |
| 7618 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 7619 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 7620 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 7621 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7622 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 7623 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
| 7624 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7625 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 7626 | 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] | 7627 | 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] | 7628 | 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] | 7629 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
Chris Chiu | 705b65f | 2018-12-05 14:48:54 +0800 | [diff] [blame] | 7630 | 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] | 7631 | 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] | 7632 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
Chris Chiu | c7531e3 | 2019-03-21 17:17:31 +0800 | [diff] [blame] | 7633 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
| 7634 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7635 | 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] | 7636 | 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] | 7637 | SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 7638 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 7639 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 7640 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
Jian-Hong Pan | 2733cce | 2019-03-21 16:39:04 +0800 | [diff] [blame] | 7641 | 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] | 7642 | 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] | 7643 | 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] | 7644 | 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] | 7645 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 7646 | 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] | 7647 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | cf52103 | 2016-01-15 12:59:25 +0100 | [diff] [blame] | 7648 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7649 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
| 7650 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7651 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7652 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7653 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7654 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7655 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 7656 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Takashi Iwai | 9807057 | 2016-01-12 21:06:39 +0100 | [diff] [blame] | 7657 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 4275554 | 2015-06-29 10:56:53 +0200 | [diff] [blame] | 7658 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7659 | 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] | 7660 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7661 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7662 | 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] | 7663 | 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] | 7664 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Kailang Yang | 8b72415 | 2014-12-17 17:08:59 +0800 | [diff] [blame] | 7665 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 7666 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7667 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 7668 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7669 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7670 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7671 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 7672 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 7673 | 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] | 7674 | 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] | 7675 | 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] | 7676 | 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] | 7677 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 7678 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
Takashi Iwai | 493de34 | 2017-02-28 17:27:57 +0100 | [diff] [blame] | 7679 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 7680 | 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] | 7681 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
| 7682 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7683 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
| 7684 | 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] | 7685 | 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] | 7686 | 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] | 7687 | 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] | 7688 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 7689 | SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
| 7690 | SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
Kailang Yang | 78def22 | 2020-02-20 15:21:54 +0800 | [diff] [blame] | 7691 | SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 7692 | SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 7693 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 7694 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 7695 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 7696 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 7697 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 7698 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7699 | /* ALC282 */ |
Hui Wang | 7976eb4 | 2015-02-13 11:14:41 +0800 | [diff] [blame] | 7700 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7701 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7702 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7703 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 7704 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 7705 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 7706 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7707 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7708 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7709 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7710 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7711 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 7712 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 7713 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
TienFu Chen | 3271cb2 | 2015-02-10 09:09:41 +0100 | [diff] [blame] | 7714 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7715 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7716 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7717 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7718 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7719 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 7720 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7721 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7722 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7723 | /* ALC290 */ |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7724 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7725 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7726 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7727 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7728 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7729 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7730 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7731 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7732 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7733 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7734 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7735 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7736 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7737 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7738 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 7739 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7740 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7741 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7742 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7743 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7744 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7745 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7746 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7747 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 7748 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 7749 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7750 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7751 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 7752 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 7753 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 7754 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 7755 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
Takashi Iwai | 563785e | 2018-11-12 09:43:12 +0100 | [diff] [blame] | 7756 | 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] | 7757 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 7758 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 7759 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 7760 | 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] | 7761 | 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] | 7762 | 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] | 7763 | 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] | 7764 | SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
| 7765 | SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 7766 | SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 7767 | SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 7768 | SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7769 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 7770 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 7771 | 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] | 7772 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7773 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 7774 | 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] | 7775 | 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] | 7776 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 7777 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
| 7778 | 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] | 7779 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
| 7780 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
| 7781 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 7782 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 7783 | 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] | 7784 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 7785 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 7786 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Adam Barber | 4963d66 | 2020-04-10 17:00:32 +0800 | [diff] [blame] | 7787 | SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Kailang Yang | 158ae2f | 2020-07-16 15:21:59 +0800 | [diff] [blame] | 7788 | SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 7789 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), |
Jian-Hong Pan | 7900e81 | 2020-05-12 14:15:28 +0800 | [diff] [blame] | 7790 | 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] | 7791 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
Chris Chiu | 28e8af8 | 2017-06-05 15:05:30 -0600 | [diff] [blame] | 7792 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 7793 | SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 7794 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 7795 | 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] | 7796 | 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] | 7797 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 7798 | SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 7799 | SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 7800 | SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7801 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 7802 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 7803 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 7804 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 7805 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 7806 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | f88abaa | 2014-02-07 12:07:59 +0100 | [diff] [blame] | 7807 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 7808 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7809 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 7810 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 7811 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 7812 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 7813 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 7814 | 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] | 7815 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Takashi Iwai | 88776f3 | 2015-05-01 09:20:34 +0200 | [diff] [blame] | 7816 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 7817 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 7818 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 7819 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
PeiSen Hou | 6fa38ef | 2020-07-27 13:56:47 +0200 | [diff] [blame] | 7820 | SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
YOKOTA Hiroshi | 0fca97a | 2018-07-01 18:30:01 +0900 | [diff] [blame] | 7821 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 7822 | 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] | 7823 | SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
| 7824 | 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] | 7825 | 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] | 7826 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
| 7827 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 7828 | 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] | 7829 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 7830 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
| 7831 | 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] | 7832 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 7833 | SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 80a5052 | 2019-05-07 17:11:08 -0400 | [diff] [blame] | 7834 | 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] | 7835 | SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 7836 | SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
| 7837 | SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7838 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
Hui Wang | ef0b320 | 2020-04-27 11:00:39 +0800 | [diff] [blame] | 7839 | SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7840 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 7841 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 7842 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 7843 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 7844 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 7845 | 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] | 7846 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Stefán Freyr | 84f98fd | 2012-10-19 22:46:00 +0200 | [diff] [blame] | 7847 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 7848 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7849 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7850 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7851 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7852 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 7853 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Rick Sherman | 59a51a6 | 2015-08-18 21:04:30 -0500 | [diff] [blame] | 7854 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 7855 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 7856 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 7857 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | b6903c0 | 2015-12-10 12:20:20 +0100 | [diff] [blame] | 7858 | 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] | 7859 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
Yves-Alexis Perez | c027866 | 2015-04-11 09:31:35 +0200 | [diff] [blame] | 7860 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7861 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7862 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Torsten Hilbrich | dab38e4 | 2016-06-07 13:14:21 +0200 | [diff] [blame] | 7863 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7864 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7865 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
| 7866 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7867 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Dennis Wassenberg | e4c07b3 | 2018-03-08 13:17:54 +0100 | [diff] [blame] | 7868 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7869 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7870 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7871 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Benjamin Berg | 85981df | 2018-02-14 13:29:39 +0100 | [diff] [blame] | 7872 | 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] | 7873 | 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] | 7874 | SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 7875 | 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] | 7876 | 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] | 7877 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Dennis Wassenberg | bef33e1 | 2019-06-28 10:54:53 +0200 | [diff] [blame] | 7878 | SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 7879 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Kailang Yang | 6581183 | 2018-04-25 17:07:27 +0800 | [diff] [blame] | 7880 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 8da5bbf | 2017-12-22 11:17:46 +0800 | [diff] [blame] | 7881 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 7882 | SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Aaron Ma | 8a6c55d | 2019-10-24 19:44:39 +0800 | [diff] [blame] | 7883 | SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
| 7884 | SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 7885 | 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] | 7886 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Michał Wadowski | 56df90b | 2019-05-14 16:58:00 +0200 | [diff] [blame] | 7887 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 7888 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 7889 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 7890 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 7891 | 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] | 7892 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
Sebastian Wicki | 80b311d | 2015-03-23 17:23:11 +0100 | [diff] [blame] | 7893 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
Ansgar Hegerfeld | 09ea997 | 2015-05-14 12:31:32 +0200 | [diff] [blame] | 7894 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
Conrad Kostecki | 037e119 | 2016-04-26 10:08:10 +0200 | [diff] [blame] | 7895 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 7896 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 7897 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
Torsten Hilbrich | 9cd2574 | 2016-07-05 10:40:22 +0200 | [diff] [blame] | 7898 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 7899 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7900 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7901 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7902 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 7903 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7904 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7905 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 7906 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7907 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 7908 | 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] | 7909 | SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), |
| 7910 | SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), |
| 7911 | SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 7912 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 7913 | SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
Hui Wang | 695d1ec | 2019-11-21 10:54:27 +0800 | [diff] [blame] | 7914 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 7915 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 7916 | SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
| 7917 | SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 7918 | SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7919 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 7920 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7921 | /* Below is a quirk table taken from the old code. |
| 7922 | * Basically the device should work as is without the fixup table. |
| 7923 | * If BIOS doesn't give a proper info, enable the corresponding |
| 7924 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 7925 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7926 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 7927 | ALC269_FIXUP_AMIC), |
| 7928 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7929 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 7930 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 7931 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 7932 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 7933 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 7934 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 7935 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 7936 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 7937 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 7938 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 7939 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 7940 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 7941 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 7942 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 7943 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 7944 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 7945 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 7946 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 7947 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 7948 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 7949 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 7950 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 7951 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 7952 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 7953 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 7954 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 7955 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 7956 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 7957 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 7958 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 7959 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 7960 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 7961 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 7962 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 7963 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 7964 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 7965 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 7966 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 7967 | #endif |
| 7968 | {} |
| 7969 | }; |
| 7970 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 7971 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 7972 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 7973 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 7974 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 7975 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 7976 | SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 7977 | {} |
| 7978 | }; |
| 7979 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7980 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7981 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 7982 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 7983 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 7984 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 7985 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 7986 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
Takashi Iwai | b016951 | 2015-05-19 10:20:13 +0200 | [diff] [blame] | 7987 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
| 7988 | {.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] | 7989 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 7990 | {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 7991 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7992 | {.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] | 7993 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 7994 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7995 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
| 7996 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 7997 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 7998 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7999 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 8000 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 8001 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 8002 | {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8003 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 8004 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 28d1d6d | 2017-10-18 14:01:58 +0200 | [diff] [blame] | 8005 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8006 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
| 8007 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, |
| 8008 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, |
| 8009 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, |
| 8010 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, |
| 8011 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, |
| 8012 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, |
| 8013 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, |
| 8014 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, |
| 8015 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, |
| 8016 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, |
| 8017 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, |
| 8018 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, |
| 8019 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, |
| 8020 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, |
| 8021 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, |
| 8022 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, |
| 8023 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, |
| 8024 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, |
| 8025 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, |
| 8026 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, |
| 8027 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, |
| 8028 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, |
| 8029 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, |
| 8030 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, |
| 8031 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, |
| 8032 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, |
| 8033 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, |
| 8034 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, |
| 8035 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, |
| 8036 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, |
| 8037 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, |
| 8038 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, |
| 8039 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, |
| 8040 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, |
| 8041 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, |
| 8042 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, |
| 8043 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, |
| 8044 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, |
| 8045 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 8046 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8047 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
| 8048 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
| 8049 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
| 8050 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, |
| 8051 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, |
| 8052 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, |
| 8053 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, |
| 8054 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, |
| 8055 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, |
| 8056 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, |
| 8057 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, |
| 8058 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, |
| 8059 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, |
| 8060 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, |
| 8061 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8062 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
| 8063 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, |
| 8064 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, |
Kailang Yang | 82aa0d7 | 2019-01-11 17:15:53 +0800 | [diff] [blame] | 8065 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8066 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 8067 | {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 8068 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
| 8069 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, |
| 8070 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, |
| 8071 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, |
| 8072 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, |
| 8073 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, |
| 8074 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, |
| 8075 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, |
| 8076 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, |
| 8077 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, |
| 8078 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, |
| 8079 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, |
| 8080 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, |
| 8081 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, |
| 8082 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
| 8083 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
| 8084 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 8085 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
| 8086 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 8087 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 8088 | {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 8089 | {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, |
Mike Pozulp | 23dc958 | 2020-08-16 21:32:17 -0700 | [diff] [blame] | 8090 | {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 8091 | {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8092 | {} |
| 8093 | }; |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8094 | #define ALC225_STANDARD_PINS \ |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8095 | {0x21, 0x04211020} |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8096 | |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 8097 | #define ALC256_STANDARD_PINS \ |
| 8098 | {0x12, 0x90a60140}, \ |
| 8099 | {0x14, 0x90170110}, \ |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 8100 | {0x21, 0x02211020} |
| 8101 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 8102 | #define ALC282_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8103 | {0x14, 0x90170110} |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 8104 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 8105 | #define ALC290_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8106 | {0x12, 0x99a30130} |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 8107 | |
| 8108 | #define ALC292_STANDARD_PINS \ |
| 8109 | {0x14, 0x90170110}, \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8110 | {0x15, 0x0221401f} |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 8111 | |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 8112 | #define ALC295_STANDARD_PINS \ |
| 8113 | {0x12, 0xb7a60130}, \ |
| 8114 | {0x14, 0x90170110}, \ |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 8115 | {0x21, 0x04211020} |
| 8116 | |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 8117 | #define ALC298_STANDARD_PINS \ |
| 8118 | {0x12, 0x90a60130}, \ |
| 8119 | {0x21, 0x03211020} |
| 8120 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 8121 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 8122 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
| 8123 | {0x14, 0x01014020}, |
| 8124 | {0x17, 0x90170110}, |
| 8125 | {0x18, 0x02a11030}, |
| 8126 | {0x19, 0x0181303F}, |
| 8127 | {0x21, 0x0221102f}), |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 8128 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 8129 | {0x12, 0x90a601c0}, |
| 8130 | {0x14, 0x90171120}, |
| 8131 | {0x21, 0x02211030}), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 8132 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 8133 | {0x14, 0x90170110}, |
| 8134 | {0x1b, 0x90a70130}, |
| 8135 | {0x21, 0x03211020}), |
| 8136 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 8137 | {0x1a, 0x90a70130}, |
| 8138 | {0x1b, 0x90170110}, |
| 8139 | {0x21, 0x03211020}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 8140 | 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] | 8141 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 8142 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8143 | {0x14, 0x901701a0}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 8144 | 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] | 8145 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 8146 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 8147 | {0x14, 0x901701b0}), |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 8148 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8149 | ALC225_STANDARD_PINS, |
| 8150 | {0x12, 0xb7a60150}, |
| 8151 | {0x14, 0x901701a0}), |
| 8152 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8153 | ALC225_STANDARD_PINS, |
| 8154 | {0x12, 0xb7a60150}, |
| 8155 | {0x14, 0x901701b0}), |
| 8156 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8157 | ALC225_STANDARD_PINS, |
| 8158 | {0x12, 0xb7a60130}, |
| 8159 | {0x1b, 0x90170110}), |
Kai-Heng Feng | 0ce48e1 | 2017-11-20 02:29:13 -0500 | [diff] [blame] | 8160 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8161 | {0x1b, 0x01111010}, |
| 8162 | {0x1e, 0x01451130}, |
| 8163 | {0x21, 0x02211020}), |
Hui Wang | 986376b | 2018-05-30 12:33:07 +0800 | [diff] [blame] | 8164 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
| 8165 | {0x12, 0x90a60140}, |
| 8166 | {0x14, 0x90170110}, |
| 8167 | {0x19, 0x02a11030}, |
| 8168 | {0x21, 0x02211020}), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 8169 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 8170 | {0x14, 0x90170110}, |
| 8171 | {0x19, 0x02a11030}, |
| 8172 | {0x1a, 0x02a11040}, |
| 8173 | {0x1b, 0x01014020}, |
| 8174 | {0x21, 0x0221101f}), |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 8175 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 8176 | {0x14, 0x90170110}, |
Hui Wang | d06fb56 | 2018-10-10 11:57:25 +0800 | [diff] [blame] | 8177 | {0x19, 0x02a11030}, |
| 8178 | {0x1a, 0x02a11040}, |
| 8179 | {0x1b, 0x01011020}, |
| 8180 | {0x21, 0x0221101f}), |
| 8181 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 8182 | {0x14, 0x90170110}, |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 8183 | {0x19, 0x02a11020}, |
| 8184 | {0x1a, 0x02a11030}, |
| 8185 | {0x21, 0x0221101f}), |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 8186 | 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] | 8187 | {0x14, 0x90170110}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 8188 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8189 | 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] | 8190 | {0x14, 0x90170130}, |
| 8191 | {0x21, 0x02211040}), |
| 8192 | 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] | 8193 | {0x12, 0x90a60140}, |
| 8194 | {0x14, 0x90170110}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8195 | {0x21, 0x02211020}), |
| 8196 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8197 | {0x12, 0x90a60160}, |
| 8198 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8199 | {0x21, 0x02211030}), |
| 8200 | 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] | 8201 | {0x14, 0x90170110}, |
| 8202 | {0x1b, 0x02011020}, |
| 8203 | {0x21, 0x0221101f}), |
| 8204 | 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] | 8205 | {0x14, 0x90170110}, |
| 8206 | {0x1b, 0x01011020}, |
| 8207 | {0x21, 0x0221101f}), |
| 8208 | 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] | 8209 | {0x14, 0x90170130}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 8210 | {0x1b, 0x01014020}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 8211 | {0x21, 0x0221103f}), |
| 8212 | 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] | 8213 | {0x14, 0x90170130}, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 8214 | {0x1b, 0x01011020}, |
| 8215 | {0x21, 0x0221103f}), |
| 8216 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8217 | {0x14, 0x90170130}, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 8218 | {0x1b, 0x02011020}, |
| 8219 | {0x21, 0x0221103f}), |
| 8220 | 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] | 8221 | {0x14, 0x90170150}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8222 | {0x1b, 0x02011020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8223 | {0x21, 0x0221105f}), |
| 8224 | 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] | 8225 | {0x14, 0x90170110}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8226 | {0x1b, 0x01014020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 8227 | {0x21, 0x0221101f}), |
| 8228 | 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] | 8229 | {0x12, 0x90a60160}, |
| 8230 | {0x14, 0x90170120}, |
| 8231 | {0x17, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8232 | {0x21, 0x0321102f}), |
| 8233 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8234 | {0x12, 0x90a60160}, |
| 8235 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8236 | {0x21, 0x02211040}), |
| 8237 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8238 | {0x12, 0x90a60160}, |
| 8239 | {0x14, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8240 | {0x21, 0x02211050}), |
| 8241 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8242 | {0x12, 0x90a60170}, |
| 8243 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8244 | {0x21, 0x02211030}), |
| 8245 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8246 | {0x12, 0x90a60170}, |
| 8247 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8248 | {0x21, 0x02211040}), |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 8249 | 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] | 8250 | {0x12, 0x90a60170}, |
Hui Wang | 0a1f90a | 2016-01-13 11:51:38 +0800 | [diff] [blame] | 8251 | {0x14, 0x90171130}, |
| 8252 | {0x21, 0x02211040}), |
| 8253 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8254 | {0x12, 0x90a60170}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 8255 | {0x14, 0x90170140}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 8256 | {0x21, 0x02211050}), |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 8257 | 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] | 8258 | {0x12, 0x90a60180}, |
| 8259 | {0x14, 0x90170130}, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 8260 | {0x21, 0x02211040}), |
AceLan Kao | f90d83b | 2016-06-03 14:45:25 +0800 | [diff] [blame] | 8261 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8262 | {0x12, 0x90a60180}, |
| 8263 | {0x14, 0x90170120}, |
| 8264 | {0x21, 0x02211030}), |
Hui Wang | 989dbe4 | 2016-11-23 16:05:38 +0800 | [diff] [blame] | 8265 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8266 | {0x1b, 0x01011020}, |
| 8267 | {0x21, 0x02211010}), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8268 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 8269 | {0x14, 0x90170110}, |
| 8270 | {0x1b, 0x90a70130}, |
| 8271 | {0x21, 0x04211020}), |
| 8272 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 8273 | {0x14, 0x90170110}, |
| 8274 | {0x1b, 0x90a70130}, |
| 8275 | {0x21, 0x03211020}), |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 8276 | 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] | 8277 | {0x12, 0x90a60130}, |
| 8278 | {0x14, 0x90170110}, |
| 8279 | {0x21, 0x03211020}), |
| 8280 | 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] | 8281 | {0x12, 0x90a60130}, |
| 8282 | {0x14, 0x90170110}, |
| 8283 | {0x21, 0x04211020}), |
| 8284 | 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] | 8285 | {0x1a, 0x90a70130}, |
| 8286 | {0x1b, 0x90170110}, |
| 8287 | {0x21, 0x03211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 8288 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 8289 | {0x12, 0x90a60130}, |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 8290 | {0x14, 0x90170110}, |
| 8291 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8292 | {0x1a, 0x04a11020}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8293 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 8294 | {0x12, 0x90a60140}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8295 | {0x14, 0x90170110}, |
| 8296 | {0x15, 0x0421101f}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8297 | {0x18, 0x02811030}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 8298 | {0x1a, 0x04a1103f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8299 | {0x1b, 0x02011020}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8300 | 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] | 8301 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8302 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8303 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 8304 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8305 | 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] | 8306 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8307 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8308 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8309 | {0x21, 0x03211040}), |
| 8310 | 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] | 8311 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8312 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8313 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8314 | {0x21, 0x03211020}), |
| 8315 | 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] | 8316 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8317 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8318 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 8319 | {0x21, 0x0421101f}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8320 | 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] | 8321 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8322 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8323 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 8324 | {0x21, 0x04211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8325 | 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] | 8326 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8327 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8328 | {0x21, 0x0321101f}), |
| 8329 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8330 | {0x12, 0x90a60160}, |
| 8331 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8332 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8333 | 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] | 8334 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8335 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8336 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 8337 | {0x21, 0x0321101f}), |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 8338 | 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] | 8339 | {0x12, 0x90a60130}, |
| 8340 | {0x14, 0x90170110}, |
| 8341 | {0x19, 0x04a11040}, |
| 8342 | {0x21, 0x04211020}), |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 8343 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
| 8344 | {0x12, 0x90a60130}, |
| 8345 | {0x17, 0x90170110}, |
| 8346 | {0x21, 0x02211020}), |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 8347 | 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] | 8348 | {0x12, 0x90a60120}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 8349 | {0x14, 0x90170110}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 8350 | {0x21, 0x0321101f}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8351 | 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] | 8352 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8353 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8354 | {0x18, 0x90170112}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8355 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8356 | 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] | 8357 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8358 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8359 | {0x18, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8360 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8361 | 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] | 8362 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8363 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8364 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8365 | 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] | 8366 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8367 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8368 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8369 | 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] | 8370 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8371 | {0x14, 0x90170110}, |
| 8372 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8373 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8374 | 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] | 8375 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8376 | {0x14, 0x90170110}, |
| 8377 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8378 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8379 | 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] | 8380 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 8381 | {0x14, 0x90170110}, |
| 8382 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8383 | {0x1a, 0x04a11020}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8384 | 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] | 8385 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8386 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8387 | {0x16, 0x01014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8388 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8389 | 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] | 8390 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8391 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 8392 | {0x16, 0x01014020}, |
| 8393 | {0x18, 0x02a19031}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8394 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8395 | 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] | 8396 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8397 | {0x12, 0x90a60140}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8398 | 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] | 8399 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8400 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8401 | {0x16, 0x21014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8402 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 8403 | 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] | 8404 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8405 | {0x13, 0x90a60140}), |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 8406 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
| 8407 | {0x14, 0x90170110}, |
| 8408 | {0x1b, 0x90a70130}, |
| 8409 | {0x21, 0x04211020}), |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 8410 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 8411 | {0x12, 0x90a60130}, |
| 8412 | {0x17, 0x90170110}, |
Jian-Hong Pan | 8bb37a2 | 2019-02-21 17:00:18 +0800 | [diff] [blame] | 8413 | {0x21, 0x03211020}), |
| 8414 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 8415 | {0x12, 0x90a60130}, |
| 8416 | {0x17, 0x90170110}, |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 8417 | {0x21, 0x04211020}), |
Takashi Iwai | 3887c26 | 2019-04-30 15:10:01 +0200 | [diff] [blame] | 8418 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 8419 | {0x12, 0x90a60130}, |
| 8420 | {0x17, 0x90170110}, |
| 8421 | {0x21, 0x03211020}), |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 8422 | 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] | 8423 | {0x12, 0x90a60120}, |
| 8424 | {0x17, 0x90170110}, |
| 8425 | {0x21, 0x04211030}), |
| 8426 | 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] | 8427 | {0x12, 0x90a60130}, |
| 8428 | {0x17, 0x90170110}, |
| 8429 | {0x21, 0x03211020}), |
| 8430 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 8431 | {0x12, 0x90a60130}, |
| 8432 | {0x17, 0x90170110}, |
| 8433 | {0x21, 0x03211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 8434 | 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] | 8435 | {0x14, 0x90170110}, |
| 8436 | {0x21, 0x04211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 8437 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8438 | {0x14, 0x90170110}, |
| 8439 | {0x21, 0x04211030}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 8440 | 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] | 8441 | ALC295_STANDARD_PINS, |
| 8442 | {0x17, 0x21014020}, |
| 8443 | {0x18, 0x21a19030}), |
| 8444 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8445 | ALC295_STANDARD_PINS, |
| 8446 | {0x17, 0x21014040}, |
| 8447 | {0x18, 0x21a19050}), |
Hui Wang | 3f30783 | 2017-03-23 10:00:25 +0800 | [diff] [blame] | 8448 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8449 | ALC295_STANDARD_PINS), |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 8450 | 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] | 8451 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 8452 | {0x17, 0x90170110}), |
| 8453 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8454 | ALC298_STANDARD_PINS, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 8455 | {0x17, 0x90170140}), |
| 8456 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8457 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 8458 | {0x17, 0x90170150}), |
Kai-Heng Feng | 9f1bc2c4 | 2017-02-16 15:26:54 +0800 | [diff] [blame] | 8459 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
| 8460 | {0x12, 0xb7a60140}, |
| 8461 | {0x13, 0xb7a60150}, |
| 8462 | {0x17, 0x90170110}, |
| 8463 | {0x1a, 0x03011020}, |
| 8464 | {0x21, 0x03211030}), |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 8465 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
| 8466 | {0x12, 0xb7a60140}, |
| 8467 | {0x17, 0x90170110}, |
| 8468 | {0x1a, 0x03a11030}, |
| 8469 | {0x21, 0x03211020}), |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 8470 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8471 | ALC225_STANDARD_PINS, |
| 8472 | {0x12, 0xb7a60130}, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 8473 | {0x17, 0x90170110}), |
Hui Wang | 573fcbf | 2020-06-08 19:55:41 +0800 | [diff] [blame] | 8474 | SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, |
| 8475 | {0x14, 0x01014010}, |
| 8476 | {0x17, 0x90170120}, |
| 8477 | {0x18, 0x02a11030}, |
| 8478 | {0x19, 0x02a1103f}, |
| 8479 | {0x21, 0x0221101f}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 8480 | {} |
| 8481 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8482 | |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 8483 | /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match |
| 8484 | * more machines, don't need to match all valid pins, just need to match |
| 8485 | * all the pins defined in the tbl. Just because of this reason, it is possible |
| 8486 | * that a single machine matches multiple tbls, so there is one limitation: |
| 8487 | * at most one tbl is allowed to define for the same vendor and same codec |
| 8488 | */ |
| 8489 | static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { |
| 8490 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 8491 | {0x19, 0x40000000}, |
| 8492 | {0x1b, 0x40000000}), |
Hui Wang | aed8c7f | 2019-11-21 10:26:43 +0800 | [diff] [blame] | 8493 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8494 | {0x19, 0x40000000}, |
| 8495 | {0x1a, 0x40000000}), |
Hui Wang | d64ebdb | 2019-11-21 10:26:44 +0800 | [diff] [blame] | 8496 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 8497 | {0x19, 0x40000000}, |
| 8498 | {0x1a, 0x40000000}), |
Hui Wang | 5815bdf | 2019-12-11 13:13:21 +0800 | [diff] [blame] | 8499 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
| 8500 | {0x19, 0x40000000}, |
| 8501 | {0x1a, 0x40000000}), |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 8502 | {} |
| 8503 | }; |
| 8504 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8505 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8506 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8507 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8508 | int val; |
| 8509 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8510 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8511 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 8512 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8513 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8514 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 8515 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 8516 | } |
| 8517 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8518 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8519 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 8520 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 8521 | } |
| 8522 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8523 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8524 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 8525 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8526 | } |
| 8527 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8528 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8529 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 8530 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8531 | /* Capless ramp up clock control */ |
| 8532 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 8533 | } |
| 8534 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 8535 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8536 | /* Class D power on reset */ |
| 8537 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 8538 | } |
| 8539 | } |
| 8540 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 8541 | /* HP */ |
| 8542 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8543 | } |
| 8544 | |
| 8545 | /* |
| 8546 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8547 | static int patch_alc269(struct hda_codec *codec) |
| 8548 | { |
| 8549 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8550 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8551 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8552 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8553 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8554 | return err; |
| 8555 | |
| 8556 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 8557 | spec->gen.shared_mic_vref_pin = 0x18; |
Kailang Yang | 317d931 | 2019-05-23 14:43:04 +0800 | [diff] [blame] | 8558 | codec->power_save_node = 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8559 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8560 | #ifdef CONFIG_PM |
| 8561 | codec->patch_ops.suspend = alc269_suspend; |
| 8562 | codec->patch_ops.resume = alc269_resume; |
| 8563 | #endif |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 8564 | spec->shutup = alc_default_shutup; |
| 8565 | spec->init_hook = alc_default_init; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8566 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8567 | switch (codec->core.vendor_id) { |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8568 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8569 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8570 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 8571 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 8572 | if (codec->bus->pci && |
| 8573 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8574 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 8575 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8576 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8577 | break; |
| 8578 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 8579 | if (codec->bus->pci && |
| 8580 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8581 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 8582 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8583 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8584 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 8585 | case 0x0030: |
| 8586 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 8587 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8588 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8589 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8590 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8591 | if (err < 0) |
| 8592 | goto error; |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 8593 | spec->shutup = alc269_shutup; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 8594 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8595 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8596 | break; |
| 8597 | |
| 8598 | case 0x10ec0280: |
| 8599 | case 0x10ec0290: |
| 8600 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 8601 | break; |
| 8602 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8603 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 8604 | spec->shutup = alc282_shutup; |
| 8605 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8606 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 8607 | case 0x10ec0233: |
| 8608 | case 0x10ec0283: |
| 8609 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 8610 | spec->shutup = alc283_shutup; |
| 8611 | spec->init_hook = alc283_init; |
| 8612 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 8613 | case 0x10ec0284: |
| 8614 | case 0x10ec0292: |
| 8615 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 8616 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 8617 | case 0x10ec0293: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 8618 | spec->codec_variant = ALC269_TYPE_ALC293; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 8619 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 8620 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 8621 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 8622 | spec->codec_variant = ALC269_TYPE_ALC286; |
| 8623 | break; |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 8624 | case 0x10ec0298: |
| 8625 | spec->codec_variant = ALC269_TYPE_ALC298; |
| 8626 | break; |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 8627 | case 0x10ec0235: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 8628 | case 0x10ec0255: |
| 8629 | spec->codec_variant = ALC269_TYPE_ALC255; |
Kailang Yang | ab3b8e5 | 2018-04-25 16:05:27 +0800 | [diff] [blame] | 8630 | spec->shutup = alc256_shutup; |
| 8631 | spec->init_hook = alc256_init; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 8632 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 8633 | case 0x10ec0236: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 8634 | case 0x10ec0256: |
| 8635 | spec->codec_variant = ALC269_TYPE_ALC256; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 8636 | spec->shutup = alc256_shutup; |
| 8637 | spec->init_hook = alc256_init; |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 8638 | 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] | 8639 | break; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 8640 | case 0x10ec0257: |
| 8641 | spec->codec_variant = ALC269_TYPE_ALC257; |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 8642 | spec->shutup = alc256_shutup; |
| 8643 | spec->init_hook = alc256_init; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 8644 | spec->gen.mixer_nid = 0; |
| 8645 | break; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8646 | case 0x10ec0215: |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 8647 | case 0x10ec0245: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8648 | case 0x10ec0285: |
Kailang Yang | 630e361 | 2020-05-27 14:10:26 +0800 | [diff] [blame] | 8649 | case 0x10ec0287: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8650 | case 0x10ec0289: |
| 8651 | spec->codec_variant = ALC269_TYPE_ALC215; |
Kailang Yang | 1b6832be | 2018-01-17 15:32:03 +0800 | [diff] [blame] | 8652 | spec->shutup = alc225_shutup; |
| 8653 | spec->init_hook = alc225_init; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8654 | spec->gen.mixer_nid = 0; |
| 8655 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8656 | case 0x10ec0225: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 8657 | case 0x10ec0295: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 8658 | case 0x10ec0299: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8659 | spec->codec_variant = ALC269_TYPE_ALC225; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 8660 | spec->shutup = alc225_shutup; |
| 8661 | spec->init_hook = alc225_init; |
Takashi Iwai | c1350bf | 2017-12-27 09:03:45 +0100 | [diff] [blame] | 8662 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8663 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8664 | case 0x10ec0234: |
| 8665 | case 0x10ec0274: |
| 8666 | case 0x10ec0294: |
| 8667 | spec->codec_variant = ALC269_TYPE_ALC294; |
Hui Wang | 532a778 | 2017-06-26 12:30:32 +0800 | [diff] [blame] | 8668 | 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] | 8669 | 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] | 8670 | spec->init_hook = alc294_init; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8671 | break; |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 8672 | case 0x10ec0300: |
| 8673 | spec->codec_variant = ALC269_TYPE_ALC300; |
| 8674 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8675 | break; |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 8676 | case 0x10ec0623: |
| 8677 | spec->codec_variant = ALC269_TYPE_ALC623; |
| 8678 | break; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8679 | case 0x10ec0700: |
| 8680 | case 0x10ec0701: |
| 8681 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 8682 | case 0x10ec0711: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8683 | spec->codec_variant = ALC269_TYPE_ALC700; |
| 8684 | 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] | 8685 | 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] | 8686 | spec->init_hook = alc294_init; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8687 | break; |
| 8688 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8689 | } |
| 8690 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 8691 | 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] | 8692 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 8693 | spec->init_hook = alc5505_dsp_init; |
| 8694 | } |
| 8695 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8696 | alc_pre_init(codec); |
| 8697 | |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 8698 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
| 8699 | alc269_fixup_tbl, alc269_fixups); |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 8700 | 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] | 8701 | 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] | 8702 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 8703 | alc269_fixups); |
| 8704 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 8705 | |
| 8706 | alc_auto_parse_customize_define(codec); |
| 8707 | |
| 8708 | if (has_cdefine_beep(codec)) |
| 8709 | spec->gen.beep_nid = 0x01; |
| 8710 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 8711 | /* automatic parse from the BIOS config */ |
| 8712 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8713 | if (err < 0) |
| 8714 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8715 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8716 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
| 8717 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); |
| 8718 | if (err < 0) |
| 8719 | goto error; |
| 8720 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8721 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8722 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8723 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8724 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8725 | |
| 8726 | error: |
| 8727 | alc_free(codec); |
| 8728 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8729 | } |
| 8730 | |
| 8731 | /* |
| 8732 | * ALC861 |
| 8733 | */ |
| 8734 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8735 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 8736 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8737 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8738 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 8739 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8740 | } |
| 8741 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8742 | /* Pin config fixes */ |
| 8743 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8744 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 8745 | ALC861_FIXUP_AMP_VREF_0F, |
| 8746 | ALC861_FIXUP_NO_JACK_DETECT, |
| 8747 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 8748 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8749 | }; |
| 8750 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8751 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 8752 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8753 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8754 | { |
| 8755 | struct alc_spec *spec = codec->spec; |
| 8756 | unsigned int val; |
| 8757 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8758 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8759 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 8760 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8761 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 8762 | val |= AC_PINCTL_IN_EN; |
| 8763 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 8764 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 8765 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8766 | } |
| 8767 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8768 | /* suppress the jack-detection */ |
| 8769 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8770 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8771 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8772 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8773 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 8774 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8775 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8776 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8777 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8778 | .type = HDA_FIXUP_PINS, |
| 8779 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8780 | { 0x0b, 0x0221101f }, /* HP */ |
| 8781 | { 0x0f, 0x90170310 }, /* speaker */ |
| 8782 | { } |
| 8783 | } |
| 8784 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8785 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8786 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 8787 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 8788 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8789 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8790 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8791 | .v.func = alc_fixup_no_jack_detect, |
| 8792 | }, |
| 8793 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8794 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8795 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 8796 | .chained = true, |
| 8797 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 8798 | }, |
| 8799 | [ALC660_FIXUP_ASUS_W7J] = { |
| 8800 | .type = HDA_FIXUP_VERBS, |
| 8801 | .v.verbs = (const struct hda_verb[]) { |
| 8802 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 8803 | * for enabling outputs |
| 8804 | */ |
| 8805 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 8806 | { } |
| 8807 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8808 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8809 | }; |
| 8810 | |
| 8811 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 8812 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 8813 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 8814 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 8815 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 8816 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 8817 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 8818 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 8819 | 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] | 8820 | {} |
| 8821 | }; |
| 8822 | |
| 8823 | /* |
| 8824 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8825 | static int patch_alc861(struct hda_codec *codec) |
| 8826 | { |
| 8827 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8828 | int err; |
| 8829 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8830 | err = alc_alloc_spec(codec, 0x15); |
| 8831 | if (err < 0) |
| 8832 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8833 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8834 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 8835 | if (has_cdefine_beep(codec)) |
| 8836 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8837 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8838 | #ifdef CONFIG_PM |
| 8839 | spec->power_hook = alc_power_eapd; |
| 8840 | #endif |
| 8841 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8842 | alc_pre_init(codec); |
| 8843 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8844 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 8845 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8846 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8847 | /* automatic parse from the BIOS config */ |
| 8848 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8849 | if (err < 0) |
| 8850 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8851 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8852 | if (!spec->gen.no_analog) { |
| 8853 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
| 8854 | if (err < 0) |
| 8855 | goto error; |
| 8856 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8857 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8858 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8859 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8860 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8861 | |
| 8862 | error: |
| 8863 | alc_free(codec); |
| 8864 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8865 | } |
| 8866 | |
| 8867 | /* |
| 8868 | * ALC861-VD support |
| 8869 | * |
| 8870 | * Based on ALC882 |
| 8871 | * |
| 8872 | * In addition, an independent DAC |
| 8873 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8874 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 8875 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8876 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8877 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 8878 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8879 | } |
| 8880 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8881 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8882 | ALC660VD_FIX_ASUS_GPIO1, |
| 8883 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8884 | }; |
| 8885 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8886 | /* exclude VREF80 */ |
| 8887 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8888 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8889 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8890 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 8891 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 8892 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8893 | } |
| 8894 | } |
| 8895 | |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 8896 | /* reset GPIO1 */ |
| 8897 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, |
| 8898 | const struct hda_fixup *fix, int action) |
| 8899 | { |
| 8900 | struct alc_spec *spec = codec->spec; |
| 8901 | |
| 8902 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 8903 | spec->gpio_mask |= 0x02; |
| 8904 | alc_fixup_gpio(codec, action, 0x01); |
| 8905 | } |
| 8906 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8907 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8908 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 8909 | .type = HDA_FIXUP_FUNC, |
| 8910 | .v.func = alc660vd_fixup_asus_gpio1, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8911 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8912 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8913 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8914 | .v.func = alc861vd_fixup_dallas, |
| 8915 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8916 | }; |
| 8917 | |
| 8918 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8919 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8920 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8921 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8922 | {} |
| 8923 | }; |
| 8924 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8925 | /* |
| 8926 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8927 | static int patch_alc861vd(struct hda_codec *codec) |
| 8928 | { |
| 8929 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8930 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8931 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8932 | err = alc_alloc_spec(codec, 0x0b); |
| 8933 | if (err < 0) |
| 8934 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8935 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8936 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 8937 | if (has_cdefine_beep(codec)) |
| 8938 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8939 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8940 | spec->shutup = alc_eapd_shutup; |
| 8941 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8942 | alc_pre_init(codec); |
| 8943 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8944 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 8945 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8946 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8947 | /* automatic parse from the BIOS config */ |
| 8948 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8949 | if (err < 0) |
| 8950 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8951 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8952 | if (!spec->gen.no_analog) { |
| 8953 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 8954 | if (err < 0) |
| 8955 | goto error; |
| 8956 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8957 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8958 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8959 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8960 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8961 | |
| 8962 | error: |
| 8963 | alc_free(codec); |
| 8964 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8965 | } |
| 8966 | |
| 8967 | /* |
| 8968 | * ALC662 support |
| 8969 | * |
| 8970 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 8971 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 8972 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 8973 | * 6-channel independent captures. |
| 8974 | * |
| 8975 | * In addition, an independent DAC for the multi-playback (not used in this |
| 8976 | * driver yet). |
| 8977 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8978 | |
| 8979 | /* |
| 8980 | * BIOS auto configuration |
| 8981 | */ |
| 8982 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8983 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 8984 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 8985 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8986 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 8987 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 8988 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 8989 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8990 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
| 8991 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || |
| 8992 | codec->core.vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8993 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 8994 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8995 | ssids = alc662_ssids; |
| 8996 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8997 | } |
| 8998 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8999 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9000 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 9001 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 9002 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 9003 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9004 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 9005 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 9006 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 9007 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 9008 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 9009 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9010 | } |
| 9011 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9012 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 9013 | { .channels = 2, |
| 9014 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 9015 | { .channels = 4, |
| 9016 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 9017 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 9018 | { } |
| 9019 | }; |
| 9020 | |
| 9021 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 9022 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9023 | const struct hda_fixup *fix, int action) |
| 9024 | { |
| 9025 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 9026 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | bbbc7e8 | 2015-02-27 17:43:19 +0100 | [diff] [blame] | 9027 | 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] | 9028 | } |
| 9029 | } |
| 9030 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 9031 | /* avoid D3 for keeping GPIO up */ |
| 9032 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 9033 | hda_nid_t nid, |
| 9034 | unsigned int power_state) |
| 9035 | { |
| 9036 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 9037 | 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] | 9038 | return AC_PWRST_D0; |
| 9039 | return power_state; |
| 9040 | } |
| 9041 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9042 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 9043 | const struct hda_fixup *fix, int action) |
| 9044 | { |
| 9045 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9046 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 9047 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9048 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 9049 | spec->mute_led_polarity = 1; |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 9050 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9051 | } |
| 9052 | } |
| 9053 | |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9054 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
| 9055 | struct hda_jack_callback *jack) |
| 9056 | { |
| 9057 | struct alc_spec *spec = codec->spec; |
| 9058 | int vref; |
| 9059 | msleep(200); |
| 9060 | snd_hda_gen_hp_automute(codec, jack); |
| 9061 | |
| 9062 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 9063 | msleep(100); |
| 9064 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 9065 | vref); |
| 9066 | } |
| 9067 | |
| 9068 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, |
| 9069 | const struct hda_fixup *fix, int action) |
| 9070 | { |
| 9071 | struct alc_spec *spec = codec->spec; |
| 9072 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 9073 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 9074 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; |
| 9075 | } |
| 9076 | } |
| 9077 | |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9078 | static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, |
| 9079 | struct hda_jack_callback *cb) |
| 9080 | { |
| 9081 | /* surround speakers at 0x1b already get muted automatically when |
| 9082 | * headphones are plugged in, but we have to mute/unmute the remaining |
| 9083 | * channels manually: |
| 9084 | * 0x15 - front left/front right |
| 9085 | * 0x18 - front center/ LFE |
| 9086 | */ |
| 9087 | if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { |
| 9088 | snd_hda_set_pin_ctl_cache(codec, 0x15, 0); |
| 9089 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 9090 | } else { |
| 9091 | snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); |
| 9092 | snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); |
| 9093 | } |
| 9094 | } |
| 9095 | |
| 9096 | static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, |
| 9097 | const struct hda_fixup *fix, int action) |
| 9098 | { |
| 9099 | /* Pin 0x1b: shared headphones jack and surround speakers */ |
| 9100 | if (!is_jack_detectable(codec, 0x1b)) |
| 9101 | return; |
| 9102 | |
| 9103 | switch (action) { |
| 9104 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 9105 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 9106 | alc662_aspire_ethos_mute_speakers); |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 9107 | /* subwoofer needs an extra GPIO setting to become audible */ |
| 9108 | alc_setup_gpio(codec, 0x02); |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9109 | break; |
| 9110 | case HDA_FIXUP_ACT_INIT: |
| 9111 | /* Make sure to start in a correct state, i.e. if |
| 9112 | * headphones have been plugged in before powering up the system |
| 9113 | */ |
| 9114 | alc662_aspire_ethos_mute_speakers(codec, NULL); |
| 9115 | break; |
| 9116 | } |
| 9117 | } |
| 9118 | |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9119 | static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, |
| 9120 | const struct hda_fixup *fix, int action) |
| 9121 | { |
| 9122 | struct alc_spec *spec = codec->spec; |
| 9123 | |
| 9124 | static const struct hda_pintbl pincfgs[] = { |
| 9125 | { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ |
| 9126 | { 0x1b, 0x0181304f }, |
| 9127 | { } |
| 9128 | }; |
| 9129 | |
| 9130 | switch (action) { |
| 9131 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 9132 | spec->gen.mixer_nid = 0; |
| 9133 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 9134 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 9135 | break; |
| 9136 | case HDA_FIXUP_ACT_INIT: |
| 9137 | alc_write_coef_idx(codec, 0x19, 0xa054); |
| 9138 | break; |
| 9139 | } |
| 9140 | } |
| 9141 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 9142 | static const struct coef_fw alc668_coefs[] = { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 9143 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 9144 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 9145 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 9146 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 9147 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 9148 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 9149 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 9150 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 9151 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 9152 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 9153 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 9154 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 9155 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 9156 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 9157 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 9158 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 9159 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 9160 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 9161 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 9162 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 9163 | {} |
| 9164 | }; |
| 9165 | |
| 9166 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 9167 | { |
| 9168 | alc_process_coef_fw(codec, alc668_coefs); |
| 9169 | } |
| 9170 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9171 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9172 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9173 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9174 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9175 | ALC272_FIXUP_MARIO, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 9176 | ALC662_FIXUP_CZC_ET26, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9177 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 9178 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9179 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9180 | ALC662_FIXUP_ASUS_MODE1, |
| 9181 | ALC662_FIXUP_ASUS_MODE2, |
| 9182 | ALC662_FIXUP_ASUS_MODE3, |
| 9183 | ALC662_FIXUP_ASUS_MODE4, |
| 9184 | ALC662_FIXUP_ASUS_MODE5, |
| 9185 | ALC662_FIXUP_ASUS_MODE6, |
| 9186 | ALC662_FIXUP_ASUS_MODE7, |
| 9187 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9188 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9189 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9190 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9191 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 9192 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9193 | ALC662_FIXUP_HEADSET_MODE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 9194 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9195 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9196 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9197 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9198 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 9199 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 9200 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 9201 | ALC668_FIXUP_DELL_XPS13, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 9202 | ALC662_FIXUP_ASUS_Nx50, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9203 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9204 | ALC668_FIXUP_ASUS_Nx51, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9205 | ALC668_FIXUP_MIC_COEF, |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 9206 | ALC668_FIXUP_ASUS_G751, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9207 | ALC891_FIXUP_HEADSET_MODE, |
| 9208 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 9209 | ALC662_FIXUP_ACER_VERITON, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9210 | ALC892_FIXUP_ASROCK_MOBO, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9211 | ALC662_FIXUP_USI_FUNC, |
| 9212 | ALC662_FIXUP_USI_HEADSET_MODE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 9213 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9214 | ALC669_FIXUP_ACER_ASPIRE_ETHOS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9215 | ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9216 | ALC671_FIXUP_HP_HEADSET_MIC2, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 9217 | ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 9218 | ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9219 | }; |
| 9220 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9221 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9222 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9223 | .type = HDA_FIXUP_PINS, |
| 9224 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9225 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 9226 | { } |
| 9227 | } |
| 9228 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9229 | [ALC662_FIXUP_LED_GPIO1] = { |
| 9230 | .type = HDA_FIXUP_FUNC, |
| 9231 | .v.func = alc662_fixup_led_gpio1, |
| 9232 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9233 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9234 | .type = HDA_FIXUP_PINS, |
| 9235 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9236 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 9237 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 9238 | }, |
| 9239 | .chained = true, |
| 9240 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9241 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9242 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9243 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 9244 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9245 | }, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 9246 | [ALC662_FIXUP_CZC_ET26] = { |
| 9247 | .type = HDA_FIXUP_PINS, |
| 9248 | .v.pins = (const struct hda_pintbl[]) { |
| 9249 | {0x12, 0x403cc000}, |
| 9250 | {0x14, 0x90170110}, /* speaker */ |
| 9251 | {0x15, 0x411111f0}, |
| 9252 | {0x16, 0x411111f0}, |
| 9253 | {0x18, 0x01a19030}, /* mic */ |
| 9254 | {0x19, 0x90a7013f}, /* int-mic */ |
| 9255 | {0x1a, 0x01014020}, |
| 9256 | {0x1b, 0x0121401f}, |
| 9257 | {0x1c, 0x411111f0}, |
| 9258 | {0x1d, 0x411111f0}, |
| 9259 | {0x1e, 0x40478e35}, |
| 9260 | {} |
| 9261 | }, |
| 9262 | .chained = true, |
| 9263 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9264 | }, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9265 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9266 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9267 | .v.verbs = (const struct hda_verb[]) { |
| 9268 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 9269 | {} |
| 9270 | } |
| 9271 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 9272 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9273 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 9274 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 9275 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9276 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9277 | .type = HDA_FIXUP_PINS, |
| 9278 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9279 | { 0x14, 0x0221201f }, /* HP out */ |
| 9280 | { } |
| 9281 | }, |
| 9282 | .chained = true, |
| 9283 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9284 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9285 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9286 | .type = HDA_FIXUP_PINS, |
| 9287 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9288 | { 0x14, 0x99130110 }, /* speaker */ |
| 9289 | { 0x18, 0x01a19c20 }, /* mic */ |
| 9290 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 9291 | { 0x21, 0x0121401f }, /* HP out */ |
| 9292 | { } |
| 9293 | }, |
| 9294 | .chained = true, |
| 9295 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9296 | }, |
| 9297 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9298 | .type = HDA_FIXUP_PINS, |
| 9299 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 9300 | { 0x14, 0x99130110 }, /* speaker */ |
| 9301 | { 0x18, 0x01a19820 }, /* mic */ |
| 9302 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 9303 | { 0x1b, 0x0121401f }, /* HP out */ |
| 9304 | { } |
| 9305 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9306 | .chained = true, |
| 9307 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9308 | }, |
| 9309 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9310 | .type = HDA_FIXUP_PINS, |
| 9311 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9312 | { 0x14, 0x99130110 }, /* speaker */ |
| 9313 | { 0x15, 0x0121441f }, /* HP */ |
| 9314 | { 0x18, 0x01a19840 }, /* mic */ |
| 9315 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9316 | { 0x21, 0x01211420 }, /* HP2 */ |
| 9317 | { } |
| 9318 | }, |
| 9319 | .chained = true, |
| 9320 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9321 | }, |
| 9322 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9323 | .type = HDA_FIXUP_PINS, |
| 9324 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9325 | { 0x14, 0x99130110 }, /* speaker */ |
| 9326 | { 0x16, 0x99130111 }, /* speaker */ |
| 9327 | { 0x18, 0x01a19840 }, /* mic */ |
| 9328 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9329 | { 0x21, 0x0121441f }, /* HP */ |
| 9330 | { } |
| 9331 | }, |
| 9332 | .chained = true, |
| 9333 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9334 | }, |
| 9335 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9336 | .type = HDA_FIXUP_PINS, |
| 9337 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9338 | { 0x14, 0x99130110 }, /* speaker */ |
| 9339 | { 0x15, 0x0121441f }, /* HP */ |
| 9340 | { 0x16, 0x99130111 }, /* speaker */ |
| 9341 | { 0x18, 0x01a19840 }, /* mic */ |
| 9342 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9343 | { } |
| 9344 | }, |
| 9345 | .chained = true, |
| 9346 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9347 | }, |
| 9348 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9349 | .type = HDA_FIXUP_PINS, |
| 9350 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9351 | { 0x14, 0x99130110 }, /* speaker */ |
| 9352 | { 0x15, 0x01211420 }, /* HP2 */ |
| 9353 | { 0x18, 0x01a19840 }, /* mic */ |
| 9354 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9355 | { 0x1b, 0x0121441f }, /* HP */ |
| 9356 | { } |
| 9357 | }, |
| 9358 | .chained = true, |
| 9359 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9360 | }, |
| 9361 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9362 | .type = HDA_FIXUP_PINS, |
| 9363 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9364 | { 0x14, 0x99130110 }, /* speaker */ |
| 9365 | { 0x17, 0x99130111 }, /* speaker */ |
| 9366 | { 0x18, 0x01a19840 }, /* mic */ |
| 9367 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 9368 | { 0x1b, 0x01214020 }, /* HP */ |
| 9369 | { 0x21, 0x0121401f }, /* HP */ |
| 9370 | { } |
| 9371 | }, |
| 9372 | .chained = true, |
| 9373 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 9374 | }, |
| 9375 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9376 | .type = HDA_FIXUP_PINS, |
| 9377 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9378 | { 0x14, 0x99130110 }, /* speaker */ |
| 9379 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 9380 | { 0x15, 0x01214020 }, /* HP */ |
| 9381 | { 0x17, 0x99130111 }, /* speaker */ |
| 9382 | { 0x18, 0x01a19840 }, /* mic */ |
| 9383 | { 0x21, 0x0121401f }, /* HP */ |
| 9384 | { } |
| 9385 | }, |
| 9386 | .chained = true, |
| 9387 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 9388 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9389 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9390 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9391 | .v.func = alc_fixup_no_jack_detect, |
| 9392 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9393 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9394 | .type = HDA_FIXUP_PINS, |
| 9395 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9396 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 9397 | { } |
| 9398 | } |
| 9399 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9400 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9401 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 9402 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9403 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 9404 | [ALC668_FIXUP_DELL_XPS13] = { |
| 9405 | .type = HDA_FIXUP_FUNC, |
| 9406 | .v.func = alc_fixup_dell_xps13, |
| 9407 | .chained = true, |
| 9408 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 9409 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 9410 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 9411 | .type = HDA_FIXUP_FUNC, |
| 9412 | .v.func = alc_fixup_disable_aamix, |
| 9413 | .chained = true, |
| 9414 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 9415 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 9416 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 9417 | .type = HDA_FIXUP_FUNC, |
| 9418 | .v.func = alc_fixup_auto_mute_via_amp, |
| 9419 | .chained = true, |
| 9420 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 9421 | }, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9422 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 9423 | .type = HDA_FIXUP_PINS, |
| 9424 | .v.pins = (const struct hda_pintbl[]) { |
| 9425 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 9426 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ |
| 9427 | { } |
| 9428 | }, |
| 9429 | .chained = true, |
| 9430 | .chain_id = ALC662_FIXUP_HEADSET_MODE |
| 9431 | }, |
| 9432 | [ALC662_FIXUP_HEADSET_MODE] = { |
| 9433 | .type = HDA_FIXUP_FUNC, |
| 9434 | .v.func = alc_fixup_headset_mode_alc662, |
| 9435 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 9436 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 9437 | .type = HDA_FIXUP_PINS, |
| 9438 | .v.pins = (const struct hda_pintbl[]) { |
| 9439 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 9440 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 9441 | { } |
| 9442 | }, |
| 9443 | .chained = true, |
| 9444 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 9445 | }, |
| 9446 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 9447 | .type = HDA_FIXUP_FUNC, |
| 9448 | .v.func = alc_fixup_headset_mode_alc668, |
| 9449 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9450 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9451 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 9452 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 9453 | .chained = true, |
| 9454 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 9455 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9456 | [ALC662_FIXUP_BASS_16] = { |
| 9457 | .type = HDA_FIXUP_PINS, |
| 9458 | .v.pins = (const struct hda_pintbl[]) { |
| 9459 | {0x16, 0x80106111}, /* bass speaker */ |
| 9460 | {} |
| 9461 | }, |
| 9462 | .chained = true, |
| 9463 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 9464 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9465 | [ALC662_FIXUP_BASS_1A] = { |
| 9466 | .type = HDA_FIXUP_PINS, |
| 9467 | .v.pins = (const struct hda_pintbl[]) { |
| 9468 | {0x1a, 0x80106111}, /* bass speaker */ |
| 9469 | {} |
| 9470 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9471 | .chained = true, |
| 9472 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9473 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9474 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9475 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 9476 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 9477 | }, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 9478 | [ALC662_FIXUP_ASUS_Nx50] = { |
| 9479 | .type = HDA_FIXUP_FUNC, |
| 9480 | .v.func = alc_fixup_auto_mute_via_amp, |
| 9481 | .chained = true, |
| 9482 | .chain_id = ALC662_FIXUP_BASS_1A |
| 9483 | }, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9484 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
| 9485 | .type = HDA_FIXUP_FUNC, |
| 9486 | .v.func = alc_fixup_headset_mode_alc668, |
| 9487 | .chain_id = ALC662_FIXUP_BASS_CHMAP |
| 9488 | }, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9489 | [ALC668_FIXUP_ASUS_Nx51] = { |
| 9490 | .type = HDA_FIXUP_PINS, |
| 9491 | .v.pins = (const struct hda_pintbl[]) { |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9492 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 9493 | { 0x1a, 0x90170151 }, /* bass speaker */ |
| 9494 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9495 | {} |
| 9496 | }, |
| 9497 | .chained = true, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 9498 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9499 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9500 | [ALC668_FIXUP_MIC_COEF] = { |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 9501 | .type = HDA_FIXUP_VERBS, |
| 9502 | .v.verbs = (const struct hda_verb[]) { |
| 9503 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, |
| 9504 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, |
| 9505 | {} |
| 9506 | }, |
| 9507 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 9508 | [ALC668_FIXUP_ASUS_G751] = { |
| 9509 | .type = HDA_FIXUP_PINS, |
| 9510 | .v.pins = (const struct hda_pintbl[]) { |
| 9511 | { 0x16, 0x0421101f }, /* HP */ |
| 9512 | {} |
| 9513 | }, |
| 9514 | .chained = true, |
| 9515 | .chain_id = ALC668_FIXUP_MIC_COEF |
| 9516 | }, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9517 | [ALC891_FIXUP_HEADSET_MODE] = { |
| 9518 | .type = HDA_FIXUP_FUNC, |
| 9519 | .v.func = alc_fixup_headset_mode, |
| 9520 | }, |
| 9521 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 9522 | .type = HDA_FIXUP_PINS, |
| 9523 | .v.pins = (const struct hda_pintbl[]) { |
| 9524 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 9525 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 9526 | { } |
| 9527 | }, |
| 9528 | .chained = true, |
| 9529 | .chain_id = ALC891_FIXUP_HEADSET_MODE |
| 9530 | }, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 9531 | [ALC662_FIXUP_ACER_VERITON] = { |
| 9532 | .type = HDA_FIXUP_PINS, |
| 9533 | .v.pins = (const struct hda_pintbl[]) { |
| 9534 | { 0x15, 0x50170120 }, /* no internal speaker */ |
| 9535 | { } |
| 9536 | } |
| 9537 | }, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9538 | [ALC892_FIXUP_ASROCK_MOBO] = { |
| 9539 | .type = HDA_FIXUP_PINS, |
| 9540 | .v.pins = (const struct hda_pintbl[]) { |
| 9541 | { 0x15, 0x40f000f0 }, /* disabled */ |
| 9542 | { 0x16, 0x40f000f0 }, /* disabled */ |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9543 | { } |
| 9544 | } |
| 9545 | }, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9546 | [ALC662_FIXUP_USI_FUNC] = { |
| 9547 | .type = HDA_FIXUP_FUNC, |
| 9548 | .v.func = alc662_fixup_usi_headset_mic, |
| 9549 | }, |
| 9550 | [ALC662_FIXUP_USI_HEADSET_MODE] = { |
| 9551 | .type = HDA_FIXUP_PINS, |
| 9552 | .v.pins = (const struct hda_pintbl[]) { |
| 9553 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ |
| 9554 | { 0x18, 0x01a1903d }, |
| 9555 | { } |
| 9556 | }, |
| 9557 | .chained = true, |
| 9558 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 9559 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 9560 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
| 9561 | .type = HDA_FIXUP_FUNC, |
| 9562 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 9563 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9564 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { |
| 9565 | .type = HDA_FIXUP_FUNC, |
| 9566 | .v.func = alc662_fixup_aspire_ethos_hp, |
| 9567 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9568 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { |
| 9569 | .type = HDA_FIXUP_PINS, |
| 9570 | .v.pins = (const struct hda_pintbl[]) { |
| 9571 | { 0x15, 0x92130110 }, /* front speakers */ |
| 9572 | { 0x18, 0x99130111 }, /* center/subwoofer */ |
| 9573 | { 0x1b, 0x11130012 }, /* surround plus jack for HP */ |
| 9574 | { } |
| 9575 | }, |
| 9576 | .chained = true, |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 9577 | .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9578 | }, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9579 | [ALC671_FIXUP_HP_HEADSET_MIC2] = { |
| 9580 | .type = HDA_FIXUP_FUNC, |
| 9581 | .v.func = alc671_fixup_hp_headset_mic2, |
| 9582 | }, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 9583 | [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { |
| 9584 | .type = HDA_FIXUP_PINS, |
| 9585 | .v.pins = (const struct hda_pintbl[]) { |
| 9586 | { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ |
| 9587 | { } |
| 9588 | }, |
| 9589 | .chained = true, |
| 9590 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 9591 | }, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 9592 | [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { |
| 9593 | .type = HDA_FIXUP_PINS, |
| 9594 | .v.pins = (const struct hda_pintbl[]) { |
| 9595 | { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ |
| 9596 | { 0x1b, 0x0221144f }, |
| 9597 | { } |
| 9598 | }, |
| 9599 | .chained = true, |
| 9600 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 9601 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9602 | }; |
| 9603 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 9604 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9605 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 9606 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | 02f6ff9 | 2015-12-07 11:29:31 +0100 | [diff] [blame] | 9607 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 9608 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 9609 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 9610 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 9611 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 9612 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 9613 | 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] | 9614 | 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] | 9615 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 9616 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 9617 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 9618 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
Niranjan Sivakumar | 467e143 | 2015-09-05 18:20:35 +0200 | [diff] [blame] | 9619 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 9620 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99e | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 9621 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 9622 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 9623 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 9624 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 9625 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
Kaho Ng | 2da2dc9 | 2016-05-09 00:27:49 +0800 | [diff] [blame] | 9626 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
Bobi Mihalca | 83a9efb | 2016-03-23 13:32:33 +0200 | [diff] [blame] | 9627 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | db8948e | 2016-01-18 09:17:30 +0100 | [diff] [blame] | 9628 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 9629 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 9630 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9631 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9632 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 9633 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
| 9634 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
Takashi Iwai | c7efff9 | 2017-01-04 21:38:16 +0100 | [diff] [blame] | 9635 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 9636 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 9637 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 9638 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9639 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 9640 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 9641 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 9642 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 9643 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9644 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 9645 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 9646 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 9647 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 9648 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 9649 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9650 | SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9651 | |
| 9652 | #if 0 |
| 9653 | /* Below is a quirk table taken from the old code. |
| 9654 | * Basically the device should work as is without the fixup table. |
| 9655 | * If BIOS doesn't give a proper info, enable the corresponding |
| 9656 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 9657 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9658 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 9659 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 9660 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 9661 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 9662 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9663 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9664 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9665 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 9666 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 9667 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9668 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 9669 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 9670 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 9671 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 9672 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 9673 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9674 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 9675 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 9676 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9677 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 9678 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 9679 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9680 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 9681 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 9682 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 9683 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9684 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 9685 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 9686 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9687 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 9688 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9689 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9690 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 9691 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 9692 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 9693 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 9694 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 9695 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 9696 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 9697 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 9698 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 9699 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 9700 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9701 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 9702 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 9703 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 9704 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 9705 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 9706 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 9707 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 9708 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9709 | {} |
| 9710 | }; |
| 9711 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9712 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9713 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
| 9714 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9715 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9716 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9717 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 9718 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 9719 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 9720 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 9721 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 9722 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 9723 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 9724 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9725 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 9726 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9727 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 9728 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9729 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
| 9730 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, |
| 9731 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, |
| 9732 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, |
| 9733 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, |
| 9734 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, |
| 9735 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, |
| 9736 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, |
Takashi Iwai | 40c5167 | 2018-10-07 09:47:39 +0200 | [diff] [blame] | 9737 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 9738 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
| 9739 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, |
| 9740 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, |
| 9741 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, |
| 9742 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 9743 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 9744 | {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 9745 | {} |
| 9746 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 9747 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 9748 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9749 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 9750 | {0x17, 0x02211010}, |
| 9751 | {0x18, 0x01a19030}, |
| 9752 | {0x1a, 0x01813040}, |
| 9753 | {0x21, 0x01014020}), |
Hui Wang | 4b4e0e3 | 2019-07-16 15:21:34 +0800 | [diff] [blame] | 9754 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 9755 | {0x16, 0x01813030}, |
| 9756 | {0x17, 0x02211010}, |
| 9757 | {0x18, 0x01a19040}, |
| 9758 | {0x21, 0x01014020}), |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9759 | 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] | 9760 | {0x14, 0x01014010}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9761 | {0x18, 0x01a19020}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 9762 | {0x1a, 0x0181302f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9763 | {0x1b, 0x0221401f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9764 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 9765 | {0x12, 0x99a30130}, |
| 9766 | {0x14, 0x90170110}, |
| 9767 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9768 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9769 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 9770 | {0x12, 0x99a30140}, |
| 9771 | {0x14, 0x90170110}, |
| 9772 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9773 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9774 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 9775 | {0x12, 0x99a30150}, |
| 9776 | {0x14, 0x90170110}, |
| 9777 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9778 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9779 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9780 | {0x14, 0x90170110}, |
| 9781 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9782 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9783 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 9784 | {0x12, 0x90a60130}, |
| 9785 | {0x14, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9786 | {0x15, 0x0321101f}), |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9787 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 9788 | {0x14, 0x01014010}, |
| 9789 | {0x17, 0x90170150}, |
Kailang Yang | f2adbae | 2020-02-05 15:40:01 +0800 | [diff] [blame] | 9790 | {0x19, 0x02a11060}, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 9791 | {0x1b, 0x01813030}, |
| 9792 | {0x21, 0x02211020}), |
| 9793 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 9794 | {0x14, 0x01014010}, |
| 9795 | {0x18, 0x01a19040}, |
| 9796 | {0x1b, 0x01813030}, |
| 9797 | {0x21, 0x02211020}), |
| 9798 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 9799 | {0x14, 0x01014020}, |
| 9800 | {0x17, 0x90170110}, |
| 9801 | {0x18, 0x01a19050}, |
| 9802 | {0x1b, 0x01813040}, |
| 9803 | {0x21, 0x02211030}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 9804 | {} |
| 9805 | }; |
| 9806 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9807 | /* |
| 9808 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9809 | static int patch_alc662(struct hda_codec *codec) |
| 9810 | { |
| 9811 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9812 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9813 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9814 | err = alc_alloc_spec(codec, 0x0b); |
| 9815 | if (err < 0) |
| 9816 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9817 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9818 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 9819 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9820 | spec->shutup = alc_eapd_shutup; |
| 9821 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 9822 | /* handle multiple HPs as is */ |
| 9823 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 9824 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 9825 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 9826 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 9827 | switch (codec->core.vendor_id) { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 9828 | case 0x10ec0668: |
| 9829 | spec->init_hook = alc668_restore_default_value; |
| 9830 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 9831 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 9832 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 9833 | alc_pre_init(codec); |
| 9834 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9835 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 9836 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 9837 | 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] | 9838 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 9839 | |
| 9840 | alc_auto_parse_customize_define(codec); |
| 9841 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 9842 | if (has_cdefine_beep(codec)) |
| 9843 | spec->gen.beep_nid = 0x01; |
| 9844 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9845 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 9846 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9847 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 9848 | err = alc_codec_rename(codec, "ALC272X"); |
| 9849 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9850 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 9851 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 9852 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 9853 | /* automatic parse from the BIOS config */ |
| 9854 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9855 | if (err < 0) |
| 9856 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9857 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 9858 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 9859 | switch (codec->core.vendor_id) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9860 | case 0x10ec0662: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9861 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9862 | break; |
| 9863 | case 0x10ec0272: |
| 9864 | case 0x10ec0663: |
| 9865 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 9866 | case 0x10ec0668: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9867 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9868 | break; |
| 9869 | case 0x10ec0273: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9870 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 9871 | break; |
| 9872 | } |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 9873 | if (err < 0) |
| 9874 | goto error; |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 9875 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 9876 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9877 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 9878 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9879 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9880 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9881 | error: |
| 9882 | alc_free(codec); |
| 9883 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 9884 | } |
| 9885 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 9886 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9887 | * ALC680 support |
| 9888 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9889 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9890 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 9891 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 9892 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9893 | } |
| 9894 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9895 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9896 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9897 | static int patch_alc680(struct hda_codec *codec) |
| 9898 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9899 | int err; |
| 9900 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 9901 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9902 | err = alc_alloc_spec(codec, 0); |
| 9903 | if (err < 0) |
| 9904 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 9905 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 9906 | /* automatic parse from the BIOS config */ |
| 9907 | err = alc680_parse_auto_config(codec); |
| 9908 | if (err < 0) { |
| 9909 | alc_free(codec); |
| 9910 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9911 | } |
| 9912 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 9913 | return 0; |
| 9914 | } |
| 9915 | |
| 9916 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9917 | * patch entries |
| 9918 | */ |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9919 | static const struct hda_device_id snd_hda_id_realtek[] = { |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9920 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9921 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 9922 | HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 9923 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9924 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
| 9925 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9926 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9927 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 9928 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 9929 | HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9930 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
| 9931 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 9932 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9933 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
| 9934 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), |
| 9935 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), |
| 9936 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), |
| 9937 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), |
| 9938 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), |
| 9939 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9940 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9941 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
| 9942 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), |
| 9943 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), |
| 9944 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), |
| 9945 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), |
| 9946 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9947 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9948 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
Kailang Yang | 630e361 | 2020-05-27 14:10:26 +0800 | [diff] [blame] | 9949 | HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9950 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 9951 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9952 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
| 9953 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), |
| 9954 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 9955 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 9956 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9957 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 9958 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 9959 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 9960 | HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9961 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
| 9962 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
| 9963 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
| 9964 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), |
| 9965 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), |
| 9966 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), |
| 9967 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), |
| 9968 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), |
| 9969 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), |
| 9970 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), |
| 9971 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), |
| 9972 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), |
| 9973 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), |
| 9974 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 9975 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
| 9976 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), |
| 9977 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 9978 | HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 9979 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9980 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
| 9981 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), |
| 9982 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), |
| 9983 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), |
| 9984 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), |
| 9985 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), |
| 9986 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), |
| 9987 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), |
| 9988 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), |
| 9989 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), |
| 9990 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), |
| 9991 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
| 9992 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 9993 | HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 9994 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 9995 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9996 | {} /* terminator */ |
| 9997 | }; |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 9998 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 9999 | |
| 10000 | MODULE_LICENSE("GPL"); |
| 10001 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 10002 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 10003 | static struct hda_codec_driver realtek_driver = { |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 10004 | .id = snd_hda_id_realtek, |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 10005 | }; |
| 10006 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 10007 | module_hda_codec_driver(realtek_driver); |