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" |
Lucas Tanure | d3dca02 | 2021-12-17 11:57:07 +0000 | [diff] [blame] | 28 | #include "hda_component.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 30 | /* keep halting ALC5505 DSP, for power saving */ |
| 31 | #define HALT_REALTEK_ALC5505 |
| 32 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 33 | /* extra amp-initialization sequence types */ |
| 34 | enum { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 35 | ALC_INIT_UNDEFINED, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 36 | ALC_INIT_NONE, |
| 37 | ALC_INIT_DEFAULT, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 38 | }; |
| 39 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 40 | enum { |
| 41 | ALC_HEADSET_MODE_UNKNOWN, |
| 42 | ALC_HEADSET_MODE_UNPLUGGED, |
| 43 | ALC_HEADSET_MODE_HEADSET, |
| 44 | ALC_HEADSET_MODE_MIC, |
| 45 | ALC_HEADSET_MODE_HEADPHONE, |
| 46 | }; |
| 47 | |
| 48 | enum { |
| 49 | ALC_HEADSET_TYPE_UNKNOWN, |
| 50 | ALC_HEADSET_TYPE_CTIA, |
| 51 | ALC_HEADSET_TYPE_OMTP, |
| 52 | }; |
| 53 | |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 54 | enum { |
| 55 | ALC_KEY_MICMUTE_INDEX, |
| 56 | }; |
| 57 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 58 | struct alc_customize_define { |
| 59 | unsigned int sku_cfg; |
| 60 | unsigned char port_connectivity; |
| 61 | unsigned char check_sum; |
| 62 | unsigned char customization; |
| 63 | unsigned char external_amp; |
| 64 | unsigned int enable_pcbeep:1; |
| 65 | unsigned int platform_type:1; |
| 66 | unsigned int swap:1; |
| 67 | unsigned int override:1; |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 68 | 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] | 69 | }; |
| 70 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 71 | struct alc_coef_led { |
| 72 | unsigned int idx; |
| 73 | unsigned int mask; |
| 74 | unsigned int on; |
| 75 | unsigned int off; |
| 76 | }; |
| 77 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | struct alc_spec { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 79 | struct hda_gen_spec gen; /* must be at head */ |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 80 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | /* codec parameterization */ |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 82 | struct alc_customize_define cdefine; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 83 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
| 84 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 85 | /* GPIO bits */ |
| 86 | unsigned int gpio_mask; |
| 87 | unsigned int gpio_dir; |
| 88 | unsigned int gpio_data; |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 89 | bool gpio_write_delay; /* add a delay before writing gpio_data */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 90 | |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 91 | /* mute LED for HP laptops, see vref_mute_led_set() */ |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 92 | int mute_led_polarity; |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 93 | int micmute_led_polarity; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 94 | hda_nid_t mute_led_nid; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 95 | hda_nid_t cap_mute_led_nid; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 96 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 97 | unsigned int gpio_mute_led_mask; |
| 98 | unsigned int gpio_mic_led_mask; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 99 | struct alc_coef_led mute_led_coef; |
| 100 | struct alc_coef_led mic_led_coef; |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 101 | struct mutex coef_mutex; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 102 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 103 | hda_nid_t headset_mic_pin; |
| 104 | hda_nid_t headphone_mic_pin; |
| 105 | int current_headset_mode; |
| 106 | int current_headset_type; |
| 107 | |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 108 | /* hooks */ |
| 109 | void (*init_hook)(struct hda_codec *codec); |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 110 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 111 | void (*power_hook)(struct hda_codec *codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 112 | #endif |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 113 | void (*shutup)(struct hda_codec *codec); |
Takashi Iwai | d922b51 | 2011-04-28 12:18:53 +0200 | [diff] [blame] | 114 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 115 | int init_amp; |
Takashi Iwai | d433a67 | 2010-09-20 15:11:54 +0200 | [diff] [blame] | 116 | int codec_variant; /* flag for other variants */ |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 117 | unsigned int has_alc5505_dsp:1; |
| 118 | unsigned int no_depop_delay:1; |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 119 | unsigned int done_hp_init:1; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 120 | unsigned int no_shutup_pins:1; |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 121 | unsigned int ultra_low_power:1; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 122 | unsigned int has_hs_key:1; |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 123 | unsigned int no_internal_mic_pin:1; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 124 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 125 | /* for PLL fix */ |
| 126 | hda_nid_t pll_nid; |
| 127 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 128 | unsigned int coef0; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 129 | struct input_dev *kb_dev; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 130 | u8 alc_mute_keycode_map[1]; |
Lucas Tanure | d3dca02 | 2021-12-17 11:57:07 +0000 | [diff] [blame] | 131 | |
| 132 | /* component binding */ |
| 133 | struct component_match *match; |
| 134 | struct hda_component comps[HDA_MAX_COMPONENTS]; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 135 | }; |
| 136 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 137 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 138 | * COEF access helper functions |
| 139 | */ |
| 140 | |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 141 | static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 142 | unsigned int coef_idx) |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 143 | { |
| 144 | unsigned int val; |
| 145 | |
| 146 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 147 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 148 | return val; |
| 149 | } |
| 150 | |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 151 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 152 | unsigned int coef_idx) |
| 153 | { |
| 154 | struct alc_spec *spec = codec->spec; |
| 155 | unsigned int val; |
| 156 | |
| 157 | mutex_lock(&spec->coef_mutex); |
| 158 | val = __alc_read_coefex_idx(codec, nid, coef_idx); |
| 159 | mutex_unlock(&spec->coef_mutex); |
| 160 | return val; |
| 161 | } |
| 162 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 163 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 164 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 165 | |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 166 | static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 167 | unsigned int coef_idx, unsigned int coef_val) |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 168 | { |
| 169 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 170 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 171 | } |
| 172 | |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 173 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 174 | unsigned int coef_idx, unsigned int coef_val) |
| 175 | { |
| 176 | struct alc_spec *spec = codec->spec; |
| 177 | |
| 178 | mutex_lock(&spec->coef_mutex); |
| 179 | __alc_write_coefex_idx(codec, nid, coef_idx, coef_val); |
| 180 | mutex_unlock(&spec->coef_mutex); |
| 181 | } |
| 182 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 183 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 184 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 185 | |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 186 | static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 187 | unsigned int coef_idx, unsigned int mask, |
| 188 | unsigned int bits_set) |
| 189 | { |
| 190 | unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx); |
| 191 | |
| 192 | if (val != -1) |
| 193 | __alc_write_coefex_idx(codec, nid, coef_idx, |
| 194 | (val & ~mask) | bits_set); |
| 195 | } |
| 196 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 197 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 198 | unsigned int coef_idx, unsigned int mask, |
| 199 | unsigned int bits_set) |
| 200 | { |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 201 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 202 | |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 203 | mutex_lock(&spec->coef_mutex); |
| 204 | __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set); |
| 205 | mutex_unlock(&spec->coef_mutex); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 209 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 210 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 211 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 212 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 213 | { |
| 214 | struct alc_spec *spec = codec->spec; |
| 215 | |
| 216 | if (!spec->coef0) |
| 217 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 218 | return spec->coef0; |
| 219 | } |
| 220 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 221 | /* coef writes/updates batch */ |
| 222 | struct coef_fw { |
| 223 | unsigned char nid; |
| 224 | unsigned char idx; |
| 225 | unsigned short mask; |
| 226 | unsigned short val; |
| 227 | }; |
| 228 | |
| 229 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 230 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 231 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 232 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 233 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 234 | |
| 235 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 236 | const struct coef_fw *fw) |
| 237 | { |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 238 | struct alc_spec *spec = codec->spec; |
| 239 | |
| 240 | mutex_lock(&spec->coef_mutex); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 241 | for (; fw->nid; fw++) { |
| 242 | if (fw->mask == (unsigned short)-1) |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 243 | __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 244 | else |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 245 | __alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 246 | fw->mask, fw->val); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 247 | } |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 248 | mutex_unlock(&spec->coef_mutex); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 249 | } |
| 250 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 251 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 252 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 253 | */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 254 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 255 | /* Enable GPIO mask and set output */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 256 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
| 257 | { |
| 258 | struct alc_spec *spec = codec->spec; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 259 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 260 | spec->gpio_mask |= mask; |
| 261 | spec->gpio_dir |= mask; |
| 262 | spec->gpio_data |= mask; |
| 263 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 264 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 265 | static void alc_write_gpio_data(struct hda_codec *codec) |
| 266 | { |
| 267 | struct alc_spec *spec = codec->spec; |
| 268 | |
| 269 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 270 | spec->gpio_data); |
| 271 | } |
| 272 | |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 273 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
| 274 | bool on) |
| 275 | { |
| 276 | struct alc_spec *spec = codec->spec; |
| 277 | unsigned int oldval = spec->gpio_data; |
| 278 | |
| 279 | if (on) |
| 280 | spec->gpio_data |= mask; |
| 281 | else |
| 282 | spec->gpio_data &= ~mask; |
| 283 | if (oldval != spec->gpio_data) |
| 284 | alc_write_gpio_data(codec); |
| 285 | } |
| 286 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 287 | static void alc_write_gpio(struct hda_codec *codec) |
| 288 | { |
| 289 | struct alc_spec *spec = codec->spec; |
| 290 | |
| 291 | if (!spec->gpio_mask) |
| 292 | return; |
| 293 | |
| 294 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 295 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); |
| 296 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 297 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 298 | if (spec->gpio_write_delay) |
| 299 | msleep(1); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 300 | alc_write_gpio_data(codec); |
| 301 | } |
| 302 | |
| 303 | static void alc_fixup_gpio(struct hda_codec *codec, int action, |
| 304 | unsigned int mask) |
| 305 | { |
| 306 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 307 | alc_setup_gpio(codec, mask); |
| 308 | } |
| 309 | |
| 310 | static void alc_fixup_gpio1(struct hda_codec *codec, |
| 311 | const struct hda_fixup *fix, int action) |
| 312 | { |
| 313 | alc_fixup_gpio(codec, action, 0x01); |
| 314 | } |
| 315 | |
| 316 | static void alc_fixup_gpio2(struct hda_codec *codec, |
| 317 | const struct hda_fixup *fix, int action) |
| 318 | { |
| 319 | alc_fixup_gpio(codec, action, 0x02); |
| 320 | } |
| 321 | |
| 322 | static void alc_fixup_gpio3(struct hda_codec *codec, |
| 323 | const struct hda_fixup *fix, int action) |
| 324 | { |
| 325 | alc_fixup_gpio(codec, action, 0x03); |
| 326 | } |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 327 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 328 | static void alc_fixup_gpio4(struct hda_codec *codec, |
| 329 | const struct hda_fixup *fix, int action) |
| 330 | { |
| 331 | alc_fixup_gpio(codec, action, 0x04); |
| 332 | } |
| 333 | |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 334 | static void alc_fixup_micmute_led(struct hda_codec *codec, |
| 335 | const struct hda_fixup *fix, int action) |
| 336 | { |
Jaroslav Kysela | e65bf99 | 2021-03-17 18:29:43 +0100 | [diff] [blame] | 337 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 338 | snd_hda_gen_add_micmute_led_cdev(codec, NULL); |
| 339 | } |
| 340 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 341 | /* |
| 342 | * Fix hardware PLL issue |
| 343 | * On some codecs, the analog PLL gating control must be off while |
| 344 | * the default value is 1. |
| 345 | */ |
| 346 | static void alc_fix_pll(struct hda_codec *codec) |
| 347 | { |
| 348 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 349 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 350 | if (spec->pll_nid) |
| 351 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 352 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 353 | } |
| 354 | |
| 355 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 356 | unsigned int coef_idx, unsigned int coef_bit) |
| 357 | { |
| 358 | struct alc_spec *spec = codec->spec; |
| 359 | spec->pll_nid = nid; |
| 360 | spec->pll_coef_idx = coef_idx; |
| 361 | spec->pll_coef_bit = coef_bit; |
| 362 | alc_fix_pll(codec); |
| 363 | } |
| 364 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 365 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 366 | static void alc_update_knob_master(struct hda_codec *codec, |
| 367 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 368 | { |
| 369 | unsigned int val; |
| 370 | struct snd_kcontrol *kctl; |
| 371 | struct snd_ctl_elem_value *uctl; |
| 372 | |
| 373 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 374 | if (!kctl) |
| 375 | return; |
| 376 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 377 | if (!uctl) |
| 378 | return; |
Takashi Iwai | 2ebab40 | 2016-02-09 10:23:52 +0100 | [diff] [blame] | 379 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 380 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 381 | val &= HDA_AMP_VOLMASK; |
| 382 | uctl->value.integer.value[0] = val; |
| 383 | uctl->value.integer.value[1] = val; |
| 384 | kctl->put(kctl, uctl); |
| 385 | kfree(uctl); |
| 386 | } |
| 387 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 388 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 389 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 390 | /* For some reason, the res given from ALC880 is broken. |
| 391 | Here we adjust it properly. */ |
| 392 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 393 | } |
| 394 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 395 | /* Change EAPD to verb control */ |
| 396 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 397 | { |
| 398 | int coef; |
| 399 | |
| 400 | coef = alc_get_coef0(codec); |
| 401 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 402 | switch (codec->core.vendor_id) { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 403 | case 0x10ec0262: |
| 404 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 405 | break; |
| 406 | case 0x10ec0267: |
| 407 | case 0x10ec0268: |
| 408 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 409 | break; |
| 410 | case 0x10ec0269: |
| 411 | if ((coef & 0x00f0) == 0x0010) |
| 412 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 413 | if ((coef & 0x00f0) == 0x0020) |
| 414 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 415 | if ((coef & 0x00f0) == 0x0030) |
| 416 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 417 | break; |
| 418 | case 0x10ec0280: |
| 419 | case 0x10ec0284: |
| 420 | case 0x10ec0290: |
| 421 | case 0x10ec0292: |
| 422 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 423 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 424 | case 0x10ec0225: |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 425 | case 0x10ec0295: |
| 426 | case 0x10ec0299: |
| 427 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Gustavo A. R. Silva | c0dbbda | 2020-07-08 15:32:36 -0500 | [diff] [blame] | 428 | fallthrough; |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 429 | case 0x10ec0215: |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 430 | case 0x10ec0230: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 431 | case 0x10ec0233: |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 432 | case 0x10ec0235: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 433 | case 0x10ec0236: |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 434 | case 0x10ec0245: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 435 | case 0x10ec0255: |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 436 | case 0x10ec0256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 437 | case 0x10ec0257: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 438 | case 0x10ec0282: |
| 439 | case 0x10ec0283: |
| 440 | case 0x10ec0286: |
| 441 | case 0x10ec0288: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 442 | case 0x10ec0285: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 443 | case 0x10ec0298: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 444 | case 0x10ec0289: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 445 | case 0x10ec0300: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 446 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 447 | break; |
Kailang Yang | 3aabf94 | 2017-11-08 15:28:33 +0800 | [diff] [blame] | 448 | case 0x10ec0275: |
| 449 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); |
| 450 | break; |
Hui Wang | 8822702 | 2021-05-07 10:44:52 +0800 | [diff] [blame] | 451 | case 0x10ec0287: |
| 452 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 453 | alc_write_coef_idx(codec, 0x8, 0x4ab7); |
| 454 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 455 | case 0x10ec0293: |
| 456 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 457 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 458 | case 0x10ec0234: |
| 459 | case 0x10ec0274: |
| 460 | case 0x10ec0294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 461 | case 0x10ec0700: |
| 462 | case 0x10ec0701: |
| 463 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 464 | case 0x10ec0711: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 465 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
| 466 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 467 | case 0x10ec0662: |
| 468 | if ((coef & 0x00f0) == 0x0030) |
| 469 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 470 | break; |
| 471 | case 0x10ec0272: |
| 472 | case 0x10ec0273: |
| 473 | case 0x10ec0663: |
| 474 | case 0x10ec0665: |
| 475 | case 0x10ec0670: |
| 476 | case 0x10ec0671: |
| 477 | case 0x10ec0672: |
| 478 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 479 | break; |
Kailang Yang | 9194a1e | 2020-01-07 17:22:19 +0800 | [diff] [blame] | 480 | case 0x10ec0222: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 481 | case 0x10ec0623: |
| 482 | alc_update_coef_idx(codec, 0x19, 1<<13, 0); |
| 483 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 484 | case 0x10ec0668: |
| 485 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 486 | break; |
| 487 | case 0x10ec0867: |
| 488 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 489 | break; |
| 490 | case 0x10ec0888: |
| 491 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 492 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 493 | break; |
| 494 | case 0x10ec0892: |
Kailang Yang | e5782a5 | 2020-11-27 14:39:23 +0800 | [diff] [blame] | 495 | case 0x10ec0897: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 496 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 497 | break; |
| 498 | case 0x10ec0899: |
| 499 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 500 | case 0x10ec0b00: |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 501 | case 0x10ec1168: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 502 | case 0x10ec1220: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 503 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 504 | break; |
| 505 | } |
| 506 | } |
| 507 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 508 | /* additional initialization for ALC888 variants */ |
| 509 | static void alc888_coef_init(struct hda_codec *codec) |
| 510 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 511 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 512 | /* alc888-VA */ |
| 513 | case 0x00: |
| 514 | /* alc888-VB */ |
| 515 | case 0x10: |
| 516 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 517 | break; |
| 518 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 519 | } |
| 520 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 521 | /* turn on/off EAPD control (only if available) */ |
| 522 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 523 | { |
| 524 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 525 | return; |
| 526 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 527 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 528 | on ? 2 : 0); |
| 529 | } |
| 530 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 531 | /* turn on/off EAPD controls of the codec */ |
| 532 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 533 | { |
| 534 | /* We currently only handle front, HP */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 535 | static const hda_nid_t pins[] = { |
Hui Wang | af95b41 | 2015-03-26 17:14:55 +0800 | [diff] [blame] | 536 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 537 | }; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 538 | const hda_nid_t *p; |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 539 | for (p = pins; *p; p++) |
| 540 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 541 | } |
| 542 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 543 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 544 | |
| 545 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) |
| 546 | { |
| 547 | const struct hda_pincfg *pin; |
| 548 | int mic_pin = find_ext_mic_pin(codec); |
| 549 | int i; |
| 550 | |
| 551 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 552 | * the default pin setup at the next load of the driver |
| 553 | */ |
| 554 | if (codec->bus->shutdown) |
| 555 | return; |
| 556 | |
| 557 | snd_array_for_each(&codec->init_pins, i, pin) { |
| 558 | /* use read here for syncing after issuing each verb */ |
| 559 | if (pin->nid != mic_pin) |
| 560 | snd_hda_codec_read(codec, pin->nid, 0, |
| 561 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 562 | } |
| 563 | |
| 564 | codec->pins_shutup = 1; |
| 565 | } |
| 566 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 567 | static void alc_shutup_pins(struct hda_codec *codec) |
| 568 | { |
| 569 | struct alc_spec *spec = codec->spec; |
| 570 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 571 | switch (codec->core.vendor_id) { |
Kailang Yang | 5aec989 | 2021-10-05 14:35:14 +0800 | [diff] [blame] | 572 | case 0x10ec0236: |
| 573 | case 0x10ec0256: |
Kailang Yang | 66c5d71 | 2019-12-09 15:56:15 +0800 | [diff] [blame] | 574 | case 0x10ec0283: |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 575 | case 0x10ec0286: |
| 576 | case 0x10ec0288: |
| 577 | case 0x10ec0298: |
| 578 | alc_headset_mic_no_shutup(codec); |
| 579 | break; |
| 580 | default: |
| 581 | if (!spec->no_shutup_pins) |
| 582 | snd_hda_shutup_pins(codec); |
| 583 | break; |
| 584 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 585 | } |
| 586 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 587 | /* generic shutup callback; |
Lars-Peter Clausen | 4ce8e6a | 2016-11-08 15:48:06 +0100 | [diff] [blame] | 588 | * just turning off EAPD and a little pause for avoiding pop-noise |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 589 | */ |
| 590 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 591 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 592 | struct alc_spec *spec = codec->spec; |
| 593 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 594 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 595 | if (!spec->no_depop_delay) |
| 596 | msleep(200); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 597 | alc_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 598 | } |
| 599 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 600 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 601 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 602 | { |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 603 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 604 | alc_write_gpio(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 605 | switch (type) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 606 | case ALC_INIT_DEFAULT: |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 607 | switch (codec->core.vendor_id) { |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 608 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 609 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 610 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 611 | case 0x10ec0880: |
| 612 | case 0x10ec0882: |
| 613 | case 0x10ec0883: |
| 614 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 615 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 616 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 617 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 618 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 619 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 620 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 621 | break; |
| 622 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 623 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 624 | |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 625 | /* get a primary headphone pin if available */ |
| 626 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) |
| 627 | { |
| 628 | if (spec->gen.autocfg.hp_pins[0]) |
| 629 | return spec->gen.autocfg.hp_pins[0]; |
| 630 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 631 | return spec->gen.autocfg.line_out_pins[0]; |
| 632 | return 0; |
| 633 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 634 | |
| 635 | /* |
| 636 | * Realtek SSID verification |
| 637 | */ |
| 638 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 639 | /* Could be any non-zero and even value. When used as fixup, tells |
| 640 | * the driver to ignore any present sku defines. |
| 641 | */ |
| 642 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 643 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 644 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 645 | const struct hda_fixup *fix, int action) |
| 646 | { |
| 647 | struct alc_spec *spec = codec->spec; |
| 648 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 649 | spec->cdefine.fixup = 1; |
| 650 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 651 | } |
| 652 | } |
| 653 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 654 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 655 | const struct hda_fixup *fix, int action) |
| 656 | { |
| 657 | struct alc_spec *spec = codec->spec; |
| 658 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 659 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 660 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 661 | codec->depop_delay = 0; |
| 662 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 663 | } |
| 664 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 665 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 666 | { |
| 667 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 668 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 669 | struct alc_spec *spec = codec->spec; |
| 670 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 671 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 672 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 673 | if (spec->cdefine.fixup) { |
| 674 | ass = spec->cdefine.sku_cfg; |
| 675 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 676 | return -1; |
| 677 | goto do_sku; |
| 678 | } |
| 679 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 680 | if (!codec->bus->pci) |
| 681 | return -1; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 682 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 683 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 684 | goto do_sku; |
| 685 | |
| 686 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 687 | if (codec->core.vendor_id == 0x10ec0260) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 688 | nid = 0x17; |
| 689 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 690 | |
| 691 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 692 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 693 | codec->core.chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 694 | return -1; |
| 695 | } |
| 696 | |
| 697 | /* check sum */ |
| 698 | tmp = 0; |
| 699 | for (i = 1; i < 16; i++) { |
| 700 | if ((ass >> i) & 1) |
| 701 | tmp++; |
| 702 | } |
| 703 | if (((ass >> 16) & 0xf) != tmp) |
| 704 | return -1; |
| 705 | |
| 706 | spec->cdefine.port_connectivity = ass >> 30; |
| 707 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 708 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 709 | spec->cdefine.customization = ass >> 8; |
| 710 | do_sku: |
| 711 | spec->cdefine.sku_cfg = ass; |
| 712 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 713 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 714 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 715 | spec->cdefine.override = ass & 0x1; |
| 716 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 717 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 718 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 719 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 720 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 721 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 722 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 723 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 724 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 725 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 726 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 727 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 728 | |
| 729 | return 0; |
| 730 | } |
| 731 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 732 | /* return the position of NID in the list, or -1 if not found */ |
| 733 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 734 | { |
| 735 | int i; |
| 736 | for (i = 0; i < nums; i++) |
| 737 | if (list[i] == nid) |
| 738 | return i; |
| 739 | return -1; |
| 740 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 741 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 742 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 743 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 744 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 745 | } |
| 746 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 747 | /* check subsystem ID and set up device-specific initialization; |
| 748 | * return 1 if initialized, 0 if invalid SSID |
| 749 | */ |
| 750 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 751 | * 31 ~ 16 : Manufacture ID |
| 752 | * 15 ~ 8 : SKU ID |
| 753 | * 7 ~ 0 : Assembly ID |
| 754 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 755 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 756 | 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] | 757 | { |
| 758 | unsigned int ass, tmp, i; |
| 759 | unsigned nid; |
| 760 | struct alc_spec *spec = codec->spec; |
| 761 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 762 | if (spec->cdefine.fixup) { |
| 763 | ass = spec->cdefine.sku_cfg; |
| 764 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 765 | return 0; |
| 766 | goto do_sku; |
| 767 | } |
| 768 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 769 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 770 | if (codec->bus->pci && |
| 771 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 772 | goto do_sku; |
| 773 | |
| 774 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 775 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 776 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 777 | * 29~21 : reserve |
| 778 | * 20 : PCBEEP input |
| 779 | * 19~16 : Check sum (15:1) |
| 780 | * 15~1 : Custom |
| 781 | * 0 : override |
| 782 | */ |
| 783 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 784 | if (codec->core.vendor_id == 0x10ec0260) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 785 | nid = 0x17; |
| 786 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 787 | codec_dbg(codec, |
| 788 | "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] | 789 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 790 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 791 | return 0; |
| 792 | if ((ass >> 30) != 1) /* no physical connection */ |
| 793 | return 0; |
| 794 | |
| 795 | /* check sum */ |
| 796 | tmp = 0; |
| 797 | for (i = 1; i < 16; i++) { |
| 798 | if ((ass >> i) & 1) |
| 799 | tmp++; |
| 800 | } |
| 801 | if (((ass >> 16) & 0xf) != tmp) |
| 802 | return 0; |
| 803 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 804 | 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] | 805 | ass & 0xffff, codec->core.vendor_id); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 806 | /* |
| 807 | * 0 : override |
| 808 | * 1 : Swap Jack |
| 809 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 810 | * 3~5 : External Amplifier control |
| 811 | * 7~6 : Reserved |
| 812 | */ |
| 813 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 814 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 815 | switch (tmp) { |
| 816 | case 1: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 817 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 818 | break; |
| 819 | case 3: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 820 | alc_setup_gpio(codec, 0x02); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 821 | break; |
| 822 | case 7: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 823 | alc_setup_gpio(codec, 0x03); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 824 | break; |
| 825 | case 5: |
| 826 | default: |
| 827 | spec->init_amp = ALC_INIT_DEFAULT; |
| 828 | break; |
| 829 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 830 | } |
| 831 | |
| 832 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 833 | * when the external headphone out jack is plugged" |
| 834 | */ |
| 835 | if (!(ass & 0x8000)) |
| 836 | return 1; |
| 837 | /* |
| 838 | * 10~8 : Jack location |
| 839 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 840 | * 14~13: Resvered |
| 841 | * 15 : 1 --> enable the function "Mute internal speaker |
| 842 | * when the external headphone out jack is plugged" |
| 843 | */ |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 844 | if (!alc_get_hp_pin(spec)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 845 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 846 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 847 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 848 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 849 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 850 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 851 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 852 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 853 | return 1; |
| 854 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 855 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 856 | /* Check the validity of ALC subsystem-id |
| 857 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 858 | 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] | 859 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 860 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 861 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6779120 | 2020-04-18 21:06:39 +0200 | [diff] [blame] | 862 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 863 | codec_dbg(codec, |
| 864 | "realtek: Enable default setup for auto mode as fallback\n"); |
| 865 | spec->init_amp = ALC_INIT_DEFAULT; |
| 866 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 867 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 868 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 869 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 870 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 871 | */ |
| 872 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 873 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 874 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 875 | { |
| 876 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 877 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 878 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 879 | } |
| 880 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 881 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 882 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 883 | { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 884 | int err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 885 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 886 | err = snd_hda_gen_build_controls(codec); |
| 887 | if (err < 0) |
| 888 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 889 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 890 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 891 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 892 | } |
| 893 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 894 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 895 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 896 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 897 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 898 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 899 | static void alc_pre_init(struct hda_codec *codec) |
| 900 | { |
| 901 | alc_fill_eapd_coef(codec); |
| 902 | } |
| 903 | |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 904 | #define is_s3_resume(codec) \ |
| 905 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 906 | #define is_s4_resume(codec) \ |
| 907 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) |
| 908 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 909 | static int alc_init(struct hda_codec *codec) |
| 910 | { |
| 911 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 912 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 913 | /* hibernation resume needs the full chip initialization */ |
| 914 | if (is_s4_resume(codec)) |
| 915 | alc_pre_init(codec); |
| 916 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 917 | if (spec->init_hook) |
| 918 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 919 | |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 920 | spec->gen.skip_verbs = 1; /* applied in below */ |
Kailang Yang | 607ca3b | 2019-04-26 16:35:41 +0800 | [diff] [blame] | 921 | snd_hda_gen_init(codec); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 922 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 923 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 89781d0 | 2019-08-30 12:03:38 +0200 | [diff] [blame] | 924 | snd_hda_apply_verbs(codec); /* apply verbs here after own init */ |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 925 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 926 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 927 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 928 | return 0; |
| 929 | } |
| 930 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 931 | static inline void alc_shutup(struct hda_codec *codec) |
| 932 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 933 | struct alc_spec *spec = codec->spec; |
| 934 | |
Takashi Iwai | c7273bd | 2018-06-12 16:09:57 +0200 | [diff] [blame] | 935 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
| 936 | return; /* disabled explicitly by hints */ |
| 937 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 938 | if (spec && spec->shutup) |
| 939 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 940 | else |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 941 | alc_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 942 | } |
| 943 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 944 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 945 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 946 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 947 | static void alc_power_eapd(struct hda_codec *codec) |
| 948 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 949 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 950 | } |
| 951 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 952 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 953 | { |
| 954 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 955 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 956 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 957 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 958 | return 0; |
| 959 | } |
| 960 | #endif |
| 961 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 962 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 963 | static int alc_resume(struct hda_codec *codec) |
| 964 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 965 | struct alc_spec *spec = codec->spec; |
| 966 | |
| 967 | if (!spec->no_depop_delay) |
| 968 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 969 | codec->patch_ops.init(codec); |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 970 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 971 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 972 | return 0; |
| 973 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 974 | #endif |
| 975 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 976 | /* |
| 977 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 978 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 979 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 980 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 981 | .init = alc_init, |
| 982 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 983 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 984 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 985 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 986 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 987 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 988 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 989 | }; |
| 990 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 991 | |
Takashi Iwai | ded255b | 2015-10-01 17:59:43 +0200 | [diff] [blame] | 992 | #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] | 993 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 994 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 995 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 996 | */ |
| 997 | struct alc_codec_rename_table { |
| 998 | unsigned int vendor_id; |
| 999 | unsigned short coef_mask; |
| 1000 | unsigned short coef_bits; |
| 1001 | const char *name; |
| 1002 | }; |
| 1003 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1004 | struct alc_codec_rename_pci_table { |
| 1005 | unsigned int codec_vendor_id; |
| 1006 | unsigned short pci_subvendor; |
| 1007 | unsigned short pci_subdevice; |
| 1008 | const char *name; |
| 1009 | }; |
| 1010 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 1011 | static const struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1012 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1013 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 1014 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 1015 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 1016 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 1017 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 1018 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 1019 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 1020 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1021 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1022 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 1023 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 1024 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 1025 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 1026 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 1027 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 1028 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 1029 | { } /* terminator */ |
| 1030 | }; |
| 1031 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 1032 | static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1033 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 1034 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 1035 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 1036 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1037 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 1038 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1039 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 1040 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1041 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 1042 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
Kailang Yang | 2c674fa | 2015-05-05 15:02:42 +0800 | [diff] [blame] | 1043 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 1044 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
Kailang Yang | 8232450 | 2015-05-25 17:16:49 +0800 | [diff] [blame] | 1045 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 1046 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 1047 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 1048 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 1049 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 1050 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 1051 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 1052 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 1053 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 1054 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 1055 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 1056 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 1057 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 1058 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 1059 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1060 | { } /* terminator */ |
| 1061 | }; |
| 1062 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1063 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 1064 | { |
| 1065 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1066 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1067 | |
| 1068 | for (p = rename_tbl; p->vendor_id; p++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1069 | if (p->vendor_id != codec->core.vendor_id) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1070 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 1071 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1072 | return alc_codec_rename(codec, p->name); |
| 1073 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1074 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 1075 | if (!codec->bus->pci) |
| 1076 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1077 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1078 | if (q->codec_vendor_id != codec->core.vendor_id) |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1079 | continue; |
| 1080 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 1081 | continue; |
| 1082 | if (!q->pci_subdevice || |
| 1083 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 1084 | return alc_codec_rename(codec, q->name); |
| 1085 | } |
| 1086 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1087 | return 0; |
| 1088 | } |
| 1089 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 1090 | |
| 1091 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1092 | * Digital-beep handlers |
| 1093 | */ |
| 1094 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1095 | |
| 1096 | /* additional beep mixers; private_value will be overwritten */ |
| 1097 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
| 1098 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
| 1099 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
| 1100 | }; |
| 1101 | |
| 1102 | /* set up and create beep controls */ |
| 1103 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, |
| 1104 | int idx, int dir) |
| 1105 | { |
| 1106 | struct snd_kcontrol_new *knew; |
| 1107 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); |
| 1108 | int i; |
| 1109 | |
| 1110 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { |
| 1111 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 1112 | &alc_beep_mixer[i]); |
| 1113 | if (!knew) |
| 1114 | return -ENOMEM; |
| 1115 | knew->private_value = beep_amp; |
| 1116 | } |
| 1117 | return 0; |
| 1118 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1119 | |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1120 | static const struct snd_pci_quirk beep_allow_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1121 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1122 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1123 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1124 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1125 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1126 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1127 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1128 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1129 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1130 | /* denylist -- no beep available */ |
Takashi Iwai | 051c78a | 2019-08-22 09:58:07 +0200 | [diff] [blame] | 1131 | SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
| 1132 | SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1133 | {} |
| 1134 | }; |
| 1135 | |
| 1136 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1137 | { |
| 1138 | struct alc_spec *spec = codec->spec; |
| 1139 | const struct snd_pci_quirk *q; |
Takashi Iwai | 6317e5e | 2020-07-14 19:26:27 +0200 | [diff] [blame] | 1140 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1141 | if (q) |
| 1142 | return q->value; |
| 1143 | return spec->cdefine.enable_pcbeep; |
| 1144 | } |
| 1145 | #else |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1146 | #define set_beep_amp(spec, nid, idx, dir) 0 |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1147 | #define has_cdefine_beep(codec) 0 |
| 1148 | #endif |
| 1149 | |
| 1150 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1151 | /* return 1 if successful, 0 if the proper config is not found, |
| 1152 | * or a negative error code |
| 1153 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1154 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1155 | const hda_nid_t *ignore_nids, |
| 1156 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1157 | { |
| 1158 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1159 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1160 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1161 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1162 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1163 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1164 | if (err < 0) |
| 1165 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1166 | |
| 1167 | if (ssid_nids) |
| 1168 | alc_ssid_check(codec, ssid_nids); |
| 1169 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1170 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1171 | if (err < 0) |
| 1172 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1173 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1174 | return 1; |
| 1175 | } |
| 1176 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1177 | /* common preparation job for alc_spec */ |
| 1178 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1179 | { |
| 1180 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1181 | int err; |
| 1182 | |
| 1183 | if (!spec) |
| 1184 | return -ENOMEM; |
| 1185 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1186 | snd_hda_gen_spec_init(&spec->gen); |
| 1187 | spec->gen.mixer_nid = mixer_nid; |
| 1188 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1189 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1190 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1191 | codec->spdif_status_reset = 1; |
Kai Vehmanen | a6e7d0a | 2020-10-12 13:27:04 +0300 | [diff] [blame] | 1192 | codec->forced_resume = 1; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1193 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | b837a9f | 2022-01-31 08:57:38 +0100 | [diff] [blame] | 1194 | mutex_init(&spec->coef_mutex); |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1195 | |
| 1196 | err = alc_codec_rename_from_preset(codec); |
| 1197 | if (err < 0) { |
| 1198 | kfree(spec); |
| 1199 | return err; |
| 1200 | } |
| 1201 | return 0; |
| 1202 | } |
| 1203 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1204 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1205 | { |
| 1206 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1207 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1208 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1209 | } |
| 1210 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1211 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1212 | * ALC880 fix-ups |
| 1213 | */ |
| 1214 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1215 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1216 | ALC880_FIXUP_GPIO2, |
| 1217 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1218 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1219 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1220 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1221 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1222 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1223 | ALC880_FIXUP_VOL_KNOB, |
| 1224 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1225 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1226 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1227 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1228 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1229 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1230 | ALC880_FIXUP_3ST_BASE, |
| 1231 | ALC880_FIXUP_3ST, |
| 1232 | ALC880_FIXUP_3ST_DIG, |
| 1233 | ALC880_FIXUP_5ST_BASE, |
| 1234 | ALC880_FIXUP_5ST, |
| 1235 | ALC880_FIXUP_5ST_DIG, |
| 1236 | ALC880_FIXUP_6ST_BASE, |
| 1237 | ALC880_FIXUP_6ST, |
| 1238 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1239 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1240 | }; |
| 1241 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1242 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1243 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1244 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1245 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1246 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1247 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1248 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1249 | } |
| 1250 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1251 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1252 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1253 | .type = HDA_FIXUP_FUNC, |
| 1254 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1255 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1256 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1257 | .type = HDA_FIXUP_FUNC, |
| 1258 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1259 | }, |
| 1260 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1261 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1262 | .v.verbs = (const struct hda_verb[]) { |
| 1263 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1264 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1265 | { } |
| 1266 | }, |
| 1267 | .chained = true, |
| 1268 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1269 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1270 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1271 | .type = HDA_FIXUP_PINS, |
| 1272 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1273 | /* disable bogus unused pins */ |
| 1274 | { 0x16, 0x411111f0 }, |
| 1275 | { 0x18, 0x411111f0 }, |
| 1276 | { 0x1a, 0x411111f0 }, |
| 1277 | { } |
| 1278 | } |
| 1279 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1280 | [ALC880_FIXUP_LG_LW25] = { |
| 1281 | .type = HDA_FIXUP_PINS, |
| 1282 | .v.pins = (const struct hda_pintbl[]) { |
| 1283 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1284 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1285 | { } |
| 1286 | } |
| 1287 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1288 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1289 | .type = HDA_FIXUP_PINS, |
| 1290 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1291 | /* disable bogus unused pins */ |
| 1292 | { 0x17, 0x411111f0 }, |
| 1293 | { } |
| 1294 | }, |
| 1295 | .chained = true, |
| 1296 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1297 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1298 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1299 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1300 | .v.verbs = (const struct hda_verb[]) { |
| 1301 | /* change to EAPD mode */ |
| 1302 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1303 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1304 | {} |
| 1305 | }, |
| 1306 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1307 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1308 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1309 | .v.verbs = (const struct hda_verb[]) { |
| 1310 | /* change to EAPD mode */ |
| 1311 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1312 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1313 | {} |
| 1314 | }, |
| 1315 | .chained = true, |
| 1316 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1317 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1318 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1319 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1320 | .v.func = alc880_fixup_vol_knob, |
| 1321 | }, |
| 1322 | [ALC880_FIXUP_FUJITSU] = { |
| 1323 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1324 | .type = HDA_FIXUP_PINS, |
| 1325 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1326 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1327 | { 0x15, 0x99030120 }, /* speaker */ |
| 1328 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1329 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1330 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1331 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1332 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1333 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1334 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1335 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1336 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1337 | { } |
| 1338 | }, |
| 1339 | .chained = true, |
| 1340 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1341 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1342 | [ALC880_FIXUP_F1734] = { |
| 1343 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1344 | .type = HDA_FIXUP_PINS, |
| 1345 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1346 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1347 | { 0x15, 0x99030120 }, /* speaker */ |
| 1348 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1349 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1350 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1351 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1352 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1353 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1354 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1355 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1356 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1357 | { } |
| 1358 | }, |
| 1359 | .chained = true, |
| 1360 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1361 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1362 | [ALC880_FIXUP_UNIWILL] = { |
| 1363 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1364 | .type = HDA_FIXUP_PINS, |
| 1365 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1366 | { 0x14, 0x0121411f }, /* HP */ |
| 1367 | { 0x15, 0x99030120 }, /* speaker */ |
| 1368 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1369 | { } |
| 1370 | }, |
| 1371 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1372 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1373 | .type = HDA_FIXUP_PINS, |
| 1374 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1375 | /* disable bogus unused pins */ |
| 1376 | { 0x17, 0x411111f0 }, |
| 1377 | { 0x19, 0x411111f0 }, |
| 1378 | { 0x1b, 0x411111f0 }, |
| 1379 | { 0x1f, 0x411111f0 }, |
| 1380 | { } |
| 1381 | } |
| 1382 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1383 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1384 | .type = HDA_FIXUP_PINS, |
| 1385 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1386 | /* set up the whole pins as BIOS is utterly broken */ |
| 1387 | { 0x14, 0x99030120 }, /* speaker */ |
| 1388 | { 0x15, 0x0121411f }, /* HP */ |
| 1389 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1390 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1391 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1392 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1393 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1394 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1395 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1396 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1397 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1398 | { } |
| 1399 | } |
| 1400 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1401 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1402 | .type = HDA_FIXUP_PINS, |
| 1403 | .v.pins = (const struct hda_pintbl[]) { |
| 1404 | /* set up the whole pins as BIOS is utterly broken */ |
| 1405 | { 0x14, 0x0121411f }, /* HP */ |
| 1406 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1407 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1408 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1409 | { 0x18, 0x90a60160 }, /* mic */ |
| 1410 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1411 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1412 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1413 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1414 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1415 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1416 | { } |
| 1417 | }, |
| 1418 | .chained = true, |
| 1419 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1420 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1421 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1422 | .type = HDA_FIXUP_PINS, |
| 1423 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1424 | { 0x14, 0x01014010 }, /* line-out */ |
| 1425 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1426 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1427 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1428 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1429 | { 0x19, 0x0121411f }, /* HP */ |
| 1430 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1431 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1432 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1433 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1434 | /* 0x1e is filled in below */ |
| 1435 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1436 | { } |
| 1437 | } |
| 1438 | }, |
| 1439 | [ALC880_FIXUP_3ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1440 | .type = HDA_FIXUP_PINS, |
| 1441 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1442 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1443 | { } |
| 1444 | }, |
| 1445 | .chained = true, |
| 1446 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1447 | }, |
| 1448 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1449 | .type = HDA_FIXUP_PINS, |
| 1450 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1451 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1452 | { } |
| 1453 | }, |
| 1454 | .chained = true, |
| 1455 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1456 | }, |
| 1457 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1458 | .type = HDA_FIXUP_PINS, |
| 1459 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1460 | { 0x14, 0x01014010 }, /* front */ |
| 1461 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1462 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1463 | { 0x17, 0x01016412 }, /* surr */ |
| 1464 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1465 | { 0x19, 0x0121411f }, /* HP */ |
| 1466 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1467 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1468 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1469 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1470 | /* 0x1e is filled in below */ |
| 1471 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1472 | { } |
| 1473 | } |
| 1474 | }, |
| 1475 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1476 | .type = HDA_FIXUP_PINS, |
| 1477 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1478 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1479 | { } |
| 1480 | }, |
| 1481 | .chained = true, |
| 1482 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1483 | }, |
| 1484 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1485 | .type = HDA_FIXUP_PINS, |
| 1486 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1487 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1488 | { } |
| 1489 | }, |
| 1490 | .chained = true, |
| 1491 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1492 | }, |
| 1493 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1494 | .type = HDA_FIXUP_PINS, |
| 1495 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1496 | { 0x14, 0x01014010 }, /* front */ |
| 1497 | { 0x15, 0x01016412 }, /* surr */ |
| 1498 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1499 | { 0x17, 0x01012414 }, /* side */ |
| 1500 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1501 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1502 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1503 | { 0x1b, 0x0121411f }, /* HP */ |
| 1504 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1505 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1506 | /* 0x1e is filled in below */ |
| 1507 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1508 | { } |
| 1509 | } |
| 1510 | }, |
| 1511 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1512 | .type = HDA_FIXUP_PINS, |
| 1513 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1514 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1515 | { } |
| 1516 | }, |
| 1517 | .chained = true, |
| 1518 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1519 | }, |
| 1520 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1521 | .type = HDA_FIXUP_PINS, |
| 1522 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1523 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1524 | { } |
| 1525 | }, |
| 1526 | .chained = true, |
| 1527 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1528 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1529 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1530 | .type = HDA_FIXUP_PINS, |
| 1531 | .v.pins = (const struct hda_pintbl[]) { |
| 1532 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1533 | { } |
| 1534 | }, |
| 1535 | .chained_before = true, |
| 1536 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1537 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1538 | }; |
| 1539 | |
| 1540 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1541 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1542 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1543 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1544 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1545 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1546 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1547 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1548 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1549 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1550 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1551 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1552 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1553 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1554 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | a161574 | 2015-08-13 18:05:06 +0200 | [diff] [blame] | 1555 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1556 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1557 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1558 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1559 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1560 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1561 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1562 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1563 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1564 | |
| 1565 | /* Below is the copied entries from alc880_quirks.c. |
| 1566 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1567 | * on these machines, thus they are kept to be compatible with |
| 1568 | * the old static quirks. Once when it's confirmed to work without |
| 1569 | * these overrides, it'd be better to remove. |
| 1570 | */ |
| 1571 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1572 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1573 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1574 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1575 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1576 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1577 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1578 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1579 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1580 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1581 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1582 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1583 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1584 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1585 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1586 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1587 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1588 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1589 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1590 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1591 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1592 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1593 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1594 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1595 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1596 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1597 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1598 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1599 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1600 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1601 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1602 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1603 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1604 | /* default Intel */ |
| 1605 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1606 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1607 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1608 | {} |
| 1609 | }; |
| 1610 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1611 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1612 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1613 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1614 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1615 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1616 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1617 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1618 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1619 | {} |
| 1620 | }; |
| 1621 | |
| 1622 | |
| 1623 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1624 | * OK, here we have finally the patch for ALC880 |
| 1625 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1626 | static int patch_alc880(struct hda_codec *codec) |
| 1627 | { |
| 1628 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1629 | int err; |
| 1630 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1631 | err = alc_alloc_spec(codec, 0x0b); |
| 1632 | if (err < 0) |
| 1633 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1634 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1635 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1636 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1637 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1638 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1639 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1640 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1641 | alc_pre_init(codec); |
| 1642 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1643 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1644 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1645 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1646 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1647 | /* automatic parse from the BIOS config */ |
| 1648 | err = alc880_parse_auto_config(codec); |
| 1649 | if (err < 0) |
| 1650 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1651 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1652 | if (!spec->gen.no_analog) { |
| 1653 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 1654 | if (err < 0) |
| 1655 | goto error; |
| 1656 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1657 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1658 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1659 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1660 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1661 | |
| 1662 | error: |
| 1663 | alc_free(codec); |
| 1664 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1665 | } |
| 1666 | |
| 1667 | |
| 1668 | /* |
| 1669 | * ALC260 support |
| 1670 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1671 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1672 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1673 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1674 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1675 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1676 | } |
| 1677 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1678 | /* |
| 1679 | * Pin config fixes |
| 1680 | */ |
| 1681 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1682 | ALC260_FIXUP_HP_DC5750, |
| 1683 | ALC260_FIXUP_HP_PIN_0F, |
| 1684 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1685 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1686 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1687 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1688 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1689 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1690 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1691 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1692 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1693 | }; |
| 1694 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1695 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1696 | { |
| 1697 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 1698 | |
| 1699 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1700 | } |
| 1701 | |
| 1702 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1703 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1704 | { |
| 1705 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1706 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1707 | /* although the machine has only one output pin, we need to |
| 1708 | * toggle GPIO1 according to the jack state |
| 1709 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1710 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1711 | spec->gen.detect_hp = 1; |
| 1712 | spec->gen.automute_speaker = 1; |
| 1713 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1714 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1715 | snd_hda_gen_hp_automute); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1716 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1717 | } |
| 1718 | } |
| 1719 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1720 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1721 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1722 | { |
| 1723 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1724 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1725 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1726 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1727 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1728 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1729 | /* disable bogus I/O pins */ |
| 1730 | { 0x10, 0x411111f0 }, |
| 1731 | { 0x11, 0x411111f0 }, |
| 1732 | { 0x14, 0x411111f0 }, |
| 1733 | { 0x15, 0x411111f0 }, |
| 1734 | { 0x16, 0x411111f0 }, |
| 1735 | { 0x17, 0x411111f0 }, |
| 1736 | { 0x19, 0x411111f0 }, |
| 1737 | { } |
| 1738 | }; |
| 1739 | |
| 1740 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1741 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1742 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1743 | spec->init_amp = ALC_INIT_NONE; |
| 1744 | break; |
| 1745 | } |
| 1746 | } |
| 1747 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1748 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1749 | const struct hda_fixup *fix, int action) |
| 1750 | { |
| 1751 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 1752 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1753 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1754 | } |
| 1755 | |
| 1756 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1757 | const struct hda_fixup *fix, int action) |
| 1758 | { |
| 1759 | struct alc_spec *spec = codec->spec; |
| 1760 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1761 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1762 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1763 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1764 | } |
| 1765 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1766 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1767 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1768 | .type = HDA_FIXUP_PINS, |
| 1769 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1770 | { 0x11, 0x90130110 }, /* speaker */ |
| 1771 | { } |
| 1772 | } |
| 1773 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1774 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1775 | .type = HDA_FIXUP_PINS, |
| 1776 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1777 | { 0x0f, 0x01214000 }, /* HP */ |
| 1778 | { } |
| 1779 | } |
| 1780 | }, |
| 1781 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1782 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1783 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1784 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1785 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1786 | { } |
| 1787 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1788 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1789 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1790 | .type = HDA_FIXUP_FUNC, |
| 1791 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1792 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1793 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1794 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1795 | .v.func = alc260_fixup_gpio1_toggle, |
| 1796 | .chained = true, |
| 1797 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1798 | }, |
| 1799 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1800 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1801 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1802 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1803 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1804 | { } |
| 1805 | }, |
| 1806 | .chained = true, |
| 1807 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1808 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1809 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1810 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1811 | .v.func = alc260_fixup_gpio1_toggle, |
| 1812 | .chained = true, |
| 1813 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1814 | }, |
| 1815 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1816 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1817 | .v.func = alc260_fixup_kn1, |
| 1818 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1819 | [ALC260_FIXUP_FSC_S7020] = { |
| 1820 | .type = HDA_FIXUP_FUNC, |
| 1821 | .v.func = alc260_fixup_fsc_s7020, |
| 1822 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1823 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1824 | .type = HDA_FIXUP_FUNC, |
| 1825 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1826 | .chained = true, |
| 1827 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1828 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1829 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1830 | .type = HDA_FIXUP_PINS, |
| 1831 | .v.pins = (const struct hda_pintbl[]) { |
| 1832 | /* Pin configs are missing completely on some VAIOs */ |
| 1833 | { 0x0f, 0x01211020 }, |
| 1834 | { 0x10, 0x0001003f }, |
| 1835 | { 0x11, 0x411111f0 }, |
| 1836 | { 0x12, 0x01a15930 }, |
| 1837 | { 0x13, 0x411111f0 }, |
| 1838 | { 0x14, 0x411111f0 }, |
| 1839 | { 0x15, 0x411111f0 }, |
| 1840 | { 0x16, 0x411111f0 }, |
| 1841 | { 0x17, 0x411111f0 }, |
| 1842 | { 0x18, 0x411111f0 }, |
| 1843 | { 0x19, 0x411111f0 }, |
| 1844 | { } |
| 1845 | } |
| 1846 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1847 | }; |
| 1848 | |
| 1849 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1850 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1851 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1852 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1853 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1854 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1855 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1856 | 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] | 1857 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1858 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1859 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1860 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1861 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1862 | {} |
| 1863 | }; |
| 1864 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1865 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1866 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1867 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1868 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1869 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1870 | {} |
| 1871 | }; |
| 1872 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1873 | /* |
| 1874 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1875 | static int patch_alc260(struct hda_codec *codec) |
| 1876 | { |
| 1877 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1878 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1879 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1880 | err = alc_alloc_spec(codec, 0x07); |
| 1881 | if (err < 0) |
| 1882 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1883 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1884 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1885 | /* as quite a few machines require HP amp for speaker outputs, |
| 1886 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1887 | * it's almost harmless. |
| 1888 | */ |
| 1889 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1890 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1891 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1892 | spec->shutup = alc_eapd_shutup; |
| 1893 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1894 | alc_pre_init(codec); |
| 1895 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1896 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1897 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1898 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1899 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1900 | /* automatic parse from the BIOS config */ |
| 1901 | err = alc260_parse_auto_config(codec); |
| 1902 | if (err < 0) |
| 1903 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1904 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1905 | if (!spec->gen.no_analog) { |
| 1906 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
| 1907 | if (err < 0) |
| 1908 | goto error; |
| 1909 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1910 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1911 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1912 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1913 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1914 | |
| 1915 | error: |
| 1916 | alc_free(codec); |
| 1917 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1918 | } |
| 1919 | |
| 1920 | |
| 1921 | /* |
| 1922 | * ALC882/883/885/888/889 support |
| 1923 | * |
| 1924 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1925 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1926 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1927 | * 6-channel independent captures. |
| 1928 | * |
| 1929 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1930 | * driver yet). |
| 1931 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1932 | |
| 1933 | /* |
| 1934 | * Pin config fixes |
| 1935 | */ |
| 1936 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1937 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1938 | ALC882_FIXUP_LENOVO_Y530, |
| 1939 | ALC882_FIXUP_PB_M5210, |
| 1940 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1941 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1942 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1943 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1944 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1945 | ALC888_FIXUP_EEE1601, |
PeiSen Hou | 4841b8e | 2021-02-02 10:30:22 +0100 | [diff] [blame] | 1946 | ALC886_FIXUP_EAPD, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1947 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1948 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1949 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1950 | ALC882_FIXUP_GPIO1, |
| 1951 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1952 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1953 | ALC889_FIXUP_COEF, |
| 1954 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1955 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1956 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1957 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1958 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1959 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1960 | ALC889_FIXUP_MBP_VREF, |
| 1961 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1962 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1963 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1964 | ALC889_FIXUP_MP11_VREF, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1965 | ALC889_FIXUP_MP41_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1966 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1967 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1968 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1969 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1970 | ALC1220_FIXUP_GB_DUAL_CODECS, |
Christian Lachner | c193300 | 2022-01-03 15:05:17 +0100 | [diff] [blame] | 1971 | ALC1220_FIXUP_GB_X570, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 1972 | ALC1220_FIXUP_CLEVO_P950, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 1973 | ALC1220_FIXUP_CLEVO_PB51ED, |
| 1974 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 1975 | ALC887_FIXUP_ASUS_AUDIO, |
| 1976 | ALC887_FIXUP_ASUS_HMIC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1977 | }; |
| 1978 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1979 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1980 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1981 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1982 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1983 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1984 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1985 | } |
| 1986 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1987 | /* set up GPIO at initialization */ |
| 1988 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1989 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1990 | { |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 1991 | struct alc_spec *spec = codec->spec; |
| 1992 | |
| 1993 | spec->gpio_write_delay = true; |
| 1994 | alc_fixup_gpio3(codec, fix, action); |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1995 | } |
| 1996 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1997 | /* Fix the connection of some pins for ALC889: |
| 1998 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1999 | * work correctly (bko#42740) |
| 2000 | */ |
| 2001 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2002 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2003 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2004 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 2005 | /* fake the connections during parsing the tree */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2006 | static const hda_nid_t conn1[] = { 0x0c, 0x0d }; |
| 2007 | static const hda_nid_t conn2[] = { 0x0e, 0x0f }; |
| 2008 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 2009 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
| 2010 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); |
| 2011 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2012 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 2013 | /* restore the connections */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2014 | static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 2015 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); |
| 2016 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); |
| 2017 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); |
| 2018 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2019 | } |
| 2020 | } |
| 2021 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2022 | /* Set VREF on HP pin */ |
| 2023 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2024 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2025 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2026 | static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2027 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2028 | int i; |
| 2029 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2030 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2031 | return; |
| 2032 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 2033 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 2034 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 2035 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 2036 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2037 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 2038 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2039 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2040 | break; |
| 2041 | } |
| 2042 | } |
| 2043 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2044 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 2045 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2046 | { |
| 2047 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2048 | int i; |
| 2049 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2050 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2051 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 2052 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2053 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 2054 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2055 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2056 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2057 | } |
| 2058 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2059 | /* Set VREF on speaker pins on imac91 */ |
| 2060 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 2061 | const struct hda_fixup *fix, int action) |
| 2062 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2063 | static const hda_nid_t nids[] = { 0x18, 0x1a }; |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2064 | |
| 2065 | if (action == HDA_FIXUP_ACT_INIT) |
| 2066 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2067 | } |
| 2068 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2069 | /* Set VREF on speaker pins on mba11 */ |
| 2070 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 2071 | const struct hda_fixup *fix, int action) |
| 2072 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2073 | static const hda_nid_t nids[] = { 0x18 }; |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2074 | |
| 2075 | if (action == HDA_FIXUP_ACT_INIT) |
| 2076 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2077 | } |
| 2078 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2079 | /* Set VREF on speaker pins on mba21 */ |
| 2080 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 2081 | const struct hda_fixup *fix, int action) |
| 2082 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2083 | static const hda_nid_t nids[] = { 0x18, 0x19 }; |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2084 | |
| 2085 | if (action == HDA_FIXUP_ACT_INIT) |
| 2086 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2087 | } |
| 2088 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2089 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 2090 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 2091 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2092 | */ |
| 2093 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2094 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2095 | { |
| 2096 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2097 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2098 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2099 | spec->gen.no_multi_io = 1; |
| 2100 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2101 | } |
| 2102 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2103 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 2104 | const struct hda_fixup *fix, int action); |
| 2105 | |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2106 | /* For dual-codec configuration, we need to disable some features to avoid |
| 2107 | * conflicts of kctls and PCM streams |
| 2108 | */ |
| 2109 | static void alc_fixup_dual_codecs(struct hda_codec *codec, |
| 2110 | const struct hda_fixup *fix, int action) |
| 2111 | { |
| 2112 | struct alc_spec *spec = codec->spec; |
| 2113 | |
| 2114 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2115 | return; |
| 2116 | /* disable vmaster */ |
| 2117 | spec->gen.suppress_vmaster = 1; |
| 2118 | /* auto-mute and auto-mic switch don't work with multiple codecs */ |
| 2119 | spec->gen.suppress_auto_mute = 1; |
| 2120 | spec->gen.suppress_auto_mic = 1; |
| 2121 | /* disable aamix as well */ |
| 2122 | spec->gen.mixer_nid = 0; |
| 2123 | /* add location prefix to avoid conflicts */ |
| 2124 | codec->force_pin_prefix = 1; |
| 2125 | } |
| 2126 | |
| 2127 | static void rename_ctl(struct hda_codec *codec, const char *oldname, |
| 2128 | const char *newname) |
| 2129 | { |
| 2130 | struct snd_kcontrol *kctl; |
| 2131 | |
| 2132 | kctl = snd_hda_find_mixer_ctl(codec, oldname); |
| 2133 | if (kctl) |
| 2134 | strcpy(kctl->id.name, newname); |
| 2135 | } |
| 2136 | |
| 2137 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
| 2138 | const struct hda_fixup *fix, |
| 2139 | int action) |
| 2140 | { |
| 2141 | alc_fixup_dual_codecs(codec, fix, action); |
| 2142 | switch (action) { |
| 2143 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2144 | /* override card longname to provide a unique UCM profile */ |
| 2145 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); |
| 2146 | break; |
| 2147 | case HDA_FIXUP_ACT_BUILD: |
| 2148 | /* rename Capture controls depending on the codec */ |
| 2149 | rename_ctl(codec, "Capture Volume", |
| 2150 | codec->addr == 0 ? |
| 2151 | "Rear-Panel Capture Volume" : |
| 2152 | "Front-Panel Capture Volume"); |
| 2153 | rename_ctl(codec, "Capture Switch", |
| 2154 | codec->addr == 0 ? |
| 2155 | "Rear-Panel Capture Switch" : |
| 2156 | "Front-Panel Capture Switch"); |
| 2157 | break; |
| 2158 | } |
| 2159 | } |
| 2160 | |
Christian Lachner | c193300 | 2022-01-03 15:05:17 +0100 | [diff] [blame] | 2161 | static void alc1220_fixup_gb_x570(struct hda_codec *codec, |
| 2162 | const struct hda_fixup *fix, |
| 2163 | int action) |
| 2164 | { |
| 2165 | static const hda_nid_t conn1[] = { 0x0c }; |
| 2166 | static const struct coef_fw gb_x570_coefs[] = { |
Christian Lachner | 41a8601 | 2022-01-29 12:32:42 +0100 | [diff] [blame] | 2167 | WRITE_COEF(0x07, 0x03c0), |
Christian Lachner | c193300 | 2022-01-03 15:05:17 +0100 | [diff] [blame] | 2168 | WRITE_COEF(0x1a, 0x01c1), |
| 2169 | WRITE_COEF(0x1b, 0x0202), |
| 2170 | WRITE_COEF(0x43, 0x3005), |
| 2171 | {} |
| 2172 | }; |
| 2173 | |
| 2174 | switch (action) { |
| 2175 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2176 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 2177 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); |
| 2178 | break; |
| 2179 | case HDA_FIXUP_ACT_INIT: |
| 2180 | alc_process_coef_fw(codec, gb_x570_coefs); |
| 2181 | break; |
| 2182 | } |
| 2183 | } |
| 2184 | |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2185 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
| 2186 | const struct hda_fixup *fix, |
| 2187 | int action) |
| 2188 | { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2189 | static const hda_nid_t conn1[] = { 0x0c }; |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2190 | |
| 2191 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2192 | return; |
| 2193 | |
| 2194 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); |
| 2195 | /* We therefore want to make sure 0x14 (front headphone) and |
| 2196 | * 0x1b (speakers) use the stereo DAC 0x02 |
| 2197 | */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 2198 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 2199 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2200 | } |
| 2201 | |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2202 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 2203 | const struct hda_fixup *fix, int action); |
| 2204 | |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2205 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2206 | const struct hda_fixup *fix, |
| 2207 | int action) |
| 2208 | { |
| 2209 | alc1220_fixup_clevo_p950(codec, fix, action); |
| 2210 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); |
| 2211 | } |
| 2212 | |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 2213 | static void alc887_asus_hp_automute_hook(struct hda_codec *codec, |
| 2214 | struct hda_jack_callback *jack) |
| 2215 | { |
| 2216 | struct alc_spec *spec = codec->spec; |
| 2217 | unsigned int vref; |
| 2218 | |
| 2219 | snd_hda_gen_hp_automute(codec, jack); |
| 2220 | |
| 2221 | if (spec->gen.hp_jack_present) |
| 2222 | vref = AC_PINCTL_VREF_80; |
| 2223 | else |
| 2224 | vref = AC_PINCTL_VREF_HIZ; |
| 2225 | snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); |
| 2226 | } |
| 2227 | |
| 2228 | static void alc887_fixup_asus_jack(struct hda_codec *codec, |
| 2229 | const struct hda_fixup *fix, int action) |
| 2230 | { |
| 2231 | struct alc_spec *spec = codec->spec; |
| 2232 | if (action != HDA_FIXUP_ACT_PROBE) |
| 2233 | return; |
| 2234 | snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); |
| 2235 | spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; |
| 2236 | } |
| 2237 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2238 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2239 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2240 | .type = HDA_FIXUP_PINS, |
| 2241 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2242 | { 0x15, 0x01080104 }, /* side */ |
| 2243 | { 0x16, 0x01011012 }, /* rear */ |
| 2244 | { 0x17, 0x01016011 }, /* clfe */ |
| 2245 | { } |
| 2246 | } |
| 2247 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2248 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2249 | .type = HDA_FIXUP_PINS, |
| 2250 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2251 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2252 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2253 | { } |
| 2254 | } |
| 2255 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2256 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2257 | .type = HDA_FIXUP_PINCTLS, |
| 2258 | .v.pins = (const struct hda_pintbl[]) { |
| 2259 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2260 | {} |
| 2261 | } |
| 2262 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2263 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2264 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2265 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2266 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2267 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2268 | .type = HDA_FIXUP_PINS, |
| 2269 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2270 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2271 | { } |
| 2272 | } |
| 2273 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2274 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2275 | .type = HDA_FIXUP_PINS, |
| 2276 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2277 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2278 | { } |
| 2279 | } |
| 2280 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2281 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2282 | .type = HDA_FIXUP_PINS, |
| 2283 | .v.pins = (const struct hda_pintbl[]) { |
| 2284 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2285 | { } |
| 2286 | }, |
| 2287 | .chained = true, |
| 2288 | .chain_id = ALC889_FIXUP_CD, |
| 2289 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2290 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2291 | .type = HDA_FIXUP_PINS, |
| 2292 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2293 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2294 | { } |
| 2295 | } |
| 2296 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2297 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2298 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2299 | .v.verbs = (const struct hda_verb[]) { |
| 2300 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2301 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2302 | { } |
| 2303 | } |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2304 | }, |
PeiSen Hou | 4841b8e | 2021-02-02 10:30:22 +0100 | [diff] [blame] | 2305 | [ALC886_FIXUP_EAPD] = { |
| 2306 | .type = HDA_FIXUP_VERBS, |
| 2307 | .v.verbs = (const struct hda_verb[]) { |
| 2308 | /* change to EAPD mode */ |
| 2309 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2310 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 }, |
| 2311 | { } |
| 2312 | } |
| 2313 | }, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2314 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2315 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2316 | .v.verbs = (const struct hda_verb[]) { |
| 2317 | /* change to EAPD mode */ |
| 2318 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2319 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2320 | { } |
| 2321 | } |
| 2322 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2323 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2324 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2325 | .v.verbs = (const struct hda_verb[]) { |
| 2326 | /* change to EAPD mode */ |
| 2327 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2328 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2329 | { } |
| 2330 | } |
| 2331 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2332 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2333 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2334 | .v.verbs = (const struct hda_verb[]) { |
| 2335 | /* eanable EAPD on Acer laptops */ |
| 2336 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2337 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2338 | { } |
| 2339 | } |
| 2340 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2341 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2342 | .type = HDA_FIXUP_FUNC, |
| 2343 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2344 | }, |
| 2345 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2346 | .type = HDA_FIXUP_FUNC, |
| 2347 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2348 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2349 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2350 | .type = HDA_FIXUP_FUNC, |
| 2351 | .v.func = alc_fixup_gpio3, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2352 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2353 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2354 | .type = HDA_FIXUP_FUNC, |
| 2355 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2356 | .chained = true, |
| 2357 | .chain_id = ALC882_FIXUP_EAPD, |
| 2358 | }, |
| 2359 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2360 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2361 | .v.func = alc889_fixup_coef, |
| 2362 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2363 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2364 | .type = HDA_FIXUP_PINS, |
| 2365 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2366 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2367 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2368 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2369 | }, |
| 2370 | .chained = true, |
| 2371 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2372 | }, |
| 2373 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2374 | .type = HDA_FIXUP_PINS, |
| 2375 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2376 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2377 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2378 | { } |
| 2379 | }, |
| 2380 | .chained = true, |
| 2381 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2382 | }, |
| 2383 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2384 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2385 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2386 | .v.verbs = (const struct hda_verb[]) { |
| 2387 | /* Enable all DACs */ |
| 2388 | /* DAC DISABLE/MUTE 1? */ |
| 2389 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2390 | * apparently. Init=0x38 */ |
| 2391 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2392 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2393 | /* DAC DISABLE/MUTE 2? */ |
| 2394 | /* some bit here disables the other DACs. |
| 2395 | * Init=0x4900 */ |
| 2396 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2397 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2398 | /* DMIC fix |
| 2399 | * This laptop has a stereo digital microphone. |
| 2400 | * The mics are only 1cm apart which makes the stereo |
| 2401 | * useless. However, either the mic or the ALC889 |
| 2402 | * makes the signal become a difference/sum signal |
| 2403 | * instead of standard stereo, which is annoying. |
| 2404 | * So instead we flip this bit which makes the |
| 2405 | * codec replicate the sum signal to both channels, |
| 2406 | * turning it into a normal mono mic. |
| 2407 | */ |
| 2408 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2409 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2410 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2411 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2412 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2413 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2414 | }, |
| 2415 | .chained = true, |
| 2416 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2417 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2418 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2419 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2420 | .v.func = alc885_fixup_macpro_gpio, |
| 2421 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2422 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2423 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2424 | .v.func = alc889_fixup_dac_route, |
| 2425 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2426 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2427 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2428 | .v.func = alc889_fixup_mbp_vref, |
| 2429 | .chained = true, |
| 2430 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2431 | }, |
| 2432 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2433 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2434 | .v.func = alc889_fixup_imac91_vref, |
| 2435 | .chained = true, |
| 2436 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2437 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2438 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2439 | .type = HDA_FIXUP_FUNC, |
| 2440 | .v.func = alc889_fixup_mba11_vref, |
| 2441 | .chained = true, |
| 2442 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2443 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2444 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2445 | .type = HDA_FIXUP_FUNC, |
| 2446 | .v.func = alc889_fixup_mba21_vref, |
| 2447 | .chained = true, |
| 2448 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2449 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2450 | [ALC889_FIXUP_MP11_VREF] = { |
| 2451 | .type = HDA_FIXUP_FUNC, |
| 2452 | .v.func = alc889_fixup_mba11_vref, |
| 2453 | .chained = true, |
| 2454 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2455 | }, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2456 | [ALC889_FIXUP_MP41_VREF] = { |
| 2457 | .type = HDA_FIXUP_FUNC, |
| 2458 | .v.func = alc889_fixup_mbp_vref, |
| 2459 | .chained = true, |
| 2460 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2461 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2462 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2463 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2464 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2465 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2466 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2467 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2468 | .v.func = alc882_fixup_no_primary_hp, |
| 2469 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2470 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2471 | .type = HDA_FIXUP_PINS, |
| 2472 | .v.pins = (const struct hda_pintbl[]) { |
| 2473 | {0x16, 0x99130130}, /* bass speaker */ |
| 2474 | {} |
| 2475 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2476 | .chained = true, |
| 2477 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2478 | }, |
| 2479 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2480 | .type = HDA_FIXUP_FUNC, |
| 2481 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2482 | }, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2483 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
| 2484 | .type = HDA_FIXUP_FUNC, |
| 2485 | .v.func = alc1220_fixup_gb_dual_codecs, |
| 2486 | }, |
Christian Lachner | c193300 | 2022-01-03 15:05:17 +0100 | [diff] [blame] | 2487 | [ALC1220_FIXUP_GB_X570] = { |
| 2488 | .type = HDA_FIXUP_FUNC, |
| 2489 | .v.func = alc1220_fixup_gb_x570, |
| 2490 | }, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2491 | [ALC1220_FIXUP_CLEVO_P950] = { |
| 2492 | .type = HDA_FIXUP_FUNC, |
| 2493 | .v.func = alc1220_fixup_clevo_p950, |
| 2494 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2495 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2496 | .type = HDA_FIXUP_FUNC, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2497 | .v.func = alc1220_fixup_clevo_pb51ed, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2498 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2499 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2500 | .type = HDA_FIXUP_PINS, |
| 2501 | .v.pins = (const struct hda_pintbl[]) { |
| 2502 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 2503 | {} |
| 2504 | }, |
| 2505 | .chained = true, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2506 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2507 | }, |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 2508 | [ALC887_FIXUP_ASUS_AUDIO] = { |
| 2509 | .type = HDA_FIXUP_PINS, |
| 2510 | .v.pins = (const struct hda_pintbl[]) { |
| 2511 | { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ |
| 2512 | { 0x19, 0x22219420 }, |
| 2513 | {} |
| 2514 | }, |
| 2515 | }, |
| 2516 | [ALC887_FIXUP_ASUS_HMIC] = { |
| 2517 | .type = HDA_FIXUP_FUNC, |
| 2518 | .v.func = alc887_fixup_asus_jack, |
| 2519 | .chained = true, |
| 2520 | .chain_id = ALC887_FIXUP_ASUS_AUDIO, |
| 2521 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2522 | }; |
| 2523 | |
| 2524 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2525 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2526 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | b5d724b | 2015-06-02 19:57:08 +0200 | [diff] [blame] | 2527 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2528 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2529 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2530 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2531 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2532 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2533 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2534 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2535 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2536 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2537 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2538 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2539 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
Takashi Iwai | b265047 | 2021-04-28 13:26:52 +0200 | [diff] [blame] | 2540 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2541 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2542 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2543 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2544 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2545 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2546 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2547 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2548 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2549 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2550 | 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] | 2551 | 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] | 2552 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2553 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2554 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Jian-Hong Pan | ca18435 | 2020-10-07 13:22:25 +0800 | [diff] [blame] | 2555 | SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2556 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2557 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | 85bcf96 | 2016-12-06 16:20:36 +0100 | [diff] [blame] | 2558 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
Takashi Iwai | b7529c1 | 2021-04-28 13:26:53 +0200 | [diff] [blame] | 2559 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
| 2560 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2561 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2562 | 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] | 2563 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2564 | |
| 2565 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2566 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2567 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2568 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2569 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2570 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2571 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2572 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2573 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2574 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2575 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2576 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2577 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2578 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2579 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2580 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2581 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2582 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2583 | 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] | 2584 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2585 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2586 | 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] | 2587 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2588 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2589 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
PeiSen Hou | 4841b8e | 2021-02-02 10:30:22 +0100 | [diff] [blame] | 2590 | SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2591 | 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] | 2592 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
Christian Lachner | c193300 | 2022-01-03 15:05:17 +0100 | [diff] [blame] | 2593 | SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570), |
Christian Lachner | ea35419 | 2022-01-29 12:32:43 +0100 | [diff] [blame] | 2594 | SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570), |
Christian Lachner | 41a8601 | 2022-01-29 12:32:42 +0100 | [diff] [blame] | 2595 | SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570), |
Takashi Iwai | a0b0395 | 2020-06-16 15:21:50 +0200 | [diff] [blame] | 2596 | SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | a655e2b | 2020-02-17 16:19:47 +0100 | [diff] [blame] | 2597 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 0992620 | 2020-12-20 09:09:43 +0100 | [diff] [blame] | 2598 | SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 1d3aa4a | 2020-04-08 15:56:45 +0200 | [diff] [blame] | 2599 | SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 7dafba3 | 2020-02-12 09:10:47 +0100 | [diff] [blame] | 2600 | SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | cc5049a | 2020-02-18 09:09:15 +0100 | [diff] [blame] | 2601 | SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | d2c3b14 | 2017-06-01 09:35:30 +0200 | [diff] [blame] | 2602 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | 26af177 | 2021-03-03 15:23:46 +0100 | [diff] [blame] | 2603 | SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS), |
Takashi Iwai | 6369158 | 2017-05-22 16:32:46 +0200 | [diff] [blame] | 2604 | 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] | 2605 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2606 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
PeiSen Hou | 259eb82 | 2020-05-19 08:50:12 +0200 | [diff] [blame] | 2607 | SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 2608 | SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2609 | SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2610 | SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Eckhart Mohr | 970e301 | 2021-04-27 17:30:25 +0200 | [diff] [blame] | 2611 | SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Steven Clarkson | aef454b | 2021-10-14 06:35:54 -0700 | [diff] [blame] | 2612 | SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 2613 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2614 | SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Eckhart Mohr | 970e301 | 2021-04-27 17:30:25 +0200 | [diff] [blame] | 2615 | SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Tim Crawford | dbfe8350 | 2021-11-01 10:21:34 -0600 | [diff] [blame] | 2616 | SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
PeiSen Hou | 259eb82 | 2020-05-19 08:50:12 +0200 | [diff] [blame] | 2617 | SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Werner Sembach | 1f8d398 | 2021-10-01 15:31:10 +0200 | [diff] [blame] | 2618 | SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Werner Sembach | cc03069 | 2021-10-01 15:31:11 +0200 | [diff] [blame] | 2619 | SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED), |
Takashi Iwai | 13e1a4c | 2021-04-28 13:26:54 +0200 | [diff] [blame] | 2620 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
| 2621 | SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), |
| 2622 | SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), |
| 2623 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
| 2624 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
| 2625 | SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950), |
| 2626 | SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950), |
| 2627 | SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950), |
| 2628 | SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950), |
| 2629 | SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), |
| 2630 | SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), |
| 2631 | SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2632 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2633 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2634 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2635 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2636 | {} |
| 2637 | }; |
| 2638 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2639 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2640 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
| 2641 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, |
| 2642 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, |
| 2643 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, |
| 2644 | {.id = ALC889_FIXUP_CD, .name = "cd"}, |
| 2645 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, |
| 2646 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, |
| 2647 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, |
| 2648 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, |
| 2649 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, |
| 2650 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, |
| 2651 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, |
| 2652 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, |
| 2653 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, |
| 2654 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2655 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2656 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2657 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2658 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
| 2659 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, |
| 2660 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, |
| 2661 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, |
| 2662 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, |
| 2663 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, |
| 2664 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, |
| 2665 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2666 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2667 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2668 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 2669 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
Christian Lachner | 63394a1 | 2022-01-29 12:32:41 +0100 | [diff] [blame] | 2670 | {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2671 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2672 | {} |
| 2673 | }; |
| 2674 | |
Hui Wang | 119b75c | 2021-05-22 11:47:41 +0800 | [diff] [blame] | 2675 | static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = { |
| 2676 | SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950, |
| 2677 | {0x14, 0x01014010}, |
| 2678 | {0x15, 0x01011012}, |
| 2679 | {0x16, 0x01016011}, |
| 2680 | {0x18, 0x01a19040}, |
| 2681 | {0x19, 0x02a19050}, |
| 2682 | {0x1a, 0x0181304f}, |
| 2683 | {0x1b, 0x0221401f}, |
| 2684 | {0x1e, 0x01456130}), |
| 2685 | SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950, |
| 2686 | {0x14, 0x01015010}, |
| 2687 | {0x15, 0x01011012}, |
| 2688 | {0x16, 0x01011011}, |
| 2689 | {0x18, 0x01a11040}, |
| 2690 | {0x19, 0x02a19050}, |
| 2691 | {0x1a, 0x0181104f}, |
| 2692 | {0x1b, 0x0221401f}, |
| 2693 | {0x1e, 0x01451130}), |
| 2694 | {} |
| 2695 | }; |
| 2696 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2697 | /* |
| 2698 | * BIOS auto configuration |
| 2699 | */ |
| 2700 | /* almost identical with ALC880 parser... */ |
| 2701 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2702 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2703 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2704 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2705 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2706 | } |
| 2707 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2708 | /* |
| 2709 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2710 | static int patch_alc882(struct hda_codec *codec) |
| 2711 | { |
| 2712 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2713 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2714 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2715 | err = alc_alloc_spec(codec, 0x0b); |
| 2716 | if (err < 0) |
| 2717 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2718 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2719 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2720 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 2721 | switch (codec->core.vendor_id) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2722 | case 0x10ec0882: |
| 2723 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2724 | case 0x10ec0900: |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 2725 | case 0x10ec0b00: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 2726 | case 0x10ec1220: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2727 | break; |
| 2728 | default: |
| 2729 | /* ALC883 and variants */ |
| 2730 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2731 | break; |
| 2732 | } |
| 2733 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2734 | alc_pre_init(codec); |
| 2735 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2736 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2737 | alc882_fixups); |
Hui Wang | 119b75c | 2021-05-22 11:47:41 +0800 | [diff] [blame] | 2738 | snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2739 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2740 | |
| 2741 | alc_auto_parse_customize_define(codec); |
| 2742 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2743 | if (has_cdefine_beep(codec)) |
| 2744 | spec->gen.beep_nid = 0x01; |
| 2745 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2746 | /* automatic parse from the BIOS config */ |
| 2747 | err = alc882_parse_auto_config(codec); |
| 2748 | if (err < 0) |
| 2749 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2750 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2751 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2752 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2753 | if (err < 0) |
| 2754 | goto error; |
| 2755 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2756 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2757 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2758 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2759 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2760 | |
| 2761 | error: |
| 2762 | alc_free(codec); |
| 2763 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2764 | } |
| 2765 | |
| 2766 | |
| 2767 | /* |
| 2768 | * ALC262 support |
| 2769 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2770 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2771 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2772 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2773 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2774 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2775 | } |
| 2776 | |
| 2777 | /* |
| 2778 | * Pin config fixes |
| 2779 | */ |
| 2780 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2781 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2782 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2783 | ALC262_FIXUP_HP_Z200, |
| 2784 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2785 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2786 | ALC262_FIXUP_BENQ, |
| 2787 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2788 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2789 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2790 | }; |
| 2791 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2792 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2793 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2794 | .type = HDA_FIXUP_PINS, |
| 2795 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2796 | { 0x14, 0x99130110 }, /* speaker */ |
| 2797 | { 0x15, 0x0221142f }, /* front HP */ |
| 2798 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2799 | { } |
| 2800 | } |
| 2801 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2802 | [ALC262_FIXUP_FSC_S7110] = { |
| 2803 | .type = HDA_FIXUP_PINS, |
| 2804 | .v.pins = (const struct hda_pintbl[]) { |
| 2805 | { 0x15, 0x90170110 }, /* speaker */ |
| 2806 | { } |
| 2807 | }, |
| 2808 | .chained = true, |
| 2809 | .chain_id = ALC262_FIXUP_BENQ, |
| 2810 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2811 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2812 | .type = HDA_FIXUP_PINS, |
| 2813 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2814 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2815 | { } |
| 2816 | } |
| 2817 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2818 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2819 | .type = HDA_FIXUP_PINS, |
| 2820 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2821 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2822 | { } |
| 2823 | } |
| 2824 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2825 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2826 | .type = HDA_FIXUP_PINCTLS, |
| 2827 | .v.pins = (const struct hda_pintbl[]) { |
| 2828 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2829 | {} |
| 2830 | }, |
| 2831 | .chained = true, |
| 2832 | .chain_id = ALC262_FIXUP_BENQ, |
| 2833 | }, |
| 2834 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2835 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2836 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2837 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2838 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2839 | {} |
| 2840 | } |
| 2841 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2842 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2843 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2844 | .v.verbs = (const struct hda_verb[]) { |
| 2845 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2846 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2847 | {} |
| 2848 | } |
| 2849 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2850 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2851 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2852 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2853 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2854 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2855 | .type = HDA_FIXUP_FUNC, |
| 2856 | .v.func = alc_fixup_no_depop_delay, |
| 2857 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2858 | }; |
| 2859 | |
| 2860 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2861 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2862 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2863 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2864 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
Takashi Iwai | 275ec0c | 2018-06-22 12:17:45 +0200 | [diff] [blame] | 2865 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2866 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2867 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2868 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2869 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2870 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2871 | {} |
| 2872 | }; |
| 2873 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2874 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2875 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e43c44d | 2018-06-26 17:02:08 +0200 | [diff] [blame] | 2876 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
| 2877 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, |
| 2878 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, |
| 2879 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, |
| 2880 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, |
| 2881 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, |
| 2882 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, |
| 2883 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2884 | {} |
| 2885 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2886 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2887 | /* |
| 2888 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2889 | static int patch_alc262(struct hda_codec *codec) |
| 2890 | { |
| 2891 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2892 | int err; |
| 2893 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2894 | err = alc_alloc_spec(codec, 0x0b); |
| 2895 | if (err < 0) |
| 2896 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2897 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2898 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2899 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2900 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2901 | spec->shutup = alc_eapd_shutup; |
| 2902 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2903 | #if 0 |
| 2904 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2905 | * under-run |
| 2906 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2907 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2908 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2909 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2910 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2911 | alc_pre_init(codec); |
| 2912 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2913 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2914 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2915 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2916 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2917 | alc_auto_parse_customize_define(codec); |
| 2918 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2919 | if (has_cdefine_beep(codec)) |
| 2920 | spec->gen.beep_nid = 0x01; |
| 2921 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2922 | /* automatic parse from the BIOS config */ |
| 2923 | err = alc262_parse_auto_config(codec); |
| 2924 | if (err < 0) |
| 2925 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2926 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2927 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2928 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2929 | if (err < 0) |
| 2930 | goto error; |
| 2931 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2932 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2933 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2934 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2935 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2936 | |
| 2937 | error: |
| 2938 | alc_free(codec); |
| 2939 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2940 | } |
| 2941 | |
| 2942 | /* |
| 2943 | * ALC268 |
| 2944 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2945 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2946 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 2947 | struct snd_ctl_elem_value *ucontrol) |
| 2948 | { |
| 2949 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2950 | unsigned long pval; |
| 2951 | int err; |
| 2952 | |
| 2953 | mutex_lock(&codec->control_mutex); |
| 2954 | pval = kcontrol->private_value; |
| 2955 | kcontrol->private_value = (pval & ~0xff) | 0x0f; |
| 2956 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2957 | if (err >= 0) { |
| 2958 | kcontrol->private_value = (pval & ~0xff) | 0x10; |
| 2959 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2960 | } |
| 2961 | kcontrol->private_value = pval; |
| 2962 | mutex_unlock(&codec->control_mutex); |
| 2963 | return err; |
| 2964 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2965 | |
| 2966 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2967 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2968 | { |
| 2969 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2970 | .name = "Beep Playback Switch", |
| 2971 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
| 2972 | .info = snd_hda_mixer_amp_switch_info, |
| 2973 | .get = snd_hda_mixer_amp_switch_get, |
| 2974 | .put = alc268_beep_switch_put, |
| 2975 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) |
| 2976 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2977 | }; |
| 2978 | |
| 2979 | /* set PCBEEP vol = 0, mute connections */ |
| 2980 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2981 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2982 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2983 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2984 | { } |
| 2985 | }; |
| 2986 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2987 | enum { |
| 2988 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2989 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2990 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2991 | }; |
| 2992 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2993 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2994 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2995 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2996 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2997 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2998 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2999 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 3000 | .v.verbs = (const struct hda_verb[]) { |
| 3001 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 3002 | {} |
| 3003 | } |
| 3004 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 3005 | [ALC268_FIXUP_SPDIF] = { |
| 3006 | .type = HDA_FIXUP_PINS, |
| 3007 | .v.pins = (const struct hda_pintbl[]) { |
| 3008 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 3009 | {} |
| 3010 | } |
| 3011 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 3012 | }; |
| 3013 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3014 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 3015 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 3016 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
Takashi Iwai | 03bf11c | 2018-06-26 16:56:41 +0200 | [diff] [blame] | 3017 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 3018 | {} |
| 3019 | }; |
| 3020 | |
| 3021 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 3022 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 3023 | 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] | 3024 | /* below is codec SSID since multiple Toshiba laptops have the |
| 3025 | * same PCI SSID 1179:ff00 |
| 3026 | */ |
| 3027 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 3028 | {} |
| 3029 | }; |
| 3030 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3031 | /* |
| 3032 | * BIOS auto configuration |
| 3033 | */ |
| 3034 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 3035 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 3036 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 3037 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3038 | } |
| 3039 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3040 | /* |
| 3041 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3042 | static int patch_alc268(struct hda_codec *codec) |
| 3043 | { |
| 3044 | struct alc_spec *spec; |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 3045 | int i, err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3046 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3047 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 3048 | err = alc_alloc_spec(codec, 0); |
| 3049 | if (err < 0) |
| 3050 | return err; |
| 3051 | |
| 3052 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 3053 | if (has_cdefine_beep(codec)) |
| 3054 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3055 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 3056 | spec->shutup = alc_eapd_shutup; |
| 3057 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 3058 | alc_pre_init(codec); |
| 3059 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3060 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 3061 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 3062 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 3063 | /* automatic parse from the BIOS config */ |
| 3064 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 3065 | if (err < 0) |
| 3066 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3067 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 3068 | if (err > 0 && !spec->gen.no_analog && |
| 3069 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 3070 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
| 3071 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 3072 | &alc268_beep_mixer[i])) { |
| 3073 | err = -ENOMEM; |
| 3074 | goto error; |
| 3075 | } |
| 3076 | } |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 3077 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3078 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 3079 | /* override the amp caps for beep generator */ |
| 3080 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 3081 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 3082 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 3083 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 3084 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 3085 | } |
| 3086 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3087 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 3088 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3089 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 3090 | |
| 3091 | error: |
| 3092 | alc_free(codec); |
| 3093 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3094 | } |
| 3095 | |
| 3096 | /* |
| 3097 | * ALC269 |
| 3098 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3099 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3100 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3101 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3102 | }; |
| 3103 | |
| 3104 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3105 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3106 | }; |
| 3107 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3108 | /* different alc269-variants */ |
| 3109 | enum { |
| 3110 | ALC269_TYPE_ALC269VA, |
| 3111 | ALC269_TYPE_ALC269VB, |
| 3112 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3113 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3114 | ALC269_TYPE_ALC280, |
| 3115 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3116 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3117 | ALC269_TYPE_ALC284, |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 3118 | ALC269_TYPE_ALC293, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 3119 | ALC269_TYPE_ALC286, |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 3120 | ALC269_TYPE_ALC298, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 3121 | ALC269_TYPE_ALC255, |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 3122 | ALC269_TYPE_ALC256, |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 3123 | ALC269_TYPE_ALC257, |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 3124 | ALC269_TYPE_ALC215, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 3125 | ALC269_TYPE_ALC225, |
Kailang Yang | 99cee034 | 2021-07-01 09:09:37 +0800 | [diff] [blame] | 3126 | ALC269_TYPE_ALC287, |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 3127 | ALC269_TYPE_ALC294, |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 3128 | ALC269_TYPE_ALC300, |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 3129 | ALC269_TYPE_ALC623, |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 3130 | ALC269_TYPE_ALC700, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3131 | }; |
| 3132 | |
| 3133 | /* |
| 3134 | * BIOS auto configuration |
| 3135 | */ |
| 3136 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 3137 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3138 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 3139 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 3140 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 3141 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3142 | const hda_nid_t *ssids; |
| 3143 | |
| 3144 | switch (spec->codec_variant) { |
| 3145 | case ALC269_TYPE_ALC269VA: |
| 3146 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3147 | case ALC269_TYPE_ALC280: |
| 3148 | case ALC269_TYPE_ALC284: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 3149 | case ALC269_TYPE_ALC293: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3150 | ssids = alc269va_ssids; |
| 3151 | break; |
| 3152 | case ALC269_TYPE_ALC269VB: |
| 3153 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 3154 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3155 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 3156 | case ALC269_TYPE_ALC286: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 3157 | case ALC269_TYPE_ALC298: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 3158 | case ALC269_TYPE_ALC255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 3159 | case ALC269_TYPE_ALC256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 3160 | case ALC269_TYPE_ALC257: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 3161 | case ALC269_TYPE_ALC215: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 3162 | case ALC269_TYPE_ALC225: |
Kailang Yang | 99cee034 | 2021-07-01 09:09:37 +0800 | [diff] [blame] | 3163 | case ALC269_TYPE_ALC287: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 3164 | case ALC269_TYPE_ALC294: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 3165 | case ALC269_TYPE_ALC300: |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 3166 | case ALC269_TYPE_ALC623: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 3167 | case ALC269_TYPE_ALC700: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3168 | ssids = alc269_ssids; |
| 3169 | break; |
| 3170 | default: |
| 3171 | ssids = alc269_ssids; |
| 3172 | break; |
| 3173 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3174 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 3175 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3176 | } |
| 3177 | |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3178 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
| 3179 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, |
| 3180 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, |
| 3181 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, |
| 3182 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, |
| 3183 | {} |
| 3184 | }; |
| 3185 | |
| 3186 | static void alc_headset_btn_callback(struct hda_codec *codec, |
| 3187 | struct hda_jack_callback *jack) |
| 3188 | { |
| 3189 | int report = 0; |
| 3190 | |
| 3191 | if (jack->unsol_res & (7 << 13)) |
| 3192 | report |= SND_JACK_BTN_0; |
| 3193 | |
| 3194 | if (jack->unsol_res & (1 << 16 | 3 << 8)) |
| 3195 | report |= SND_JACK_BTN_1; |
| 3196 | |
| 3197 | /* Volume up key */ |
| 3198 | if (jack->unsol_res & (7 << 23)) |
| 3199 | report |= SND_JACK_BTN_2; |
| 3200 | |
| 3201 | /* Volume down key */ |
| 3202 | if (jack->unsol_res & (7 << 10)) |
| 3203 | report |= SND_JACK_BTN_3; |
| 3204 | |
Hui Wang | 04f7791 | 2021-03-05 17:26:08 +0800 | [diff] [blame] | 3205 | snd_hda_jack_set_button_state(codec, jack->nid, report); |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3206 | } |
| 3207 | |
| 3208 | static void alc_disable_headset_jack_key(struct hda_codec *codec) |
| 3209 | { |
| 3210 | struct alc_spec *spec = codec->spec; |
| 3211 | |
| 3212 | if (!spec->has_hs_key) |
| 3213 | return; |
| 3214 | |
| 3215 | switch (codec->core.vendor_id) { |
| 3216 | case 0x10ec0215: |
| 3217 | case 0x10ec0225: |
| 3218 | case 0x10ec0285: |
Hui Wang | c72b9bf | 2020-12-05 13:11:30 +0800 | [diff] [blame] | 3219 | case 0x10ec0287: |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3220 | case 0x10ec0295: |
| 3221 | case 0x10ec0289: |
| 3222 | case 0x10ec0299: |
| 3223 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3224 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3225 | alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); |
| 3226 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 3227 | case 0x10ec0230: |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3228 | case 0x10ec0236: |
| 3229 | case 0x10ec0256: |
| 3230 | alc_write_coef_idx(codec, 0x48, 0x0); |
| 3231 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); |
| 3232 | break; |
| 3233 | } |
| 3234 | } |
| 3235 | |
| 3236 | static void alc_enable_headset_jack_key(struct hda_codec *codec) |
| 3237 | { |
| 3238 | struct alc_spec *spec = codec->spec; |
| 3239 | |
| 3240 | if (!spec->has_hs_key) |
| 3241 | return; |
| 3242 | |
| 3243 | switch (codec->core.vendor_id) { |
| 3244 | case 0x10ec0215: |
| 3245 | case 0x10ec0225: |
| 3246 | case 0x10ec0285: |
Hui Wang | c72b9bf | 2020-12-05 13:11:30 +0800 | [diff] [blame] | 3247 | case 0x10ec0287: |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3248 | case 0x10ec0295: |
| 3249 | case 0x10ec0289: |
| 3250 | case 0x10ec0299: |
| 3251 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3252 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3253 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); |
| 3254 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 3255 | case 0x10ec0230: |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3256 | case 0x10ec0236: |
| 3257 | case 0x10ec0256: |
| 3258 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 3259 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 3260 | break; |
| 3261 | } |
| 3262 | } |
| 3263 | |
| 3264 | static void alc_fixup_headset_jack(struct hda_codec *codec, |
| 3265 | const struct hda_fixup *fix, int action) |
| 3266 | { |
| 3267 | struct alc_spec *spec = codec->spec; |
Hui Wang | 04f7791 | 2021-03-05 17:26:08 +0800 | [diff] [blame] | 3268 | hda_nid_t hp_pin; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3269 | |
| 3270 | switch (action) { |
| 3271 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 3272 | spec->has_hs_key = 1; |
| 3273 | snd_hda_jack_detect_enable_callback(codec, 0x55, |
| 3274 | alc_headset_btn_callback); |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3275 | break; |
Hui Wang | 04f7791 | 2021-03-05 17:26:08 +0800 | [diff] [blame] | 3276 | case HDA_FIXUP_ACT_BUILD: |
| 3277 | hp_pin = alc_get_hp_pin(spec); |
| 3278 | if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55, |
| 3279 | alc_headset_btn_keymap, |
| 3280 | hp_pin)) |
| 3281 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", |
| 3282 | false, SND_JACK_HEADSET, |
| 3283 | alc_headset_btn_keymap); |
| 3284 | |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3285 | alc_enable_headset_jack_key(codec); |
| 3286 | break; |
| 3287 | } |
| 3288 | } |
| 3289 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3290 | 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] | 3291 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3292 | 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] | 3293 | } |
| 3294 | |
| 3295 | static void alc269_shutup(struct hda_codec *codec) |
| 3296 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3297 | struct alc_spec *spec = codec->spec; |
| 3298 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3299 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3300 | alc269vb_toggle_power_output(codec, 0); |
| 3301 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 3302 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3303 | msleep(150); |
| 3304 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3305 | alc_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3306 | } |
| 3307 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3308 | static const struct coef_fw alc282_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3309 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 3310 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3311 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3312 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3313 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3314 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3315 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3316 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 3317 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3318 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3319 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 3320 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 3321 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 3322 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 3323 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3324 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3325 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3326 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 3327 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 3328 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 3329 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 3330 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 3331 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 3332 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 3333 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3334 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 3335 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 3336 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 3337 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 3338 | {} |
| 3339 | }; |
| 3340 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3341 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 3342 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3343 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3344 | } |
| 3345 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3346 | static void alc282_init(struct hda_codec *codec) |
| 3347 | { |
| 3348 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3349 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3350 | bool hp_pin_sense; |
| 3351 | int coef78; |
| 3352 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3353 | alc282_restore_default_value(codec); |
| 3354 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3355 | if (!hp_pin) |
| 3356 | return; |
| 3357 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3358 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3359 | |
| 3360 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 3361 | /* Headphone capless set to high power mode */ |
| 3362 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3363 | |
| 3364 | if (hp_pin_sense) |
| 3365 | msleep(2); |
| 3366 | |
| 3367 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3368 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3369 | |
| 3370 | if (hp_pin_sense) |
| 3371 | msleep(85); |
| 3372 | |
| 3373 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3374 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3375 | |
| 3376 | if (hp_pin_sense) |
| 3377 | msleep(100); |
| 3378 | |
| 3379 | /* Headphone capless set to normal mode */ |
| 3380 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3381 | } |
| 3382 | |
| 3383 | static void alc282_shutup(struct hda_codec *codec) |
| 3384 | { |
| 3385 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3386 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3387 | bool hp_pin_sense; |
| 3388 | int coef78; |
| 3389 | |
| 3390 | if (!hp_pin) { |
| 3391 | alc269_shutup(codec); |
| 3392 | return; |
| 3393 | } |
| 3394 | |
| 3395 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3396 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3397 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3398 | |
| 3399 | if (hp_pin_sense) |
| 3400 | msleep(2); |
| 3401 | |
| 3402 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3403 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3404 | |
| 3405 | if (hp_pin_sense) |
| 3406 | msleep(85); |
| 3407 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3408 | if (!spec->no_shutup_pins) |
| 3409 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3410 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3411 | |
| 3412 | if (hp_pin_sense) |
| 3413 | msleep(100); |
| 3414 | |
| 3415 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3416 | alc_shutup_pins(codec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3417 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3418 | } |
| 3419 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 3420 | static const struct coef_fw alc283_coefs[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3421 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3422 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3423 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3424 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3425 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3426 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3427 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3428 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 3429 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3430 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3431 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 3432 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 3433 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 3434 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 3435 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3436 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3437 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3438 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 3439 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 3440 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 3441 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 3442 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 3443 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 3444 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 3445 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3446 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 3447 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 3448 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 3449 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 3450 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 3451 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 3452 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3453 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3454 | {} |
| 3455 | }; |
| 3456 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3457 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 3458 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3459 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3460 | } |
| 3461 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3462 | static void alc283_init(struct hda_codec *codec) |
| 3463 | { |
| 3464 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3465 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3466 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3467 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3468 | alc283_restore_default_value(codec); |
| 3469 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3470 | if (!hp_pin) |
| 3471 | return; |
Kailang Yang | a59d719 | 2015-04-08 16:34:00 +0800 | [diff] [blame] | 3472 | |
| 3473 | msleep(30); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3474 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3475 | |
| 3476 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 3477 | /* Headphone capless set to high power mode */ |
| 3478 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3479 | |
| 3480 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3481 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3482 | |
| 3483 | if (hp_pin_sense) |
| 3484 | msleep(85); |
| 3485 | |
| 3486 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3487 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3488 | |
| 3489 | if (hp_pin_sense) |
| 3490 | msleep(85); |
| 3491 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3492 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3493 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3494 | /* Headphone capless set to normal mode */ |
| 3495 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3496 | } |
| 3497 | |
| 3498 | static void alc283_shutup(struct hda_codec *codec) |
| 3499 | { |
| 3500 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3501 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3502 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3503 | |
| 3504 | if (!hp_pin) { |
| 3505 | alc269_shutup(codec); |
| 3506 | return; |
| 3507 | } |
| 3508 | |
| 3509 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3510 | |
| 3511 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3512 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 3513 | /*depop hp during suspend*/ |
| 3514 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 3515 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3516 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3517 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3518 | |
| 3519 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3520 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3521 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3522 | if (!spec->no_shutup_pins) |
| 3523 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3524 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3525 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3526 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3527 | |
| 3528 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3529 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3530 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3531 | alc_shutup_pins(codec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3532 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3533 | } |
| 3534 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3535 | static void alc256_init(struct hda_codec *codec) |
| 3536 | { |
| 3537 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3538 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3539 | bool hp_pin_sense; |
| 3540 | |
| 3541 | if (!hp_pin) |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3542 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3543 | |
| 3544 | msleep(30); |
| 3545 | |
| 3546 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3547 | |
| 3548 | if (hp_pin_sense) |
| 3549 | msleep(2); |
| 3550 | |
| 3551 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3552 | if (spec->ultra_low_power) { |
| 3553 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); |
| 3554 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); |
| 3555 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); |
| 3556 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); |
| 3557 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3558 | msleep(30); |
| 3559 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3560 | |
| 3561 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3562 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3563 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3564 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3565 | msleep(85); |
| 3566 | |
| 3567 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3568 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3569 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3570 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3571 | msleep(100); |
| 3572 | |
| 3573 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
| 3574 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 3575 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
| 3576 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); |
Thomas Hebb | c447374 | 2020-03-30 12:09:38 -0400 | [diff] [blame] | 3577 | /* |
| 3578 | * Expose headphone mic (or possibly Line In on some machines) instead |
| 3579 | * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See |
| 3580 | * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of |
| 3581 | * this register. |
| 3582 | */ |
| 3583 | alc_write_coef_idx(codec, 0x36, 0x5757); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3584 | } |
| 3585 | |
| 3586 | static void alc256_shutup(struct hda_codec *codec) |
| 3587 | { |
| 3588 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3589 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3590 | bool hp_pin_sense; |
| 3591 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3592 | if (!hp_pin) |
| 3593 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3594 | |
| 3595 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3596 | |
| 3597 | if (hp_pin_sense) |
| 3598 | msleep(2); |
| 3599 | |
| 3600 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3601 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3602 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3603 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3604 | msleep(85); |
| 3605 | |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3606 | /* 3k pull low control for Headset jack. */ |
| 3607 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
Hui Wang | 3f74249 | 2020-09-14 14:51:18 +0800 | [diff] [blame] | 3608 | /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly |
| 3609 | * when booting with headset plugged. So skip setting it for the codec alc257 |
| 3610 | */ |
Kailang Yang | 5aec989 | 2021-10-05 14:35:14 +0800 | [diff] [blame] | 3611 | if (spec->codec_variant != ALC269_TYPE_ALC257 && |
| 3612 | spec->codec_variant != ALC269_TYPE_ALC256) |
Hui Wang | 3f74249 | 2020-09-14 14:51:18 +0800 | [diff] [blame] | 3613 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3614 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3615 | if (!spec->no_shutup_pins) |
| 3616 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3617 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3618 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3619 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3620 | msleep(100); |
| 3621 | |
| 3622 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3623 | alc_shutup_pins(codec); |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3624 | if (spec->ultra_low_power) { |
| 3625 | msleep(50); |
| 3626 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); |
| 3627 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); |
| 3628 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); |
| 3629 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); |
| 3630 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3631 | msleep(30); |
| 3632 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3633 | } |
| 3634 | |
Kailang Yang | 3c24e48 | 2021-07-01 09:33:33 +0800 | [diff] [blame] | 3635 | static void alc285_hp_init(struct hda_codec *codec) |
| 3636 | { |
| 3637 | struct alc_spec *spec = codec->spec; |
| 3638 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
| 3639 | int i, val; |
| 3640 | int coef38, coef0d, coef36; |
| 3641 | |
| 3642 | alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */ |
| 3643 | coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */ |
| 3644 | coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */ |
| 3645 | coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */ |
| 3646 | alc_update_coef_idx(codec, 0x38, 1<<4, 0x0); |
| 3647 | alc_update_coef_idx(codec, 0x0d, 0x110, 0x0); |
| 3648 | |
| 3649 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
| 3650 | |
| 3651 | if (hp_pin) |
| 3652 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3653 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3654 | |
| 3655 | msleep(130); |
| 3656 | alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14); |
| 3657 | alc_update_coef_idx(codec, 0x36, 1<<13, 0x0); |
| 3658 | |
| 3659 | if (hp_pin) |
| 3660 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3661 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3662 | msleep(10); |
| 3663 | alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */ |
| 3664 | alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880); |
| 3665 | alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049); |
| 3666 | alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0); |
| 3667 | |
| 3668 | alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */ |
| 3669 | val = alc_read_coefex_idx(codec, 0x58, 0x00); |
| 3670 | for (i = 0; i < 20 && val & 0x8000; i++) { |
| 3671 | msleep(50); |
| 3672 | val = alc_read_coefex_idx(codec, 0x58, 0x00); |
| 3673 | } /* Wait for depop procedure finish */ |
| 3674 | |
| 3675 | alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */ |
| 3676 | alc_update_coef_idx(codec, 0x38, 1<<4, coef38); |
| 3677 | alc_update_coef_idx(codec, 0x0d, 0x110, coef0d); |
| 3678 | alc_update_coef_idx(codec, 0x36, 3<<13, coef36); |
| 3679 | |
| 3680 | msleep(50); |
| 3681 | alc_update_coef_idx(codec, 0x4a, 1<<15, 0); |
| 3682 | } |
| 3683 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3684 | static void alc225_init(struct hda_codec *codec) |
| 3685 | { |
| 3686 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3687 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3688 | bool hp1_pin_sense, hp2_pin_sense; |
| 3689 | |
Kailang Yang | 3c24e48 | 2021-07-01 09:33:33 +0800 | [diff] [blame] | 3690 | if (spec->codec_variant != ALC269_TYPE_ALC287) |
| 3691 | /* required only at boot or S3 and S4 resume time */ |
| 3692 | if (!spec->done_hp_init || |
| 3693 | is_s3_resume(codec) || |
| 3694 | is_s4_resume(codec)) { |
| 3695 | alc285_hp_init(codec); |
| 3696 | spec->done_hp_init = true; |
| 3697 | } |
| 3698 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3699 | if (!hp_pin) |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3700 | hp_pin = 0x21; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3701 | msleep(30); |
| 3702 | |
| 3703 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3704 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3705 | |
| 3706 | if (hp1_pin_sense || hp2_pin_sense) |
| 3707 | msleep(2); |
| 3708 | |
| 3709 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3710 | if (spec->ultra_low_power) { |
| 3711 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); |
| 3712 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3713 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); |
| 3714 | msleep(30); |
| 3715 | } |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3716 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3717 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3718 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3719 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3720 | if (hp2_pin_sense) |
| 3721 | snd_hda_codec_write(codec, 0x16, 0, |
| 3722 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3723 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3724 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3725 | msleep(85); |
| 3726 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3727 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3728 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3729 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3730 | if (hp2_pin_sense) |
| 3731 | snd_hda_codec_write(codec, 0x16, 0, |
| 3732 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3733 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3734 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3735 | msleep(100); |
| 3736 | |
| 3737 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3738 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
| 3739 | } |
| 3740 | |
| 3741 | static void alc225_shutup(struct hda_codec *codec) |
| 3742 | { |
| 3743 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3744 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3745 | bool hp1_pin_sense, hp2_pin_sense; |
| 3746 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3747 | if (!hp_pin) |
| 3748 | hp_pin = 0x21; |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3749 | |
| 3750 | alc_disable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3751 | /* 3k pull low control for Headset jack. */ |
| 3752 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); |
| 3753 | |
| 3754 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3755 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3756 | |
| 3757 | if (hp1_pin_sense || hp2_pin_sense) |
| 3758 | msleep(2); |
| 3759 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3760 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3761 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3762 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3763 | if (hp2_pin_sense) |
| 3764 | snd_hda_codec_write(codec, 0x16, 0, |
| 3765 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3766 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3767 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3768 | msleep(85); |
| 3769 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3770 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3771 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3772 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3773 | if (hp2_pin_sense) |
| 3774 | snd_hda_codec_write(codec, 0x16, 0, |
| 3775 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3776 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3777 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3778 | msleep(100); |
| 3779 | |
| 3780 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3781 | alc_shutup_pins(codec); |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3782 | if (spec->ultra_low_power) { |
| 3783 | msleep(50); |
| 3784 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); |
| 3785 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3786 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); |
| 3787 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); |
| 3788 | msleep(30); |
| 3789 | } |
Hui Wang | 476c02e | 2020-03-29 16:20:18 +0800 | [diff] [blame] | 3790 | |
| 3791 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3792 | alc_enable_headset_jack_key(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3793 | } |
| 3794 | |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3795 | static void alc_default_init(struct hda_codec *codec) |
| 3796 | { |
| 3797 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3798 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3799 | bool hp_pin_sense; |
| 3800 | |
| 3801 | if (!hp_pin) |
| 3802 | return; |
| 3803 | |
| 3804 | msleep(30); |
| 3805 | |
| 3806 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3807 | |
| 3808 | if (hp_pin_sense) |
| 3809 | msleep(2); |
| 3810 | |
| 3811 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3812 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3813 | |
| 3814 | if (hp_pin_sense) |
| 3815 | msleep(85); |
| 3816 | |
| 3817 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3818 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3819 | |
| 3820 | if (hp_pin_sense) |
| 3821 | msleep(100); |
| 3822 | } |
| 3823 | |
| 3824 | static void alc_default_shutup(struct hda_codec *codec) |
| 3825 | { |
| 3826 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3827 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3828 | bool hp_pin_sense; |
| 3829 | |
| 3830 | if (!hp_pin) { |
| 3831 | alc269_shutup(codec); |
| 3832 | return; |
| 3833 | } |
| 3834 | |
| 3835 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3836 | |
| 3837 | if (hp_pin_sense) |
| 3838 | msleep(2); |
| 3839 | |
| 3840 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3841 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3842 | |
| 3843 | if (hp_pin_sense) |
| 3844 | msleep(85); |
| 3845 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3846 | if (!spec->no_shutup_pins) |
| 3847 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3848 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3849 | |
| 3850 | if (hp_pin_sense) |
| 3851 | msleep(100); |
| 3852 | |
| 3853 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3854 | alc_shutup_pins(codec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3855 | } |
| 3856 | |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3857 | static void alc294_hp_init(struct hda_codec *codec) |
| 3858 | { |
| 3859 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3860 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3861 | int i, val; |
| 3862 | |
| 3863 | if (!hp_pin) |
| 3864 | return; |
| 3865 | |
| 3866 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3867 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3868 | |
| 3869 | msleep(100); |
| 3870 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3871 | if (!spec->no_shutup_pins) |
| 3872 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3873 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3874 | |
| 3875 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ |
| 3876 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ |
| 3877 | |
| 3878 | /* Wait for depop procedure finish */ |
| 3879 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3880 | for (i = 0; i < 20 && val & 0x0080; i++) { |
| 3881 | msleep(50); |
| 3882 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3883 | } |
| 3884 | /* Set HP depop to auto mode */ |
| 3885 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); |
| 3886 | msleep(50); |
| 3887 | } |
| 3888 | |
| 3889 | static void alc294_init(struct hda_codec *codec) |
| 3890 | { |
| 3891 | struct alc_spec *spec = codec->spec; |
| 3892 | |
Takashi Iwai | f6ef4e0 | 2019-01-29 14:14:51 +0100 | [diff] [blame] | 3893 | /* required only at boot or S4 resume time */ |
| 3894 | if (!spec->done_hp_init || |
| 3895 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3896 | alc294_hp_init(codec); |
| 3897 | spec->done_hp_init = true; |
| 3898 | } |
| 3899 | alc_default_init(codec); |
| 3900 | } |
| 3901 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3902 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3903 | unsigned int val) |
| 3904 | { |
| 3905 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3906 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3907 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3908 | } |
| 3909 | |
| 3910 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3911 | { |
| 3912 | unsigned int val; |
| 3913 | |
| 3914 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3915 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3916 | & 0xffff; |
| 3917 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3918 | << 16; |
| 3919 | return val; |
| 3920 | } |
| 3921 | |
| 3922 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3923 | { |
| 3924 | unsigned int val; |
| 3925 | |
| 3926 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3927 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3928 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3929 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3930 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3931 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3932 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3933 | val = alc5505_coef_get(codec, 0x6220); |
| 3934 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3935 | } |
| 3936 | |
| 3937 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3938 | { |
| 3939 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3940 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3941 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3942 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3943 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3944 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3945 | } |
| 3946 | |
| 3947 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3948 | { |
| 3949 | unsigned int val; |
| 3950 | |
| 3951 | alc5505_dsp_halt(codec); |
| 3952 | alc5505_dsp_back_from_halt(codec); |
| 3953 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3954 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3955 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3956 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3957 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3958 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3959 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3960 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3961 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3962 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3963 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3964 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3965 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3966 | |
| 3967 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3968 | if (val <= 3) |
| 3969 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3970 | else |
| 3971 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3972 | |
| 3973 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3974 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3975 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3976 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3977 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3978 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3979 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3980 | |
| 3981 | #ifdef HALT_REALTEK_ALC5505 |
| 3982 | alc5505_dsp_halt(codec); |
| 3983 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3984 | } |
| 3985 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3986 | #ifdef HALT_REALTEK_ALC5505 |
Pierre-Louis Bossart | 8a71821 | 2020-01-11 15:47:35 -0600 | [diff] [blame] | 3987 | #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ |
| 3988 | #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3989 | #else |
| 3990 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3991 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3992 | #endif |
| 3993 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3994 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3995 | static int alc269_suspend(struct hda_codec *codec) |
| 3996 | { |
| 3997 | struct alc_spec *spec = codec->spec; |
| 3998 | |
| 3999 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 4000 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 4001 | return alc_suspend(codec); |
| 4002 | } |
| 4003 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4004 | static int alc269_resume(struct hda_codec *codec) |
| 4005 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 4006 | struct alc_spec *spec = codec->spec; |
| 4007 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 4008 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 4009 | alc269vb_toggle_power_output(codec, 0); |
| 4010 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 4011 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4012 | msleep(150); |
| 4013 | } |
| 4014 | |
| 4015 | codec->patch_ops.init(codec); |
| 4016 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 4017 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 4018 | alc269vb_toggle_power_output(codec, 1); |
| 4019 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 4020 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4021 | msleep(200); |
| 4022 | } |
| 4023 | |
Takashi Iwai | 1a462be | 2020-01-09 10:01:04 +0100 | [diff] [blame] | 4024 | snd_hda_regmap_sync(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4025 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 4026 | |
| 4027 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 4028 | * suspend, and won't restore the data after resume, so we restore it |
| 4029 | * in the driver. |
| 4030 | */ |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 4031 | if (spec->gpio_data) |
| 4032 | alc_write_gpio_data(codec); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 4033 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 4034 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 4035 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 4036 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4037 | return 0; |
| 4038 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 4039 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4040 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4041 | 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] | 4042 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4043 | { |
| 4044 | struct alc_spec *spec = codec->spec; |
| 4045 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4046 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4047 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 4048 | } |
| 4049 | |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 4050 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
| 4051 | const struct hda_fixup *fix, |
| 4052 | int action) |
| 4053 | { |
| 4054 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); |
| 4055 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); |
| 4056 | |
| 4057 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) |
| 4058 | snd_hda_codec_set_pincfg(codec, 0x19, |
| 4059 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | |
| 4060 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); |
| 4061 | } |
| 4062 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4063 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4064 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4065 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4066 | if (action == HDA_FIXUP_ACT_INIT) |
| 4067 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4068 | } |
| 4069 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 4070 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 4071 | const struct hda_fixup *fix, int action) |
| 4072 | { |
| 4073 | struct alc_spec *spec = codec->spec; |
| 4074 | |
| 4075 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 4076 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4077 | } |
| 4078 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4079 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4080 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4081 | { |
| 4082 | static const struct hda_verb verbs[] = { |
| 4083 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 4084 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 4085 | {} |
| 4086 | }; |
| 4087 | unsigned int cfg; |
| 4088 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4089 | if (strcmp(codec->core.chip_name, "ALC271X") && |
| 4090 | strcmp(codec->core.chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4091 | return; |
| 4092 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 4093 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 4094 | snd_hda_sequence_write(codec, verbs); |
| 4095 | } |
| 4096 | |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 4097 | /* Fix the speaker amp after resume, etc */ |
| 4098 | static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec, |
| 4099 | const struct hda_fixup *fix, |
| 4100 | int action) |
| 4101 | { |
| 4102 | if (action == HDA_FIXUP_ACT_INIT) |
| 4103 | alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000); |
| 4104 | } |
| 4105 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4106 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4107 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4108 | { |
| 4109 | struct alc_spec *spec = codec->spec; |
| 4110 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4111 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4112 | return; |
| 4113 | |
| 4114 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 4115 | * fix the sample rate of analog I/O to 44.1kHz |
| 4116 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 4117 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 4118 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4119 | } |
| 4120 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4121 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4122 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4123 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4124 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 4125 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 4126 | * Below is a workaround specific to ALC269 to control the dmic |
| 4127 | * signal source as mono. |
| 4128 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4129 | if (action == HDA_FIXUP_ACT_INIT) |
| 4130 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4131 | } |
| 4132 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4133 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 4134 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 4135 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4136 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 4137 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 4138 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4139 | } |
| 4140 | |
| 4141 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4142 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4143 | { |
| 4144 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4145 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4146 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 4147 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4148 | } |
| 4149 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4150 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 4151 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4152 | { |
| 4153 | struct alc_spec *spec = codec->spec; |
| 4154 | int vref; |
| 4155 | msleep(200); |
| 4156 | snd_hda_gen_hp_automute(codec, jack); |
| 4157 | |
| 4158 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 4159 | msleep(100); |
| 4160 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 4161 | vref); |
| 4162 | msleep(500); |
| 4163 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 4164 | vref); |
| 4165 | } |
| 4166 | |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 4167 | /* |
| 4168 | * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) |
| 4169 | */ |
| 4170 | struct hda_alc298_mbxinit { |
| 4171 | unsigned char value_0x23; |
| 4172 | unsigned char value_0x25; |
| 4173 | }; |
| 4174 | |
| 4175 | static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, |
| 4176 | const struct hda_alc298_mbxinit *initval, |
| 4177 | bool first) |
| 4178 | { |
| 4179 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); |
| 4180 | alc_write_coef_idx(codec, 0x26, 0xb000); |
| 4181 | |
| 4182 | if (first) |
| 4183 | snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); |
| 4184 | |
| 4185 | snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 4186 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 4187 | alc_write_coef_idx(codec, 0x23, initval->value_0x23); |
| 4188 | |
| 4189 | if (initval->value_0x23 != 0x1e) |
| 4190 | alc_write_coef_idx(codec, 0x25, initval->value_0x25); |
| 4191 | |
| 4192 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 4193 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 4194 | } |
| 4195 | |
| 4196 | static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, |
| 4197 | const struct hda_fixup *fix, |
| 4198 | int action) |
| 4199 | { |
| 4200 | /* Initialization magic */ |
| 4201 | static const struct hda_alc298_mbxinit dac_init[] = { |
| 4202 | {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, |
| 4203 | {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, |
| 4204 | {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, |
| 4205 | {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, |
| 4206 | {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, |
| 4207 | {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, |
| 4208 | {0x2f, 0x00}, |
| 4209 | {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, |
| 4210 | {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, |
| 4211 | {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, |
| 4212 | {} |
| 4213 | }; |
| 4214 | const struct hda_alc298_mbxinit *seq; |
| 4215 | |
| 4216 | if (action != HDA_FIXUP_ACT_INIT) |
| 4217 | return; |
| 4218 | |
| 4219 | /* Start */ |
| 4220 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); |
| 4221 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); |
| 4222 | alc_write_coef_idx(codec, 0x26, 0xf000); |
| 4223 | alc_write_coef_idx(codec, 0x22, 0x31); |
| 4224 | alc_write_coef_idx(codec, 0x23, 0x0b); |
| 4225 | alc_write_coef_idx(codec, 0x25, 0x00); |
| 4226 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); |
| 4227 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); |
| 4228 | |
| 4229 | for (seq = dac_init; seq->value_0x23; seq++) |
| 4230 | alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); |
| 4231 | } |
| 4232 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4233 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 4234 | const struct hda_fixup *fix, int action) |
| 4235 | { |
| 4236 | struct alc_spec *spec = codec->spec; |
| 4237 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4238 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4239 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 4240 | } |
| 4241 | } |
| 4242 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4243 | static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, |
| 4244 | bool polarity, bool on) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4245 | { |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4246 | unsigned int pinval; |
| 4247 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4248 | if (!pin) |
| 4249 | return; |
| 4250 | if (polarity) |
| 4251 | on = !on; |
| 4252 | pinval = snd_hda_codec_get_pin_target(codec, pin); |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 4253 | pinval &= ~AC_PINCTL_VREFEN; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4254 | pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; |
| 4255 | /* temporarily power up/down for setting VREF */ |
| 4256 | snd_hda_power_up_pm(codec); |
| 4257 | snd_hda_set_pin_ctl_cache(codec, pin, pinval); |
| 4258 | snd_hda_power_down_pm(codec); |
| 4259 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4260 | |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4261 | /* 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] | 4262 | static int vref_mute_led_set(struct led_classdev *led_cdev, |
| 4263 | enum led_brightness brightness) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4264 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4265 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4266 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4267 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4268 | alc_update_vref_led(codec, spec->mute_led_nid, |
| 4269 | spec->mute_led_polarity, brightness); |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4270 | return 0; |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4271 | } |
| 4272 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4273 | /* Make sure the led works even in runtime suspend */ |
| 4274 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 4275 | hda_nid_t nid, |
| 4276 | unsigned int power_state) |
| 4277 | { |
| 4278 | struct alc_spec *spec = codec->spec; |
| 4279 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4280 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 4281 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4282 | return power_state; |
| 4283 | |
| 4284 | /* Set pin ctl again, it might have just been set to 0 */ |
| 4285 | snd_hda_set_pin_ctl(codec, nid, |
| 4286 | snd_hda_codec_get_pin_target(codec, nid)); |
| 4287 | |
Takashi Iwai | cffd396 | 2015-04-09 10:30:25 +0200 | [diff] [blame] | 4288 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4289 | } |
| 4290 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4291 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 4292 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4293 | { |
| 4294 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4295 | const struct dmi_device *dev = NULL; |
| 4296 | |
| 4297 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4298 | return; |
| 4299 | |
| 4300 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 4301 | int pol, pin; |
| 4302 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 4303 | continue; |
| 4304 | if (pin < 0x0a || pin >= 0x10) |
| 4305 | break; |
| 4306 | spec->mute_led_polarity = pol; |
| 4307 | spec->mute_led_nid = pin - 0x0a + 0x18; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4308 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4309 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4310 | codec_dbg(codec, |
| 4311 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4312 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4313 | break; |
| 4314 | } |
| 4315 | } |
| 4316 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4317 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
| 4318 | const struct hda_fixup *fix, |
| 4319 | int action, hda_nid_t pin) |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4320 | { |
| 4321 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4322 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4323 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4324 | spec->mute_led_polarity = 0; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4325 | spec->mute_led_nid = pin; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4326 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 4327 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4328 | } |
| 4329 | } |
| 4330 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4331 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 4332 | const struct hda_fixup *fix, int action) |
| 4333 | { |
| 4334 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); |
| 4335 | } |
| 4336 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4337 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 4338 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4339 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4340 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4341 | } |
| 4342 | |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4343 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
| 4344 | const struct hda_fixup *fix, int action) |
| 4345 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 4346 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 4347 | } |
| 4348 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4349 | /* update LED status via GPIO */ |
| 4350 | 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] | 4351 | int polarity, bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4352 | { |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 4353 | if (polarity) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4354 | enabled = !enabled; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 4355 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4356 | } |
| 4357 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4358 | /* turn on/off mute LED via GPIO per vmaster hook */ |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4359 | static int gpio_mute_led_set(struct led_classdev *led_cdev, |
| 4360 | enum led_brightness brightness) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4361 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4362 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4363 | struct alc_spec *spec = codec->spec; |
| 4364 | |
Kai-Heng Feng | dbd1317 | 2020-04-30 16:32:51 +0800 | [diff] [blame] | 4365 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4366 | spec->mute_led_polarity, !brightness); |
| 4367 | return 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 4368 | } |
| 4369 | |
| 4370 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
Kai-Heng Feng | 87dc364 | 2020-04-30 21:52:07 +0800 | [diff] [blame] | 4371 | static int micmute_led_set(struct led_classdev *led_cdev, |
| 4372 | enum led_brightness brightness) |
| 4373 | { |
| 4374 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
| 4375 | struct alc_spec *spec = codec->spec; |
| 4376 | |
| 4377 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
Hui Wang | 4046906 | 2020-08-11 20:24:30 +0800 | [diff] [blame] | 4378 | spec->micmute_led_polarity, !brightness); |
Kai-Heng Feng | 87dc364 | 2020-04-30 21:52:07 +0800 | [diff] [blame] | 4379 | return 0; |
| 4380 | } |
| 4381 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4382 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
| 4383 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4384 | int action, |
| 4385 | unsigned int mute_mask, |
| 4386 | unsigned int micmute_mask) |
| 4387 | { |
| 4388 | struct alc_spec *spec = codec->spec; |
| 4389 | |
| 4390 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
| 4391 | |
| 4392 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 4393 | return; |
| 4394 | if (mute_mask) { |
| 4395 | spec->gpio_mute_led_mask = mute_mask; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4396 | snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4397 | } |
| 4398 | if (micmute_mask) { |
| 4399 | spec->gpio_mic_led_mask = micmute_mask; |
Takashi Iwai | 7cdf8c4 | 2020-06-18 13:08:31 +0200 | [diff] [blame] | 4400 | snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4401 | } |
| 4402 | } |
| 4403 | |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 4404 | static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4405 | const struct hda_fixup *fix, int action) |
| 4406 | { |
| 4407 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); |
| 4408 | } |
| 4409 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4410 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4411 | const struct hda_fixup *fix, int action) |
| 4412 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4413 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4414 | } |
| 4415 | |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 4416 | static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4417 | const struct hda_fixup *fix, int action) |
| 4418 | { |
Kai-Heng Feng | 3e0650a | 2020-04-30 16:32:52 +0800 | [diff] [blame] | 4419 | alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 4420 | } |
| 4421 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 4422 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4423 | const struct hda_fixup *fix, int action) |
| 4424 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4425 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4426 | } |
| 4427 | |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 4428 | static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4429 | const struct hda_fixup *fix, int action) |
| 4430 | { |
| 4431 | alc_fixup_hp_gpio_led(codec, action, 0x10, 0); |
| 4432 | } |
| 4433 | |
Johnathon Clark | 5fc462c | 2021-10-20 14:12:51 +0100 | [diff] [blame] | 4434 | static void alc245_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4435 | const struct hda_fixup *fix, int action) |
| 4436 | { |
| 4437 | struct alc_spec *spec = codec->spec; |
| 4438 | |
| 4439 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 4440 | spec->micmute_led_polarity = 1; |
| 4441 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
| 4442 | } |
| 4443 | |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4444 | /* turn on/off mic-mute LED per capture hook via VREF change */ |
| 4445 | static int vref_micmute_led_set(struct led_classdev *led_cdev, |
| 4446 | enum led_brightness brightness) |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4447 | { |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4448 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4449 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4450 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4451 | alc_update_vref_led(codec, spec->cap_mute_led_nid, |
| 4452 | spec->micmute_led_polarity, brightness); |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4453 | return 0; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4454 | } |
| 4455 | |
| 4456 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 4457 | const struct hda_fixup *fix, int action) |
| 4458 | { |
| 4459 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4460 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4461 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4462 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4463 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
| 4464 | * enable headphone amp |
| 4465 | */ |
| 4466 | spec->gpio_mask |= 0x10; |
| 4467 | spec->gpio_dir |= 0x10; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4468 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4469 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 4470 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4471 | } |
| 4472 | } |
| 4473 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4474 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 4475 | const struct hda_fixup *fix, int action) |
| 4476 | { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4477 | struct alc_spec *spec = codec->spec; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4478 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4479 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4480 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4481 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4482 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4483 | codec->power_filter = led_power_filter; |
| 4484 | } |
| 4485 | } |
| 4486 | |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 4487 | /* HP Spectre x360 14 model needs a unique workaround for enabling the amp; |
| 4488 | * it needs to toggle the GPIO0 once on and off at each time (bko#210633) |
| 4489 | */ |
| 4490 | static void alc245_fixup_hp_x360_amp(struct hda_codec *codec, |
| 4491 | const struct hda_fixup *fix, int action) |
| 4492 | { |
| 4493 | struct alc_spec *spec = codec->spec; |
| 4494 | |
| 4495 | switch (action) { |
| 4496 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 4497 | spec->gpio_mask |= 0x01; |
| 4498 | spec->gpio_dir |= 0x01; |
| 4499 | break; |
| 4500 | case HDA_FIXUP_ACT_INIT: |
| 4501 | /* need to toggle GPIO to enable the amp */ |
| 4502 | alc_update_gpio_data(codec, 0x01, true); |
| 4503 | msleep(100); |
| 4504 | alc_update_gpio_data(codec, 0x01, false); |
| 4505 | break; |
| 4506 | } |
| 4507 | } |
| 4508 | |
Takashi Iwai | 622464c | 2021-05-04 11:18:02 +0200 | [diff] [blame] | 4509 | /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */ |
| 4510 | static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo, |
| 4511 | struct hda_codec *codec, |
| 4512 | struct snd_pcm_substream *substream, |
| 4513 | int action) |
| 4514 | { |
| 4515 | switch (action) { |
| 4516 | case HDA_GEN_PCM_ACT_PREPARE: |
| 4517 | alc_update_gpio_data(codec, 0x04, true); |
| 4518 | break; |
| 4519 | case HDA_GEN_PCM_ACT_CLEANUP: |
| 4520 | alc_update_gpio_data(codec, 0x04, false); |
| 4521 | break; |
| 4522 | } |
| 4523 | } |
| 4524 | |
| 4525 | static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec, |
| 4526 | const struct hda_fixup *fix, |
| 4527 | int action) |
| 4528 | { |
| 4529 | struct alc_spec *spec = codec->spec; |
| 4530 | |
| 4531 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 4532 | spec->gpio_mask |= 0x04; |
| 4533 | spec->gpio_dir |= 0x04; |
| 4534 | spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook; |
| 4535 | } |
| 4536 | } |
| 4537 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4538 | static void alc_update_coef_led(struct hda_codec *codec, |
| 4539 | struct alc_coef_led *led, |
| 4540 | bool polarity, bool on) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4541 | { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4542 | if (polarity) |
| 4543 | on = !on; |
| 4544 | /* temporarily power up/down for setting COEF bit */ |
| 4545 | alc_update_coef_idx(codec, led->idx, led->mask, |
| 4546 | on ? led->on : led->off); |
| 4547 | } |
| 4548 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4549 | /* update mute-LED according to the speaker mute state via COEF bit */ |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4550 | static int coef_mute_led_set(struct led_classdev *led_cdev, |
| 4551 | enum led_brightness brightness) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4552 | { |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4553 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4554 | struct alc_spec *spec = codec->spec; |
| 4555 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4556 | alc_update_coef_led(codec, &spec->mute_led_coef, |
| 4557 | spec->mute_led_polarity, brightness); |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4558 | return 0; |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4559 | } |
| 4560 | |
| 4561 | static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4562 | const struct hda_fixup *fix, |
| 4563 | int action) |
| 4564 | { |
| 4565 | struct alc_spec *spec = codec->spec; |
| 4566 | |
| 4567 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4568 | spec->mute_led_polarity = 0; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4569 | spec->mute_led_coef.idx = 0x0b; |
| 4570 | spec->mute_led_coef.mask = 1 << 3; |
| 4571 | spec->mute_led_coef.on = 1 << 3; |
| 4572 | spec->mute_led_coef.off = 0; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4573 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4574 | } |
| 4575 | } |
| 4576 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4577 | static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
| 4578 | const struct hda_fixup *fix, |
| 4579 | int action) |
| 4580 | { |
| 4581 | struct alc_spec *spec = codec->spec; |
| 4582 | |
| 4583 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4584 | spec->mute_led_polarity = 0; |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4585 | spec->mute_led_coef.idx = 0x34; |
| 4586 | spec->mute_led_coef.mask = 1 << 5; |
| 4587 | spec->mute_led_coef.on = 0; |
| 4588 | spec->mute_led_coef.off = 1 << 5; |
Takashi Iwai | 8d3d1ec | 2020-06-18 13:08:38 +0200 | [diff] [blame] | 4589 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4590 | } |
| 4591 | } |
| 4592 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4593 | /* turn on/off mic-mute LED per capture hook by coef bit */ |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4594 | static int coef_micmute_led_set(struct led_classdev *led_cdev, |
| 4595 | enum led_brightness brightness) |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4596 | { |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4597 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4598 | struct alc_spec *spec = codec->spec; |
| 4599 | |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4600 | alc_update_coef_led(codec, &spec->mic_led_coef, |
| 4601 | spec->micmute_led_polarity, brightness); |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4602 | return 0; |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4603 | } |
| 4604 | |
| 4605 | static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4606 | const struct hda_fixup *fix, int action) |
| 4607 | { |
| 4608 | struct alc_spec *spec = codec->spec; |
| 4609 | |
| 4610 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4611 | spec->mic_led_coef.idx = 0x19; |
| 4612 | spec->mic_led_coef.mask = 1 << 13; |
| 4613 | spec->mic_led_coef.on = 1 << 13; |
| 4614 | spec->mic_led_coef.off = 0; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4615 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4616 | } |
| 4617 | } |
| 4618 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4619 | static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
| 4620 | const struct hda_fixup *fix, int action) |
| 4621 | { |
| 4622 | struct alc_spec *spec = codec->spec; |
| 4623 | |
| 4624 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 766538a | 2020-06-18 13:08:41 +0200 | [diff] [blame] | 4625 | spec->mic_led_coef.idx = 0x35; |
| 4626 | spec->mic_led_coef.mask = 3 << 2; |
| 4627 | spec->mic_led_coef.on = 2 << 2; |
| 4628 | spec->mic_led_coef.off = 1 << 2; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4629 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4630 | } |
| 4631 | } |
| 4632 | |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 4633 | static void alc285_fixup_hp_mute_led(struct hda_codec *codec, |
| 4634 | const struct hda_fixup *fix, int action) |
| 4635 | { |
| 4636 | alc285_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4637 | alc285_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4638 | } |
| 4639 | |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 4640 | static void alc236_fixup_hp_mute_led(struct hda_codec *codec, |
| 4641 | const struct hda_fixup *fix, int action) |
| 4642 | { |
| 4643 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4644 | alc236_fixup_hp_coef_micmute_led(codec, fix, action); |
| 4645 | } |
| 4646 | |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 4647 | static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec, |
| 4648 | const struct hda_fixup *fix, int action) |
| 4649 | { |
| 4650 | struct alc_spec *spec = codec->spec; |
| 4651 | |
| 4652 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4653 | spec->cap_mute_led_nid = 0x1a; |
| 4654 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
| 4655 | codec->power_filter = led_power_filter; |
| 4656 | } |
| 4657 | } |
| 4658 | |
| 4659 | static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec, |
| 4660 | const struct hda_fixup *fix, int action) |
| 4661 | { |
| 4662 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); |
| 4663 | alc236_fixup_hp_micmute_led_vref(codec, fix, action); |
| 4664 | } |
| 4665 | |
Takashi Iwai | 6a30aba | 2018-04-27 17:17:35 +0200 | [diff] [blame] | 4666 | #if IS_REACHABLE(CONFIG_INPUT) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4667 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 4668 | struct hda_jack_callback *event) |
| 4669 | { |
| 4670 | struct alc_spec *spec = codec->spec; |
| 4671 | |
| 4672 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore |
| 4673 | send both key on and key off event for every interrupt. */ |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4674 | 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] | 4675 | input_sync(spec->kb_dev); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4676 | 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] | 4677 | input_sync(spec->kb_dev); |
| 4678 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4679 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4680 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
| 4681 | { |
| 4682 | struct alc_spec *spec = codec->spec; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4683 | int i; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4684 | |
| 4685 | spec->kb_dev = input_allocate_device(); |
| 4686 | if (!spec->kb_dev) { |
| 4687 | codec_err(codec, "Out of memory (input_allocate_device)\n"); |
| 4688 | return -ENOMEM; |
| 4689 | } |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4690 | |
| 4691 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; |
| 4692 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4693 | spec->kb_dev->name = "Microphone Mute Button"; |
| 4694 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4695 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
| 4696 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); |
| 4697 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; |
| 4698 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) |
| 4699 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4700 | |
| 4701 | if (input_register_device(spec->kb_dev)) { |
| 4702 | codec_err(codec, "input_register_device failed\n"); |
| 4703 | input_free_device(spec->kb_dev); |
| 4704 | spec->kb_dev = NULL; |
| 4705 | return -ENOMEM; |
| 4706 | } |
| 4707 | |
| 4708 | return 0; |
| 4709 | } |
| 4710 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4711 | /* GPIO1 = set according to SKU external amp |
| 4712 | * GPIO2 = mic mute hotkey |
| 4713 | * GPIO3 = mute LED |
| 4714 | * GPIO4 = mic mute LED |
| 4715 | */ |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4716 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
| 4717 | const struct hda_fixup *fix, int action) |
| 4718 | { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4719 | struct alc_spec *spec = codec->spec; |
| 4720 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4721 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4722 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4723 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4724 | if (alc_register_micmute_input_device(codec) != 0) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4725 | return; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4726 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4727 | spec->gpio_mask |= 0x06; |
| 4728 | spec->gpio_dir |= 0x02; |
| 4729 | spec->gpio_data |= 0x02; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4730 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4731 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4732 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4733 | gpio2_mic_hotkey_event); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4734 | return; |
| 4735 | } |
| 4736 | |
| 4737 | if (!spec->kb_dev) |
| 4738 | return; |
| 4739 | |
| 4740 | switch (action) { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4741 | case HDA_FIXUP_ACT_FREE: |
| 4742 | input_unregister_device(spec->kb_dev); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4743 | spec->kb_dev = NULL; |
| 4744 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4745 | } |
| 4746 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4747 | /* Line2 = mic mute hotkey |
| 4748 | * GPIO2 = mic mute LED |
| 4749 | */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4750 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
| 4751 | const struct hda_fixup *fix, int action) |
| 4752 | { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4753 | struct alc_spec *spec = codec->spec; |
| 4754 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4755 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4756 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4757 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4758 | if (alc_register_micmute_input_device(codec) != 0) |
| 4759 | return; |
| 4760 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4761 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 4762 | gpio2_mic_hotkey_event); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4763 | return; |
| 4764 | } |
| 4765 | |
| 4766 | if (!spec->kb_dev) |
| 4767 | return; |
| 4768 | |
| 4769 | switch (action) { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4770 | case HDA_FIXUP_ACT_FREE: |
| 4771 | input_unregister_device(spec->kb_dev); |
| 4772 | spec->kb_dev = NULL; |
| 4773 | } |
| 4774 | } |
Takashi Iwai | c469652 | 2018-01-15 10:44:35 +0100 | [diff] [blame] | 4775 | #else /* INPUT */ |
| 4776 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL |
| 4777 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL |
| 4778 | #endif /* INPUT */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4779 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4780 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 4781 | const struct hda_fixup *fix, int action) |
| 4782 | { |
| 4783 | struct alc_spec *spec = codec->spec; |
| 4784 | |
Takashi Iwai | 1bce62a | 2018-06-19 23:15:59 +0200 | [diff] [blame] | 4785 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4786 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4787 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 4788 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4789 | } |
| 4790 | } |
| 4791 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4792 | static const struct coef_fw alc225_pre_hsmode[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4793 | UPDATE_COEF(0x4a, 1<<8, 0), |
| 4794 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), |
| 4795 | UPDATE_COEF(0x63, 3<<14, 3<<14), |
| 4796 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4797 | UPDATE_COEF(0x4a, 3<<10, 3<<10), |
| 4798 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), |
| 4799 | UPDATE_COEF(0x4a, 3<<10, 0), |
| 4800 | {} |
| 4801 | }; |
| 4802 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4803 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 4804 | { |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 4805 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4806 | static const struct coef_fw coef0255[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4807 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4808 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4809 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4810 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4811 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 4812 | {} |
| 4813 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4814 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4815 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4816 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4817 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4818 | WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ |
| 4819 | 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] | 4820 | {} |
| 4821 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4822 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4823 | WRITE_COEF(0x1b, 0x0c0b), |
| 4824 | WRITE_COEF(0x45, 0xc429), |
| 4825 | UPDATE_COEF(0x35, 0x4000, 0), |
| 4826 | WRITE_COEF(0x06, 0x2104), |
| 4827 | WRITE_COEF(0x1a, 0x0001), |
| 4828 | WRITE_COEF(0x26, 0x0004), |
| 4829 | WRITE_COEF(0x32, 0x42a3), |
| 4830 | {} |
| 4831 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4832 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4833 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4834 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4835 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4836 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4837 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4838 | {} |
| 4839 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4840 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4841 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
| 4842 | {} |
| 4843 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4844 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4845 | WRITE_COEF(0x76, 0x000e), |
| 4846 | WRITE_COEF(0x6c, 0x2400), |
| 4847 | WRITE_COEF(0x18, 0x7308), |
| 4848 | WRITE_COEF(0x6b, 0xc429), |
| 4849 | {} |
| 4850 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4851 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4852 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 4853 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 4854 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 4855 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 4856 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 4857 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4858 | {} |
| 4859 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4860 | static const struct coef_fw coef0668[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4861 | WRITE_COEF(0x15, 0x0d40), |
| 4862 | WRITE_COEF(0xb7, 0x802b), |
| 4863 | {} |
| 4864 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4865 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4866 | UPDATE_COEF(0x63, 3<<14, 0), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4867 | {} |
| 4868 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4869 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4870 | UPDATE_COEF(0x4a, 0x0100, 0), |
| 4871 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), |
| 4872 | UPDATE_COEF(0x6b, 0xf000, 0x5000), |
| 4873 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4874 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), |
| 4875 | WRITE_COEF(0x45, 0x5289), |
| 4876 | UPDATE_COEF(0x4a, 0x0c00, 0), |
| 4877 | {} |
| 4878 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4879 | |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 4880 | if (spec->no_internal_mic_pin) { |
| 4881 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); |
| 4882 | return; |
| 4883 | } |
| 4884 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4885 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4886 | case 0x10ec0255: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4887 | alc_process_coef_fw(codec, coef0255); |
| 4888 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 4889 | case 0x10ec0230: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4890 | case 0x10ec0236: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4891 | case 0x10ec0256: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4892 | alc_process_coef_fw(codec, coef0256); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4893 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4894 | case 0x10ec0234: |
| 4895 | case 0x10ec0274: |
| 4896 | case 0x10ec0294: |
| 4897 | alc_process_coef_fw(codec, coef0274); |
| 4898 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4899 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4900 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4901 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4902 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4903 | case 0x10ec0286: |
| 4904 | case 0x10ec0288: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4905 | alc_process_coef_fw(codec, coef0288); |
| 4906 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4907 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4908 | alc_process_coef_fw(codec, coef0298); |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4909 | alc_process_coef_fw(codec, coef0288); |
| 4910 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4911 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4912 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4913 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4914 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4915 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4916 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4917 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4918 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4919 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4920 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4921 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4922 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4923 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4924 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4925 | case 0x10ec0299: |
Kailang Yang | 4d4b0c5 | 2019-01-09 16:23:37 +0800 | [diff] [blame] | 4926 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4927 | alc_process_coef_fw(codec, coef0225); |
| 4928 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4929 | case 0x10ec0867: |
| 4930 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4931 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4932 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4933 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4934 | } |
| 4935 | |
| 4936 | |
| 4937 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 4938 | hda_nid_t mic_pin) |
| 4939 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4940 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4941 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 4942 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4943 | {} |
| 4944 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4945 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 4946 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4947 | WRITE_COEFEX(0x57, 0x03, 0x09a3), |
| 4948 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4949 | {} |
| 4950 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4951 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4952 | UPDATE_COEF(0x35, 0, 1<<14), |
| 4953 | WRITE_COEF(0x06, 0x2100), |
| 4954 | WRITE_COEF(0x1a, 0x0021), |
| 4955 | WRITE_COEF(0x26, 0x008c), |
| 4956 | {} |
| 4957 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4958 | static const struct coef_fw coef0288[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4959 | UPDATE_COEF(0x4f, 0x00c0, 0), |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4960 | UPDATE_COEF(0x50, 0x2000, 0), |
| 4961 | UPDATE_COEF(0x56, 0x0006, 0), |
| 4962 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4963 | UPDATE_COEF(0x66, 0x0008, 0x0008), |
| 4964 | UPDATE_COEF(0x67, 0x2000, 0x2000), |
| 4965 | {} |
| 4966 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4967 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4968 | WRITE_COEF(0x19, 0xa208), |
| 4969 | WRITE_COEF(0x2e, 0xacf0), |
| 4970 | {} |
| 4971 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4972 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4973 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 4974 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 4975 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4976 | {} |
| 4977 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4978 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4979 | WRITE_COEF(0xb7, 0x802b), |
| 4980 | WRITE_COEF(0xb5, 0x1040), |
| 4981 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 4982 | {} |
| 4983 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4984 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4985 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
| 4986 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4987 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4988 | {} |
| 4989 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 4990 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4991 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
| 4992 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4993 | UPDATE_COEF(0x6b, 0xf000, 0), |
| 4994 | {} |
| 4995 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4996 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4997 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4998 | case 0x10ec0255: |
| 4999 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 5000 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5001 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5002 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5003 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 5004 | case 0x10ec0230: |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5005 | case 0x10ec0236: |
| 5006 | case 0x10ec0256: |
| 5007 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 5008 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 5009 | alc_process_coef_fw(codec, coef0256); |
| 5010 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5011 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5012 | case 0x10ec0234: |
| 5013 | case 0x10ec0274: |
| 5014 | case 0x10ec0294: |
| 5015 | alc_write_coef_idx(codec, 0x45, 0x4689); |
| 5016 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 5017 | alc_process_coef_fw(codec, coef0274); |
| 5018 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5019 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5020 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5021 | case 0x10ec0283: |
| 5022 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 5023 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5024 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5025 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5026 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5027 | case 0x10ec0286: |
| 5028 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5029 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5030 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 5031 | alc_process_coef_fw(codec, coef0288); |
| 5032 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5033 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5034 | case 0x10ec0292: |
| 5035 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5036 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5037 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5038 | case 0x10ec0293: |
| 5039 | /* Set to TRS mode */ |
| 5040 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 5041 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5042 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5043 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5044 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5045 | case 0x10ec0867: |
| 5046 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); |
Gustavo A. R. Silva | c0dbbda | 2020-07-08 15:32:36 -0500 | [diff] [blame] | 5047 | fallthrough; |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 5048 | case 0x10ec0221: |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5049 | case 0x10ec0662: |
| 5050 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 5051 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5052 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5053 | case 0x10ec0668: |
| 5054 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 5055 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5056 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5057 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5058 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5059 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5060 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5061 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5062 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5063 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5064 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5065 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5066 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
| 5067 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 5068 | alc_process_coef_fw(codec, coef0225); |
| 5069 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 5070 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5071 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5072 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5073 | } |
| 5074 | |
| 5075 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 5076 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5077 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5078 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
| 5079 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), |
| 5080 | UPDATE_COEF(0x49, 3<<8, 0<<8), |
| 5081 | UPDATE_COEF(0x4a, 3<<4, 3<<4), |
| 5082 | UPDATE_COEF(0x63, 3<<14, 0), |
| 5083 | UPDATE_COEF(0x67, 0xf000, 0x3000), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 5084 | {} |
| 5085 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5086 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5087 | WRITE_COEF(0x45, 0xc089), |
| 5088 | WRITE_COEF(0x45, 0xc489), |
| 5089 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 5090 | WRITE_COEF(0x49, 0x0049), |
| 5091 | {} |
| 5092 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5093 | static const struct coef_fw coef0256[] = { |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5094 | WRITE_COEF(0x45, 0xc489), |
| 5095 | WRITE_COEFEX(0x57, 0x03, 0x0da3), |
| 5096 | WRITE_COEF(0x49, 0x0049), |
| 5097 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 5098 | WRITE_COEF(0x06, 0x6100), |
| 5099 | {} |
| 5100 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5101 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5102 | WRITE_COEF(0x06, 0x2100), |
| 5103 | WRITE_COEF(0x32, 0x4ea3), |
| 5104 | {} |
| 5105 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5106 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5107 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
| 5108 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5109 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5110 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5111 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5112 | {} |
| 5113 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5114 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5115 | WRITE_COEF(0x76, 0x000e), |
| 5116 | WRITE_COEF(0x6c, 0x2400), |
| 5117 | WRITE_COEF(0x6b, 0xc429), |
| 5118 | WRITE_COEF(0x18, 0x7308), |
| 5119 | {} |
| 5120 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5121 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5122 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 5123 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 5124 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 5125 | {} |
| 5126 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5127 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5128 | WRITE_COEF(0x11, 0x0041), |
| 5129 | WRITE_COEF(0x15, 0x0d40), |
| 5130 | WRITE_COEF(0xb7, 0x802b), |
| 5131 | {} |
| 5132 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5133 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5134 | WRITE_COEF(0x45, 0x4289), |
| 5135 | UPDATE_COEF(0x4a, 0x0010, 0x0010), |
| 5136 | UPDATE_COEF(0x6b, 0x0f00, 0), |
| 5137 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 5138 | {} |
| 5139 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5140 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5141 | switch (codec->core.vendor_id) { |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5142 | case 0x10ec0215: |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 5143 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5144 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5145 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5146 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5147 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5148 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 5149 | alc_process_coef_fw(codec, coef0225); |
| 5150 | break; |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5151 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5152 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5153 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 5154 | case 0x10ec0230: |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5155 | case 0x10ec0236: |
| 5156 | case 0x10ec0256: |
| 5157 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 5158 | alc_write_coef_idx(codec, 0x45, 0xc089); |
| 5159 | msleep(50); |
| 5160 | alc_process_coef_fw(codec, coef0256); |
| 5161 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5162 | case 0x10ec0234: |
| 5163 | case 0x10ec0274: |
| 5164 | case 0x10ec0294: |
| 5165 | alc_process_coef_fw(codec, coef0274); |
| 5166 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5167 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5168 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5169 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5170 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5171 | case 0x10ec0286: |
| 5172 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5173 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5174 | alc_process_coef_fw(codec, coef0288); |
| 5175 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5176 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5177 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5178 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5179 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5180 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5181 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5182 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5183 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5184 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5185 | case 0x10ec0867: |
| 5186 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 5187 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5188 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5189 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5190 | } |
| 5191 | |
| 5192 | /* Iphone type */ |
| 5193 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 5194 | { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5195 | int val; |
| 5196 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5197 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5198 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 5199 | WRITE_COEF(0x1b, 0x0c2b), |
| 5200 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 5201 | {} |
| 5202 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5203 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5204 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5205 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5206 | {} |
| 5207 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5208 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5209 | WRITE_COEF(0x45, 0xd429), |
| 5210 | WRITE_COEF(0x1b, 0x0c2b), |
| 5211 | WRITE_COEF(0x32, 0x4ea3), |
| 5212 | {} |
| 5213 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5214 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5215 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5216 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5217 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5218 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5219 | {} |
| 5220 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5221 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5222 | WRITE_COEF(0x6b, 0xd429), |
| 5223 | WRITE_COEF(0x76, 0x0008), |
| 5224 | WRITE_COEF(0x18, 0x7388), |
| 5225 | {} |
| 5226 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5227 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5228 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 5229 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 5230 | {} |
| 5231 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5232 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5233 | WRITE_COEF(0x11, 0x0001), |
| 5234 | WRITE_COEF(0x15, 0x0d60), |
| 5235 | WRITE_COEF(0xc3, 0x0000), |
| 5236 | {} |
| 5237 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5238 | static const struct coef_fw coef0225_1[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5239 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5240 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
| 5241 | {} |
| 5242 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5243 | static const struct coef_fw coef0225_2[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5244 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
| 5245 | UPDATE_COEF(0x63, 3<<14, 1<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5246 | {} |
| 5247 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5248 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5249 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5250 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5251 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5252 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 5253 | case 0x10ec0230: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5254 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5255 | case 0x10ec0256: |
| 5256 | alc_process_coef_fw(codec, coef0256); |
| 5257 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5258 | case 0x10ec0234: |
| 5259 | case 0x10ec0274: |
| 5260 | case 0x10ec0294: |
| 5261 | alc_write_coef_idx(codec, 0x45, 0xd689); |
| 5262 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5263 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5264 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5265 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5266 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5267 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5268 | val = alc_read_coef_idx(codec, 0x50); |
| 5269 | if (val & (1 << 12)) { |
| 5270 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 5271 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 5272 | msleep(300); |
| 5273 | } else { |
| 5274 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 5275 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 5276 | msleep(300); |
| 5277 | } |
| 5278 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5279 | case 0x10ec0286: |
| 5280 | case 0x10ec0288: |
| 5281 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 5282 | msleep(300); |
| 5283 | alc_process_coef_fw(codec, coef0288); |
| 5284 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5285 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5286 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5287 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5288 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5289 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5290 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5291 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5292 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5293 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5294 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5295 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5296 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5297 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5298 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5299 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5300 | val = alc_read_coef_idx(codec, 0x45); |
| 5301 | if (val & (1 << 9)) |
| 5302 | alc_process_coef_fw(codec, coef0225_2); |
| 5303 | else |
| 5304 | alc_process_coef_fw(codec, coef0225_1); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5305 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5306 | case 0x10ec0867: |
| 5307 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 5308 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5309 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5310 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5311 | } |
| 5312 | |
| 5313 | /* Nokia type */ |
| 5314 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 5315 | { |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5316 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5317 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 5318 | WRITE_COEF(0x1b, 0x0c2b), |
| 5319 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 5320 | {} |
| 5321 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5322 | static const struct coef_fw coef0256[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5323 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5324 | WRITE_COEF(0x1b, 0x0e6b), |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5325 | {} |
| 5326 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5327 | static const struct coef_fw coef0233[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5328 | WRITE_COEF(0x45, 0xe429), |
| 5329 | WRITE_COEF(0x1b, 0x0c2b), |
| 5330 | WRITE_COEF(0x32, 0x4ea3), |
| 5331 | {} |
| 5332 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5333 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5334 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5335 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5336 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5337 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5338 | {} |
| 5339 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5340 | static const struct coef_fw coef0292[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5341 | WRITE_COEF(0x6b, 0xe429), |
| 5342 | WRITE_COEF(0x76, 0x0008), |
| 5343 | WRITE_COEF(0x18, 0x7388), |
| 5344 | {} |
| 5345 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5346 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5347 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 5348 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 5349 | {} |
| 5350 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5351 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5352 | WRITE_COEF(0x11, 0x0001), |
| 5353 | WRITE_COEF(0x15, 0x0d50), |
| 5354 | WRITE_COEF(0xc3, 0x0000), |
| 5355 | {} |
| 5356 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5357 | static const struct coef_fw coef0225[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5358 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5359 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5360 | {} |
| 5361 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5362 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5363 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5364 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5365 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5366 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 5367 | case 0x10ec0230: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5368 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5369 | case 0x10ec0256: |
| 5370 | alc_process_coef_fw(codec, coef0256); |
| 5371 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5372 | case 0x10ec0234: |
| 5373 | case 0x10ec0274: |
| 5374 | case 0x10ec0294: |
| 5375 | alc_write_coef_idx(codec, 0x45, 0xe689); |
| 5376 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5377 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5378 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5379 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5380 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5381 | case 0x10ec0298: |
| 5382 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5383 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5384 | msleep(300); |
| 5385 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5386 | case 0x10ec0286: |
| 5387 | case 0x10ec0288: |
| 5388 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 5389 | msleep(300); |
| 5390 | alc_process_coef_fw(codec, coef0288); |
| 5391 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5392 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5393 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5394 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5395 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5396 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5397 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5398 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5399 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5400 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5401 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5402 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5403 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5404 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5405 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5406 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5407 | alc_process_coef_fw(codec, coef0225); |
| 5408 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5409 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5410 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5411 | } |
| 5412 | |
| 5413 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 5414 | { |
| 5415 | int val; |
| 5416 | bool is_ctia = false; |
| 5417 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5418 | static const struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5419 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 5420 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 5421 | conteol) */ |
| 5422 | {} |
| 5423 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5424 | static const struct coef_fw coef0288[] = { |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5425 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
| 5426 | {} |
| 5427 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5428 | static const struct coef_fw coef0298[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5429 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 5430 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 5431 | UPDATE_COEF(0x66, 0x0008, 0), |
| 5432 | UPDATE_COEF(0x67, 0x2000, 0), |
| 5433 | UPDATE_COEF(0x19, 0x1300, 0x1300), |
| 5434 | {} |
| 5435 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5436 | static const struct coef_fw coef0293[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5437 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 5438 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 5439 | {} |
| 5440 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5441 | static const struct coef_fw coef0688[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5442 | WRITE_COEF(0x11, 0x0001), |
| 5443 | WRITE_COEF(0xb7, 0x802b), |
| 5444 | WRITE_COEF(0x15, 0x0d60), |
| 5445 | WRITE_COEF(0xc3, 0x0c00), |
| 5446 | {} |
| 5447 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5448 | static const struct coef_fw coef0274[] = { |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5449 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 5450 | UPDATE_COEF(0x4a, 0x8000, 0), |
| 5451 | WRITE_COEF(0x45, 0xd289), |
| 5452 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 5453 | {} |
| 5454 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5455 | |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 5456 | if (spec->no_internal_mic_pin) { |
| 5457 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); |
| 5458 | return; |
| 5459 | } |
| 5460 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 5461 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5462 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5463 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5464 | msleep(300); |
| 5465 | val = alc_read_coef_idx(codec, 0x46); |
| 5466 | is_ctia = (val & 0x0070) == 0x0070; |
| 5467 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 5468 | case 0x10ec0230: |
Kailang Yang | 717f43d | 2019-05-31 17:16:53 +0800 | [diff] [blame] | 5469 | case 0x10ec0236: |
| 5470 | case 0x10ec0256: |
| 5471 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
| 5472 | alc_write_coef_idx(codec, 0x06, 0x6104); |
| 5473 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); |
| 5474 | |
| 5475 | snd_hda_codec_write(codec, 0x21, 0, |
| 5476 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5477 | msleep(80); |
| 5478 | snd_hda_codec_write(codec, 0x21, 0, |
| 5479 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5480 | |
| 5481 | alc_process_coef_fw(codec, coef0255); |
| 5482 | msleep(300); |
| 5483 | val = alc_read_coef_idx(codec, 0x46); |
| 5484 | is_ctia = (val & 0x0070) == 0x0070; |
| 5485 | |
| 5486 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); |
| 5487 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 5488 | |
| 5489 | snd_hda_codec_write(codec, 0x21, 0, |
| 5490 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5491 | msleep(80); |
| 5492 | snd_hda_codec_write(codec, 0x21, 0, |
| 5493 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5494 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5495 | case 0x10ec0234: |
| 5496 | case 0x10ec0274: |
| 5497 | case 0x10ec0294: |
| 5498 | alc_process_coef_fw(codec, coef0274); |
Hui Wang | febf2256 | 2021-03-20 17:15:41 +0800 | [diff] [blame] | 5499 | msleep(850); |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 5500 | val = alc_read_coef_idx(codec, 0x46); |
| 5501 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5502 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 5503 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5504 | case 0x10ec0283: |
| 5505 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 5506 | msleep(300); |
| 5507 | val = alc_read_coef_idx(codec, 0x46); |
| 5508 | is_ctia = (val & 0x0070) == 0x0070; |
| 5509 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 5510 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 5511 | snd_hda_codec_write(codec, 0x21, 0, |
| 5512 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5513 | msleep(100); |
| 5514 | snd_hda_codec_write(codec, 0x21, 0, |
| 5515 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5516 | msleep(200); |
| 5517 | |
| 5518 | val = alc_read_coef_idx(codec, 0x50); |
| 5519 | if (val & (1 << 12)) { |
| 5520 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 5521 | alc_process_coef_fw(codec, coef0288); |
| 5522 | msleep(350); |
| 5523 | val = alc_read_coef_idx(codec, 0x50); |
| 5524 | is_ctia = (val & 0x0070) == 0x0070; |
| 5525 | } else { |
| 5526 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 5527 | alc_process_coef_fw(codec, coef0288); |
| 5528 | msleep(350); |
| 5529 | val = alc_read_coef_idx(codec, 0x50); |
| 5530 | is_ctia = (val & 0x0070) == 0x0070; |
| 5531 | } |
| 5532 | alc_process_coef_fw(codec, coef0298); |
| 5533 | snd_hda_codec_write(codec, 0x21, 0, |
| 5534 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); |
| 5535 | msleep(75); |
| 5536 | snd_hda_codec_write(codec, 0x21, 0, |
| 5537 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 5538 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 5539 | case 0x10ec0286: |
| 5540 | case 0x10ec0288: |
| 5541 | alc_process_coef_fw(codec, coef0288); |
| 5542 | msleep(350); |
| 5543 | val = alc_read_coef_idx(codec, 0x50); |
| 5544 | is_ctia = (val & 0x0070) == 0x0070; |
| 5545 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5546 | case 0x10ec0292: |
| 5547 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 5548 | msleep(300); |
| 5549 | val = alc_read_coef_idx(codec, 0x6c); |
| 5550 | is_ctia = (val & 0x001c) == 0x001c; |
| 5551 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5552 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5553 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5554 | msleep(300); |
| 5555 | val = alc_read_coef_idx(codec, 0x46); |
| 5556 | is_ctia = (val & 0x0070) == 0x0070; |
| 5557 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5558 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5559 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5560 | msleep(300); |
| 5561 | val = alc_read_coef_idx(codec, 0xbe); |
| 5562 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 5563 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5564 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5565 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5566 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 5567 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 5568 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 5569 | case 0x10ec0299: |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5570 | snd_hda_codec_write(codec, 0x21, 0, |
| 5571 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5572 | msleep(80); |
| 5573 | snd_hda_codec_write(codec, 0x21, 0, |
| 5574 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 5575 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 5576 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
| 5577 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
| 5578 | val = alc_read_coef_idx(codec, 0x45); |
| 5579 | if (val & (1 << 9)) { |
| 5580 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5581 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); |
| 5582 | msleep(800); |
| 5583 | val = alc_read_coef_idx(codec, 0x46); |
| 5584 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5585 | } else { |
| 5586 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 5587 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); |
| 5588 | msleep(800); |
| 5589 | val = alc_read_coef_idx(codec, 0x46); |
| 5590 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 5591 | } |
| 5592 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); |
| 5593 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); |
| 5594 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 5595 | |
| 5596 | snd_hda_codec_write(codec, 0x21, 0, |
| 5597 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 5598 | msleep(80); |
| 5599 | snd_hda_codec_write(codec, 0x21, 0, |
| 5600 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 5601 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 5602 | case 0x10ec0867: |
| 5603 | is_ctia = true; |
| 5604 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5605 | } |
| 5606 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5607 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5608 | is_ctia ? "yes" : "no"); |
| 5609 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 5610 | } |
| 5611 | |
| 5612 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 5613 | { |
| 5614 | struct alc_spec *spec = codec->spec; |
| 5615 | |
| 5616 | 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] | 5617 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5618 | |
| 5619 | int new_headset_mode; |
| 5620 | |
| 5621 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 5622 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 5623 | else if (mux_pin == spec->headset_mic_pin) |
| 5624 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 5625 | else if (mux_pin == spec->headphone_mic_pin) |
| 5626 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 5627 | else |
| 5628 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 5629 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5630 | if (new_headset_mode == spec->current_headset_mode) { |
| 5631 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5632 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 5633 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5634 | |
| 5635 | switch (new_headset_mode) { |
| 5636 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 5637 | alc_headset_mode_unplugged(codec); |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5638 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5639 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5640 | spec->gen.hp_jack_present = false; |
| 5641 | break; |
| 5642 | case ALC_HEADSET_MODE_HEADSET: |
| 5643 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 5644 | alc_determine_headset_type(codec); |
| 5645 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 5646 | alc_headset_mode_ctia(codec); |
| 5647 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 5648 | alc_headset_mode_omtp(codec); |
| 5649 | spec->gen.hp_jack_present = true; |
| 5650 | break; |
| 5651 | case ALC_HEADSET_MODE_MIC: |
| 5652 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 5653 | spec->gen.hp_jack_present = false; |
| 5654 | break; |
| 5655 | case ALC_HEADSET_MODE_HEADPHONE: |
| 5656 | alc_headset_mode_default(codec); |
| 5657 | spec->gen.hp_jack_present = true; |
| 5658 | break; |
| 5659 | } |
| 5660 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 5661 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 5662 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5663 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5664 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 5665 | PIN_VREFHIZ); |
| 5666 | } |
| 5667 | spec->current_headset_mode = new_headset_mode; |
| 5668 | |
| 5669 | snd_hda_gen_update_outputs(codec); |
| 5670 | } |
| 5671 | |
| 5672 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 5673 | struct snd_kcontrol *kcontrol, |
| 5674 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5675 | { |
| 5676 | alc_update_headset_mode(codec); |
| 5677 | } |
| 5678 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5679 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 5680 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5681 | { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5682 | snd_hda_gen_hp_automute(codec, jack); |
Hui Wang | e54f30b | 2021-03-20 17:15:42 +0800 | [diff] [blame] | 5683 | alc_update_headset_mode(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5684 | } |
| 5685 | |
| 5686 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 5687 | { |
| 5688 | int i; |
| 5689 | struct alc_spec *spec = codec->spec; |
| 5690 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5691 | |
| 5692 | /* Find mic pins */ |
| 5693 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5694 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 5695 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 5696 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 5697 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 5698 | } |
| 5699 | |
Takashi Iwai | 0bed2aa | 2018-06-19 12:45:53 +0200 | [diff] [blame] | 5700 | WARN_ON(spec->gen.cap_sync_hook); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5701 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 5702 | spec->gen.automute_hook = alc_update_headset_mode; |
| 5703 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 5704 | } |
| 5705 | |
| 5706 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 5707 | const struct hda_fixup *fix, int action) |
| 5708 | { |
| 5709 | struct alc_spec *spec = codec->spec; |
| 5710 | |
| 5711 | switch (action) { |
| 5712 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5713 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 5714 | break; |
| 5715 | case HDA_FIXUP_ACT_PROBE: |
| 5716 | alc_probe_headset_mode(codec); |
| 5717 | break; |
| 5718 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | aeac1a0 | 2019-05-16 16:10:44 +0800 | [diff] [blame] | 5719 | if (is_s3_resume(codec) || is_s4_resume(codec)) { |
| 5720 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
| 5721 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
| 5722 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5723 | alc_update_headset_mode(codec); |
| 5724 | break; |
| 5725 | } |
| 5726 | } |
| 5727 | |
| 5728 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 5729 | const struct hda_fixup *fix, int action) |
| 5730 | { |
| 5731 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5732 | struct alc_spec *spec = codec->spec; |
| 5733 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5734 | } |
| 5735 | else |
| 5736 | alc_fixup_headset_mode(codec, fix, action); |
| 5737 | } |
| 5738 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5739 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 5740 | { |
| 5741 | /* Set to iphone type */ |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5742 | static const struct coef_fw alc255fw[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5743 | WRITE_COEF(0x1b, 0x880b), |
| 5744 | WRITE_COEF(0x45, 0xd089), |
| 5745 | WRITE_COEF(0x1b, 0x080b), |
| 5746 | WRITE_COEF(0x46, 0x0004), |
| 5747 | WRITE_COEF(0x1b, 0x0c0b), |
| 5748 | {} |
| 5749 | }; |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 5750 | static const struct coef_fw alc256fw[] = { |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5751 | WRITE_COEF(0x1b, 0x884b), |
| 5752 | WRITE_COEF(0x45, 0xd089), |
| 5753 | WRITE_COEF(0x1b, 0x084b), |
| 5754 | WRITE_COEF(0x46, 0x0004), |
| 5755 | WRITE_COEF(0x1b, 0x0c4b), |
| 5756 | {} |
| 5757 | }; |
| 5758 | switch (codec->core.vendor_id) { |
| 5759 | case 0x10ec0255: |
| 5760 | alc_process_coef_fw(codec, alc255fw); |
| 5761 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 5762 | case 0x10ec0230: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5763 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5764 | case 0x10ec0256: |
| 5765 | alc_process_coef_fw(codec, alc256fw); |
| 5766 | break; |
| 5767 | } |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5768 | msleep(30); |
| 5769 | } |
| 5770 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5771 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 5772 | const struct hda_fixup *fix, int action) |
| 5773 | { |
| 5774 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5775 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5776 | } |
| 5777 | alc_fixup_headset_mode(codec, fix, action); |
| 5778 | } |
| 5779 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5780 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 5781 | const struct hda_fixup *fix, int action) |
| 5782 | { |
| 5783 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5784 | struct alc_spec *spec = codec->spec; |
| 5785 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5786 | alc255_set_default_jack_type(codec); |
| 5787 | } |
| 5788 | else |
| 5789 | alc_fixup_headset_mode(codec, fix, action); |
| 5790 | } |
| 5791 | |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5792 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
| 5793 | struct hda_jack_callback *jack) |
| 5794 | { |
| 5795 | struct alc_spec *spec = codec->spec; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5796 | |
| 5797 | alc_update_headset_jack_cb(codec, jack); |
| 5798 | /* Headset Mic enable or disable, only for Dell Dino */ |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5799 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5800 | } |
| 5801 | |
| 5802 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, |
| 5803 | const struct hda_fixup *fix, int action) |
| 5804 | { |
| 5805 | alc_fixup_headset_mode(codec, fix, action); |
| 5806 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 5807 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5808 | /* toggled via hp_automute_hook */ |
| 5809 | spec->gpio_mask |= 0x40; |
| 5810 | spec->gpio_dir |= 0x40; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5811 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
| 5812 | } |
| 5813 | } |
| 5814 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5815 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 5816 | const struct hda_fixup *fix, int action) |
| 5817 | { |
| 5818 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5819 | struct alc_spec *spec = codec->spec; |
| 5820 | spec->gen.auto_mute_via_amp = 1; |
| 5821 | } |
| 5822 | } |
| 5823 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5824 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 5825 | const struct hda_fixup *fix, int action) |
| 5826 | { |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5827 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5828 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 5829 | spec->no_shutup_pins = 1; |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5830 | } |
| 5831 | } |
| 5832 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5833 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 5834 | const struct hda_fixup *fix, int action) |
| 5835 | { |
| 5836 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5837 | struct alc_spec *spec = codec->spec; |
| 5838 | /* Disable AA-loopback as it causes white noise */ |
| 5839 | spec->gen.mixer_nid = 0; |
| 5840 | } |
| 5841 | } |
| 5842 | |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5843 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
| 5844 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, |
| 5845 | const struct hda_fixup *fix, int action) |
| 5846 | { |
| 5847 | static const struct hda_pintbl pincfgs[] = { |
| 5848 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 5849 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5850 | { } |
| 5851 | }; |
| 5852 | struct alc_spec *spec = codec->spec; |
| 5853 | |
| 5854 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5855 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5856 | codec->power_save_node = 0; /* avoid click noises */ |
| 5857 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5858 | } |
| 5859 | } |
| 5860 | |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5861 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
| 5862 | const struct hda_fixup *fix, int action) |
| 5863 | { |
| 5864 | static const struct hda_pintbl pincfgs[] = { |
| 5865 | { 0x17, 0x21211010 }, /* dock headphone */ |
| 5866 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5867 | { } |
| 5868 | }; |
| 5869 | struct alc_spec *spec = codec->spec; |
| 5870 | |
| 5871 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5872 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
Takashi Iwai | 71db96d | 2018-02-26 15:36:38 +0100 | [diff] [blame] | 5873 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5874 | } else if (action == HDA_FIXUP_ACT_INIT) { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5875 | /* Enable DOCK device */ |
| 5876 | snd_hda_codec_write(codec, 0x17, 0, |
| 5877 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
| 5878 | /* Enable DOCK device */ |
| 5879 | snd_hda_codec_write(codec, 0x19, 0, |
| 5880 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5881 | } |
| 5882 | } |
| 5883 | |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 5884 | static void alc_fixup_tpt470_dacs(struct hda_codec *codec, |
| 5885 | const struct hda_fixup *fix, int action) |
| 5886 | { |
| 5887 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise |
| 5888 | * the speaker output becomes too low by some reason on Thinkpads with |
| 5889 | * ALC298 codec |
| 5890 | */ |
| 5891 | static const hda_nid_t preferred_pairs[] = { |
| 5892 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, |
| 5893 | 0 |
| 5894 | }; |
| 5895 | struct alc_spec *spec = codec->spec; |
| 5896 | |
| 5897 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5898 | spec->gen.preferred_dacs = preferred_pairs; |
| 5899 | } |
| 5900 | |
Takashi Iwai | 8eedd3a | 2021-05-04 10:20:57 +0200 | [diff] [blame] | 5901 | static void alc295_fixup_asus_dacs(struct hda_codec *codec, |
| 5902 | const struct hda_fixup *fix, int action) |
| 5903 | { |
| 5904 | static const hda_nid_t preferred_pairs[] = { |
| 5905 | 0x17, 0x02, 0x21, 0x03, 0 |
| 5906 | }; |
| 5907 | struct alc_spec *spec = codec->spec; |
| 5908 | |
| 5909 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5910 | spec->gen.preferred_dacs = preferred_pairs; |
| 5911 | } |
| 5912 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5913 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5914 | { |
| 5915 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5916 | int hp_pin = alc_get_hp_pin(spec); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5917 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5918 | /* Prevent pop noises when headphones are plugged in */ |
| 5919 | snd_hda_codec_write(codec, hp_pin, 0, |
| 5920 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5921 | msleep(20); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5922 | } |
| 5923 | |
| 5924 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 5925 | const struct hda_fixup *fix, int action) |
| 5926 | { |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5927 | struct alc_spec *spec = codec->spec; |
| 5928 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 5929 | int i; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5930 | |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5931 | switch (action) { |
| 5932 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5933 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise |
| 5934 | * it causes a click noise at start up |
| 5935 | */ |
| 5936 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5937 | spec->shutup = alc_shutup_dell_xps13; |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5938 | break; |
| 5939 | case HDA_FIXUP_ACT_PROBE: |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5940 | /* Make the internal mic the default input source. */ |
| 5941 | for (i = 0; i < imux->num_items; i++) { |
| 5942 | if (spec->gen.imux_pins[i] == 0x12) { |
| 5943 | spec->gen.cur_mux[0] = i; |
| 5944 | break; |
| 5945 | } |
| 5946 | } |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5947 | break; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5948 | } |
| 5949 | } |
| 5950 | |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5951 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
| 5952 | const struct hda_fixup *fix, int action) |
| 5953 | { |
| 5954 | struct alc_spec *spec = codec->spec; |
| 5955 | |
| 5956 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5957 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5958 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ |
David Henningsson | b40eda6 | 2015-05-28 09:40:23 +0200 | [diff] [blame] | 5959 | |
| 5960 | /* Disable boost for mic-in permanently. (This code is only called |
| 5961 | from quirks that guarantee that the headphone is at NID 0x1b.) */ |
| 5962 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); |
| 5963 | 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] | 5964 | } else |
| 5965 | alc_fixup_headset_mode(codec, fix, action); |
| 5966 | } |
| 5967 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5968 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 5969 | const struct hda_fixup *fix, int action) |
| 5970 | { |
| 5971 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5972 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5973 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5974 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 5975 | } |
| 5976 | alc_fixup_headset_mode(codec, fix, action); |
| 5977 | } |
| 5978 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5979 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 5980 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 5981 | { |
| 5982 | struct alc_spec *spec = codec->spec; |
| 5983 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5984 | hda_nid_t nid; |
| 5985 | unsigned int defcfg; |
| 5986 | int i; |
| 5987 | |
| 5988 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5989 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5990 | continue; |
| 5991 | nid = cfg->inputs[i].pin; |
| 5992 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5993 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 5994 | continue; |
| 5995 | return nid; |
| 5996 | } |
| 5997 | |
| 5998 | return 0; |
| 5999 | } |
| 6000 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6001 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6002 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6003 | int action) |
| 6004 | { |
| 6005 | struct alc_spec *spec = codec->spec; |
| 6006 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 6007 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 6008 | int mic_pin = find_ext_mic_pin(codec); |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 6009 | int hp_pin = alc_get_hp_pin(spec); |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 6010 | |
| 6011 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 6012 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 6013 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 6014 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6015 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6016 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6017 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 6018 | const struct hda_fixup *fix, |
| 6019 | int action) |
| 6020 | { |
| 6021 | struct alc_spec *spec = codec->spec; |
| 6022 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 6023 | int i; |
| 6024 | |
| 6025 | /* The mic boosts on level 2 and 3 are too noisy |
| 6026 | on the internal mic input. |
| 6027 | Therefore limit the boost to 0 or 1. */ |
| 6028 | |
| 6029 | if (action != HDA_FIXUP_ACT_PROBE) |
| 6030 | return; |
| 6031 | |
| 6032 | for (i = 0; i < cfg->num_inputs; i++) { |
| 6033 | hda_nid_t nid = cfg->inputs[i].pin; |
| 6034 | unsigned int defcfg; |
| 6035 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 6036 | continue; |
| 6037 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 6038 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 6039 | continue; |
| 6040 | |
| 6041 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 6042 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 6043 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 6044 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 6045 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 6046 | } |
| 6047 | } |
| 6048 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6049 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 6050 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6051 | { |
| 6052 | struct alc_spec *spec = codec->spec; |
| 6053 | int vref; |
| 6054 | |
| 6055 | msleep(200); |
| 6056 | snd_hda_gen_hp_automute(codec, jack); |
| 6057 | |
| 6058 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 6059 | |
| 6060 | msleep(600); |
| 6061 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 6062 | vref); |
| 6063 | } |
| 6064 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6065 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 6066 | const struct hda_fixup *fix, int action) |
| 6067 | { |
| 6068 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6069 | |
| 6070 | switch (action) { |
| 6071 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6072 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 6073 | /* Disable AA-loopback as it causes white noise */ |
| 6074 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 6075 | break; |
| 6076 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 6077 | /* MIC2-VREF control */ |
| 6078 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 6079 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6080 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 6081 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6082 | break; |
| 6083 | } |
| 6084 | } |
| 6085 | |
| 6086 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 6087 | const struct hda_fixup *fix, int action) |
| 6088 | { |
| 6089 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6090 | |
| 6091 | switch (action) { |
| 6092 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6093 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 6094 | break; |
| 6095 | case HDA_FIXUP_ACT_INIT: |
| 6096 | /* MIC2-VREF control */ |
| 6097 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 6098 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6099 | break; |
| 6100 | } |
| 6101 | } |
| 6102 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6103 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 6104 | static void asus_tx300_automute(struct hda_codec *codec) |
| 6105 | { |
| 6106 | struct alc_spec *spec = codec->spec; |
| 6107 | snd_hda_gen_update_outputs(codec); |
| 6108 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 6109 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 6110 | } |
| 6111 | |
| 6112 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 6113 | const struct hda_fixup *fix, int action) |
| 6114 | { |
| 6115 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6116 | static const struct hda_pintbl dock_pins[] = { |
| 6117 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 6118 | {} |
| 6119 | }; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6120 | |
| 6121 | switch (action) { |
| 6122 | case HDA_FIXUP_ACT_PRE_PROBE: |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 6123 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6124 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 6125 | alc_setup_gpio(codec, 0x04); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6126 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 6127 | spec->gen.auto_mute_via_amp = 1; |
| 6128 | spec->gen.automute_hook = asus_tx300_automute; |
| 6129 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6130 | snd_hda_gen_hp_automute); |
| 6131 | break; |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 6132 | case HDA_FIXUP_ACT_PROBE: |
| 6133 | spec->init_amp = ALC_INIT_DEFAULT; |
| 6134 | break; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6135 | case HDA_FIXUP_ACT_BUILD: |
| 6136 | /* this is a bit tricky; give more sane names for the main |
| 6137 | * (tablet) speaker and the dock speaker, respectively |
| 6138 | */ |
Takashi Iwai | 56798e6 | 2017-04-11 08:10:52 +0200 | [diff] [blame] | 6139 | rename_ctl(codec, "Speaker Playback Switch", |
| 6140 | "Dock Speaker Playback Switch"); |
| 6141 | rename_ctl(codec, "Bass Speaker Playback Switch", |
| 6142 | "Speaker Playback Switch"); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6143 | break; |
| 6144 | } |
| 6145 | } |
| 6146 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6147 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 6148 | const struct hda_fixup *fix, int action) |
| 6149 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6150 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 6151 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 6152 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 6153 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 6154 | static const hda_nid_t conn1[] = { 0x0c }; |
| 6155 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
| 6156 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6157 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6158 | } |
| 6159 | |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6160 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
| 6161 | const struct hda_fixup *fix, int action) |
| 6162 | { |
| 6163 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 6164 | /* The speaker is routed to the Node 0x06 by a mistake, as a result |
| 6165 | we can't adjust the speaker's volume since this node does not has |
| 6166 | Amp-out capability. we change the speaker's route to: |
| 6167 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( |
| 6168 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust |
| 6169 | speaker's volume now. */ |
| 6170 | |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 6171 | static const hda_nid_t conn1[] = { 0x0c }; |
| 6172 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6173 | } |
| 6174 | } |
| 6175 | |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6176 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
| 6177 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, |
| 6178 | const struct hda_fixup *fix, int action) |
| 6179 | { |
| 6180 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 6181 | static const hda_nid_t conn[] = { 0x02, 0x03 }; |
| 6182 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6183 | } |
| 6184 | } |
| 6185 | |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6186 | /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ |
| 6187 | static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, |
| 6188 | const struct hda_fixup *fix, int action) |
| 6189 | { |
| 6190 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 6191 | static const hda_nid_t conn[] = { 0x02 }; |
| 6192 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6193 | } |
| 6194 | } |
| 6195 | |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6196 | /* Hook to update amp GPIO4 for automute */ |
| 6197 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, |
| 6198 | struct hda_jack_callback *jack) |
| 6199 | { |
| 6200 | struct alc_spec *spec = codec->spec; |
| 6201 | |
| 6202 | snd_hda_gen_hp_automute(codec, jack); |
| 6203 | /* 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] | 6204 | alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, |
| 6205 | !spec->gen.hp_jack_present); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6206 | } |
| 6207 | |
| 6208 | /* Manage GPIOs for HP EliteBook Folio 9480m. |
| 6209 | * |
| 6210 | * GPIO4 is the headphone amplifier power control |
| 6211 | * GPIO3 is the audio output mute indicator LED |
| 6212 | */ |
| 6213 | |
| 6214 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, |
| 6215 | const struct hda_fixup *fix, |
| 6216 | int action) |
| 6217 | { |
| 6218 | struct alc_spec *spec = codec->spec; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6219 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 6220 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6221 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 6222 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
| 6223 | spec->gpio_mask |= 0x10; |
| 6224 | spec->gpio_dir |= 0x10; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6225 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6226 | } |
| 6227 | } |
| 6228 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6229 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
| 6230 | const struct hda_fixup *fix, |
| 6231 | int action) |
| 6232 | { |
| 6233 | struct alc_spec *spec = codec->spec; |
| 6234 | |
| 6235 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 6236 | spec->gpio_mask |= 0x04; |
| 6237 | spec->gpio_dir |= 0x04; |
| 6238 | /* set data bit low */ |
| 6239 | } |
| 6240 | } |
| 6241 | |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 6242 | /* Quirk for Thinkpad X1 7th and 8th Gen |
| 6243 | * The following fixed routing needed |
| 6244 | * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly |
| 6245 | * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC |
| 6246 | * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp |
| 6247 | */ |
| 6248 | static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, |
| 6249 | const struct hda_fixup *fix, int action) |
| 6250 | { |
| 6251 | static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ |
| 6252 | static const hda_nid_t preferred_pairs[] = { |
| 6253 | 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 |
| 6254 | }; |
| 6255 | struct alc_spec *spec = codec->spec; |
| 6256 | |
| 6257 | switch (action) { |
| 6258 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6259 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
| 6260 | spec->gen.preferred_dacs = preferred_pairs; |
| 6261 | break; |
| 6262 | case HDA_FIXUP_ACT_BUILD: |
| 6263 | /* The generic parser creates somewhat unintuitive volume ctls |
| 6264 | * with the fixed routing above, and the shared DAC2 may be |
| 6265 | * confusing for PA. |
| 6266 | * Rename those to unique names so that PA doesn't touch them |
| 6267 | * and use only Master volume. |
| 6268 | */ |
| 6269 | rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); |
| 6270 | rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); |
| 6271 | break; |
| 6272 | } |
| 6273 | } |
| 6274 | |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6275 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
| 6276 | const struct hda_fixup *fix, |
| 6277 | int action) |
| 6278 | { |
| 6279 | alc_fixup_dual_codecs(codec, fix, action); |
| 6280 | switch (action) { |
| 6281 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6282 | /* override card longname to provide a unique UCM profile */ |
| 6283 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); |
| 6284 | break; |
| 6285 | case HDA_FIXUP_ACT_BUILD: |
| 6286 | /* rename Capture controls depending on the codec */ |
| 6287 | rename_ctl(codec, "Capture Volume", |
| 6288 | codec->addr == 0 ? |
| 6289 | "Rear-Panel Capture Volume" : |
| 6290 | "Front-Panel Capture Volume"); |
| 6291 | rename_ctl(codec, "Capture Switch", |
| 6292 | codec->addr == 0 ? |
| 6293 | "Rear-Panel Capture Switch" : |
| 6294 | "Front-Panel Capture Switch"); |
| 6295 | break; |
| 6296 | } |
| 6297 | } |
| 6298 | |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 6299 | static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, |
| 6300 | const struct hda_fixup *fix, int action) |
| 6301 | { |
| 6302 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 6303 | return; |
| 6304 | |
| 6305 | codec->power_save_node = 1; |
| 6306 | } |
| 6307 | |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6308 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
| 6309 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
| 6310 | const struct hda_fixup *fix, int action) |
| 6311 | { |
| 6312 | struct alc_spec *spec = codec->spec; |
Michał Mirosław | caf3c04 | 2020-01-03 10:23:48 +0100 | [diff] [blame] | 6313 | static const hda_nid_t preferred_pairs[] = { |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6314 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
| 6315 | 0 |
| 6316 | }; |
| 6317 | |
| 6318 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 6319 | return; |
| 6320 | |
| 6321 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 0700d3d | 2019-04-26 16:13:54 +0800 | [diff] [blame] | 6322 | spec->gen.auto_mute_via_amp = 1; |
| 6323 | codec->power_save_node = 0; |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6324 | } |
| 6325 | |
Takashi Iwai | c84bfed | 2020-11-27 15:11:04 +0100 | [diff] [blame] | 6326 | /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */ |
| 6327 | static void alc289_fixup_asus_ga401(struct hda_codec *codec, |
| 6328 | const struct hda_fixup *fix, int action) |
| 6329 | { |
| 6330 | static const hda_nid_t preferred_pairs[] = { |
| 6331 | 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0 |
| 6332 | }; |
| 6333 | struct alc_spec *spec = codec->spec; |
| 6334 | |
| 6335 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 6336 | spec->gen.preferred_dacs = preferred_pairs; |
| 6337 | spec->gen.obey_preferred_dacs = 1; |
| 6338 | } |
| 6339 | } |
| 6340 | |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6341 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
| 6342 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, |
| 6343 | const struct hda_fixup *fix, int action) |
| 6344 | { |
| 6345 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 6346 | return; |
| 6347 | |
| 6348 | snd_hda_override_wcaps(codec, 0x03, 0); |
| 6349 | } |
| 6350 | |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6351 | static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) |
| 6352 | { |
| 6353 | switch (codec->core.vendor_id) { |
| 6354 | case 0x10ec0274: |
| 6355 | case 0x10ec0294: |
| 6356 | case 0x10ec0225: |
| 6357 | case 0x10ec0295: |
| 6358 | case 0x10ec0299: |
| 6359 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ |
| 6360 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); |
| 6361 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 6362 | case 0x10ec0230: |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6363 | case 0x10ec0235: |
| 6364 | case 0x10ec0236: |
| 6365 | case 0x10ec0255: |
| 6366 | case 0x10ec0256: |
| 6367 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ |
| 6368 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); |
| 6369 | break; |
| 6370 | } |
| 6371 | } |
| 6372 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6373 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
| 6374 | const struct hda_fixup *fix, int action) |
| 6375 | { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 6376 | struct alc_spec *spec = codec->spec; |
| 6377 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6378 | switch (action) { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 6379 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6380 | spec->ultra_low_power = true; |
| 6381 | break; |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6382 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6383 | alc_combo_jack_hp_jd_restart(codec); |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6384 | break; |
| 6385 | } |
| 6386 | } |
| 6387 | |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6388 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
| 6389 | const struct hda_fixup *fix, int action) |
| 6390 | { |
| 6391 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 6392 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
| 6393 | } |
| 6394 | |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 6395 | |
| 6396 | static void alc294_gx502_toggle_output(struct hda_codec *codec, |
| 6397 | struct hda_jack_callback *cb) |
| 6398 | { |
| 6399 | /* The Windows driver sets the codec up in a very different way where |
| 6400 | * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it |
| 6401 | */ |
| 6402 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) |
| 6403 | alc_write_coef_idx(codec, 0x10, 0x8a20); |
| 6404 | else |
| 6405 | alc_write_coef_idx(codec, 0x10, 0x0a20); |
| 6406 | } |
| 6407 | |
| 6408 | static void alc294_fixup_gx502_hp(struct hda_codec *codec, |
| 6409 | const struct hda_fixup *fix, int action) |
| 6410 | { |
| 6411 | /* Pin 0x21: headphones/headset mic */ |
| 6412 | if (!is_jack_detectable(codec, 0x21)) |
| 6413 | return; |
| 6414 | |
| 6415 | switch (action) { |
| 6416 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6417 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 6418 | alc294_gx502_toggle_output); |
| 6419 | break; |
| 6420 | case HDA_FIXUP_ACT_INIT: |
| 6421 | /* Make sure to start in a correct state, i.e. if |
| 6422 | * headphones have been plugged in before powering up the system |
| 6423 | */ |
| 6424 | alc294_gx502_toggle_output(codec, NULL); |
| 6425 | break; |
| 6426 | } |
| 6427 | } |
| 6428 | |
Daniel Cordova A | c1b55029 | 2021-05-07 12:31:16 -0500 | [diff] [blame] | 6429 | static void alc294_gu502_toggle_output(struct hda_codec *codec, |
| 6430 | struct hda_jack_callback *cb) |
| 6431 | { |
| 6432 | /* Windows sets 0x10 to 0x8420 for Node 0x20 which is |
| 6433 | * responsible from changes between speakers and headphones |
| 6434 | */ |
| 6435 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) |
| 6436 | alc_write_coef_idx(codec, 0x10, 0x8420); |
| 6437 | else |
| 6438 | alc_write_coef_idx(codec, 0x10, 0x0a20); |
| 6439 | } |
| 6440 | |
| 6441 | static void alc294_fixup_gu502_hp(struct hda_codec *codec, |
| 6442 | const struct hda_fixup *fix, int action) |
| 6443 | { |
| 6444 | if (!is_jack_detectable(codec, 0x21)) |
| 6445 | return; |
| 6446 | |
| 6447 | switch (action) { |
| 6448 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6449 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 6450 | alc294_gu502_toggle_output); |
| 6451 | break; |
| 6452 | case HDA_FIXUP_ACT_INIT: |
| 6453 | alc294_gu502_toggle_output(codec, NULL); |
| 6454 | break; |
| 6455 | } |
| 6456 | } |
| 6457 | |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 6458 | static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, |
| 6459 | const struct hda_fixup *fix, int action) |
| 6460 | { |
| 6461 | if (action != HDA_FIXUP_ACT_INIT) |
| 6462 | return; |
| 6463 | |
| 6464 | msleep(100); |
| 6465 | alc_write_coef_idx(codec, 0x65, 0x0); |
| 6466 | } |
| 6467 | |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6468 | static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, |
| 6469 | const struct hda_fixup *fix, int action) |
| 6470 | { |
| 6471 | switch (action) { |
| 6472 | case HDA_FIXUP_ACT_INIT: |
| 6473 | alc_combo_jack_hp_jd_restart(codec); |
| 6474 | break; |
| 6475 | } |
| 6476 | } |
| 6477 | |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 6478 | static void alc_fixup_no_int_mic(struct hda_codec *codec, |
| 6479 | const struct hda_fixup *fix, int action) |
| 6480 | { |
| 6481 | struct alc_spec *spec = codec->spec; |
| 6482 | |
| 6483 | switch (action) { |
| 6484 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6485 | /* Mic RING SLEEVE swap for combo jack */ |
| 6486 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); |
| 6487 | spec->no_internal_mic_pin = true; |
| 6488 | break; |
| 6489 | case HDA_FIXUP_ACT_INIT: |
| 6490 | alc_combo_jack_hp_jd_restart(codec); |
| 6491 | break; |
| 6492 | } |
| 6493 | } |
| 6494 | |
Davide Baldo | d94befb | 2021-10-15 09:21:22 +0200 | [diff] [blame] | 6495 | /* GPIO1 = amplifier on/off |
| 6496 | * GPIO3 = mic mute LED |
| 6497 | */ |
| 6498 | static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, |
| 6499 | const struct hda_fixup *fix, int action) |
| 6500 | { |
| 6501 | static const hda_nid_t conn[] = { 0x02 }; |
| 6502 | |
| 6503 | struct alc_spec *spec = codec->spec; |
| 6504 | static const struct hda_pintbl pincfgs[] = { |
| 6505 | { 0x14, 0x90170110 }, /* front/high speakers */ |
| 6506 | { 0x17, 0x90170130 }, /* back/bass speakers */ |
| 6507 | { } |
| 6508 | }; |
| 6509 | |
| 6510 | //enable micmute led |
| 6511 | alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04); |
| 6512 | |
| 6513 | switch (action) { |
| 6514 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6515 | spec->micmute_led_polarity = 1; |
| 6516 | /* needed for amp of back speakers */ |
| 6517 | spec->gpio_mask |= 0x01; |
| 6518 | spec->gpio_dir |= 0x01; |
| 6519 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 6520 | /* share DAC to have unified volume control */ |
| 6521 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); |
| 6522 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
| 6523 | break; |
| 6524 | case HDA_FIXUP_ACT_INIT: |
| 6525 | /* need to toggle GPIO to enable the amp of back speakers */ |
| 6526 | alc_update_gpio_data(codec, 0x01, true); |
| 6527 | msleep(100); |
| 6528 | alc_update_gpio_data(codec, 0x01, false); |
| 6529 | break; |
| 6530 | } |
| 6531 | } |
| 6532 | |
Elia Devito | 434591b | 2021-06-19 22:41:04 +0200 | [diff] [blame] | 6533 | static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, |
| 6534 | const struct hda_fixup *fix, int action) |
| 6535 | { |
| 6536 | static const hda_nid_t conn[] = { 0x02 }; |
| 6537 | static const struct hda_pintbl pincfgs[] = { |
| 6538 | { 0x14, 0x90170110 }, /* rear speaker */ |
| 6539 | { } |
| 6540 | }; |
| 6541 | |
| 6542 | switch (action) { |
| 6543 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6544 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 6545 | /* force front speaker to DAC1 */ |
| 6546 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); |
| 6547 | break; |
| 6548 | } |
| 6549 | } |
| 6550 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 6551 | /* for hda_fixup_thinkpad_acpi() */ |
| 6552 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6553 | |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6554 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
| 6555 | const struct hda_fixup *fix, int action) |
| 6556 | { |
| 6557 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ |
| 6558 | hda_fixup_thinkpad_acpi(codec, fix, action); |
| 6559 | } |
| 6560 | |
Cameron Berkenpas | ad7cc2d | 2021-09-13 14:26:29 -0700 | [diff] [blame] | 6561 | /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */ |
| 6562 | static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec, |
| 6563 | const struct hda_fixup *fix, |
| 6564 | int action) |
| 6565 | { |
| 6566 | struct alc_spec *spec = codec->spec; |
| 6567 | |
| 6568 | switch (action) { |
| 6569 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6570 | spec->gen.suppress_auto_mute = 1; |
| 6571 | break; |
| 6572 | } |
| 6573 | } |
| 6574 | |
Lucas Tanure | d3dca02 | 2021-12-17 11:57:07 +0000 | [diff] [blame] | 6575 | static int comp_match_dev_name(struct device *dev, void *data) |
| 6576 | { |
| 6577 | return strcmp(dev_name(dev), data) == 0; |
| 6578 | } |
| 6579 | |
| 6580 | static int find_comp_by_dev_name(struct alc_spec *spec, const char *name) |
| 6581 | { |
| 6582 | int i; |
| 6583 | |
| 6584 | for (i = 0; i < HDA_MAX_COMPONENTS; i++) { |
| 6585 | if (strcmp(spec->comps[i].name, name) == 0) |
| 6586 | return i; |
| 6587 | } |
| 6588 | |
| 6589 | return -ENODEV; |
| 6590 | } |
| 6591 | |
| 6592 | static int comp_bind(struct device *dev) |
| 6593 | { |
| 6594 | struct hda_codec *cdc = dev_to_hda_codec(dev); |
| 6595 | struct alc_spec *spec = cdc->spec; |
| 6596 | |
| 6597 | return component_bind_all(dev, spec->comps); |
| 6598 | } |
| 6599 | |
| 6600 | static void comp_unbind(struct device *dev) |
| 6601 | { |
| 6602 | struct hda_codec *cdc = dev_to_hda_codec(dev); |
| 6603 | struct alc_spec *spec = cdc->spec; |
| 6604 | |
| 6605 | component_unbind_all(dev, spec->comps); |
| 6606 | } |
| 6607 | |
| 6608 | static const struct component_master_ops comp_master_ops = { |
| 6609 | .bind = comp_bind, |
| 6610 | .unbind = comp_unbind, |
| 6611 | }; |
| 6612 | |
| 6613 | static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc, |
| 6614 | struct snd_pcm_substream *sub, int action) |
| 6615 | { |
| 6616 | struct alc_spec *spec = cdc->spec; |
| 6617 | int i; |
| 6618 | |
| 6619 | for (i = 0; i < HDA_MAX_COMPONENTS; i++) { |
| 6620 | if (spec->comps[i].dev) |
| 6621 | spec->comps[i].playback_hook(spec->comps[i].dev, action); |
| 6622 | } |
| 6623 | } |
| 6624 | |
Stefan Binding | ae7abe3 | 2021-12-17 11:57:08 +0000 | [diff] [blame] | 6625 | static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus, |
| 6626 | const char *hid, int count) |
| 6627 | { |
| 6628 | struct device *dev = hda_codec_dev(cdc); |
| 6629 | struct alc_spec *spec = cdc->spec; |
| 6630 | char *name; |
| 6631 | int ret, i; |
| 6632 | |
| 6633 | switch (action) { |
| 6634 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6635 | for (i = 0; i < count; i++) { |
| 6636 | name = devm_kasprintf(dev, GFP_KERNEL, |
| 6637 | "%s-%s:00-cs35l41-hda.%d", bus, hid, i); |
| 6638 | if (!name) |
| 6639 | return; |
| 6640 | component_match_add(dev, &spec->match, comp_match_dev_name, name); |
| 6641 | } |
| 6642 | ret = component_master_add_with_match(dev, &comp_master_ops, spec->match); |
| 6643 | if (ret) |
| 6644 | codec_err(cdc, "Fail to register component aggregator %d\n", ret); |
| 6645 | else |
| 6646 | spec->gen.pcm_playback_hook = comp_generic_playback_hook; |
| 6647 | break; |
| 6648 | } |
| 6649 | } |
| 6650 | |
| 6651 | static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) |
| 6652 | { |
| 6653 | cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2); |
| 6654 | } |
| 6655 | |
Lucas Tanure | d3dca02 | 2021-12-17 11:57:07 +0000 | [diff] [blame] | 6656 | static void alc287_legion_16achg6_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc, |
| 6657 | struct snd_pcm_substream *sub, int action) |
| 6658 | { |
| 6659 | struct alc_spec *spec = cdc->spec; |
| 6660 | unsigned int rx_slot; |
| 6661 | int i; |
| 6662 | |
| 6663 | switch (action) { |
| 6664 | case HDA_GEN_PCM_ACT_PREPARE: |
| 6665 | rx_slot = 0; |
| 6666 | i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.0"); |
| 6667 | if (i >= 0) |
| 6668 | spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot); |
| 6669 | |
| 6670 | rx_slot = 1; |
| 6671 | i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.1"); |
| 6672 | if (i >= 0) |
| 6673 | spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot); |
| 6674 | break; |
| 6675 | } |
| 6676 | |
| 6677 | comp_generic_playback_hook(hinfo, cdc, sub, action); |
| 6678 | } |
| 6679 | |
| 6680 | static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix, |
| 6681 | int action) |
| 6682 | { |
| 6683 | struct device *dev = hda_codec_dev(cdc); |
| 6684 | struct alc_spec *spec = cdc->spec; |
| 6685 | int ret; |
| 6686 | |
| 6687 | switch (action) { |
| 6688 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 6689 | component_match_add(dev, &spec->match, comp_match_dev_name, |
| 6690 | "i2c-CLSA0100:00-cs35l41-hda.0"); |
| 6691 | component_match_add(dev, &spec->match, comp_match_dev_name, |
| 6692 | "i2c-CLSA0100:00-cs35l41-hda.1"); |
| 6693 | ret = component_master_add_with_match(dev, &comp_master_ops, spec->match); |
| 6694 | if (ret) |
| 6695 | codec_err(cdc, "Fail to register component aggregator %d\n", ret); |
| 6696 | else |
| 6697 | spec->gen.pcm_playback_hook = alc287_legion_16achg6_playback_hook; |
| 6698 | break; |
| 6699 | } |
| 6700 | } |
| 6701 | |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6702 | /* for alc295_fixup_hp_top_speakers */ |
| 6703 | #include "hp_x360_helper.c" |
| 6704 | |
Takashi Iwai | 26928ca | 2021-04-16 10:12:11 +0200 | [diff] [blame] | 6705 | /* for alc285_fixup_ideapad_s740_coef() */ |
| 6706 | #include "ideapad_s740_helper.c" |
| 6707 | |
Werner Sembach | 619764c | 2021-12-02 17:50:10 +0100 | [diff] [blame] | 6708 | static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = { |
| 6709 | WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000), |
| 6710 | WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000), |
| 6711 | WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089), |
| 6712 | {} |
| 6713 | }; |
| 6714 | |
| 6715 | static void alc256_fixup_set_coef_defaults(struct hda_codec *codec, |
| 6716 | const struct hda_fixup *fix, |
| 6717 | int action) |
Werner Sembach | dd6dd6e3 | 2021-10-06 15:04:15 +0200 | [diff] [blame] | 6718 | { |
| 6719 | /* |
Werner Sembach | 619764c | 2021-12-02 17:50:10 +0100 | [diff] [blame] | 6720 | * A certain other OS sets these coeffs to different values. On at least |
| 6721 | * one TongFang barebone these settings might survive even a cold |
| 6722 | * reboot. So to restore a clean slate the values are explicitly reset |
| 6723 | * to default here. Without this, the external microphone is always in a |
| 6724 | * plugged-in state, while the internal microphone is always in an |
| 6725 | * unplugged state, breaking the ability to use the internal microphone. |
| 6726 | */ |
| 6727 | alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs); |
Werner Sembach | dd6dd6e3 | 2021-10-06 15:04:15 +0200 | [diff] [blame] | 6728 | } |
| 6729 | |
Werner Sembach | 174a7fb | 2021-11-12 12:07:04 +0100 | [diff] [blame] | 6730 | static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = { |
| 6731 | WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06), |
| 6732 | WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074), |
| 6733 | WRITE_COEF(0x49, 0x0149), |
| 6734 | {} |
| 6735 | }; |
| 6736 | |
| 6737 | static void alc233_fixup_no_audio_jack(struct hda_codec *codec, |
| 6738 | const struct hda_fixup *fix, |
| 6739 | int action) |
| 6740 | { |
| 6741 | /* |
| 6742 | * The audio jack input and output is not detected on the ASRock NUC Box |
| 6743 | * 1100 series when cold booting without this fix. Warm rebooting from a |
| 6744 | * certain other OS makes the audio functional, as COEF settings are |
| 6745 | * preserved in this case. This fix sets these altered COEF values as |
| 6746 | * the default. |
| 6747 | */ |
| 6748 | alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs); |
| 6749 | } |
| 6750 | |
Werner Sembach | edca7cc | 2021-12-15 20:16:46 +0100 | [diff] [blame] | 6751 | static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec, |
| 6752 | const struct hda_fixup *fix, |
| 6753 | int action) |
| 6754 | { |
| 6755 | /* |
| 6756 | * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec, |
| 6757 | * but uses the 0x8686 subproduct id in both cases. The ALC256 codec |
| 6758 | * needs an additional quirk for sound working after suspend and resume. |
| 6759 | */ |
| 6760 | if (codec->core.vendor_id == 0x10ec0256) { |
| 6761 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 6762 | snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120); |
| 6763 | } else { |
| 6764 | snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c); |
| 6765 | } |
| 6766 | } |
| 6767 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6768 | enum { |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame] | 6769 | ALC269_FIXUP_GPIO2, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6770 | ALC269_FIXUP_SONY_VAIO, |
| 6771 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 6772 | ALC269_FIXUP_DELL_M101Z, |
| 6773 | ALC269_FIXUP_SKU_IGNORE, |
| 6774 | ALC269_FIXUP_ASUS_G73JW, |
| 6775 | ALC269_FIXUP_LENOVO_EAPD, |
| 6776 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6777 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6778 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6779 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6780 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 6781 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 6782 | ALC269_FIXUP_QUANTA_MUTE, |
| 6783 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 6784 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 6785 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6786 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 6787 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6788 | ALC269_FIXUP_AMIC, |
| 6789 | ALC269_FIXUP_DMIC, |
| 6790 | ALC269VB_FIXUP_AMIC, |
| 6791 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6792 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 6793 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6794 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 6795 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6796 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6797 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 6798 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6799 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6800 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 6801 | ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6802 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6803 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6804 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6805 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6806 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6807 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 6808 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6809 | ALC269_FIXUP_HEADSET_MODE, |
| 6810 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6811 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6812 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 6813 | ALC269_FIXUP_ASUS_X101_VERB, |
| 6814 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6815 | ALC271_FIXUP_AMIC_MIC2, |
| 6816 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6817 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6818 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6819 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6820 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6821 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6822 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6823 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6824 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6825 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6826 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6827 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6828 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6829 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6830 | ALC290_FIXUP_SUBWOOFER, |
| 6831 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6832 | ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6833 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6834 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6835 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6836 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6837 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6838 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6839 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6840 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6841 | ALC292_FIXUP_TPT440_DOCK, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6842 | ALC292_FIXUP_TPT440, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6843 | ALC283_FIXUP_HEADSET_MIC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6844 | ALC255_FIXUP_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6845 | ALC282_FIXUP_ASPIRE_V5_PINS, |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 6846 | ALC269VB_FIXUP_ASPIRE_E1_COEF, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6847 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6848 | ALC286_FIXUP_HP_GPIO_LED, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6849 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6850 | ALC280_FIXUP_HP_DOCK_PINS, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6851 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6852 | ALC280_FIXUP_HP_9480M, |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 6853 | ALC245_FIXUP_HP_X360_AMP, |
Davide Baldo | d94befb | 2021-10-15 09:21:22 +0200 | [diff] [blame] | 6854 | ALC285_FIXUP_HP_SPECTRE_X360_EB1, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6855 | ALC288_FIXUP_DELL_HEADSET_MODE, |
| 6856 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6857 | ALC288_FIXUP_DELL_XPS_13, |
| 6858 | ALC288_FIXUP_DISABLE_AAMIX, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 6859 | ALC292_FIXUP_DELL_E7X_AAMIX, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6860 | ALC292_FIXUP_DELL_E7X, |
| 6861 | ALC292_FIXUP_DISABLE_AAMIX, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6862 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 6863 | ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6864 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6865 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6866 | ALC275_FIXUP_DELL_XPS, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6867 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6868 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6869 | ALC255_FIXUP_DELL_SPK_NOISE, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6870 | ALC225_FIXUP_DISABLE_MIC_VREF, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6871 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6872 | ALC295_FIXUP_DISABLE_DAC3, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 6873 | ALC285_FIXUP_SPEAKER2_TO_DAC1, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6874 | ALC280_FIXUP_HP_HEADSET_MIC, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6875 | ALC221_FIXUP_HP_FRONT_MIC, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6876 | ALC292_FIXUP_TPT460, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6877 | ALC298_FIXUP_SPK_VOLUME, |
Kailang Yang | f86de9b | 2020-10-23 14:46:47 +0800 | [diff] [blame] | 6878 | ALC298_FIXUP_LENOVO_SPK_VOLUME, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6879 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6880 | ALC269_FIXUP_ATIV_BOOK_8, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6881 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6882 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
| 6883 | ALC256_FIXUP_ASUS_MIC, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6884 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6885 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 6886 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6887 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 6888 | ALC233_FIXUP_ACER_HEADSET_MIC, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6889 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6890 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 6891 | ALC225_FIXUP_S3_POP_NOISE, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6892 | ALC700_FIXUP_INTEL_REFERENCE, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6893 | ALC274_FIXUP_DELL_BIND_DACS, |
| 6894 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 6895 | ALC298_FIXUP_TPT470_DOCK_FIX, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6896 | ALC298_FIXUP_TPT470_DOCK, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6897 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6898 | ALC255_FIXUP_DELL_HEADSET_MIC, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 6899 | ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 6900 | ALC298_FIXUP_HUAWEI_MBX_STEREO, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6901 | ALC295_FIXUP_HP_X360, |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 6902 | ALC221_FIXUP_HP_HEADSET_MIC, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6903 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6904 | ALC295_FIXUP_HP_AUTO_MUTE, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 6905 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 6906 | ALC294_FIXUP_ASUS_MIC, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6907 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
| 6908 | ALC294_FIXUP_ASUS_SPK, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 6909 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 6910 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6911 | ALC255_FIXUP_ACER_HEADSET_MIC, |
Kailang Yang | 10f5b1b | 2019-02-21 16:10:22 +0800 | [diff] [blame] | 6912 | ALC295_FIXUP_CHROME_BOOK, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6913 | ALC225_FIXUP_HEADSET_JACK, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 6914 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
| 6915 | ALC225_FIXUP_WYSE_AUTO_MUTE, |
| 6916 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6917 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 6918 | ALC256_FIXUP_ASUS_HEADSET_MIC, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 6919 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 6920 | ALC299_FIXUP_PREDATOR_SPK, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 6921 | ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 6922 | ALC289_FIXUP_DELL_SPK2, |
| 6923 | ALC289_FIXUP_DUAL_SPK, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 6924 | ALC294_FIXUP_SPK2_TO_DAC1, |
| 6925 | ALC294_FIXUP_ASUS_DUAL_SPK, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 6926 | ALC285_FIXUP_THINKPAD_X1_GEN7, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 6927 | ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 6928 | ALC294_FIXUP_ASUS_HPE, |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 6929 | ALC294_FIXUP_ASUS_COEF_1B, |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 6930 | ALC294_FIXUP_ASUS_GX502_HP, |
| 6931 | ALC294_FIXUP_ASUS_GX502_PINS, |
| 6932 | ALC294_FIXUP_ASUS_GX502_VERBS, |
Daniel Cordova A | c1b55029 | 2021-05-07 12:31:16 -0500 | [diff] [blame] | 6933 | ALC294_FIXUP_ASUS_GU502_HP, |
| 6934 | ALC294_FIXUP_ASUS_GU502_PINS, |
| 6935 | ALC294_FIXUP_ASUS_GU502_VERBS, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 6936 | ALC285_FIXUP_HP_GPIO_LED, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 6937 | ALC285_FIXUP_HP_MUTE_LED, |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 6938 | ALC236_FIXUP_HP_GPIO_LED, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 6939 | ALC236_FIXUP_HP_MUTE_LED, |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 6940 | ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, |
Mike Pozulp | 14425f1 | 2020-05-09 20:28:37 -0700 | [diff] [blame] | 6941 | ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 6942 | ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | 8eae7e9 | 2020-07-06 15:18:25 +0800 | [diff] [blame] | 6943 | ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, |
Jian-Hong Pan | 6e15d12 | 2020-07-06 15:18:27 +0800 | [diff] [blame] | 6944 | ALC269VC_FIXUP_ACER_HEADSET_MIC, |
Jian-Hong Pan | 781c90c | 2020-07-06 15:18:29 +0800 | [diff] [blame] | 6945 | ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 6946 | ALC289_FIXUP_ASUS_GA401, |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 6947 | ALC289_FIXUP_ASUS_GA502, |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 6948 | ALC256_FIXUP_ACER_MIC_NO_PRESENCE, |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 6949 | ALC285_FIXUP_HP_GPIO_AMP_INIT, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 6950 | ALC269_FIXUP_CZC_B20, |
| 6951 | ALC269_FIXUP_CZC_TMI, |
| 6952 | ALC269_FIXUP_CZC_L101, |
| 6953 | ALC269_FIXUP_LEMOTE_A1802, |
| 6954 | ALC269_FIXUP_LEMOTE_A190X, |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 6955 | ALC256_FIXUP_INTEL_NUC8_RUGGED, |
Phil Calvin | d1ee66c | 2021-04-15 18:01:29 -0400 | [diff] [blame] | 6956 | ALC233_FIXUP_INTEL_NUC8_DMIC, |
| 6957 | ALC233_FIXUP_INTEL_NUC8_BOOST, |
Werner Sembach | 73e7161 | 2021-03-02 19:04:14 +0100 | [diff] [blame] | 6958 | ALC256_FIXUP_INTEL_NUC10, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 6959 | ALC255_FIXUP_XIAOMI_HEADSET_MIC, |
Hui Wang | 13468bf | 2020-09-28 16:01:17 +0800 | [diff] [blame] | 6960 | ALC274_FIXUP_HP_MIC, |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 6961 | ALC274_FIXUP_HP_HEADSET_MIC, |
Takashi Iwai | 622464c | 2021-05-04 11:18:02 +0200 | [diff] [blame] | 6962 | ALC274_FIXUP_HP_ENVY_GPIO, |
Kailang Yang | ef9ce66 | 2020-11-03 15:40:35 +0800 | [diff] [blame] | 6963 | ALC256_FIXUP_ASUS_HPE, |
Kailang Yang | 446b818 | 2020-11-02 15:00:12 +0800 | [diff] [blame] | 6964 | ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 6965 | ALC287_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 6966 | ALC256_FIXUP_HP_HEADSET_MIC, |
Johnathon Clark | 5fc462c | 2021-10-20 14:12:51 +0100 | [diff] [blame] | 6967 | ALC245_FIXUP_HP_GPIO_LED, |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 6968 | ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
Chris Chiu | 34cdf40 | 2020-12-16 20:52:00 +0800 | [diff] [blame] | 6969 | ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
Chris Chiu | 495dc76 | 2021-01-14 16:27:28 +0800 | [diff] [blame] | 6970 | ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST, |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 6971 | ALC256_FIXUP_ACER_HEADSET_MIC, |
Takashi Iwai | 26928ca | 2021-04-16 10:12:11 +0200 | [diff] [blame] | 6972 | ALC285_FIXUP_IDEAPAD_S740_COEF, |
Kai-Heng Feng | bd15b15 | 2021-04-20 19:55:29 +0800 | [diff] [blame] | 6973 | ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST, |
Takashi Iwai | 8eedd3a | 2021-05-04 10:20:57 +0200 | [diff] [blame] | 6974 | ALC295_FIXUP_ASUS_DACS, |
Takashi Iwai | 5d84b53 | 2021-05-04 14:18:32 +0200 | [diff] [blame] | 6975 | ALC295_FIXUP_HP_OMEN, |
Elia Devito | f2be77f | 2021-05-11 14:46:49 +0200 | [diff] [blame] | 6976 | ALC285_FIXUP_HP_SPECTRE_X360, |
Hui Wang | 9ebaef0 | 2021-05-22 12:26:45 +0800 | [diff] [blame] | 6977 | ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, |
Peter Ujfalusi | 29c8f40 | 2021-05-24 23:37:26 +0300 | [diff] [blame] | 6978 | ALC623_FIXUP_LENOVO_THINKSTATION_P340, |
Hui Wang | 57c9e21 | 2021-06-08 10:46:00 +0800 | [diff] [blame] | 6979 | ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, |
Kai-Heng Feng | 8903376d | 2021-08-18 22:41:18 +0800 | [diff] [blame] | 6980 | ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST, |
Cameron Berkenpas | ad7cc2d | 2021-09-13 14:26:29 -0700 | [diff] [blame] | 6981 | ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS, |
| 6982 | ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, |
| 6983 | ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, |
Werner Sembach | dd6dd6e3 | 2021-10-06 15:04:15 +0200 | [diff] [blame] | 6984 | ALC287_FIXUP_13S_GEN2_SPEAKERS, |
Werner Sembach | 619764c | 2021-12-02 17:50:10 +0100 | [diff] [blame] | 6985 | ALC256_FIXUP_SET_COEF_DEFAULTS, |
Jeremy Soller | 1278cc5ac | 2021-11-02 11:21:04 -0600 | [diff] [blame] | 6986 | ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
Werner Sembach | 174a7fb | 2021-11-12 12:07:04 +0100 | [diff] [blame] | 6987 | ALC233_FIXUP_NO_AUDIO_JACK, |
Werner Sembach | edca7cc | 2021-12-15 20:16:46 +0100 | [diff] [blame] | 6988 | ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME, |
Baole Fang | 8f4c904 | 2022-01-05 22:08:54 +0800 | [diff] [blame] | 6989 | ALC285_FIXUP_LEGION_Y9000X_SPEAKERS, |
| 6990 | ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, |
Lucas Tanure | d3dca02 | 2021-12-17 11:57:07 +0000 | [diff] [blame] | 6991 | ALC287_FIXUP_LEGION_16ACHG6, |
Stefan Binding | ae7abe3 | 2021-12-17 11:57:08 +0000 | [diff] [blame] | 6992 | ALC287_FIXUP_CS35L41_I2C_2, |
Alexander Sergeyev | 91502a9 | 2022-01-14 19:50:50 +0300 | [diff] [blame] | 6993 | ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6994 | }; |
| 6995 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6996 | static const struct hda_fixup alc269_fixups[] = { |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame] | 6997 | [ALC269_FIXUP_GPIO2] = { |
| 6998 | .type = HDA_FIXUP_FUNC, |
| 6999 | .v.func = alc_fixup_gpio2, |
| 7000 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7001 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 7002 | .type = HDA_FIXUP_PINCTLS, |
| 7003 | .v.pins = (const struct hda_pintbl[]) { |
| 7004 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7005 | {} |
| 7006 | } |
| 7007 | }, |
| 7008 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 7009 | .type = HDA_FIXUP_FUNC, |
| 7010 | .v.func = alc275_fixup_gpio4_off, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7011 | .chained = true, |
| 7012 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 7013 | }, |
| 7014 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7015 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7016 | .v.verbs = (const struct hda_verb[]) { |
| 7017 | /* Enables internal speaker */ |
| 7018 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 7019 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 7020 | {} |
| 7021 | } |
| 7022 | }, |
| 7023 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7024 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 7025 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7026 | }, |
| 7027 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7028 | .type = HDA_FIXUP_PINS, |
| 7029 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7030 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 7031 | { } |
| 7032 | } |
| 7033 | }, |
| 7034 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7035 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7036 | .v.verbs = (const struct hda_verb[]) { |
| 7037 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 7038 | {} |
| 7039 | } |
| 7040 | }, |
| 7041 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7042 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7043 | .v.func = alc269_fixup_hweq, |
| 7044 | .chained = true, |
| 7045 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 7046 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 7047 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 7048 | .type = HDA_FIXUP_FUNC, |
| 7049 | .v.func = alc_fixup_disable_aamix, |
| 7050 | .chained = true, |
| 7051 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 7052 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7053 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7054 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7055 | .v.func = alc271_fixup_dmic, |
| 7056 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 7057 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7058 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 7059 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 7060 | .chained = true, |
| 7061 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 7062 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 7063 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7064 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 7065 | .v.func = alc269_fixup_stereo_dmic, |
| 7066 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 7067 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 7068 | .type = HDA_FIXUP_FUNC, |
| 7069 | .v.func = alc269_fixup_headset_mic, |
| 7070 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 7071 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7072 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 7073 | .v.func = alc269_fixup_quanta_mute, |
| 7074 | }, |
| 7075 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7076 | .type = HDA_FIXUP_PINS, |
| 7077 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 7078 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 7079 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 7080 | { } |
| 7081 | }, |
| 7082 | .chained = true, |
| 7083 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 7084 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 7085 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 7086 | .type = HDA_FIXUP_PINS, |
| 7087 | .v.pins = (const struct hda_pintbl[]) { |
| 7088 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 7089 | { } |
| 7090 | }, |
| 7091 | }, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 7092 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
| 7093 | .type = HDA_FIXUP_PINS, |
| 7094 | .v.pins = (const struct hda_pintbl[]) { |
| 7095 | { 0x21, 0x0221102f }, /* HP out */ |
| 7096 | { } |
| 7097 | }, |
| 7098 | }, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 7099 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
| 7100 | .type = HDA_FIXUP_FUNC, |
| 7101 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
| 7102 | }, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 7103 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
| 7104 | .type = HDA_FIXUP_FUNC, |
| 7105 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, |
| 7106 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7107 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7108 | .type = HDA_FIXUP_PINS, |
| 7109 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7110 | { 0x14, 0x99130110 }, /* speaker */ |
| 7111 | { 0x15, 0x0121401f }, /* HP out */ |
| 7112 | { 0x18, 0x01a19c20 }, /* mic */ |
| 7113 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 7114 | { } |
| 7115 | }, |
| 7116 | }, |
| 7117 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7118 | .type = HDA_FIXUP_PINS, |
| 7119 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7120 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 7121 | { 0x14, 0x99130110 }, /* speaker */ |
| 7122 | { 0x15, 0x0121401f }, /* HP out */ |
| 7123 | { 0x18, 0x01a19c20 }, /* mic */ |
| 7124 | { } |
| 7125 | }, |
| 7126 | }, |
| 7127 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7128 | .type = HDA_FIXUP_PINS, |
| 7129 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7130 | { 0x14, 0x99130110 }, /* speaker */ |
| 7131 | { 0x18, 0x01a19c20 }, /* mic */ |
| 7132 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 7133 | { 0x21, 0x0121401f }, /* HP out */ |
| 7134 | { } |
| 7135 | }, |
| 7136 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 7137 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7138 | .type = HDA_FIXUP_PINS, |
| 7139 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7140 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 7141 | { 0x14, 0x99130110 }, /* speaker */ |
| 7142 | { 0x18, 0x01a19c20 }, /* mic */ |
| 7143 | { 0x21, 0x0121401f }, /* HP out */ |
| 7144 | { } |
| 7145 | }, |
| 7146 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 7147 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7148 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 7149 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 7150 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 7151 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 7152 | .type = HDA_FIXUP_FUNC, |
| 7153 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 7154 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 7155 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7156 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 7157 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 7158 | }, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 7159 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
| 7160 | .type = HDA_FIXUP_FUNC, |
| 7161 | .v.func = alc269_fixup_hp_mute_led_mic3, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 7162 | .chained = true, |
| 7163 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 7164 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 7165 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 7166 | .type = HDA_FIXUP_FUNC, |
| 7167 | .v.func = alc269_fixup_hp_gpio_led, |
| 7168 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 7169 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 7170 | .type = HDA_FIXUP_FUNC, |
| 7171 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 7172 | }, |
| 7173 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 7174 | .type = HDA_FIXUP_FUNC, |
| 7175 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 7176 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 7177 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7178 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 7179 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 7180 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 7181 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 7182 | .type = HDA_FIXUP_FUNC, |
| 7183 | .v.func = alc_fixup_no_shutup, |
| 7184 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7185 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7186 | .type = HDA_FIXUP_PINS, |
| 7187 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7188 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 7189 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 7190 | { } |
| 7191 | }, |
| 7192 | .chained = true, |
| 7193 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 7194 | }, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 7195 | [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { |
| 7196 | .type = HDA_FIXUP_FUNC, |
| 7197 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 7198 | .chained = true, |
| 7199 | .chain_id = ALC269_FIXUP_LENOVO_DOCK, |
| 7200 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7201 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7202 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7203 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 7204 | .chained = true, |
| 7205 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7206 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7207 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7208 | .type = HDA_FIXUP_PINS, |
| 7209 | .v.pins = (const struct hda_pintbl[]) { |
| 7210 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7211 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7212 | { } |
| 7213 | }, |
| 7214 | .chained = true, |
| 7215 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7216 | }, |
| 7217 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 7218 | .type = HDA_FIXUP_PINS, |
| 7219 | .v.pins = (const struct hda_pintbl[]) { |
| 7220 | { 0x16, 0x21014020 }, /* dock line out */ |
| 7221 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 7222 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7223 | { } |
| 7224 | }, |
| 7225 | .chained = true, |
| 7226 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7227 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 7228 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 7229 | .type = HDA_FIXUP_PINS, |
| 7230 | .v.pins = (const struct hda_pintbl[]) { |
| 7231 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7232 | { } |
| 7233 | }, |
| 7234 | .chained = true, |
| 7235 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7236 | }, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 7237 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
| 7238 | .type = HDA_FIXUP_PINS, |
| 7239 | .v.pins = (const struct hda_pintbl[]) { |
| 7240 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7241 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7242 | { } |
| 7243 | }, |
| 7244 | .chained = true, |
| 7245 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7246 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7247 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 7248 | .type = HDA_FIXUP_FUNC, |
| 7249 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 7250 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7251 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7252 | }, |
| 7253 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 7254 | .type = HDA_FIXUP_FUNC, |
| 7255 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 7256 | }, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 7257 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
| 7258 | .type = HDA_FIXUP_PINS, |
| 7259 | .v.pins = (const struct hda_pintbl[]) { |
| 7260 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 7261 | { } |
| 7262 | }, |
| 7263 | .chained = true, |
| 7264 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 7265 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 7266 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 7267 | .type = HDA_FIXUP_PINS, |
| 7268 | .v.pins = (const struct hda_pintbl[]) { |
| 7269 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7270 | { } |
| 7271 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 7272 | .chained = true, |
| 7273 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 7274 | }, |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 7275 | [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 7276 | .type = HDA_FIXUP_PINS, |
| 7277 | .v.pins = (const struct hda_pintbl[]) { |
| 7278 | {0x12, 0x90a60130}, |
| 7279 | {0x13, 0x40000000}, |
| 7280 | {0x14, 0x90170110}, |
| 7281 | {0x18, 0x411111f0}, |
| 7282 | {0x19, 0x04a11040}, |
| 7283 | {0x1a, 0x411111f0}, |
| 7284 | {0x1b, 0x90170112}, |
| 7285 | {0x1d, 0x40759a05}, |
| 7286 | {0x1e, 0x411111f0}, |
| 7287 | {0x21, 0x04211020}, |
| 7288 | { } |
| 7289 | }, |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 7290 | .chained = true, |
| 7291 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 7292 | }, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 7293 | [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { |
| 7294 | .type = HDA_FIXUP_FUNC, |
| 7295 | .v.func = alc298_fixup_huawei_mbx_stereo, |
| 7296 | .chained = true, |
| 7297 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
| 7298 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 7299 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 7300 | .type = HDA_FIXUP_FUNC, |
| 7301 | .v.func = alc269_fixup_x101_headset_mic, |
| 7302 | }, |
| 7303 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 7304 | .type = HDA_FIXUP_VERBS, |
| 7305 | .v.verbs = (const struct hda_verb[]) { |
| 7306 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 7307 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 7308 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 7309 | { } |
| 7310 | }, |
| 7311 | .chained = true, |
| 7312 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 7313 | }, |
| 7314 | [ALC269_FIXUP_ASUS_X101] = { |
| 7315 | .type = HDA_FIXUP_PINS, |
| 7316 | .v.pins = (const struct hda_pintbl[]) { |
| 7317 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 7318 | { } |
| 7319 | }, |
| 7320 | .chained = true, |
| 7321 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 7322 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 7323 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7324 | .type = HDA_FIXUP_PINS, |
| 7325 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 7326 | { 0x14, 0x99130110 }, /* speaker */ |
| 7327 | { 0x19, 0x01a19c20 }, /* mic */ |
| 7328 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 7329 | { 0x21, 0x0121401f }, /* HP out */ |
| 7330 | { } |
| 7331 | }, |
| 7332 | }, |
| 7333 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7334 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 7335 | .v.func = alc271_hp_gate_mic_jack, |
| 7336 | .chained = true, |
| 7337 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 7338 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 7339 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 7340 | .type = HDA_FIXUP_FUNC, |
| 7341 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 7342 | .chained = true, |
| 7343 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 7344 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 7345 | [ALC269_FIXUP_ACER_AC700] = { |
| 7346 | .type = HDA_FIXUP_PINS, |
| 7347 | .v.pins = (const struct hda_pintbl[]) { |
| 7348 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 7349 | { 0x14, 0x99130110 }, /* speaker */ |
| 7350 | { 0x18, 0x03a11c20 }, /* mic */ |
| 7351 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 7352 | { 0x21, 0x0321101f }, /* HP out */ |
| 7353 | { } |
| 7354 | }, |
| 7355 | .chained = true, |
| 7356 | .chain_id = ALC271_FIXUP_DMIC, |
| 7357 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 7358 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 7359 | .type = HDA_FIXUP_FUNC, |
| 7360 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 7361 | .chained = true, |
| 7362 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 7363 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 7364 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 7365 | .type = HDA_FIXUP_FUNC, |
| 7366 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 7367 | .chained = true, |
| 7368 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 7369 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 7370 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 7371 | .type = HDA_FIXUP_VERBS, |
| 7372 | .v.verbs = (const struct hda_verb[]) { |
| 7373 | /* class-D output amp +5dB */ |
| 7374 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 7375 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 7376 | {} |
| 7377 | }, |
| 7378 | .chained = true, |
| 7379 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 7380 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 7381 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 7382 | .type = HDA_FIXUP_FUNC, |
| 7383 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 7384 | .chained = true, |
| 7385 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 7386 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 7387 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 7388 | .type = HDA_FIXUP_PINS, |
| 7389 | .v.pins = (const struct hda_pintbl[]) { |
| 7390 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 7391 | { 0x18, 0x03a11d20 }, /* mic */ |
| 7392 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 7393 | { } |
| 7394 | }, |
| 7395 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 7396 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 7397 | .type = HDA_FIXUP_FUNC, |
| 7398 | .v.func = alc283_fixup_chromebook, |
| 7399 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 7400 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 7401 | .type = HDA_FIXUP_FUNC, |
| 7402 | .v.func = alc283_fixup_sense_combo_jack, |
| 7403 | .chained = true, |
| 7404 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 7405 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 7406 | [ALC282_FIXUP_ASUS_TX300] = { |
| 7407 | .type = HDA_FIXUP_FUNC, |
| 7408 | .v.func = alc282_fixup_asus_tx300, |
| 7409 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 7410 | [ALC283_FIXUP_INT_MIC] = { |
| 7411 | .type = HDA_FIXUP_VERBS, |
| 7412 | .v.verbs = (const struct hda_verb[]) { |
| 7413 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 7414 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 7415 | { } |
| 7416 | }, |
| 7417 | .chained = true, |
| 7418 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 7419 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7420 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 7421 | .type = HDA_FIXUP_PINS, |
| 7422 | .v.pins = (const struct hda_pintbl[]) { |
| 7423 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 7424 | { } |
| 7425 | }, |
| 7426 | .chained = true, |
| 7427 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 7428 | }, |
| 7429 | [ALC290_FIXUP_SUBWOOFER] = { |
| 7430 | .type = HDA_FIXUP_PINS, |
| 7431 | .v.pins = (const struct hda_pintbl[]) { |
| 7432 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 7433 | { } |
| 7434 | }, |
| 7435 | .chained = true, |
| 7436 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 7437 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 7438 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 7439 | .type = HDA_FIXUP_FUNC, |
| 7440 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 7441 | }, |
| 7442 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 7443 | .type = HDA_FIXUP_FUNC, |
| 7444 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 7445 | .chained = true, |
| 7446 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 7447 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 7448 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 7449 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 7450 | .v.func = alc_fixup_thinkpad_acpi, |
Takashi Iwai | 09da111 | 2016-09-08 12:15:02 +0200 | [diff] [blame] | 7451 | .chained = true, |
| 7452 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 7453 | }, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 7454 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
| 7455 | .type = HDA_FIXUP_FUNC, |
| 7456 | .v.func = alc_fixup_inv_dmic, |
| 7457 | .chained = true, |
| 7458 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 7459 | }, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 7460 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 7461 | .type = HDA_FIXUP_PINS, |
| 7462 | .v.pins = (const struct hda_pintbl[]) { |
| 7463 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7464 | { } |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 7465 | }, |
| 7466 | .chained = true, |
Hui Wang | 17d3046 | 2019-06-14 16:44:12 +0800 | [diff] [blame] | 7467 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 7468 | }, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 7469 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7470 | .type = HDA_FIXUP_PINS, |
| 7471 | .v.pins = (const struct hda_pintbl[]) { |
| 7472 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7473 | { } |
| 7474 | }, |
| 7475 | .chained = true, |
| 7476 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 7477 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 7478 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7479 | .type = HDA_FIXUP_PINS, |
| 7480 | .v.pins = (const struct hda_pintbl[]) { |
| 7481 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7482 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7483 | { } |
| 7484 | }, |
| 7485 | .chained = true, |
| 7486 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 7487 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 7488 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 7489 | .type = HDA_FIXUP_PINS, |
| 7490 | .v.pins = (const struct hda_pintbl[]) { |
| 7491 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7492 | { } |
| 7493 | }, |
| 7494 | .chained = true, |
| 7495 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7496 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 7497 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 7498 | .type = HDA_FIXUP_FUNC, |
| 7499 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 7500 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7501 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 7502 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 7503 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 7504 | .type = HDA_FIXUP_FUNC, |
| 7505 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 7506 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 7507 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7508 | .type = HDA_FIXUP_PINS, |
| 7509 | .v.pins = (const struct hda_pintbl[]) { |
| 7510 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7511 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7512 | { } |
| 7513 | }, |
| 7514 | .chained = true, |
| 7515 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7516 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7517 | [ALC292_FIXUP_TPT440_DOCK] = { |
David Henningsson | ec56af6 | 2015-06-24 10:46:33 +0200 | [diff] [blame] | 7518 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 7519 | .v.func = alc_fixup_tpt440_dock, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7520 | .chained = true, |
| 7521 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 7522 | }, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7523 | [ALC292_FIXUP_TPT440] = { |
| 7524 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 157f0b7 | 2015-12-10 23:30:43 +0100 | [diff] [blame] | 7525 | .v.func = alc_fixup_disable_aamix, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7526 | .chained = true, |
| 7527 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
| 7528 | }, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 7529 | [ALC283_FIXUP_HEADSET_MIC] = { |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 7530 | .type = HDA_FIXUP_PINS, |
| 7531 | .v.pins = (const struct hda_pintbl[]) { |
| 7532 | { 0x19, 0x04a110f0 }, |
| 7533 | { }, |
| 7534 | }, |
| 7535 | }, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7536 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 7537 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 7538 | .v.func = alc_fixup_micmute_led, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 7539 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 7540 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 7541 | .type = HDA_FIXUP_PINS, |
| 7542 | .v.pins = (const struct hda_pintbl[]) { |
| 7543 | { 0x12, 0x90a60130 }, |
| 7544 | { 0x14, 0x90170110 }, |
| 7545 | { 0x17, 0x40000008 }, |
| 7546 | { 0x18, 0x411111f0 }, |
Mateusz Sylwestrzak | 0420694 | 2015-07-19 17:38:56 +0200 | [diff] [blame] | 7547 | { 0x19, 0x01a1913c }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 7548 | { 0x1a, 0x411111f0 }, |
| 7549 | { 0x1b, 0x411111f0 }, |
| 7550 | { 0x1d, 0x40f89b2d }, |
| 7551 | { 0x1e, 0x411111f0 }, |
| 7552 | { 0x21, 0x0321101f }, |
| 7553 | { }, |
| 7554 | }, |
| 7555 | }, |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 7556 | [ALC269VB_FIXUP_ASPIRE_E1_COEF] = { |
| 7557 | .type = HDA_FIXUP_FUNC, |
| 7558 | .v.func = alc269vb_fixup_aspire_e1_coef, |
| 7559 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 7560 | [ALC280_FIXUP_HP_GPIO4] = { |
| 7561 | .type = HDA_FIXUP_FUNC, |
| 7562 | .v.func = alc280_fixup_hp_gpio4, |
| 7563 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 7564 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 7565 | .type = HDA_FIXUP_FUNC, |
| 7566 | .v.func = alc286_fixup_hp_gpio_led, |
| 7567 | }, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 7568 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
| 7569 | .type = HDA_FIXUP_FUNC, |
| 7570 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, |
| 7571 | }, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 7572 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
| 7573 | .type = HDA_FIXUP_PINS, |
| 7574 | .v.pins = (const struct hda_pintbl[]) { |
| 7575 | { 0x1b, 0x21011020 }, /* line-out */ |
| 7576 | { 0x1a, 0x01a1903c }, /* headset mic */ |
| 7577 | { 0x18, 0x2181103f }, /* line-in */ |
| 7578 | { }, |
| 7579 | }, |
| 7580 | .chained = true, |
| 7581 | .chain_id = ALC280_FIXUP_HP_GPIO4 |
| 7582 | }, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7583 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
| 7584 | .type = HDA_FIXUP_PINS, |
| 7585 | .v.pins = (const struct hda_pintbl[]) { |
| 7586 | { 0x1b, 0x21011020 }, /* line-out */ |
| 7587 | { 0x18, 0x2181103f }, /* line-in */ |
| 7588 | { }, |
| 7589 | }, |
| 7590 | .chained = true, |
| 7591 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED |
| 7592 | }, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 7593 | [ALC280_FIXUP_HP_9480M] = { |
| 7594 | .type = HDA_FIXUP_FUNC, |
| 7595 | .v.func = alc280_fixup_hp_9480m, |
| 7596 | }, |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 7597 | [ALC245_FIXUP_HP_X360_AMP] = { |
| 7598 | .type = HDA_FIXUP_FUNC, |
| 7599 | .v.func = alc245_fixup_hp_x360_amp, |
Johnathon Clark | 5fc462c | 2021-10-20 14:12:51 +0100 | [diff] [blame] | 7600 | .chained = true, |
| 7601 | .chain_id = ALC245_FIXUP_HP_GPIO_LED |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 7602 | }, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7603 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
| 7604 | .type = HDA_FIXUP_FUNC, |
| 7605 | .v.func = alc_fixup_headset_mode_dell_alc288, |
| 7606 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7607 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7608 | }, |
| 7609 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7610 | .type = HDA_FIXUP_PINS, |
| 7611 | .v.pins = (const struct hda_pintbl[]) { |
| 7612 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7613 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7614 | { } |
| 7615 | }, |
| 7616 | .chained = true, |
| 7617 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE |
| 7618 | }, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7619 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
| 7620 | .type = HDA_FIXUP_FUNC, |
| 7621 | .v.func = alc_fixup_disable_aamix, |
| 7622 | .chained = true, |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 7623 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7624 | }, |
| 7625 | [ALC288_FIXUP_DELL_XPS_13] = { |
| 7626 | .type = HDA_FIXUP_FUNC, |
| 7627 | .v.func = alc_fixup_dell_xps13, |
| 7628 | .chained = true, |
| 7629 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX |
| 7630 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7631 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
| 7632 | .type = HDA_FIXUP_FUNC, |
| 7633 | .v.func = alc_fixup_disable_aamix, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 7634 | .chained = true, |
| 7635 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7636 | }, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 7637 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
| 7638 | .type = HDA_FIXUP_FUNC, |
| 7639 | .v.func = alc_fixup_disable_aamix, |
| 7640 | .chained = true, |
| 7641 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7642 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 7643 | [ALC292_FIXUP_DELL_E7X_AAMIX] = { |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7644 | .type = HDA_FIXUP_FUNC, |
| 7645 | .v.func = alc_fixup_dell_xps13, |
| 7646 | .chained = true, |
| 7647 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX |
| 7648 | }, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 7649 | [ALC292_FIXUP_DELL_E7X] = { |
| 7650 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8a50355 | 2020-06-18 13:08:32 +0200 | [diff] [blame] | 7651 | .v.func = alc_fixup_micmute_led, |
Takashi Iwai | 5fab582 | 2020-01-05 09:11:19 +0100 | [diff] [blame] | 7652 | /* micmute fixup must be applied at last */ |
| 7653 | .chained_before = true, |
| 7654 | .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, |
| 7655 | }, |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 7656 | [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { |
| 7657 | .type = HDA_FIXUP_PINS, |
| 7658 | .v.pins = (const struct hda_pintbl[]) { |
| 7659 | { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 7660 | { } |
| 7661 | }, |
| 7662 | .chained_before = true, |
| 7663 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 7664 | }, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7665 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7666 | .type = HDA_FIXUP_PINS, |
| 7667 | .v.pins = (const struct hda_pintbl[]) { |
| 7668 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7669 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7670 | { } |
| 7671 | }, |
| 7672 | .chained = true, |
| 7673 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7674 | }, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 7675 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
| 7676 | .type = HDA_FIXUP_PINS, |
| 7677 | .v.pins = (const struct hda_pintbl[]) { |
| 7678 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7679 | { } |
| 7680 | }, |
| 7681 | .chained = true, |
| 7682 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7683 | }, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 7684 | [ALC275_FIXUP_DELL_XPS] = { |
| 7685 | .type = HDA_FIXUP_VERBS, |
| 7686 | .v.verbs = (const struct hda_verb[]) { |
| 7687 | /* Enables internal speaker */ |
| 7688 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, |
| 7689 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, |
| 7690 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, |
| 7691 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, |
| 7692 | {} |
| 7693 | } |
| 7694 | }, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 7695 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
| 7696 | .type = HDA_FIXUP_FUNC, |
| 7697 | .v.func = alc_fixup_disable_aamix, |
| 7698 | .chained = true, |
| 7699 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 7700 | }, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 7701 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
| 7702 | .type = HDA_FIXUP_FUNC, |
| 7703 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, |
| 7704 | }, |
Phil Calvin | d1ee66c | 2021-04-15 18:01:29 -0400 | [diff] [blame] | 7705 | [ALC233_FIXUP_INTEL_NUC8_DMIC] = { |
| 7706 | .type = HDA_FIXUP_FUNC, |
| 7707 | .v.func = alc_fixup_inv_dmic, |
| 7708 | .chained = true, |
| 7709 | .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST, |
| 7710 | }, |
| 7711 | [ALC233_FIXUP_INTEL_NUC8_BOOST] = { |
| 7712 | .type = HDA_FIXUP_FUNC, |
| 7713 | .v.func = alc269_fixup_limit_int_mic_boost |
| 7714 | }, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 7715 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
| 7716 | .type = HDA_FIXUP_FUNC, |
| 7717 | .v.func = alc_fixup_disable_aamix, |
| 7718 | .chained = true, |
| 7719 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7720 | }, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 7721 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
| 7722 | .type = HDA_FIXUP_FUNC, |
| 7723 | .v.func = alc_fixup_disable_mic_vref, |
| 7724 | .chained = true, |
| 7725 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7726 | }, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7727 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 7728 | .type = HDA_FIXUP_VERBS, |
| 7729 | .v.verbs = (const struct hda_verb[]) { |
| 7730 | /* Disable pass-through path for FRONT 14h */ |
| 7731 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 7732 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 7733 | {} |
| 7734 | }, |
| 7735 | .chained = true, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 7736 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7737 | }, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 7738 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
| 7739 | .type = HDA_FIXUP_FUNC, |
| 7740 | .v.func = alc_fixup_disable_aamix, |
| 7741 | .chained = true, |
| 7742 | .chain_id = ALC269_FIXUP_HEADSET_MIC, |
| 7743 | }, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 7744 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
| 7745 | .type = HDA_FIXUP_PINS, |
| 7746 | .v.pins = (const struct hda_pintbl[]) { |
| 7747 | { 0x19, 0x02a19020 }, /* Front Mic */ |
| 7748 | { } |
| 7749 | }, |
| 7750 | }, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7751 | [ALC292_FIXUP_TPT460] = { |
| 7752 | .type = HDA_FIXUP_FUNC, |
| 7753 | .v.func = alc_fixup_tpt440_dock, |
| 7754 | .chained = true, |
| 7755 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, |
| 7756 | }, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 7757 | [ALC298_FIXUP_SPK_VOLUME] = { |
| 7758 | .type = HDA_FIXUP_FUNC, |
| 7759 | .v.func = alc298_fixup_speaker_volume, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 7760 | .chained = true, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 7761 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 7762 | }, |
Kailang Yang | f86de9b | 2020-10-23 14:46:47 +0800 | [diff] [blame] | 7763 | [ALC298_FIXUP_LENOVO_SPK_VOLUME] = { |
| 7764 | .type = HDA_FIXUP_FUNC, |
| 7765 | .v.func = alc298_fixup_speaker_volume, |
| 7766 | }, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 7767 | [ALC295_FIXUP_DISABLE_DAC3] = { |
| 7768 | .type = HDA_FIXUP_FUNC, |
| 7769 | .v.func = alc295_fixup_disable_dac3, |
| 7770 | }, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 7771 | [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { |
| 7772 | .type = HDA_FIXUP_FUNC, |
| 7773 | .v.func = alc285_fixup_speaker2_to_dac1, |
Hui Wang | c37c0ab | 2020-02-19 13:23:06 +0800 | [diff] [blame] | 7774 | .chained = true, |
| 7775 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 7776 | }, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 7777 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
| 7778 | .type = HDA_FIXUP_PINS, |
| 7779 | .v.pins = (const struct hda_pintbl[]) { |
| 7780 | { 0x1b, 0x90170151 }, |
| 7781 | { } |
| 7782 | }, |
| 7783 | .chained = true, |
| 7784 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7785 | }, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 7786 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
| 7787 | .type = HDA_FIXUP_FUNC, |
| 7788 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7789 | .chained = true, |
| 7790 | .chain_id = ALC269_FIXUP_NO_SHUTUP |
| 7791 | }, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 7792 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
| 7793 | .type = HDA_FIXUP_PINS, |
| 7794 | .v.pins = (const struct hda_pintbl[]) { |
| 7795 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7796 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7797 | { } |
| 7798 | }, |
| 7799 | .chained = true, |
| 7800 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 7801 | }, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7802 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
| 7803 | .type = HDA_FIXUP_FUNC, |
| 7804 | .v.func = alc_fixup_headset_mode, |
| 7805 | }, |
| 7806 | [ALC256_FIXUP_ASUS_MIC] = { |
| 7807 | .type = HDA_FIXUP_PINS, |
| 7808 | .v.pins = (const struct hda_pintbl[]) { |
| 7809 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 7810 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7811 | { } |
| 7812 | }, |
| 7813 | .chained = true, |
| 7814 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 7815 | }, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7816 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 7817 | .type = HDA_FIXUP_FUNC, |
| 7818 | /* Set up GPIO2 for the speaker amp */ |
| 7819 | .v.func = alc_fixup_gpio4, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 7820 | }, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 7821 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 7822 | .type = HDA_FIXUP_PINS, |
| 7823 | .v.pins = (const struct hda_pintbl[]) { |
| 7824 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7825 | { } |
| 7826 | }, |
| 7827 | .chained = true, |
| 7828 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7829 | }, |
| 7830 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { |
| 7831 | .type = HDA_FIXUP_VERBS, |
| 7832 | .v.verbs = (const struct hda_verb[]) { |
| 7833 | /* Enables internal speaker */ |
| 7834 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, |
| 7835 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, |
| 7836 | {} |
| 7837 | }, |
| 7838 | .chained = true, |
| 7839 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 7840 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7841 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
| 7842 | .type = HDA_FIXUP_FUNC, |
| 7843 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
Kai-Heng Feng | f73bbf6 | 2020-09-14 15:02:29 +0800 | [diff] [blame] | 7844 | .chained = true, |
| 7845 | .chain_id = ALC269_FIXUP_GPIO2 |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7846 | }, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 7847 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
| 7848 | .type = HDA_FIXUP_VERBS, |
| 7849 | .v.verbs = (const struct hda_verb[]) { |
| 7850 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 7851 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 7852 | { } |
| 7853 | }, |
| 7854 | .chained = true, |
| 7855 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 7856 | }, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 7857 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
| 7858 | .type = HDA_FIXUP_PINS, |
| 7859 | .v.pins = (const struct hda_pintbl[]) { |
| 7860 | /* Change the mic location from front to right, otherwise there are |
| 7861 | two front mics with the same name, pulseaudio can't handle them. |
| 7862 | This is just a temporary workaround, after applying this fixup, |
| 7863 | there will be one "Front Mic" and one "Mic" in this machine. |
| 7864 | */ |
| 7865 | { 0x1a, 0x04a19040 }, |
| 7866 | { } |
| 7867 | }, |
| 7868 | }, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 7869 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
| 7870 | .type = HDA_FIXUP_PINS, |
| 7871 | .v.pins = (const struct hda_pintbl[]) { |
| 7872 | { 0x16, 0x0101102f }, /* Rear Headset HP */ |
| 7873 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 7874 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ |
| 7875 | { 0x1b, 0x02011020 }, |
| 7876 | { } |
| 7877 | }, |
| 7878 | .chained = true, |
Kai-Heng Feng | 52e4e36 | 2020-05-03 23:24:47 +0800 | [diff] [blame] | 7879 | .chain_id = ALC225_FIXUP_S3_POP_NOISE |
| 7880 | }, |
| 7881 | [ALC225_FIXUP_S3_POP_NOISE] = { |
| 7882 | .type = HDA_FIXUP_FUNC, |
| 7883 | .v.func = alc225_fixup_s3_pop_noise, |
| 7884 | .chained = true, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 7885 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 7886 | }, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 7887 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
| 7888 | .type = HDA_FIXUP_VERBS, |
| 7889 | .v.verbs = (const struct hda_verb[]) { |
| 7890 | /* Enables internal speaker */ |
| 7891 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, |
| 7892 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, |
| 7893 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, |
| 7894 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, |
| 7895 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, |
| 7896 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, |
| 7897 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, |
| 7898 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, |
| 7899 | {} |
| 7900 | } |
| 7901 | }, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 7902 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
| 7903 | .type = HDA_FIXUP_FUNC, |
| 7904 | .v.func = alc274_fixup_bind_dacs, |
| 7905 | .chained = true, |
| 7906 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7907 | }, |
| 7908 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { |
| 7909 | .type = HDA_FIXUP_PINS, |
| 7910 | .v.pins = (const struct hda_pintbl[]) { |
| 7911 | { 0x1b, 0x0401102f }, |
| 7912 | { } |
| 7913 | }, |
| 7914 | .chained = true, |
| 7915 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS |
| 7916 | }, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 7917 | [ALC298_FIXUP_TPT470_DOCK_FIX] = { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7918 | .type = HDA_FIXUP_FUNC, |
| 7919 | .v.func = alc_fixup_tpt470_dock, |
| 7920 | .chained = true, |
| 7921 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE |
| 7922 | }, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 7923 | [ALC298_FIXUP_TPT470_DOCK] = { |
| 7924 | .type = HDA_FIXUP_FUNC, |
| 7925 | .v.func = alc_fixup_tpt470_dacs, |
| 7926 | .chained = true, |
| 7927 | .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX |
| 7928 | }, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 7929 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
| 7930 | .type = HDA_FIXUP_PINS, |
| 7931 | .v.pins = (const struct hda_pintbl[]) { |
| 7932 | { 0x14, 0x0201101f }, |
| 7933 | { } |
| 7934 | }, |
| 7935 | .chained = true, |
| 7936 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 7937 | }, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7938 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
| 7939 | .type = HDA_FIXUP_PINS, |
| 7940 | .v.pins = (const struct hda_pintbl[]) { |
| 7941 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7942 | { } |
| 7943 | }, |
Hui Wang | 3ce0d5a | 2018-04-19 13:29:04 +0800 | [diff] [blame] | 7944 | .chained = true, |
| 7945 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 7946 | }, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 7947 | [ALC295_FIXUP_HP_X360] = { |
| 7948 | .type = HDA_FIXUP_FUNC, |
| 7949 | .v.func = alc295_fixup_hp_top_speakers, |
| 7950 | .chained = true, |
| 7951 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 7952 | }, |
| 7953 | [ALC221_FIXUP_HP_HEADSET_MIC] = { |
| 7954 | .type = HDA_FIXUP_PINS, |
| 7955 | .v.pins = (const struct hda_pintbl[]) { |
| 7956 | { 0x19, 0x0181313f}, |
| 7957 | { } |
| 7958 | }, |
| 7959 | .chained = true, |
| 7960 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7961 | }, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7962 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
| 7963 | .type = HDA_FIXUP_FUNC, |
| 7964 | .v.func = alc285_fixup_invalidate_dacs, |
Hui Wang | 6ba189c | 2018-12-09 09:16:43 +0800 | [diff] [blame] | 7965 | .chained = true, |
| 7966 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7967 | }, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 7968 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
| 7969 | .type = HDA_FIXUP_FUNC, |
| 7970 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7971 | }, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 7972 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
| 7973 | .type = HDA_FIXUP_PINS, |
| 7974 | .v.pins = (const struct hda_pintbl[]) { |
| 7975 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 7976 | { } |
| 7977 | }, |
| 7978 | .chained = true, |
| 7979 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 7980 | }, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7981 | [ALC294_FIXUP_ASUS_MIC] = { |
| 7982 | .type = HDA_FIXUP_PINS, |
| 7983 | .v.pins = (const struct hda_pintbl[]) { |
| 7984 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 7985 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 7986 | { } |
| 7987 | }, |
| 7988 | .chained = true, |
Kailang Yang | ef9ddb9 | 2020-07-10 15:31:11 +0800 | [diff] [blame] | 7989 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7990 | }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7991 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
| 7992 | .type = HDA_FIXUP_PINS, |
| 7993 | .v.pins = (const struct hda_pintbl[]) { |
Jian-Hong Pan | 82b0114 | 2018-12-27 16:46:31 +0800 | [diff] [blame] | 7994 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7995 | { } |
| 7996 | }, |
| 7997 | .chained = true, |
Kailang Yang | ef9ddb9 | 2020-07-10 15:31:11 +0800 | [diff] [blame] | 7998 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 7999 | }, |
| 8000 | [ALC294_FIXUP_ASUS_SPK] = { |
| 8001 | .type = HDA_FIXUP_VERBS, |
| 8002 | .v.verbs = (const struct hda_verb[]) { |
| 8003 | /* Set EAPD high */ |
| 8004 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, |
| 8005 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, |
Kailang Yang | 473fbe13 | 2020-07-16 14:42:33 +0800 | [diff] [blame] | 8006 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 8007 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 8008 | { } |
| 8009 | }, |
| 8010 | .chained = true, |
| 8011 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 8012 | }, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 8013 | [ALC295_FIXUP_CHROME_BOOK] = { |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 8014 | .type = HDA_FIXUP_FUNC, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 8015 | .v.func = alc295_fixup_chromebook, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 8016 | .chained = true, |
| 8017 | .chain_id = ALC225_FIXUP_HEADSET_JACK |
| 8018 | }, |
| 8019 | [ALC225_FIXUP_HEADSET_JACK] = { |
| 8020 | .type = HDA_FIXUP_FUNC, |
| 8021 | .v.func = alc_fixup_headset_jack, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 8022 | }, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 8023 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
| 8024 | .type = HDA_FIXUP_PINS, |
| 8025 | .v.pins = (const struct hda_pintbl[]) { |
| 8026 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 8027 | { } |
| 8028 | }, |
| 8029 | .chained = true, |
| 8030 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 8031 | }, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 8032 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
| 8033 | .type = HDA_FIXUP_VERBS, |
| 8034 | .v.verbs = (const struct hda_verb[]) { |
| 8035 | /* Disable PCBEEP-IN passthrough */ |
| 8036 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 8037 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 8038 | { } |
| 8039 | }, |
| 8040 | .chained = true, |
| 8041 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
| 8042 | }, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 8043 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
| 8044 | .type = HDA_FIXUP_PINS, |
| 8045 | .v.pins = (const struct hda_pintbl[]) { |
| 8046 | { 0x19, 0x03a11130 }, |
| 8047 | { 0x1a, 0x90a60140 }, /* use as internal mic */ |
| 8048 | { } |
| 8049 | }, |
| 8050 | .chained = true, |
| 8051 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 8052 | }, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 8053 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
| 8054 | .type = HDA_FIXUP_PINS, |
| 8055 | .v.pins = (const struct hda_pintbl[]) { |
| 8056 | { 0x16, 0x01011020 }, /* Rear Line out */ |
| 8057 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 8058 | { } |
| 8059 | }, |
| 8060 | .chained = true, |
| 8061 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE |
| 8062 | }, |
| 8063 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { |
| 8064 | .type = HDA_FIXUP_FUNC, |
| 8065 | .v.func = alc_fixup_auto_mute_via_amp, |
| 8066 | .chained = true, |
| 8067 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF |
| 8068 | }, |
| 8069 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { |
| 8070 | .type = HDA_FIXUP_FUNC, |
| 8071 | .v.func = alc_fixup_disable_mic_vref, |
| 8072 | .chained = true, |
| 8073 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 8074 | }, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 8075 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
| 8076 | .type = HDA_FIXUP_VERBS, |
| 8077 | .v.verbs = (const struct hda_verb[]) { |
| 8078 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, |
| 8079 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, |
| 8080 | { } |
| 8081 | }, |
| 8082 | .chained = true, |
| 8083 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE |
| 8084 | }, |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 8085 | [ALC256_FIXUP_ASUS_HEADSET_MIC] = { |
| 8086 | .type = HDA_FIXUP_PINS, |
| 8087 | .v.pins = (const struct hda_pintbl[]) { |
| 8088 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 8089 | { } |
| 8090 | }, |
| 8091 | .chained = true, |
| 8092 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 8093 | }, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 8094 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 8095 | .type = HDA_FIXUP_PINS, |
| 8096 | .v.pins = (const struct hda_pintbl[]) { |
| 8097 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 8098 | { } |
| 8099 | }, |
| 8100 | .chained = true, |
| 8101 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 8102 | }, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 8103 | [ALC299_FIXUP_PREDATOR_SPK] = { |
| 8104 | .type = HDA_FIXUP_PINS, |
| 8105 | .v.pins = (const struct hda_pintbl[]) { |
| 8106 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ |
| 8107 | { } |
| 8108 | } |
| 8109 | }, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 8110 | [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { |
| 8111 | .type = HDA_FIXUP_PINS, |
| 8112 | .v.pins = (const struct hda_pintbl[]) { |
| 8113 | { 0x19, 0x04a11040 }, |
| 8114 | { 0x21, 0x04211020 }, |
| 8115 | { } |
| 8116 | }, |
| 8117 | .chained = true, |
| 8118 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 8119 | }, |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 8120 | [ALC289_FIXUP_DELL_SPK2] = { |
| 8121 | .type = HDA_FIXUP_PINS, |
| 8122 | .v.pins = (const struct hda_pintbl[]) { |
| 8123 | { 0x17, 0x90170130 }, /* bass spk */ |
| 8124 | { } |
| 8125 | }, |
| 8126 | .chained = true, |
| 8127 | .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE |
| 8128 | }, |
| 8129 | [ALC289_FIXUP_DUAL_SPK] = { |
| 8130 | .type = HDA_FIXUP_FUNC, |
| 8131 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 8132 | .chained = true, |
| 8133 | .chain_id = ALC289_FIXUP_DELL_SPK2 |
| 8134 | }, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 8135 | [ALC294_FIXUP_SPK2_TO_DAC1] = { |
| 8136 | .type = HDA_FIXUP_FUNC, |
| 8137 | .v.func = alc285_fixup_speaker2_to_dac1, |
| 8138 | .chained = true, |
| 8139 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 8140 | }, |
| 8141 | [ALC294_FIXUP_ASUS_DUAL_SPK] = { |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 8142 | .type = HDA_FIXUP_FUNC, |
| 8143 | /* The GPIO must be pulled to initialize the AMP */ |
| 8144 | .v.func = alc_fixup_gpio4, |
| 8145 | .chained = true, |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 8146 | .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 |
Jian-Hong Pan | 436e255 | 2019-11-25 17:34:06 +0800 | [diff] [blame] | 8147 | }, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 8148 | [ALC285_FIXUP_THINKPAD_X1_GEN7] = { |
| 8149 | .type = HDA_FIXUP_FUNC, |
| 8150 | .v.func = alc285_fixup_thinkpad_x1_gen7, |
| 8151 | .chained = true, |
| 8152 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 8153 | }, |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 8154 | [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { |
| 8155 | .type = HDA_FIXUP_FUNC, |
| 8156 | .v.func = alc_fixup_headset_jack, |
| 8157 | .chained = true, |
Takashi Iwai | 6a6660d | 2020-09-03 10:33:00 +0200 | [diff] [blame] | 8158 | .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 |
Kailang Yang | 76f7dec | 2020-02-10 16:30:26 +0800 | [diff] [blame] | 8159 | }, |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 8160 | [ALC294_FIXUP_ASUS_HPE] = { |
| 8161 | .type = HDA_FIXUP_VERBS, |
| 8162 | .v.verbs = (const struct hda_verb[]) { |
| 8163 | /* Set EAPD high */ |
| 8164 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 8165 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, |
| 8166 | { } |
| 8167 | }, |
| 8168 | .chained = true, |
| 8169 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 8170 | }, |
Luke D Jones | c3cdf18 | 2020-09-07 20:19:59 +1200 | [diff] [blame] | 8171 | [ALC294_FIXUP_ASUS_GX502_PINS] = { |
| 8172 | .type = HDA_FIXUP_PINS, |
| 8173 | .v.pins = (const struct hda_pintbl[]) { |
| 8174 | { 0x19, 0x03a11050 }, /* front HP mic */ |
| 8175 | { 0x1a, 0x01a11830 }, /* rear external mic */ |
| 8176 | { 0x21, 0x03211020 }, /* front HP out */ |
| 8177 | { } |
| 8178 | }, |
| 8179 | .chained = true, |
| 8180 | .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS |
| 8181 | }, |
| 8182 | [ALC294_FIXUP_ASUS_GX502_VERBS] = { |
| 8183 | .type = HDA_FIXUP_VERBS, |
| 8184 | .v.verbs = (const struct hda_verb[]) { |
| 8185 | /* set 0x15 to HP-OUT ctrl */ |
| 8186 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, |
| 8187 | /* unmute the 0x15 amp */ |
| 8188 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, |
| 8189 | { } |
| 8190 | }, |
| 8191 | .chained = true, |
| 8192 | .chain_id = ALC294_FIXUP_ASUS_GX502_HP |
| 8193 | }, |
| 8194 | [ALC294_FIXUP_ASUS_GX502_HP] = { |
| 8195 | .type = HDA_FIXUP_FUNC, |
| 8196 | .v.func = alc294_fixup_gx502_hp, |
| 8197 | }, |
Daniel Cordova A | c1b55029 | 2021-05-07 12:31:16 -0500 | [diff] [blame] | 8198 | [ALC294_FIXUP_ASUS_GU502_PINS] = { |
| 8199 | .type = HDA_FIXUP_PINS, |
| 8200 | .v.pins = (const struct hda_pintbl[]) { |
| 8201 | { 0x19, 0x01a11050 }, /* rear HP mic */ |
| 8202 | { 0x1a, 0x01a11830 }, /* rear external mic */ |
| 8203 | { 0x21, 0x012110f0 }, /* rear HP out */ |
| 8204 | { } |
| 8205 | }, |
| 8206 | .chained = true, |
| 8207 | .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS |
| 8208 | }, |
| 8209 | [ALC294_FIXUP_ASUS_GU502_VERBS] = { |
| 8210 | .type = HDA_FIXUP_VERBS, |
| 8211 | .v.verbs = (const struct hda_verb[]) { |
| 8212 | /* set 0x15 to HP-OUT ctrl */ |
| 8213 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, |
| 8214 | /* unmute the 0x15 amp */ |
| 8215 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, |
| 8216 | /* set 0x1b to HP-OUT */ |
| 8217 | { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, |
| 8218 | { } |
| 8219 | }, |
| 8220 | .chained = true, |
| 8221 | .chain_id = ALC294_FIXUP_ASUS_GU502_HP |
| 8222 | }, |
| 8223 | [ALC294_FIXUP_ASUS_GU502_HP] = { |
| 8224 | .type = HDA_FIXUP_FUNC, |
| 8225 | .v.func = alc294_fixup_gu502_hp, |
| 8226 | }, |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 8227 | [ALC294_FIXUP_ASUS_COEF_1B] = { |
| 8228 | .type = HDA_FIXUP_VERBS, |
| 8229 | .v.verbs = (const struct hda_verb[]) { |
| 8230 | /* Set bit 10 to correct noisy output after reboot from |
| 8231 | * Windows 10 (due to pop noise reduction?) |
| 8232 | */ |
| 8233 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, |
| 8234 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, |
| 8235 | { } |
| 8236 | }, |
Takashi Iwai | f8fbcdf | 2021-06-20 08:59:52 +0200 | [diff] [blame] | 8237 | .chained = true, |
| 8238 | .chain_id = ALC289_FIXUP_ASUS_GA401, |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 8239 | }, |
Kai-Heng Feng | f5a88b0 | 2020-03-27 12:46:25 +0800 | [diff] [blame] | 8240 | [ALC285_FIXUP_HP_GPIO_LED] = { |
| 8241 | .type = HDA_FIXUP_FUNC, |
| 8242 | .v.func = alc285_fixup_hp_gpio_led, |
| 8243 | }, |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 8244 | [ALC285_FIXUP_HP_MUTE_LED] = { |
| 8245 | .type = HDA_FIXUP_FUNC, |
| 8246 | .v.func = alc285_fixup_hp_mute_led, |
| 8247 | }, |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 8248 | [ALC236_FIXUP_HP_GPIO_LED] = { |
| 8249 | .type = HDA_FIXUP_FUNC, |
| 8250 | .v.func = alc236_fixup_hp_gpio_led, |
| 8251 | }, |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 8252 | [ALC236_FIXUP_HP_MUTE_LED] = { |
| 8253 | .type = HDA_FIXUP_FUNC, |
| 8254 | .v.func = alc236_fixup_hp_mute_led, |
| 8255 | }, |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 8256 | [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = { |
| 8257 | .type = HDA_FIXUP_FUNC, |
| 8258 | .v.func = alc236_fixup_hp_mute_led_micmute_vref, |
| 8259 | }, |
Mike Pozulp | 14425f1 | 2020-05-09 20:28:37 -0700 | [diff] [blame] | 8260 | [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { |
| 8261 | .type = HDA_FIXUP_VERBS, |
| 8262 | .v.verbs = (const struct hda_verb[]) { |
| 8263 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, |
| 8264 | { } |
| 8265 | }, |
| 8266 | }, |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 8267 | [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 8268 | .type = HDA_FIXUP_PINS, |
| 8269 | .v.pins = (const struct hda_pintbl[]) { |
| 8270 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 8271 | { } |
| 8272 | }, |
| 8273 | .chained = true, |
| 8274 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 8275 | }, |
Jian-Hong Pan | 8eae7e9 | 2020-07-06 15:18:25 +0800 | [diff] [blame] | 8276 | [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { |
| 8277 | .type = HDA_FIXUP_PINS, |
| 8278 | .v.pins = (const struct hda_pintbl[]) { |
| 8279 | { 0x14, 0x90100120 }, /* use as internal speaker */ |
| 8280 | { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ |
| 8281 | { 0x1a, 0x01011020 }, /* use as line out */ |
| 8282 | { }, |
| 8283 | }, |
| 8284 | .chained = true, |
| 8285 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 8286 | }, |
Jian-Hong Pan | 6e15d12 | 2020-07-06 15:18:27 +0800 | [diff] [blame] | 8287 | [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { |
| 8288 | .type = HDA_FIXUP_PINS, |
| 8289 | .v.pins = (const struct hda_pintbl[]) { |
| 8290 | { 0x18, 0x02a11030 }, /* use as headset mic */ |
| 8291 | { } |
| 8292 | }, |
| 8293 | .chained = true, |
| 8294 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 8295 | }, |
Jian-Hong Pan | 781c90c | 2020-07-06 15:18:29 +0800 | [diff] [blame] | 8296 | [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 8297 | .type = HDA_FIXUP_PINS, |
| 8298 | .v.pins = (const struct hda_pintbl[]) { |
| 8299 | { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ |
| 8300 | { } |
| 8301 | }, |
| 8302 | .chained = true, |
| 8303 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 8304 | }, |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 8305 | [ALC289_FIXUP_ASUS_GA401] = { |
Takashi Iwai | c84bfed | 2020-11-27 15:11:04 +0100 | [diff] [blame] | 8306 | .type = HDA_FIXUP_FUNC, |
| 8307 | .v.func = alc289_fixup_asus_ga401, |
| 8308 | .chained = true, |
| 8309 | .chain_id = ALC289_FIXUP_ASUS_GA502, |
Armas Spann | ff53664 | 2020-07-11 13:05:57 +0200 | [diff] [blame] | 8310 | }, |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 8311 | [ALC289_FIXUP_ASUS_GA502] = { |
| 8312 | .type = HDA_FIXUP_PINS, |
| 8313 | .v.pins = (const struct hda_pintbl[]) { |
| 8314 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ |
| 8315 | { } |
| 8316 | }, |
| 8317 | }, |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 8318 | [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 8319 | .type = HDA_FIXUP_PINS, |
| 8320 | .v.pins = (const struct hda_pintbl[]) { |
| 8321 | { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ |
| 8322 | { } |
| 8323 | }, |
| 8324 | .chained = true, |
| 8325 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 8326 | }, |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 8327 | [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { |
| 8328 | .type = HDA_FIXUP_FUNC, |
| 8329 | .v.func = alc285_fixup_hp_gpio_amp_init, |
| 8330 | .chained = true, |
| 8331 | .chain_id = ALC285_FIXUP_HP_GPIO_LED |
| 8332 | }, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 8333 | [ALC269_FIXUP_CZC_B20] = { |
| 8334 | .type = HDA_FIXUP_PINS, |
| 8335 | .v.pins = (const struct hda_pintbl[]) { |
| 8336 | { 0x12, 0x411111f0 }, |
| 8337 | { 0x14, 0x90170110 }, /* speaker */ |
| 8338 | { 0x15, 0x032f1020 }, /* HP out */ |
| 8339 | { 0x17, 0x411111f0 }, |
| 8340 | { 0x18, 0x03ab1040 }, /* mic */ |
| 8341 | { 0x19, 0xb7a7013f }, |
| 8342 | { 0x1a, 0x0181305f }, |
| 8343 | { 0x1b, 0x411111f0 }, |
| 8344 | { 0x1d, 0x411111f0 }, |
| 8345 | { 0x1e, 0x411111f0 }, |
| 8346 | { } |
| 8347 | }, |
| 8348 | .chain_id = ALC269_FIXUP_DMIC, |
| 8349 | }, |
| 8350 | [ALC269_FIXUP_CZC_TMI] = { |
| 8351 | .type = HDA_FIXUP_PINS, |
| 8352 | .v.pins = (const struct hda_pintbl[]) { |
| 8353 | { 0x12, 0x4000c000 }, |
| 8354 | { 0x14, 0x90170110 }, /* speaker */ |
| 8355 | { 0x15, 0x0421401f }, /* HP out */ |
| 8356 | { 0x17, 0x411111f0 }, |
| 8357 | { 0x18, 0x04a19020 }, /* mic */ |
| 8358 | { 0x19, 0x411111f0 }, |
| 8359 | { 0x1a, 0x411111f0 }, |
| 8360 | { 0x1b, 0x411111f0 }, |
| 8361 | { 0x1d, 0x40448505 }, |
| 8362 | { 0x1e, 0x411111f0 }, |
| 8363 | { 0x20, 0x8000ffff }, |
| 8364 | { } |
| 8365 | }, |
| 8366 | .chain_id = ALC269_FIXUP_DMIC, |
| 8367 | }, |
| 8368 | [ALC269_FIXUP_CZC_L101] = { |
| 8369 | .type = HDA_FIXUP_PINS, |
| 8370 | .v.pins = (const struct hda_pintbl[]) { |
| 8371 | { 0x12, 0x40000000 }, |
| 8372 | { 0x14, 0x01014010 }, /* speaker */ |
| 8373 | { 0x15, 0x411111f0 }, /* HP out */ |
| 8374 | { 0x16, 0x411111f0 }, |
| 8375 | { 0x18, 0x01a19020 }, /* mic */ |
| 8376 | { 0x19, 0x02a19021 }, |
| 8377 | { 0x1a, 0x0181302f }, |
| 8378 | { 0x1b, 0x0221401f }, |
| 8379 | { 0x1c, 0x411111f0 }, |
| 8380 | { 0x1d, 0x4044c601 }, |
| 8381 | { 0x1e, 0x411111f0 }, |
| 8382 | { } |
| 8383 | }, |
| 8384 | .chain_id = ALC269_FIXUP_DMIC, |
| 8385 | }, |
| 8386 | [ALC269_FIXUP_LEMOTE_A1802] = { |
| 8387 | .type = HDA_FIXUP_PINS, |
| 8388 | .v.pins = (const struct hda_pintbl[]) { |
| 8389 | { 0x12, 0x40000000 }, |
| 8390 | { 0x14, 0x90170110 }, /* speaker */ |
| 8391 | { 0x17, 0x411111f0 }, |
| 8392 | { 0x18, 0x03a19040 }, /* mic1 */ |
| 8393 | { 0x19, 0x90a70130 }, /* mic2 */ |
| 8394 | { 0x1a, 0x411111f0 }, |
| 8395 | { 0x1b, 0x411111f0 }, |
| 8396 | { 0x1d, 0x40489d2d }, |
| 8397 | { 0x1e, 0x411111f0 }, |
| 8398 | { 0x20, 0x0003ffff }, |
| 8399 | { 0x21, 0x03214020 }, |
| 8400 | { } |
| 8401 | }, |
| 8402 | .chain_id = ALC269_FIXUP_DMIC, |
| 8403 | }, |
| 8404 | [ALC269_FIXUP_LEMOTE_A190X] = { |
| 8405 | .type = HDA_FIXUP_PINS, |
| 8406 | .v.pins = (const struct hda_pintbl[]) { |
| 8407 | { 0x14, 0x99130110 }, /* speaker */ |
| 8408 | { 0x15, 0x0121401f }, /* HP out */ |
| 8409 | { 0x18, 0x01a19c20 }, /* rear mic */ |
| 8410 | { 0x19, 0x99a3092f }, /* front mic */ |
| 8411 | { 0x1b, 0x0201401f }, /* front lineout */ |
| 8412 | { } |
| 8413 | }, |
| 8414 | .chain_id = ALC269_FIXUP_DMIC, |
| 8415 | }, |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 8416 | [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { |
| 8417 | .type = HDA_FIXUP_PINS, |
| 8418 | .v.pins = (const struct hda_pintbl[]) { |
| 8419 | { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 8420 | { } |
| 8421 | }, |
| 8422 | .chained = true, |
| 8423 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 8424 | }, |
Werner Sembach | 73e7161 | 2021-03-02 19:04:14 +0100 | [diff] [blame] | 8425 | [ALC256_FIXUP_INTEL_NUC10] = { |
| 8426 | .type = HDA_FIXUP_PINS, |
| 8427 | .v.pins = (const struct hda_pintbl[]) { |
| 8428 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 8429 | { } |
| 8430 | }, |
| 8431 | .chained = true, |
| 8432 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 8433 | }, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 8434 | [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { |
| 8435 | .type = HDA_FIXUP_VERBS, |
| 8436 | .v.verbs = (const struct hda_verb[]) { |
| 8437 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 8438 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 8439 | { } |
| 8440 | }, |
| 8441 | .chained = true, |
Takashi Iwai | c84bfed | 2020-11-27 15:11:04 +0100 | [diff] [blame] | 8442 | .chain_id = ALC289_FIXUP_ASUS_GA502 |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 8443 | }, |
Hui Wang | 13468bf | 2020-09-28 16:01:17 +0800 | [diff] [blame] | 8444 | [ALC274_FIXUP_HP_MIC] = { |
| 8445 | .type = HDA_FIXUP_VERBS, |
| 8446 | .v.verbs = (const struct hda_verb[]) { |
| 8447 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 8448 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 8449 | { } |
| 8450 | }, |
| 8451 | }, |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 8452 | [ALC274_FIXUP_HP_HEADSET_MIC] = { |
| 8453 | .type = HDA_FIXUP_FUNC, |
| 8454 | .v.func = alc274_fixup_hp_headset_mic, |
| 8455 | .chained = true, |
| 8456 | .chain_id = ALC274_FIXUP_HP_MIC |
| 8457 | }, |
Takashi Iwai | 622464c | 2021-05-04 11:18:02 +0200 | [diff] [blame] | 8458 | [ALC274_FIXUP_HP_ENVY_GPIO] = { |
| 8459 | .type = HDA_FIXUP_FUNC, |
| 8460 | .v.func = alc274_fixup_hp_envy_gpio, |
| 8461 | }, |
Kailang Yang | ef9ce66 | 2020-11-03 15:40:35 +0800 | [diff] [blame] | 8462 | [ALC256_FIXUP_ASUS_HPE] = { |
| 8463 | .type = HDA_FIXUP_VERBS, |
| 8464 | .v.verbs = (const struct hda_verb[]) { |
| 8465 | /* Set EAPD high */ |
| 8466 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
| 8467 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, |
| 8468 | { } |
| 8469 | }, |
| 8470 | .chained = true, |
| 8471 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 8472 | }, |
Kailang Yang | 446b818 | 2020-11-02 15:00:12 +0800 | [diff] [blame] | 8473 | [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = { |
| 8474 | .type = HDA_FIXUP_FUNC, |
| 8475 | .v.func = alc_fixup_headset_jack, |
| 8476 | .chained = true, |
| 8477 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 8478 | }, |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 8479 | [ALC287_FIXUP_HP_GPIO_LED] = { |
| 8480 | .type = HDA_FIXUP_FUNC, |
| 8481 | .v.func = alc287_fixup_hp_gpio_led, |
| 8482 | }, |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 8483 | [ALC256_FIXUP_HP_HEADSET_MIC] = { |
| 8484 | .type = HDA_FIXUP_FUNC, |
| 8485 | .v.func = alc274_fixup_hp_headset_mic, |
| 8486 | }, |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 8487 | [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = { |
| 8488 | .type = HDA_FIXUP_FUNC, |
| 8489 | .v.func = alc_fixup_no_int_mic, |
| 8490 | .chained = true, |
| 8491 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 8492 | }, |
Chris Chiu | 34cdf40 | 2020-12-16 20:52:00 +0800 | [diff] [blame] | 8493 | [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = { |
| 8494 | .type = HDA_FIXUP_PINS, |
| 8495 | .v.pins = (const struct hda_pintbl[]) { |
| 8496 | { 0x1b, 0x411111f0 }, |
| 8497 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 8498 | { }, |
| 8499 | }, |
| 8500 | .chained = true, |
| 8501 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 8502 | }, |
Chris Chiu | 495dc76 | 2021-01-14 16:27:28 +0800 | [diff] [blame] | 8503 | [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = { |
| 8504 | .type = HDA_FIXUP_FUNC, |
| 8505 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 8506 | .chained = true, |
| 8507 | .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 8508 | }, |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 8509 | [ALC256_FIXUP_ACER_HEADSET_MIC] = { |
| 8510 | .type = HDA_FIXUP_PINS, |
| 8511 | .v.pins = (const struct hda_pintbl[]) { |
| 8512 | { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */ |
| 8513 | { 0x1a, 0x90a1092f }, /* use as internal mic */ |
| 8514 | { } |
| 8515 | }, |
| 8516 | .chained = true, |
| 8517 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 8518 | }, |
Takashi Iwai | 26928ca | 2021-04-16 10:12:11 +0200 | [diff] [blame] | 8519 | [ALC285_FIXUP_IDEAPAD_S740_COEF] = { |
| 8520 | .type = HDA_FIXUP_FUNC, |
| 8521 | .v.func = alc285_fixup_ideapad_s740_coef, |
| 8522 | .chained = true, |
| 8523 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 8524 | }, |
Kai-Heng Feng | bd15b15 | 2021-04-20 19:55:29 +0800 | [diff] [blame] | 8525 | [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { |
| 8526 | .type = HDA_FIXUP_FUNC, |
| 8527 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 8528 | .chained = true, |
| 8529 | .chain_id = ALC285_FIXUP_HP_MUTE_LED, |
| 8530 | }, |
Takashi Iwai | 8eedd3a | 2021-05-04 10:20:57 +0200 | [diff] [blame] | 8531 | [ALC295_FIXUP_ASUS_DACS] = { |
| 8532 | .type = HDA_FIXUP_FUNC, |
| 8533 | .v.func = alc295_fixup_asus_dacs, |
| 8534 | }, |
Takashi Iwai | 5d84b53 | 2021-05-04 14:18:32 +0200 | [diff] [blame] | 8535 | [ALC295_FIXUP_HP_OMEN] = { |
| 8536 | .type = HDA_FIXUP_PINS, |
| 8537 | .v.pins = (const struct hda_pintbl[]) { |
| 8538 | { 0x12, 0xb7a60130 }, |
| 8539 | { 0x13, 0x40000000 }, |
| 8540 | { 0x14, 0x411111f0 }, |
| 8541 | { 0x16, 0x411111f0 }, |
| 8542 | { 0x17, 0x90170110 }, |
| 8543 | { 0x18, 0x411111f0 }, |
| 8544 | { 0x19, 0x02a11030 }, |
| 8545 | { 0x1a, 0x411111f0 }, |
| 8546 | { 0x1b, 0x04a19030 }, |
| 8547 | { 0x1d, 0x40600001 }, |
| 8548 | { 0x1e, 0x411111f0 }, |
| 8549 | { 0x21, 0x03211020 }, |
| 8550 | {} |
| 8551 | }, |
| 8552 | .chained = true, |
| 8553 | .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED, |
| 8554 | }, |
Elia Devito | f2be77f | 2021-05-11 14:46:49 +0200 | [diff] [blame] | 8555 | [ALC285_FIXUP_HP_SPECTRE_X360] = { |
Elia Devito | 434591b | 2021-06-19 22:41:04 +0200 | [diff] [blame] | 8556 | .type = HDA_FIXUP_FUNC, |
| 8557 | .v.func = alc285_fixup_hp_spectre_x360, |
Elia Devito | f2be77f | 2021-05-11 14:46:49 +0200 | [diff] [blame] | 8558 | }, |
Davide Baldo | d94befb | 2021-10-15 09:21:22 +0200 | [diff] [blame] | 8559 | [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = { |
| 8560 | .type = HDA_FIXUP_FUNC, |
| 8561 | .v.func = alc285_fixup_hp_spectre_x360_eb1 |
| 8562 | }, |
Hui Wang | 9ebaef0 | 2021-05-22 12:26:45 +0800 | [diff] [blame] | 8563 | [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { |
| 8564 | .type = HDA_FIXUP_FUNC, |
| 8565 | .v.func = alc285_fixup_ideapad_s740_coef, |
| 8566 | .chained = true, |
| 8567 | .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
| 8568 | }, |
Peter Ujfalusi | 29c8f40 | 2021-05-24 23:37:26 +0300 | [diff] [blame] | 8569 | [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = { |
| 8570 | .type = HDA_FIXUP_FUNC, |
| 8571 | .v.func = alc_fixup_no_shutup, |
| 8572 | .chained = true, |
| 8573 | .chain_id = ALC283_FIXUP_HEADSET_MIC, |
| 8574 | }, |
Hui Wang | 57c9e21 | 2021-06-08 10:46:00 +0800 | [diff] [blame] | 8575 | [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = { |
| 8576 | .type = HDA_FIXUP_PINS, |
| 8577 | .v.pins = (const struct hda_pintbl[]) { |
| 8578 | { 0x21, 0x03211030 }, /* Change the Headphone location to Left */ |
| 8579 | { } |
| 8580 | }, |
| 8581 | .chained = true, |
| 8582 | .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC |
| 8583 | }, |
Kai-Heng Feng | 8903376d | 2021-08-18 22:41:18 +0800 | [diff] [blame] | 8584 | [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { |
| 8585 | .type = HDA_FIXUP_FUNC, |
| 8586 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 8587 | .chained = true, |
| 8588 | .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, |
| 8589 | }, |
Baole Fang | 8f4c904 | 2022-01-05 22:08:54 +0800 | [diff] [blame] | 8590 | [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = { |
| 8591 | .type = HDA_FIXUP_FUNC, |
| 8592 | .v.func = alc285_fixup_ideapad_s740_coef, |
| 8593 | .chained = true, |
| 8594 | .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, |
| 8595 | }, |
| 8596 | [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = { |
| 8597 | .type = HDA_FIXUP_FUNC, |
| 8598 | .v.func = alc287_fixup_legion_15imhg05_speakers, |
| 8599 | .chained = true, |
| 8600 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 8601 | }, |
Cameron Berkenpas | ad7cc2d | 2021-09-13 14:26:29 -0700 | [diff] [blame] | 8602 | [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = { |
| 8603 | .type = HDA_FIXUP_VERBS, |
| 8604 | //.v.verbs = legion_15imhg05_coefs, |
| 8605 | .v.verbs = (const struct hda_verb[]) { |
| 8606 | // set left speaker Legion 7i. |
| 8607 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, |
| 8608 | { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, |
| 8609 | |
| 8610 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8611 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, |
| 8612 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8613 | { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, |
| 8614 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8615 | |
| 8616 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8617 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
| 8618 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8619 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8620 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8621 | |
| 8622 | // set right speaker Legion 7i. |
| 8623 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, |
| 8624 | { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, |
| 8625 | |
| 8626 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8627 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, |
| 8628 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8629 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, |
| 8630 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8631 | |
| 8632 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8633 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
| 8634 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8635 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8636 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8637 | {} |
| 8638 | }, |
| 8639 | .chained = true, |
| 8640 | .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, |
| 8641 | }, |
| 8642 | [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = { |
| 8643 | .type = HDA_FIXUP_FUNC, |
| 8644 | .v.func = alc287_fixup_legion_15imhg05_speakers, |
| 8645 | .chained = true, |
| 8646 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 8647 | }, |
| 8648 | [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = { |
| 8649 | .type = HDA_FIXUP_VERBS, |
| 8650 | .v.verbs = (const struct hda_verb[]) { |
| 8651 | // set left speaker Yoga 7i. |
| 8652 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, |
| 8653 | { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, |
| 8654 | |
| 8655 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8656 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, |
| 8657 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8658 | { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, |
| 8659 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8660 | |
| 8661 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8662 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
| 8663 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8664 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8665 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8666 | |
| 8667 | // set right speaker Yoga 7i. |
| 8668 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, |
| 8669 | { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, |
| 8670 | |
| 8671 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8672 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, |
| 8673 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8674 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, |
| 8675 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8676 | |
| 8677 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8678 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
| 8679 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8680 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8681 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8682 | {} |
| 8683 | }, |
| 8684 | .chained = true, |
| 8685 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 8686 | }, |
| 8687 | [ALC287_FIXUP_13S_GEN2_SPEAKERS] = { |
| 8688 | .type = HDA_FIXUP_VERBS, |
| 8689 | .v.verbs = (const struct hda_verb[]) { |
| 8690 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, |
| 8691 | { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, |
Cameron Berkenpas | 023a062 | 2021-10-10 15:54:11 -0700 | [diff] [blame] | 8692 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
Cameron Berkenpas | ad7cc2d | 2021-09-13 14:26:29 -0700 | [diff] [blame] | 8693 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
| 8694 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8695 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8696 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8697 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, |
| 8698 | { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, |
| 8699 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
| 8700 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
| 8701 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8702 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
| 8703 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
| 8704 | {} |
| 8705 | }, |
| 8706 | .chained = true, |
| 8707 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 8708 | }, |
Werner Sembach | 619764c | 2021-12-02 17:50:10 +0100 | [diff] [blame] | 8709 | [ALC256_FIXUP_SET_COEF_DEFAULTS] = { |
Werner Sembach | dd6dd6e3 | 2021-10-06 15:04:15 +0200 | [diff] [blame] | 8710 | .type = HDA_FIXUP_FUNC, |
Werner Sembach | 619764c | 2021-12-02 17:50:10 +0100 | [diff] [blame] | 8711 | .v.func = alc256_fixup_set_coef_defaults, |
Werner Sembach | dd6dd6e3 | 2021-10-06 15:04:15 +0200 | [diff] [blame] | 8712 | }, |
Johnathon Clark | 5fc462c | 2021-10-20 14:12:51 +0100 | [diff] [blame] | 8713 | [ALC245_FIXUP_HP_GPIO_LED] = { |
| 8714 | .type = HDA_FIXUP_FUNC, |
| 8715 | .v.func = alc245_fixup_hp_gpio_led, |
| 8716 | }, |
Jeremy Soller | 1278cc5ac | 2021-11-02 11:21:04 -0600 | [diff] [blame] | 8717 | [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
| 8718 | .type = HDA_FIXUP_PINS, |
| 8719 | .v.pins = (const struct hda_pintbl[]) { |
| 8720 | { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */ |
| 8721 | { } |
| 8722 | }, |
| 8723 | .chained = true, |
| 8724 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
| 8725 | }, |
Werner Sembach | 174a7fb | 2021-11-12 12:07:04 +0100 | [diff] [blame] | 8726 | [ALC233_FIXUP_NO_AUDIO_JACK] = { |
| 8727 | .type = HDA_FIXUP_FUNC, |
| 8728 | .v.func = alc233_fixup_no_audio_jack, |
| 8729 | }, |
Werner Sembach | edca7cc | 2021-12-15 20:16:46 +0100 | [diff] [blame] | 8730 | [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = { |
| 8731 | .type = HDA_FIXUP_FUNC, |
| 8732 | .v.func = alc256_fixup_mic_no_presence_and_resume, |
| 8733 | .chained = true, |
| 8734 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 8735 | }, |
Lucas Tanure | d3dca02 | 2021-12-17 11:57:07 +0000 | [diff] [blame] | 8736 | [ALC287_FIXUP_LEGION_16ACHG6] = { |
| 8737 | .type = HDA_FIXUP_FUNC, |
| 8738 | .v.func = alc287_fixup_legion_16achg6_speakers, |
| 8739 | }, |
Stefan Binding | ae7abe3 | 2021-12-17 11:57:08 +0000 | [diff] [blame] | 8740 | [ALC287_FIXUP_CS35L41_I2C_2] = { |
| 8741 | .type = HDA_FIXUP_FUNC, |
| 8742 | .v.func = cs35l41_fixup_i2c_two, |
| 8743 | }, |
Alexander Sergeyev | 91502a9 | 2022-01-14 19:50:50 +0300 | [diff] [blame] | 8744 | [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = { |
| 8745 | .type = HDA_FIXUP_VERBS, |
| 8746 | .v.verbs = (const struct hda_verb[]) { |
| 8747 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 }, |
| 8748 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 }, |
| 8749 | { } |
| 8750 | }, |
| 8751 | .chained = true, |
| 8752 | .chain_id = ALC285_FIXUP_HP_MUTE_LED, |
| 8753 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8754 | }; |
| 8755 | |
| 8756 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 8757 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 8758 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 8759 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 8760 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 8761 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 8762 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 8763 | 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] | 8764 | 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] | 8765 | 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] | 8766 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
Takashi Iwai | 433f894 | 2021-04-28 13:26:56 +0200 | [diff] [blame] | 8767 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 8768 | SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF), |
Chris Chiu | 13be30f | 2020-12-22 23:04:59 +0800 | [diff] [blame] | 8769 | SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK), |
Chris Chiu | 705b65f | 2018-12-05 14:48:54 +0800 | [diff] [blame] | 8770 | 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] | 8771 | 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] | 8772 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
Chris Chiu | 495dc76 | 2021-01-14 16:27:28 +0800 | [diff] [blame] | 8773 | SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), |
Chris Chiu | c7531e3 | 2019-03-21 17:17:31 +0800 | [diff] [blame] | 8774 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
| 8775 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Chris Chiu | 13be30f | 2020-12-22 23:04:59 +0800 | [diff] [blame] | 8776 | SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK), |
| 8777 | SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK), |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 8778 | 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] | 8779 | 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] | 8780 | SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 8781 | SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC), |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 8782 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 8783 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 8784 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
Chris Chiu | d0e1856 | 2021-02-26 09:04:40 +0800 | [diff] [blame] | 8785 | SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC), |
Nikos Liolios | 35171fb | 2021-07-27 06:05:10 +0300 | [diff] [blame] | 8786 | SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), |
Jian-Hong Pan | 2733cce | 2019-03-21 16:39:04 +0800 | [diff] [blame] | 8787 | 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] | 8788 | 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] | 8789 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), |
Jaroslav Kysela | 2a5bb69 | 2021-11-04 16:57:26 +0100 | [diff] [blame] | 8790 | SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Alexander Monakov | 0d4867a | 2021-07-21 20:01:41 +0300 | [diff] [blame] | 8791 | SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Jian-Hong Pan | f50a121 | 2020-07-13 14:04:22 +0800 | [diff] [blame] | 8792 | SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), |
Hui Wang | 57c9e21 | 2021-06-08 10:46:00 +0800 | [diff] [blame] | 8793 | SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 8794 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 8795 | 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] | 8796 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | cf52103 | 2016-01-15 12:59:25 +0100 | [diff] [blame] | 8797 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 8798 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
| 8799 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 8800 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8801 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8802 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8803 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 8804 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 8805 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Takashi Iwai | 9807057 | 2016-01-12 21:06:39 +0100 | [diff] [blame] | 8806 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 4275554 | 2015-06-29 10:56:53 +0200 | [diff] [blame] | 8807 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 8808 | 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] | 8809 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8810 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 8811 | 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] | 8812 | 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] | 8813 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Kailang Yang | 8b72415 | 2014-12-17 17:08:59 +0800 | [diff] [blame] | 8814 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 8815 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8816 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 8817 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8818 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8819 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8820 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 8821 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 8822 | 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] | 8823 | 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] | 8824 | 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] | 8825 | 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] | 8826 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
Takashi Iwai | 493de34 | 2017-02-28 17:27:57 +0100 | [diff] [blame] | 8827 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
Takashi Iwai | aa143ad | 2021-04-28 13:26:57 +0200 | [diff] [blame] | 8828 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 8829 | 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] | 8830 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
| 8831 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 8832 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
| 8833 | 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] | 8834 | 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] | 8835 | 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] | 8836 | 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] | 8837 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | e79c226 | 2019-12-19 14:12:15 +0800 | [diff] [blame] | 8838 | SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
Takashi Iwai | aa143ad | 2021-04-28 13:26:57 +0200 | [diff] [blame] | 8839 | SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
Kailang Yang | 78def22 | 2020-02-20 15:21:54 +0800 | [diff] [blame] | 8840 | SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 8841 | SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 8842 | SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), |
| 8843 | SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), |
Kailang Yang | c1e8952 | 2020-12-23 15:34:57 +0800 | [diff] [blame] | 8844 | SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), |
Kristin Paget | da94692 | 2021-08-14 15:46:05 -0700 | [diff] [blame] | 8845 | SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK), |
John Liu | eb67662 | 2021-09-30 13:53:16 +0200 | [diff] [blame] | 8846 | SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK), |
Chris Chiu | 2b987fe | 2021-10-01 14:28:56 +0800 | [diff] [blame] | 8847 | SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), |
| 8848 | SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 8849 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8850 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 8851 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 8852 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 8853 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
Hui Wang | 7976eb4 | 2015-02-13 11:14:41 +0800 | [diff] [blame] | 8854 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 8855 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 8856 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8857 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8858 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
| 8859 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8860 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8861 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 8862 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 8863 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 8864 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8865 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8866 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8867 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8868 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8869 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8870 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8871 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 8872 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8873 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8874 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8875 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8876 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8877 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8878 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8879 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8880 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8881 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8882 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8883 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8884 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8885 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8886 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 8887 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8888 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8889 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8890 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8891 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8892 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8893 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8894 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8895 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8896 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8897 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 8898 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8899 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 45461e3 | 2021-04-28 13:26:55 +0200 | [diff] [blame] | 8900 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8901 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
| 8902 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 8903 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 8904 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8905 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8906 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 8907 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 8908 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 8909 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
Kailang Yang | 1c9d9df | 2021-04-20 14:17:34 +0800 | [diff] [blame] | 8910 | SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC), |
| 8911 | SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC), |
Takashi Iwai | 563785e | 2018-11-12 09:43:12 +0100 | [diff] [blame] | 8912 | 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] | 8913 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 8914 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
Takashi Iwai | aeedad2 | 2020-11-28 10:00:15 +0100 | [diff] [blame] | 8915 | SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 8916 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 8917 | 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] | 8918 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Carlos M | 901be14 | 2021-05-31 22:20:26 +0200 | [diff] [blame] | 8919 | SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Takashi Iwai | 190d038 | 2019-08-13 17:39:56 +0200 | [diff] [blame] | 8920 | SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Takashi Iwai | 5d84b53 | 2021-05-04 14:18:32 +0200 | [diff] [blame] | 8921 | SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), |
Sam Bazley | d33cd42 | 2019-09-01 03:31:30 +0100 | [diff] [blame] | 8922 | SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Elia Devito | f2be77f | 2021-05-11 14:46:49 +0200 | [diff] [blame] | 8923 | SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), |
Bradley Scott | d296a74 | 2021-12-13 10:49:39 -0500 | [diff] [blame] | 8924 | SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Takashi Iwai | 0ac05b2 | 2021-06-23 14:20:22 +0200 | [diff] [blame] | 8925 | SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Kai-Heng Feng | b2c2291 | 2020-06-17 18:29:02 +0800 | [diff] [blame] | 8926 | SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
Takashi Iwai | 622464c | 2021-05-04 11:18:02 +0200 | [diff] [blame] | 8927 | SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), |
Jeremy Szu | 15d295b | 2021-06-05 16:25:36 +0800 | [diff] [blame] | 8928 | SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Jeremy Szu | 61d3e87 | 2021-06-05 16:25:37 +0800 | [diff] [blame] | 8929 | SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Kai-Heng Feng | a598098 | 2020-12-30 20:56:35 +0800 | [diff] [blame] | 8930 | SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), |
Kai-Heng Feng | c058493 | 2021-11-10 22:40:32 +0800 | [diff] [blame] | 8931 | SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED), |
Kai-Heng Feng | b2c2291 | 2020-06-17 18:29:02 +0800 | [diff] [blame] | 8932 | SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), |
Jonas Witschel | 75b62ab | 2021-04-16 12:58:54 +0200 | [diff] [blame] | 8933 | SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), |
Takashi Iwai | 05ec716 | 2021-11-18 08:16:36 +0100 | [diff] [blame] | 8934 | SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), |
Kailang Yang | 5649625 | 2020-07-29 15:09:27 +0800 | [diff] [blame] | 8935 | SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Qiu Wenbo | 08befca | 2020-10-02 20:44:54 +0800 | [diff] [blame] | 8936 | SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), |
Kailang Yang | 431e76c | 2020-04-07 14:40:20 +0800 | [diff] [blame] | 8937 | SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), |
Kailang Yang | 24164f4 | 2020-04-07 14:52:42 +0800 | [diff] [blame] | 8938 | SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
Jeremy Szu | 91bc156 | 2021-01-06 21:05:46 +0800 | [diff] [blame] | 8939 | SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation", |
| 8940 | ALC285_FIXUP_HP_GPIO_AMP_INIT), |
| 8941 | SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", |
| 8942 | ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Takashi Iwai | 375f842 | 2021-10-28 09:09:11 +0200 | [diff] [blame] | 8943 | SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), |
Manuel Jiménez | 4842295 | 2020-12-29 15:38:56 +0100 | [diff] [blame] | 8944 | SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), |
Jeremy Szu | e7d66cf | 2021-03-16 15:46:24 +0800 | [diff] [blame] | 8945 | SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
Andy Chi | 2b70b26 | 2021-07-01 17:14:13 +0800 | [diff] [blame] | 8946 | SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
Andy Chi | fb3acdb | 2021-07-01 17:14:15 +0800 | [diff] [blame] | 8947 | SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
Jeremy Szu | 417eadf | 2021-03-30 19:44:27 +0800 | [diff] [blame] | 8948 | SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
Kailang Yang | a0ccbc5 | 2020-11-06 15:20:38 +0800 | [diff] [blame] | 8949 | SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), |
| 8950 | SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), |
Johnathon Clark | 93ab3ea | 2021-08-23 17:21:10 +0100 | [diff] [blame] | 8951 | SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 8952 | SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), |
Jeremy Szu | d07149a | 2021-08-10 18:08:45 +0800 | [diff] [blame] | 8953 | SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
Jeremy Szu | dfc2e8a | 2021-06-25 21:34:13 +0800 | [diff] [blame] | 8954 | SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
Davide Baldo | d94befb | 2021-10-15 09:21:22 +0200 | [diff] [blame] | 8955 | SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), |
| 8956 | SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), |
Jeremy Szu | 53b861b | 2021-03-16 17:42:35 +0800 | [diff] [blame] | 8957 | SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
Jeremy Szu | c3d2c88 | 2021-06-18 01:14:20 +0800 | [diff] [blame] | 8958 | SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
Jeremy Szu | dfb0640 | 2021-06-05 16:25:38 +0800 | [diff] [blame] | 8959 | SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
Jeremy Szu | ca68833 | 2021-03-16 14:54:50 +0800 | [diff] [blame] | 8960 | SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
Kai-Heng Feng | 8903376d | 2021-08-18 22:41:18 +0800 | [diff] [blame] | 8961 | SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), |
| 8962 | SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), |
Jeremy Szu | 50dbfae | 2021-05-20 01:03:56 +0800 | [diff] [blame] | 8963 | SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Jeremy Szu | e650c1a | 2021-05-20 01:03:55 +0800 | [diff] [blame] | 8964 | SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Jeremy Szu | bbe183e | 2021-05-20 01:03:54 +0800 | [diff] [blame] | 8965 | SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
Jeremy Szu | 600dd2a | 2021-06-08 19:47:48 +0800 | [diff] [blame] | 8966 | SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), |
Alexander Sergeyev | 91502a9 | 2022-01-14 19:50:50 +0300 | [diff] [blame] | 8967 | SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED), |
Jeremy Szu | 0e68c4b | 2021-05-20 01:03:53 +0800 | [diff] [blame] | 8968 | SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), |
Kai-Heng Feng | bd15b15 | 2021-04-20 19:55:29 +0800 | [diff] [blame] | 8969 | SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), |
Frank Schäfer | 42334fb | 2021-07-03 15:54:16 +0200 | [diff] [blame] | 8970 | SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), |
Kai-Heng Feng | 08977fe | 2021-12-24 11:50:13 +0800 | [diff] [blame] | 8971 | SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED), |
Jeremy Szu | f7ac570 | 2021-12-15 00:41:54 +0800 | [diff] [blame] | 8972 | SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8973 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 8974 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 8975 | 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] | 8976 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8977 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 8978 | 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] | 8979 | 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] | 8980 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
Takashi Iwai | 3cd0ed6 | 2021-04-28 13:26:58 +0200 | [diff] [blame] | 8981 | SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
Chris Chiu | 5cfca59 | 2020-12-07 15:27:55 +0800 | [diff] [blame] | 8982 | SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 8983 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
| 8984 | 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] | 8985 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 3cd0ed6 | 2021-04-28 13:26:58 +0200 | [diff] [blame] | 8986 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 8987 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 8988 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 8989 | 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] | 8990 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Takashi Iwai | 8eedd3a | 2021-05-04 10:20:57 +0200 | [diff] [blame] | 8991 | SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), |
Chris Chiu | 48e0150 | 2019-12-30 11:11:18 +0800 | [diff] [blame] | 8992 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), |
Luke D Jones | 739d095 | 2021-08-07 14:58:05 +1200 | [diff] [blame] | 8993 | SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), |
Takashi Iwai | 3cd0ed6 | 2021-04-28 13:26:58 +0200 | [diff] [blame] | 8994 | SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), |
Daniel Drake | 8c8967a | 2019-10-17 16:15:01 +0800 | [diff] [blame] | 8995 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Adam Barber | 4963d66 | 2020-04-10 17:00:32 +0800 | [diff] [blame] | 8996 | SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Kailang Yang | 158ae2f | 2020-07-16 15:21:59 +0800 | [diff] [blame] | 8997 | SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), |
Takashi Iwai | 4fad4fb | 2021-11-07 09:33:39 +0100 | [diff] [blame] | 8998 | SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401), |
Jian-Hong Pan | 5de3b94 | 2021-01-22 13:47:06 +0800 | [diff] [blame] | 8999 | SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), |
Jian-Hong Pan | 8b33a13 | 2020-02-25 15:29:21 +0800 | [diff] [blame] | 9000 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), |
Jian-Hong Pan | 7900e81 | 2020-05-12 14:15:28 +0800 | [diff] [blame] | 9001 | 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] | 9002 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
Chris Chiu | 28e8af8 | 2017-06-05 15:05:30 -0600 | [diff] [blame] | 9003 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 1b94e59 | 2020-05-12 09:32:03 +0200 | [diff] [blame] | 9004 | SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 9005 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 9006 | 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] | 9007 | 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] | 9008 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
Kailang Yang | ef9ce66 | 2020-11-03 15:40:35 +0800 | [diff] [blame] | 9009 | SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), |
Armas Spann | 4b43d05 | 2020-07-24 16:06:16 +0200 | [diff] [blame] | 9010 | SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), |
Daniel Cordova A | c1b55029 | 2021-05-07 12:31:16 -0500 | [diff] [blame] | 9011 | SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), |
Luke D Jones | 76fae61 | 2021-04-19 15:04:11 +1200 | [diff] [blame] | 9012 | SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), |
Armas Spann | 293a92c | 2020-07-24 16:08:37 +0200 | [diff] [blame] | 9013 | SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), |
Albert Geantă | 94db9cc | 2022-01-31 03:05:23 +0200 | [diff] [blame] | 9014 | SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 9015 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 9016 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 9017 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 9018 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 9019 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 9020 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9021 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 9022 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 9023 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 9024 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
Takashi Iwai | cab561f | 2021-04-28 13:26:59 +0200 | [diff] [blame] | 9025 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
| 9026 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 9027 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 9028 | 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] | 9029 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 9030 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 9031 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 9032 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 9033 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 9034 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
PeiSen Hou | 6fa38ef | 2020-07-27 13:56:47 +0200 | [diff] [blame] | 9035 | SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
PeiSen Hou | ce2e79b | 2020-12-31 11:57:28 +0100 | [diff] [blame] | 9036 | SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
| 9037 | SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
YOKOTA Hiroshi | 0fca97a | 2018-07-01 18:30:01 +0900 | [diff] [blame] | 9038 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 9039 | 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] | 9040 | SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
| 9041 | 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] | 9042 | 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] | 9043 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 9044 | 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] | 9045 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 9046 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 9047 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
| 9048 | 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] | 9049 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
Chris Chiu | 6ca653e | 2020-12-22 23:04:58 +0800 | [diff] [blame] | 9050 | SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9051 | SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Werner Sembach | 745f260 | 2021-06-04 16:02:07 +0200 | [diff] [blame] | 9052 | SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9053 | SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9054 | SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9055 | SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9056 | SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9057 | SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9058 | SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9059 | SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9060 | SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9061 | SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9062 | SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 1278cc5ac | 2021-11-02 11:21:04 -0600 | [diff] [blame] | 9063 | SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9064 | SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9065 | SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9066 | SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9067 | SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9068 | SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9069 | SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 1278cc5ac | 2021-11-02 11:21:04 -0600 | [diff] [blame] | 9070 | SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9071 | SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9072 | SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | 1d5cfca | 2021-05-14 12:50:48 +0200 | [diff] [blame] | 9073 | SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9074 | SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | 1d5cfca | 2021-05-14 12:50:48 +0200 | [diff] [blame] | 9075 | SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9076 | SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9077 | SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9078 | SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9079 | SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9080 | SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9081 | SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | 1d5cfca | 2021-05-14 12:50:48 +0200 | [diff] [blame] | 9082 | SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9083 | SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9084 | SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9085 | SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9086 | SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9087 | SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9088 | SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9089 | SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9090 | SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Werner Sembach | 745f260 | 2021-06-04 16:02:07 +0200 | [diff] [blame] | 9091 | SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9092 | SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9093 | SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), |
| 9094 | SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), |
| 9095 | SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9096 | SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9097 | SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Werner Sembach | edca7cc | 2021-12-15 20:16:46 +0100 | [diff] [blame] | 9098 | SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9099 | SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9100 | SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9101 | SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9102 | SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | 1d5cfca | 2021-05-14 12:50:48 +0200 | [diff] [blame] | 9103 | SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | b5acfe1 | 2020-11-11 08:58:59 +0100 | [diff] [blame] | 9104 | SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9105 | SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Werner Sembach | 745f260 | 2021-06-04 16:02:07 +0200 | [diff] [blame] | 9106 | SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9107 | SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
PeiSen Hou | 1d5cfca | 2021-05-14 12:50:48 +0200 | [diff] [blame] | 9108 | SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9109 | SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9110 | SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9111 | SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9112 | SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 9113 | SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 9114 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
Peter Ujfalusi | 29c8f40 | 2021-05-24 23:37:26 +0300 | [diff] [blame] | 9115 | SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9116 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 9117 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 9118 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 9119 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 9120 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | f552ff5 | 2021-04-28 13:27:00 +0200 | [diff] [blame] | 9121 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 9122 | 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] | 9123 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 9124 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 9125 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 9126 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 9127 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 9128 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 9129 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Rick Sherman | 59a51a6 | 2015-08-18 21:04:30 -0500 | [diff] [blame] | 9130 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 9131 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 9132 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 9133 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | b6903c0 | 2015-12-10 12:20:20 +0100 | [diff] [blame] | 9134 | 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] | 9135 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
Yves-Alexis Perez | c027866 | 2015-04-11 09:31:35 +0200 | [diff] [blame] | 9136 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 9137 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 9138 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Torsten Hilbrich | dab38e4 | 2016-06-07 13:14:21 +0200 | [diff] [blame] | 9139 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 9140 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 9141 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
| 9142 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 9143 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Dennis Wassenberg | e4c07b3 | 2018-03-08 13:17:54 +0100 | [diff] [blame] | 9144 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 9145 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 9146 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 9147 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Benjamin Berg | 85981df | 2018-02-14 13:29:39 +0100 | [diff] [blame] | 9148 | 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] | 9149 | 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] | 9150 | SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
Kailang Yang | 446b818 | 2020-11-02 15:00:12 +0800 | [diff] [blame] | 9151 | SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), |
| 9152 | SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), |
Stefan Binding | ae7abe3 | 2021-12-17 11:57:08 +0000 | [diff] [blame] | 9153 | SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2), |
| 9154 | SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2), |
| 9155 | SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2), |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 9156 | 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] | 9157 | 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] | 9158 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Dennis Wassenberg | bef33e1 | 2019-06-28 10:54:53 +0200 | [diff] [blame] | 9159 | SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 9160 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Kailang Yang | 6581183 | 2018-04-25 17:07:27 +0800 | [diff] [blame] | 9161 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 8da5bbf | 2017-12-22 11:17:46 +0800 | [diff] [blame] | 9162 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 9163 | SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Aaron Ma | 8a6c55d | 2019-10-24 19:44:39 +0800 | [diff] [blame] | 9164 | SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
| 9165 | SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
Hui Wang | e4efa82 | 2021-07-19 11:02:31 +0800 | [diff] [blame] | 9166 | SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), |
Cameron Berkenpas | ad7cc2d | 2021-09-13 14:26:29 -0700 | [diff] [blame] | 9167 | SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), |
Takashi Iwai | 2aac550 | 2022-01-05 17:03:21 +0100 | [diff] [blame] | 9168 | SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), |
| 9169 | SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), |
| 9170 | SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), |
| 9171 | SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), |
Bart Kroon | b81e9e5 | 2021-12-13 19:20:43 +0100 | [diff] [blame] | 9172 | SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
Takashi Iwai | 2aac550 | 2022-01-05 17:03:21 +0100 | [diff] [blame] | 9173 | SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), |
Lucas Tanure | d3dca02 | 2021-12-17 11:57:07 +0000 | [diff] [blame] | 9174 | SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6), |
Takashi Iwai | 2aac550 | 2022-01-05 17:03:21 +0100 | [diff] [blame] | 9175 | SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
Cameron Berkenpas | ad7cc2d | 2021-09-13 14:26:29 -0700 | [diff] [blame] | 9176 | SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
| 9177 | SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 9178 | 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] | 9179 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Michał Wadowski | 56df90b | 2019-05-14 16:58:00 +0200 | [diff] [blame] | 9180 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
Takashi Iwai | f552ff5 | 2021-04-28 13:27:00 +0200 | [diff] [blame] | 9181 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 9182 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 9183 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 9184 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 9185 | 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] | 9186 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
Sebastian Wicki | 80b311d | 2015-03-23 17:23:11 +0100 | [diff] [blame] | 9187 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
Ansgar Hegerfeld | 09ea997 | 2015-05-14 12:31:32 +0200 | [diff] [blame] | 9188 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
Conrad Kostecki | 037e119 | 2016-04-26 10:08:10 +0200 | [diff] [blame] | 9189 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 9190 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 9191 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
Torsten Hilbrich | 9cd2574 | 2016-07-05 10:40:22 +0200 | [diff] [blame] | 9192 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 9193 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 9194 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 9195 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 9196 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 9197 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 9198 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 9199 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9200 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Werner Sembach | 174a7fb | 2021-11-12 12:07:04 +0100 | [diff] [blame] | 9201 | SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 9202 | 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] | 9203 | SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), |
| 9204 | SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), |
| 9205 | SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 9206 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
Takashi Iwai | c656f74 | 2021-04-28 13:27:01 +0200 | [diff] [blame] | 9207 | SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
| 9208 | SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), |
Werner Sembach | 619764c | 2021-12-02 17:50:10 +0100 | [diff] [blame] | 9209 | SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 9210 | SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
Xiaoliang Yu | b95bc12 | 2021-03-16 00:49:00 +0800 | [diff] [blame] | 9211 | SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 695d1ec | 2019-11-21 10:54:27 +0800 | [diff] [blame] | 9212 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
Xiaoliang Yu | e1c8621 | 2021-03-13 07:54:53 +0800 | [diff] [blame] | 9213 | SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
Phil Calvin | d1ee66c | 2021-04-15 18:01:29 -0400 | [diff] [blame] | 9214 | SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), |
Kai-Heng Feng | e2d2fde | 2020-08-07 16:05:12 +0800 | [diff] [blame] | 9215 | SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), |
Werner Sembach | 73e7161 | 2021-03-02 19:04:14 +0100 | [diff] [blame] | 9216 | SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 9217 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 9218 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 9219 | /* Below is a quirk table taken from the old code. |
| 9220 | * Basically the device should work as is without the fixup table. |
| 9221 | * If BIOS doesn't give a proper info, enable the corresponding |
| 9222 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 9223 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 9224 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 9225 | ALC269_FIXUP_AMIC), |
| 9226 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 9227 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 9228 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 9229 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 9230 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 9231 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 9232 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 9233 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 9234 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 9235 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 9236 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 9237 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 9238 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 9239 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 9240 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 9241 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 9242 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 9243 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 9244 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 9245 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 9246 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 9247 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 9248 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 9249 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 9250 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 9251 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 9252 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 9253 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 9254 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 9255 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 9256 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 9257 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 9258 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 9259 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 9260 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 9261 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 9262 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 9263 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 9264 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 9265 | #endif |
| 9266 | {} |
| 9267 | }; |
| 9268 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 9269 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 9270 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 9271 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 9272 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 9273 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
Ayman Bagabas | 0fbf21c | 2019-05-23 05:30:11 -0400 | [diff] [blame] | 9274 | SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 9275 | {} |
| 9276 | }; |
| 9277 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 9278 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 9279 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 9280 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 9281 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 9282 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 9283 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 9284 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
Takashi Iwai | b016951 | 2015-05-19 10:20:13 +0200 | [diff] [blame] | 9285 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
| 9286 | {.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] | 9287 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | b590b38 | 2020-05-14 18:05:33 +0200 | [diff] [blame] | 9288 | {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 9289 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 9290 | {.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] | 9291 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 9292 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9293 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
| 9294 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 9295 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 9296 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 9297 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 9298 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 9299 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
Takashi Iwai | 399c01a | 2020-05-26 08:24:06 +0200 | [diff] [blame] | 9300 | {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9301 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 9302 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 28d1d6d | 2017-10-18 14:01:58 +0200 | [diff] [blame] | 9303 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9304 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
| 9305 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, |
| 9306 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, |
| 9307 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, |
| 9308 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, |
| 9309 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, |
| 9310 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, |
| 9311 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, |
| 9312 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, |
| 9313 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, |
| 9314 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, |
| 9315 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, |
| 9316 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, |
| 9317 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, |
| 9318 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, |
| 9319 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, |
| 9320 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, |
| 9321 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, |
| 9322 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, |
| 9323 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, |
| 9324 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, |
| 9325 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, |
| 9326 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, |
| 9327 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, |
| 9328 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, |
| 9329 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, |
| 9330 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, |
| 9331 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, |
| 9332 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, |
| 9333 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, |
| 9334 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, |
| 9335 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, |
| 9336 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, |
| 9337 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, |
| 9338 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, |
| 9339 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, |
| 9340 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, |
| 9341 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, |
| 9342 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, |
| 9343 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 9344 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9345 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
Takashi Iwai | c8426b2 | 2021-04-07 11:57:30 +0200 | [diff] [blame] | 9346 | {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9347 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
| 9348 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
| 9349 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, |
| 9350 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, |
| 9351 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, |
| 9352 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, |
| 9353 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, |
| 9354 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, |
| 9355 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, |
| 9356 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, |
| 9357 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, |
| 9358 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, |
| 9359 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, |
| 9360 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9361 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
| 9362 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, |
| 9363 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, |
Kailang Yang | 82aa0d7 | 2019-01-11 17:15:53 +0800 | [diff] [blame] | 9364 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9365 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
Jaroslav Kysela | d2cd795 | 2019-11-29 15:40:27 +0100 | [diff] [blame] | 9366 | {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 9367 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
| 9368 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, |
| 9369 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, |
| 9370 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, |
| 9371 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, |
| 9372 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, |
| 9373 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, |
| 9374 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, |
| 9375 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, |
| 9376 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, |
| 9377 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, |
| 9378 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, |
| 9379 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, |
| 9380 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, |
| 9381 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
| 9382 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
| 9383 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 9384 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
| 9385 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 9386 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
Tomas Espeleta | a2ef03f | 2019-08-09 16:37:54 +0200 | [diff] [blame] | 9387 | {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, |
Jan-Marek Glogowski | bd9c10b | 2019-09-15 16:57:28 +0200 | [diff] [blame] | 9388 | {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, |
Mike Pozulp | 23dc958 | 2020-08-16 21:32:17 -0700 | [diff] [blame] | 9389 | {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, |
Hui Wang | fc19d55 | 2020-09-09 10:00:41 +0800 | [diff] [blame] | 9390 | {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, |
Hui Wang | 13468bf | 2020-09-28 16:01:17 +0800 | [diff] [blame] | 9391 | {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, |
Takashi Iwai | c3bb2b5 | 2021-02-15 09:25:40 +0100 | [diff] [blame] | 9392 | {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, |
Takashi Iwai | 5d84b53 | 2021-05-04 14:18:32 +0200 | [diff] [blame] | 9393 | {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, |
Elia Devito | f2be77f | 2021-05-11 14:46:49 +0200 | [diff] [blame] | 9394 | {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, |
Davide Baldo | d94befb | 2021-10-15 09:21:22 +0200 | [diff] [blame] | 9395 | {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, |
Hui Wang | 9ebaef0 | 2021-05-22 12:26:45 +0800 | [diff] [blame] | 9396 | {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, |
Peter Ujfalusi | 29c8f40 | 2021-05-24 23:37:26 +0300 | [diff] [blame] | 9397 | {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, |
Hui Wang | 57c9e21 | 2021-06-08 10:46:00 +0800 | [diff] [blame] | 9398 | {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, |
Bradley Scott | aa72394 | 2021-12-13 11:22:47 -0500 | [diff] [blame] | 9399 | {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9400 | {} |
| 9401 | }; |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 9402 | #define ALC225_STANDARD_PINS \ |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 9403 | {0x21, 0x04211020} |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9404 | |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 9405 | #define ALC256_STANDARD_PINS \ |
| 9406 | {0x12, 0x90a60140}, \ |
| 9407 | {0x14, 0x90170110}, \ |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 9408 | {0x21, 0x02211020} |
| 9409 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 9410 | #define ALC282_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9411 | {0x14, 0x90170110} |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 9412 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 9413 | #define ALC290_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9414 | {0x12, 0x99a30130} |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 9415 | |
| 9416 | #define ALC292_STANDARD_PINS \ |
| 9417 | {0x14, 0x90170110}, \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9418 | {0x15, 0x0221401f} |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 9419 | |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 9420 | #define ALC295_STANDARD_PINS \ |
| 9421 | {0x12, 0xb7a60130}, \ |
| 9422 | {0x14, 0x90170110}, \ |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 9423 | {0x21, 0x04211020} |
| 9424 | |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 9425 | #define ALC298_STANDARD_PINS \ |
| 9426 | {0x12, 0x90a60130}, \ |
| 9427 | {0x21, 0x03211020} |
| 9428 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 9429 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 9430 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
| 9431 | {0x14, 0x01014020}, |
| 9432 | {0x17, 0x90170110}, |
| 9433 | {0x18, 0x02a11030}, |
| 9434 | {0x19, 0x0181303F}, |
| 9435 | {0x21, 0x0221102f}), |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 9436 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 9437 | {0x12, 0x90a601c0}, |
| 9438 | {0x14, 0x90171120}, |
| 9439 | {0x21, 0x02211030}), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 9440 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 9441 | {0x14, 0x90170110}, |
| 9442 | {0x1b, 0x90a70130}, |
| 9443 | {0x21, 0x03211020}), |
| 9444 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 9445 | {0x1a, 0x90a70130}, |
| 9446 | {0x1b, 0x90170110}, |
| 9447 | {0x21, 0x03211020}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 9448 | 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] | 9449 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 9450 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 9451 | {0x14, 0x901701a0}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 9452 | 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] | 9453 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 9454 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 9455 | {0x14, 0x901701b0}), |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 9456 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9457 | ALC225_STANDARD_PINS, |
| 9458 | {0x12, 0xb7a60150}, |
| 9459 | {0x14, 0x901701a0}), |
| 9460 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9461 | ALC225_STANDARD_PINS, |
| 9462 | {0x12, 0xb7a60150}, |
| 9463 | {0x14, 0x901701b0}), |
| 9464 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9465 | ALC225_STANDARD_PINS, |
| 9466 | {0x12, 0xb7a60130}, |
| 9467 | {0x1b, 0x90170110}), |
Kai-Heng Feng | 0ce48e1 | 2017-11-20 02:29:13 -0500 | [diff] [blame] | 9468 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9469 | {0x1b, 0x01111010}, |
| 9470 | {0x1e, 0x01451130}, |
| 9471 | {0x21, 0x02211020}), |
Hui Wang | 986376b | 2018-05-30 12:33:07 +0800 | [diff] [blame] | 9472 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
| 9473 | {0x12, 0x90a60140}, |
| 9474 | {0x14, 0x90170110}, |
| 9475 | {0x19, 0x02a11030}, |
| 9476 | {0x21, 0x02211020}), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 9477 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 9478 | {0x14, 0x90170110}, |
| 9479 | {0x19, 0x02a11030}, |
| 9480 | {0x1a, 0x02a11040}, |
| 9481 | {0x1b, 0x01014020}, |
| 9482 | {0x21, 0x0221101f}), |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 9483 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 9484 | {0x14, 0x90170110}, |
Hui Wang | d06fb56 | 2018-10-10 11:57:25 +0800 | [diff] [blame] | 9485 | {0x19, 0x02a11030}, |
| 9486 | {0x1a, 0x02a11040}, |
| 9487 | {0x1b, 0x01011020}, |
| 9488 | {0x21, 0x0221101f}), |
| 9489 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 9490 | {0x14, 0x90170110}, |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 9491 | {0x19, 0x02a11020}, |
| 9492 | {0x1a, 0x02a11030}, |
| 9493 | {0x21, 0x0221101f}), |
Kailang Yang | 92666d4 | 2020-11-19 17:04:21 +0800 | [diff] [blame] | 9494 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
| 9495 | {0x21, 0x02211010}), |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 9496 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
| 9497 | {0x14, 0x90170110}, |
| 9498 | {0x19, 0x02a11020}, |
| 9499 | {0x21, 0x02211030}), |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 9500 | 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] | 9501 | {0x14, 0x90170110}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 9502 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9503 | 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] | 9504 | {0x14, 0x90170130}, |
| 9505 | {0x21, 0x02211040}), |
| 9506 | 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] | 9507 | {0x12, 0x90a60140}, |
| 9508 | {0x14, 0x90170110}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9509 | {0x21, 0x02211020}), |
| 9510 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9511 | {0x12, 0x90a60160}, |
| 9512 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9513 | {0x21, 0x02211030}), |
| 9514 | 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] | 9515 | {0x14, 0x90170110}, |
| 9516 | {0x1b, 0x02011020}, |
| 9517 | {0x21, 0x0221101f}), |
| 9518 | 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] | 9519 | {0x14, 0x90170110}, |
| 9520 | {0x1b, 0x01011020}, |
| 9521 | {0x21, 0x0221101f}), |
| 9522 | 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] | 9523 | {0x14, 0x90170130}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 9524 | {0x1b, 0x01014020}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 9525 | {0x21, 0x0221103f}), |
| 9526 | 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] | 9527 | {0x14, 0x90170130}, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 9528 | {0x1b, 0x01011020}, |
| 9529 | {0x21, 0x0221103f}), |
| 9530 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9531 | {0x14, 0x90170130}, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 9532 | {0x1b, 0x02011020}, |
| 9533 | {0x21, 0x0221103f}), |
| 9534 | 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] | 9535 | {0x14, 0x90170150}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 9536 | {0x1b, 0x02011020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 9537 | {0x21, 0x0221105f}), |
| 9538 | 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] | 9539 | {0x14, 0x90170110}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 9540 | {0x1b, 0x01014020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 9541 | {0x21, 0x0221101f}), |
| 9542 | 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] | 9543 | {0x12, 0x90a60160}, |
| 9544 | {0x14, 0x90170120}, |
| 9545 | {0x17, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9546 | {0x21, 0x0321102f}), |
| 9547 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9548 | {0x12, 0x90a60160}, |
| 9549 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9550 | {0x21, 0x02211040}), |
| 9551 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9552 | {0x12, 0x90a60160}, |
| 9553 | {0x14, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9554 | {0x21, 0x02211050}), |
| 9555 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9556 | {0x12, 0x90a60170}, |
| 9557 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9558 | {0x21, 0x02211030}), |
| 9559 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9560 | {0x12, 0x90a60170}, |
| 9561 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9562 | {0x21, 0x02211040}), |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 9563 | 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] | 9564 | {0x12, 0x90a60170}, |
Hui Wang | 0a1f90a | 2016-01-13 11:51:38 +0800 | [diff] [blame] | 9565 | {0x14, 0x90171130}, |
| 9566 | {0x21, 0x02211040}), |
| 9567 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9568 | {0x12, 0x90a60170}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 9569 | {0x14, 0x90170140}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 9570 | {0x21, 0x02211050}), |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 9571 | 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] | 9572 | {0x12, 0x90a60180}, |
| 9573 | {0x14, 0x90170130}, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 9574 | {0x21, 0x02211040}), |
AceLan Kao | f90d83b | 2016-06-03 14:45:25 +0800 | [diff] [blame] | 9575 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9576 | {0x12, 0x90a60180}, |
| 9577 | {0x14, 0x90170120}, |
| 9578 | {0x21, 0x02211030}), |
Hui Wang | 989dbe4 | 2016-11-23 16:05:38 +0800 | [diff] [blame] | 9579 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9580 | {0x1b, 0x01011020}, |
| 9581 | {0x21, 0x02211010}), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 9582 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 9583 | {0x14, 0x90170110}, |
| 9584 | {0x1b, 0x90a70130}, |
| 9585 | {0x21, 0x04211020}), |
| 9586 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 9587 | {0x14, 0x90170110}, |
| 9588 | {0x1b, 0x90a70130}, |
| 9589 | {0x21, 0x03211020}), |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 9590 | 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] | 9591 | {0x12, 0x90a60130}, |
| 9592 | {0x14, 0x90170110}, |
| 9593 | {0x21, 0x03211020}), |
| 9594 | 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] | 9595 | {0x12, 0x90a60130}, |
| 9596 | {0x14, 0x90170110}, |
| 9597 | {0x21, 0x04211020}), |
| 9598 | 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] | 9599 | {0x1a, 0x90a70130}, |
| 9600 | {0x1b, 0x90170110}, |
| 9601 | {0x21, 0x03211020}), |
Kailang Yang | 9e88577 | 2020-11-03 15:30:51 +0800 | [diff] [blame] | 9602 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
| 9603 | {0x14, 0x90170110}, |
| 9604 | {0x19, 0x02a11020}, |
| 9605 | {0x21, 0x0221101f}), |
Kailang Yang | 8a8de09c | 2020-10-27 16:46:38 +0800 | [diff] [blame] | 9606 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, |
| 9607 | {0x17, 0x90170110}, |
| 9608 | {0x19, 0x03a11030}, |
| 9609 | {0x21, 0x03211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 9610 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 9611 | {0x12, 0x90a60130}, |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 9612 | {0x14, 0x90170110}, |
| 9613 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9614 | {0x1a, 0x04a11020}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 9615 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 9616 | {0x12, 0x90a60140}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 9617 | {0x14, 0x90170110}, |
| 9618 | {0x15, 0x0421101f}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 9619 | {0x18, 0x02811030}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 9620 | {0x1a, 0x04a1103f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9621 | {0x1b, 0x02011020}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 9622 | 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] | 9623 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 9624 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 9625 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 9626 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9627 | 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] | 9628 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9629 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9630 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9631 | {0x21, 0x03211040}), |
| 9632 | 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] | 9633 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9634 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9635 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9636 | {0x21, 0x03211020}), |
| 9637 | 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] | 9638 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9639 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9640 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 9641 | {0x21, 0x0421101f}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 9642 | 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] | 9643 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 9644 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 9645 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 9646 | {0x21, 0x04211020}), |
Chris Chiu | 34cdf40 | 2020-12-16 20:52:00 +0800 | [diff] [blame] | 9647 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
| 9648 | ALC282_STANDARD_PINS, |
| 9649 | {0x12, 0x90a609c0}, |
| 9650 | {0x18, 0x03a11830}, |
| 9651 | {0x19, 0x04a19831}, |
| 9652 | {0x1a, 0x0481303f}, |
| 9653 | {0x1b, 0x04211020}, |
| 9654 | {0x21, 0x0321101f}), |
| 9655 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
| 9656 | ALC282_STANDARD_PINS, |
| 9657 | {0x12, 0x90a60940}, |
| 9658 | {0x18, 0x03a11830}, |
| 9659 | {0x19, 0x04a19831}, |
| 9660 | {0x1a, 0x0481303f}, |
| 9661 | {0x1b, 0x04211020}, |
| 9662 | {0x21, 0x0321101f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9663 | 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] | 9664 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9665 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9666 | {0x21, 0x0321101f}), |
| 9667 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9668 | {0x12, 0x90a60160}, |
| 9669 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9670 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 9671 | 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] | 9672 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 9673 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 9674 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 9675 | {0x21, 0x0321101f}), |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 9676 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Sami Loone | 266fd99 | 2021-05-01 12:07:53 +0200 | [diff] [blame] | 9677 | {0x12, 0x90a60130}, |
| 9678 | {0x14, 0x90170110}, |
| 9679 | {0x19, 0x04a11040}, |
| 9680 | {0x21, 0x04211020}), |
| 9681 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
| 9682 | {0x14, 0x90170110}, |
| 9683 | {0x19, 0x04a11040}, |
| 9684 | {0x1d, 0x40600001}, |
| 9685 | {0x21, 0x04211020}), |
| 9686 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 9687 | {0x14, 0x90170110}, |
| 9688 | {0x19, 0x04a11040}, |
| 9689 | {0x21, 0x04211020}), |
Hui Wang | c72b9bf | 2020-12-05 13:11:30 +0800 | [diff] [blame] | 9690 | SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
| 9691 | {0x14, 0x90170110}, |
| 9692 | {0x17, 0x90170111}, |
| 9693 | {0x19, 0x03a11030}, |
| 9694 | {0x21, 0x03211020}), |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 9695 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
| 9696 | {0x12, 0x90a60130}, |
| 9697 | {0x17, 0x90170110}, |
| 9698 | {0x21, 0x02211020}), |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 9699 | 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] | 9700 | {0x12, 0x90a60120}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 9701 | {0x14, 0x90170110}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 9702 | {0x21, 0x0321101f}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9703 | 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] | 9704 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9705 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9706 | {0x18, 0x90170112}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9707 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9708 | 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] | 9709 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9710 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9711 | {0x18, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9712 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9713 | 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] | 9714 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9715 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9716 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9717 | 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] | 9718 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9719 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9720 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9721 | 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] | 9722 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9723 | {0x14, 0x90170110}, |
| 9724 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9725 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9726 | 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] | 9727 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9728 | {0x14, 0x90170110}, |
| 9729 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9730 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9731 | 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] | 9732 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 9733 | {0x14, 0x90170110}, |
| 9734 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9735 | {0x1a, 0x04a11020}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 9736 | 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] | 9737 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 9738 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 9739 | {0x16, 0x01014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9740 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 9741 | 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] | 9742 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 9743 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 9744 | {0x16, 0x01014020}, |
| 9745 | {0x18, 0x02a19031}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9746 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9747 | 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] | 9748 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9749 | {0x12, 0x90a60140}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9750 | 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] | 9751 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9752 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 9753 | {0x16, 0x21014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9754 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 9755 | 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] | 9756 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 9757 | {0x13, 0x90a60140}), |
Jian-Hong Pan | eeacd80 | 2020-11-24 17:20:25 +0800 | [diff] [blame] | 9758 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE, |
| 9759 | {0x17, 0x90170110}, |
| 9760 | {0x21, 0x04211020}), |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 9761 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
| 9762 | {0x14, 0x90170110}, |
| 9763 | {0x1b, 0x90a70130}, |
| 9764 | {0x21, 0x04211020}), |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 9765 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 9766 | {0x12, 0x90a60130}, |
| 9767 | {0x17, 0x90170110}, |
Jian-Hong Pan | 8bb37a2 | 2019-02-21 17:00:18 +0800 | [diff] [blame] | 9768 | {0x21, 0x03211020}), |
| 9769 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 9770 | {0x12, 0x90a60130}, |
| 9771 | {0x17, 0x90170110}, |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 9772 | {0x21, 0x04211020}), |
Takashi Iwai | 3887c26 | 2019-04-30 15:10:01 +0200 | [diff] [blame] | 9773 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 9774 | {0x12, 0x90a60130}, |
| 9775 | {0x17, 0x90170110}, |
| 9776 | {0x21, 0x03211020}), |
Chris Chiu | 9e43342 | 2020-05-12 14:15:24 +0800 | [diff] [blame] | 9777 | 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] | 9778 | {0x12, 0x90a60120}, |
| 9779 | {0x17, 0x90170110}, |
| 9780 | {0x21, 0x04211030}), |
| 9781 | 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] | 9782 | {0x12, 0x90a60130}, |
| 9783 | {0x17, 0x90170110}, |
| 9784 | {0x21, 0x03211020}), |
| 9785 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 9786 | {0x12, 0x90a60130}, |
| 9787 | {0x17, 0x90170110}, |
| 9788 | {0x21, 0x03211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 9789 | 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] | 9790 | {0x14, 0x90170110}, |
| 9791 | {0x21, 0x04211020}), |
Kailang Yang | fbc5712 | 2019-07-15 10:41:50 +0800 | [diff] [blame] | 9792 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 9793 | {0x14, 0x90170110}, |
| 9794 | {0x21, 0x04211030}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 9795 | 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] | 9796 | ALC295_STANDARD_PINS, |
| 9797 | {0x17, 0x21014020}, |
| 9798 | {0x18, 0x21a19030}), |
| 9799 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9800 | ALC295_STANDARD_PINS, |
| 9801 | {0x17, 0x21014040}, |
| 9802 | {0x18, 0x21a19050}), |
Hui Wang | 3f30783 | 2017-03-23 10:00:25 +0800 | [diff] [blame] | 9803 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9804 | ALC295_STANDARD_PINS), |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 9805 | 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] | 9806 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 9807 | {0x17, 0x90170110}), |
| 9808 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9809 | ALC298_STANDARD_PINS, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 9810 | {0x17, 0x90170140}), |
| 9811 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9812 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 9813 | {0x17, 0x90170150}), |
Kai-Heng Feng | 9f1bc2c4 | 2017-02-16 15:26:54 +0800 | [diff] [blame] | 9814 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
| 9815 | {0x12, 0xb7a60140}, |
| 9816 | {0x13, 0xb7a60150}, |
| 9817 | {0x17, 0x90170110}, |
| 9818 | {0x1a, 0x03011020}, |
| 9819 | {0x21, 0x03211030}), |
James McDonnell | 5432422 | 2019-09-16 14:53:38 +0000 | [diff] [blame] | 9820 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
| 9821 | {0x12, 0xb7a60140}, |
| 9822 | {0x17, 0x90170110}, |
| 9823 | {0x1a, 0x03a11030}, |
| 9824 | {0x21, 0x03211020}), |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 9825 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 9826 | ALC225_STANDARD_PINS, |
| 9827 | {0x12, 0xb7a60130}, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 9828 | {0x17, 0x90170110}), |
Hui Wang | 573fcbf | 2020-06-08 19:55:41 +0800 | [diff] [blame] | 9829 | SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, |
| 9830 | {0x14, 0x01014010}, |
| 9831 | {0x17, 0x90170120}, |
| 9832 | {0x18, 0x02a11030}, |
| 9833 | {0x19, 0x02a1103f}, |
| 9834 | {0x21, 0x0221101f}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 9835 | {} |
| 9836 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9837 | |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 9838 | /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match |
| 9839 | * more machines, don't need to match all valid pins, just need to match |
| 9840 | * all the pins defined in the tbl. Just because of this reason, it is possible |
| 9841 | * that a single machine matches multiple tbls, so there is one limitation: |
| 9842 | * at most one tbl is allowed to define for the same vendor and same codec |
| 9843 | */ |
| 9844 | static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { |
| 9845 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 9846 | {0x19, 0x40000000}, |
| 9847 | {0x1b, 0x40000000}), |
Hui Wang | aed8c7f | 2019-11-21 10:26:43 +0800 | [diff] [blame] | 9848 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9849 | {0x19, 0x40000000}, |
| 9850 | {0x1a, 0x40000000}), |
Hui Wang | d64ebdb | 2019-11-21 10:26:44 +0800 | [diff] [blame] | 9851 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 9852 | {0x19, 0x40000000}, |
| 9853 | {0x1a, 0x40000000}), |
Hui Wang | 5815bdf | 2019-12-11 13:13:21 +0800 | [diff] [blame] | 9854 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
| 9855 | {0x19, 0x40000000}, |
| 9856 | {0x1a, 0x40000000}), |
Hui Wang | 7c0a693 | 2019-08-16 14:27:40 +0800 | [diff] [blame] | 9857 | {} |
| 9858 | }; |
| 9859 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 9860 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9861 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 9862 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9863 | int val; |
| 9864 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 9865 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 9866 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 9867 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9868 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9869 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 9870 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 9871 | } |
| 9872 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9873 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9874 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 9875 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 9876 | } |
| 9877 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9878 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9879 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 9880 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9881 | } |
| 9882 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9883 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9884 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 9885 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9886 | /* Capless ramp up clock control */ |
| 9887 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 9888 | } |
| 9889 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 9890 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9891 | /* Class D power on reset */ |
| 9892 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 9893 | } |
| 9894 | } |
| 9895 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 9896 | /* HP */ |
| 9897 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9898 | } |
| 9899 | |
| 9900 | /* |
| 9901 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9902 | static int patch_alc269(struct hda_codec *codec) |
| 9903 | { |
| 9904 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9905 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9906 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9907 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9908 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 9909 | return err; |
| 9910 | |
| 9911 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 9912 | spec->gen.shared_mic_vref_pin = 0x18; |
Kailang Yang | 317d931 | 2019-05-23 14:43:04 +0800 | [diff] [blame] | 9913 | codec->power_save_node = 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9914 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9915 | #ifdef CONFIG_PM |
| 9916 | codec->patch_ops.suspend = alc269_suspend; |
| 9917 | codec->patch_ops.resume = alc269_resume; |
| 9918 | #endif |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 9919 | spec->shutup = alc_default_shutup; |
| 9920 | spec->init_hook = alc_default_init; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 9921 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 9922 | switch (codec->core.vendor_id) { |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9923 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9924 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9925 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 9926 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 9927 | if (codec->bus->pci && |
| 9928 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9929 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 9930 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9931 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9932 | break; |
| 9933 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 9934 | if (codec->bus->pci && |
| 9935 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9936 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 9937 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9938 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9939 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 9940 | case 0x0030: |
| 9941 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 9942 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9943 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9944 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 9945 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 9946 | if (err < 0) |
| 9947 | goto error; |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 9948 | spec->shutup = alc269_shutup; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 9949 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 9950 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9951 | break; |
| 9952 | |
| 9953 | case 0x10ec0280: |
| 9954 | case 0x10ec0290: |
| 9955 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 9956 | break; |
| 9957 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9958 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 9959 | spec->shutup = alc282_shutup; |
| 9960 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9961 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 9962 | case 0x10ec0233: |
| 9963 | case 0x10ec0283: |
| 9964 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 9965 | spec->shutup = alc283_shutup; |
| 9966 | spec->init_hook = alc283_init; |
| 9967 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 9968 | case 0x10ec0284: |
| 9969 | case 0x10ec0292: |
| 9970 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 9971 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 9972 | case 0x10ec0293: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 9973 | spec->codec_variant = ALC269_TYPE_ALC293; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 9974 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 9975 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 9976 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 9977 | spec->codec_variant = ALC269_TYPE_ALC286; |
| 9978 | break; |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 9979 | case 0x10ec0298: |
| 9980 | spec->codec_variant = ALC269_TYPE_ALC298; |
| 9981 | break; |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 9982 | case 0x10ec0235: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 9983 | case 0x10ec0255: |
| 9984 | spec->codec_variant = ALC269_TYPE_ALC255; |
Kailang Yang | ab3b8e5 | 2018-04-25 16:05:27 +0800 | [diff] [blame] | 9985 | spec->shutup = alc256_shutup; |
| 9986 | spec->init_hook = alc256_init; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 9987 | break; |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 9988 | case 0x10ec0230: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 9989 | case 0x10ec0236: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 9990 | case 0x10ec0256: |
| 9991 | spec->codec_variant = ALC269_TYPE_ALC256; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 9992 | spec->shutup = alc256_shutup; |
| 9993 | spec->init_hook = alc256_init; |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 9994 | 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] | 9995 | break; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 9996 | case 0x10ec0257: |
| 9997 | spec->codec_variant = ALC269_TYPE_ALC257; |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 9998 | spec->shutup = alc256_shutup; |
| 9999 | spec->init_hook = alc256_init; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 10000 | spec->gen.mixer_nid = 0; |
| 10001 | break; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 10002 | case 0x10ec0215: |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 10003 | case 0x10ec0245: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 10004 | case 0x10ec0285: |
| 10005 | case 0x10ec0289: |
| 10006 | spec->codec_variant = ALC269_TYPE_ALC215; |
Kailang Yang | 1b6832be | 2018-01-17 15:32:03 +0800 | [diff] [blame] | 10007 | spec->shutup = alc225_shutup; |
| 10008 | spec->init_hook = alc225_init; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 10009 | spec->gen.mixer_nid = 0; |
| 10010 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 10011 | case 0x10ec0225: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 10012 | case 0x10ec0295: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 10013 | case 0x10ec0299: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 10014 | spec->codec_variant = ALC269_TYPE_ALC225; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 10015 | spec->shutup = alc225_shutup; |
| 10016 | spec->init_hook = alc225_init; |
Takashi Iwai | c1350bf | 2017-12-27 09:03:45 +0100 | [diff] [blame] | 10017 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 10018 | break; |
Kailang Yang | 99cee034 | 2021-07-01 09:09:37 +0800 | [diff] [blame] | 10019 | case 0x10ec0287: |
| 10020 | spec->codec_variant = ALC269_TYPE_ALC287; |
| 10021 | spec->shutup = alc225_shutup; |
| 10022 | spec->init_hook = alc225_init; |
| 10023 | spec->gen.mixer_nid = 0; /* no loopback on ALC287 */ |
| 10024 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 10025 | case 0x10ec0234: |
| 10026 | case 0x10ec0274: |
| 10027 | case 0x10ec0294: |
| 10028 | spec->codec_variant = ALC269_TYPE_ALC294; |
Hui Wang | 532a778 | 2017-06-26 12:30:32 +0800 | [diff] [blame] | 10029 | 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] | 10030 | 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] | 10031 | spec->init_hook = alc294_init; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 10032 | break; |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 10033 | case 0x10ec0300: |
| 10034 | spec->codec_variant = ALC269_TYPE_ALC300; |
| 10035 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10036 | break; |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 10037 | case 0x10ec0623: |
| 10038 | spec->codec_variant = ALC269_TYPE_ALC623; |
| 10039 | break; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 10040 | case 0x10ec0700: |
| 10041 | case 0x10ec0701: |
| 10042 | case 0x10ec0703: |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 10043 | case 0x10ec0711: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 10044 | spec->codec_variant = ALC269_TYPE_ALC700; |
| 10045 | 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] | 10046 | 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] | 10047 | spec->init_hook = alc294_init; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 10048 | break; |
| 10049 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10050 | } |
| 10051 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 10052 | 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] | 10053 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 10054 | spec->init_hook = alc5505_dsp_init; |
| 10055 | } |
| 10056 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 10057 | alc_pre_init(codec); |
| 10058 | |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 10059 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
| 10060 | alc269_fixup_tbl, alc269_fixups); |
Takashi Iwai | 13d9c6b | 2021-08-20 16:32:14 +0200 | [diff] [blame] | 10061 | /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and |
| 10062 | * the quirk breaks the latter (bko#214101). |
| 10063 | * Clear the wrong entry. |
| 10064 | */ |
| 10065 | if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 && |
| 10066 | codec->core.vendor_id == 0x10ec0294) { |
| 10067 | codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n"); |
| 10068 | codec->fixup_id = HDA_FIXUP_ID_NOT_SET; |
| 10069 | } |
| 10070 | |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 10071 | 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] | 10072 | 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] | 10073 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 10074 | alc269_fixups); |
| 10075 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 10076 | |
| 10077 | alc_auto_parse_customize_define(codec); |
| 10078 | |
| 10079 | if (has_cdefine_beep(codec)) |
| 10080 | spec->gen.beep_nid = 0x01; |
| 10081 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 10082 | /* automatic parse from the BIOS config */ |
| 10083 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10084 | if (err < 0) |
| 10085 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10086 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 10087 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
| 10088 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); |
| 10089 | if (err < 0) |
| 10090 | goto error; |
| 10091 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10092 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10093 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 10094 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10095 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10096 | |
| 10097 | error: |
| 10098 | alc_free(codec); |
| 10099 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10100 | } |
| 10101 | |
| 10102 | /* |
| 10103 | * ALC861 |
| 10104 | */ |
| 10105 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10106 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 10107 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10108 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 10109 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 10110 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10111 | } |
| 10112 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10113 | /* Pin config fixes */ |
| 10114 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10115 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 10116 | ALC861_FIXUP_AMP_VREF_0F, |
| 10117 | ALC861_FIXUP_NO_JACK_DETECT, |
| 10118 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 10119 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10120 | }; |
| 10121 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 10122 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 10123 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10124 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 10125 | { |
| 10126 | struct alc_spec *spec = codec->spec; |
| 10127 | unsigned int val; |
| 10128 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10129 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 10130 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 10131 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 10132 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 10133 | val |= AC_PINCTL_IN_EN; |
| 10134 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 10135 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 10136 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 10137 | } |
| 10138 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10139 | /* suppress the jack-detection */ |
| 10140 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10141 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10142 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10143 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10144 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 10145 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10146 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10147 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10148 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10149 | .type = HDA_FIXUP_PINS, |
| 10150 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10151 | { 0x0b, 0x0221101f }, /* HP */ |
| 10152 | { 0x0f, 0x90170310 }, /* speaker */ |
| 10153 | { } |
| 10154 | } |
| 10155 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10156 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10157 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 10158 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 10159 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10160 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10161 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10162 | .v.func = alc_fixup_no_jack_detect, |
| 10163 | }, |
| 10164 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10165 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10166 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 10167 | .chained = true, |
| 10168 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 10169 | }, |
| 10170 | [ALC660_FIXUP_ASUS_W7J] = { |
| 10171 | .type = HDA_FIXUP_VERBS, |
| 10172 | .v.verbs = (const struct hda_verb[]) { |
| 10173 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 10174 | * for enabling outputs |
| 10175 | */ |
| 10176 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 10177 | { } |
| 10178 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10179 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10180 | }; |
| 10181 | |
| 10182 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 10183 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 10184 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10185 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 10186 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 10187 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | defce24 | 2021-04-28 13:27:03 +0200 | [diff] [blame] | 10188 | SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 10189 | 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] | 10190 | {} |
| 10191 | }; |
| 10192 | |
| 10193 | /* |
| 10194 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10195 | static int patch_alc861(struct hda_codec *codec) |
| 10196 | { |
| 10197 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10198 | int err; |
| 10199 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10200 | err = alc_alloc_spec(codec, 0x15); |
| 10201 | if (err < 0) |
| 10202 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10203 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10204 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 10205 | if (has_cdefine_beep(codec)) |
| 10206 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10207 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 10208 | #ifdef CONFIG_PM |
| 10209 | spec->power_hook = alc_power_eapd; |
| 10210 | #endif |
| 10211 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 10212 | alc_pre_init(codec); |
| 10213 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10214 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 10215 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10216 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 10217 | /* automatic parse from the BIOS config */ |
| 10218 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10219 | if (err < 0) |
| 10220 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10221 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 10222 | if (!spec->gen.no_analog) { |
| 10223 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
| 10224 | if (err < 0) |
| 10225 | goto error; |
| 10226 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10227 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10228 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 10229 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10230 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10231 | |
| 10232 | error: |
| 10233 | alc_free(codec); |
| 10234 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10235 | } |
| 10236 | |
| 10237 | /* |
| 10238 | * ALC861-VD support |
| 10239 | * |
| 10240 | * Based on ALC882 |
| 10241 | * |
| 10242 | * In addition, an independent DAC |
| 10243 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10244 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 10245 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10246 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 10247 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 10248 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10249 | } |
| 10250 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10251 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10252 | ALC660VD_FIX_ASUS_GPIO1, |
| 10253 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10254 | }; |
| 10255 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10256 | /* exclude VREF80 */ |
| 10257 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10258 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10259 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10260 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 10261 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 10262 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10263 | } |
| 10264 | } |
| 10265 | |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 10266 | /* reset GPIO1 */ |
| 10267 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, |
| 10268 | const struct hda_fixup *fix, int action) |
| 10269 | { |
| 10270 | struct alc_spec *spec = codec->spec; |
| 10271 | |
| 10272 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 10273 | spec->gpio_mask |= 0x02; |
| 10274 | alc_fixup_gpio(codec, action, 0x01); |
| 10275 | } |
| 10276 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10277 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10278 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 10279 | .type = HDA_FIXUP_FUNC, |
| 10280 | .v.func = alc660vd_fixup_asus_gpio1, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10281 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10282 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10283 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10284 | .v.func = alc861vd_fixup_dallas, |
| 10285 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10286 | }; |
| 10287 | |
| 10288 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10289 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10290 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 10291 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10292 | {} |
| 10293 | }; |
| 10294 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10295 | /* |
| 10296 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10297 | static int patch_alc861vd(struct hda_codec *codec) |
| 10298 | { |
| 10299 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 10300 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10301 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10302 | err = alc_alloc_spec(codec, 0x0b); |
| 10303 | if (err < 0) |
| 10304 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10305 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 10306 | spec = codec->spec; |
Takashi Iwai | 2722b53 | 2019-08-22 09:55:37 +0200 | [diff] [blame] | 10307 | if (has_cdefine_beep(codec)) |
| 10308 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10309 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 10310 | spec->shutup = alc_eapd_shutup; |
| 10311 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 10312 | alc_pre_init(codec); |
| 10313 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10314 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 10315 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10316 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 10317 | /* automatic parse from the BIOS config */ |
| 10318 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10319 | if (err < 0) |
| 10320 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10321 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 10322 | if (!spec->gen.no_analog) { |
| 10323 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 10324 | if (err < 0) |
| 10325 | goto error; |
| 10326 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10327 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10328 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 10329 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10330 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 10331 | |
| 10332 | error: |
| 10333 | alc_free(codec); |
| 10334 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10335 | } |
| 10336 | |
| 10337 | /* |
| 10338 | * ALC662 support |
| 10339 | * |
| 10340 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 10341 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 10342 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 10343 | * 6-channel independent captures. |
| 10344 | * |
| 10345 | * In addition, an independent DAC for the multi-playback (not used in this |
| 10346 | * driver yet). |
| 10347 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 10348 | |
| 10349 | /* |
| 10350 | * BIOS auto configuration |
| 10351 | */ |
| 10352 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10353 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 10354 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 10355 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 10356 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 10357 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 10358 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 10359 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 10360 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
| 10361 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || |
| 10362 | codec->core.vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 10363 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 10364 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 10365 | ssids = alc662_ssids; |
| 10366 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 10367 | } |
| 10368 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 10369 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10370 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 10371 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 10372 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 10373 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 10374 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 10375 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 10376 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 10377 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 10378 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 10379 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 10380 | } |
| 10381 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 10382 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 10383 | { .channels = 2, |
| 10384 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 10385 | { .channels = 4, |
| 10386 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 10387 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 10388 | { } |
| 10389 | }; |
| 10390 | |
| 10391 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 10392 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 10393 | const struct hda_fixup *fix, int action) |
| 10394 | { |
| 10395 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 10396 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | bbbc7e8 | 2015-02-27 17:43:19 +0100 | [diff] [blame] | 10397 | 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] | 10398 | } |
| 10399 | } |
| 10400 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 10401 | /* avoid D3 for keeping GPIO up */ |
| 10402 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 10403 | hda_nid_t nid, |
| 10404 | unsigned int power_state) |
| 10405 | { |
| 10406 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 10407 | 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] | 10408 | return AC_PWRST_D0; |
| 10409 | return power_state; |
| 10410 | } |
| 10411 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 10412 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 10413 | const struct hda_fixup *fix, int action) |
| 10414 | { |
| 10415 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 10416 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 10417 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 10418 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 10419 | spec->mute_led_polarity = 1; |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 10420 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 10421 | } |
| 10422 | } |
| 10423 | |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 10424 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
| 10425 | struct hda_jack_callback *jack) |
| 10426 | { |
| 10427 | struct alc_spec *spec = codec->spec; |
| 10428 | int vref; |
| 10429 | msleep(200); |
| 10430 | snd_hda_gen_hp_automute(codec, jack); |
| 10431 | |
| 10432 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 10433 | msleep(100); |
| 10434 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 10435 | vref); |
| 10436 | } |
| 10437 | |
| 10438 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, |
| 10439 | const struct hda_fixup *fix, int action) |
| 10440 | { |
| 10441 | struct alc_spec *spec = codec->spec; |
| 10442 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 10443 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 10444 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; |
| 10445 | } |
| 10446 | } |
| 10447 | |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10448 | static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, |
| 10449 | struct hda_jack_callback *cb) |
| 10450 | { |
| 10451 | /* surround speakers at 0x1b already get muted automatically when |
| 10452 | * headphones are plugged in, but we have to mute/unmute the remaining |
| 10453 | * channels manually: |
| 10454 | * 0x15 - front left/front right |
| 10455 | * 0x18 - front center/ LFE |
| 10456 | */ |
| 10457 | if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { |
| 10458 | snd_hda_set_pin_ctl_cache(codec, 0x15, 0); |
| 10459 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 10460 | } else { |
| 10461 | snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); |
| 10462 | snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); |
| 10463 | } |
| 10464 | } |
| 10465 | |
| 10466 | static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, |
| 10467 | const struct hda_fixup *fix, int action) |
| 10468 | { |
| 10469 | /* Pin 0x1b: shared headphones jack and surround speakers */ |
| 10470 | if (!is_jack_detectable(codec, 0x1b)) |
| 10471 | return; |
| 10472 | |
| 10473 | switch (action) { |
| 10474 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 10475 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 10476 | alc662_aspire_ethos_mute_speakers); |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 10477 | /* subwoofer needs an extra GPIO setting to become audible */ |
| 10478 | alc_setup_gpio(codec, 0x02); |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10479 | break; |
| 10480 | case HDA_FIXUP_ACT_INIT: |
| 10481 | /* Make sure to start in a correct state, i.e. if |
| 10482 | * headphones have been plugged in before powering up the system |
| 10483 | */ |
| 10484 | alc662_aspire_ethos_mute_speakers(codec, NULL); |
| 10485 | break; |
| 10486 | } |
| 10487 | } |
| 10488 | |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 10489 | static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, |
| 10490 | const struct hda_fixup *fix, int action) |
| 10491 | { |
| 10492 | struct alc_spec *spec = codec->spec; |
| 10493 | |
| 10494 | static const struct hda_pintbl pincfgs[] = { |
| 10495 | { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ |
| 10496 | { 0x1b, 0x0181304f }, |
| 10497 | { } |
| 10498 | }; |
| 10499 | |
| 10500 | switch (action) { |
| 10501 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 10502 | spec->gen.mixer_nid = 0; |
| 10503 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 10504 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 10505 | break; |
| 10506 | case HDA_FIXUP_ACT_INIT: |
| 10507 | alc_write_coef_idx(codec, 0x19, 0xa054); |
| 10508 | break; |
| 10509 | } |
| 10510 | } |
| 10511 | |
Kailang Yang | d7f32791 | 2021-11-23 16:32:44 +0800 | [diff] [blame] | 10512 | static void alc897_hp_automute_hook(struct hda_codec *codec, |
| 10513 | struct hda_jack_callback *jack) |
| 10514 | { |
| 10515 | struct alc_spec *spec = codec->spec; |
| 10516 | int vref; |
| 10517 | |
| 10518 | snd_hda_gen_hp_automute(codec, jack); |
| 10519 | vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP; |
| 10520 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 10521 | vref); |
| 10522 | } |
| 10523 | |
| 10524 | static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec, |
| 10525 | const struct hda_fixup *fix, int action) |
| 10526 | { |
| 10527 | struct alc_spec *spec = codec->spec; |
| 10528 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 10529 | spec->gen.hp_automute_hook = alc897_hp_automute_hook; |
| 10530 | } |
| 10531 | } |
| 10532 | |
Takashi Iwai | 6b0f95c | 2020-01-05 15:47:18 +0100 | [diff] [blame] | 10533 | static const struct coef_fw alc668_coefs[] = { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 10534 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 10535 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 10536 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 10537 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 10538 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 10539 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 10540 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 10541 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 10542 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 10543 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 10544 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 10545 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 10546 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 10547 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 10548 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 10549 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 10550 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 10551 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 10552 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 10553 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 10554 | {} |
| 10555 | }; |
| 10556 | |
| 10557 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 10558 | { |
| 10559 | alc_process_coef_fw(codec, alc668_coefs); |
| 10560 | } |
| 10561 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10562 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 10563 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 10564 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10565 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 10566 | ALC272_FIXUP_MARIO, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 10567 | ALC662_FIXUP_CZC_ET26, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 10568 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 10569 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 10570 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10571 | ALC662_FIXUP_ASUS_MODE1, |
| 10572 | ALC662_FIXUP_ASUS_MODE2, |
| 10573 | ALC662_FIXUP_ASUS_MODE3, |
| 10574 | ALC662_FIXUP_ASUS_MODE4, |
| 10575 | ALC662_FIXUP_ASUS_MODE5, |
| 10576 | ALC662_FIXUP_ASUS_MODE6, |
| 10577 | ALC662_FIXUP_ASUS_MODE7, |
| 10578 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 10579 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 10580 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 10581 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 10582 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 10583 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 10584 | ALC662_FIXUP_HEADSET_MODE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 10585 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 10586 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 10587 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 10588 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 10589 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 10590 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 10591 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 10592 | ALC668_FIXUP_DELL_XPS13, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 10593 | ALC662_FIXUP_ASUS_Nx50, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 10594 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 10595 | ALC668_FIXUP_ASUS_Nx51, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 10596 | ALC668_FIXUP_MIC_COEF, |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 10597 | ALC668_FIXUP_ASUS_G751, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 10598 | ALC891_FIXUP_HEADSET_MODE, |
| 10599 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 10600 | ALC662_FIXUP_ACER_VERITON, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 10601 | ALC892_FIXUP_ASROCK_MOBO, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 10602 | ALC662_FIXUP_USI_FUNC, |
| 10603 | ALC662_FIXUP_USI_HEADSET_MODE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 10604 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10605 | ALC669_FIXUP_ACER_ASPIRE_ETHOS, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10606 | ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 10607 | ALC671_FIXUP_HP_HEADSET_MIC2, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 10608 | ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 10609 | ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
Hui Wang | a3fd1a9 | 2021-10-12 19:47:48 +0800 | [diff] [blame] | 10610 | ALC668_FIXUP_ASUS_NO_HEADSET_MIC, |
| 10611 | ALC668_FIXUP_HEADSET_MIC, |
| 10612 | ALC668_FIXUP_MIC_DET_COEF, |
Kailang Yang | d7f32791 | 2021-11-23 16:32:44 +0800 | [diff] [blame] | 10613 | ALC897_FIXUP_LENOVO_HEADSET_MIC, |
| 10614 | ALC897_FIXUP_HEADSET_MIC_PIN, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10615 | }; |
| 10616 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10617 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 10618 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10619 | .type = HDA_FIXUP_PINS, |
| 10620 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 10621 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 10622 | { } |
| 10623 | } |
| 10624 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 10625 | [ALC662_FIXUP_LED_GPIO1] = { |
| 10626 | .type = HDA_FIXUP_FUNC, |
| 10627 | .v.func = alc662_fixup_led_gpio1, |
| 10628 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10629 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10630 | .type = HDA_FIXUP_PINS, |
| 10631 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10632 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 10633 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 10634 | }, |
| 10635 | .chained = true, |
| 10636 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 10637 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 10638 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10639 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 10640 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 10641 | }, |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 10642 | [ALC662_FIXUP_CZC_ET26] = { |
| 10643 | .type = HDA_FIXUP_PINS, |
| 10644 | .v.pins = (const struct hda_pintbl[]) { |
| 10645 | {0x12, 0x403cc000}, |
| 10646 | {0x14, 0x90170110}, /* speaker */ |
| 10647 | {0x15, 0x411111f0}, |
| 10648 | {0x16, 0x411111f0}, |
| 10649 | {0x18, 0x01a19030}, /* mic */ |
| 10650 | {0x19, 0x90a7013f}, /* int-mic */ |
| 10651 | {0x1a, 0x01014020}, |
| 10652 | {0x1b, 0x0121401f}, |
| 10653 | {0x1c, 0x411111f0}, |
| 10654 | {0x1d, 0x411111f0}, |
| 10655 | {0x1e, 0x40478e35}, |
| 10656 | {} |
| 10657 | }, |
| 10658 | .chained = true, |
| 10659 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10660 | }, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 10661 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10662 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 10663 | .v.verbs = (const struct hda_verb[]) { |
| 10664 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 10665 | {} |
| 10666 | } |
| 10667 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 10668 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10669 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 10670 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 10671 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 10672 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10673 | .type = HDA_FIXUP_PINS, |
| 10674 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 10675 | { 0x14, 0x0221201f }, /* HP out */ |
| 10676 | { } |
| 10677 | }, |
| 10678 | .chained = true, |
| 10679 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10680 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10681 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10682 | .type = HDA_FIXUP_PINS, |
| 10683 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10684 | { 0x14, 0x99130110 }, /* speaker */ |
| 10685 | { 0x18, 0x01a19c20 }, /* mic */ |
| 10686 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 10687 | { 0x21, 0x0121401f }, /* HP out */ |
| 10688 | { } |
| 10689 | }, |
| 10690 | .chained = true, |
| 10691 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10692 | }, |
| 10693 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10694 | .type = HDA_FIXUP_PINS, |
| 10695 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 10696 | { 0x14, 0x99130110 }, /* speaker */ |
| 10697 | { 0x18, 0x01a19820 }, /* mic */ |
| 10698 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 10699 | { 0x1b, 0x0121401f }, /* HP out */ |
| 10700 | { } |
| 10701 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10702 | .chained = true, |
| 10703 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10704 | }, |
| 10705 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10706 | .type = HDA_FIXUP_PINS, |
| 10707 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10708 | { 0x14, 0x99130110 }, /* speaker */ |
| 10709 | { 0x15, 0x0121441f }, /* HP */ |
| 10710 | { 0x18, 0x01a19840 }, /* mic */ |
| 10711 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 10712 | { 0x21, 0x01211420 }, /* HP2 */ |
| 10713 | { } |
| 10714 | }, |
| 10715 | .chained = true, |
| 10716 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10717 | }, |
| 10718 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10719 | .type = HDA_FIXUP_PINS, |
| 10720 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10721 | { 0x14, 0x99130110 }, /* speaker */ |
| 10722 | { 0x16, 0x99130111 }, /* speaker */ |
| 10723 | { 0x18, 0x01a19840 }, /* mic */ |
| 10724 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 10725 | { 0x21, 0x0121441f }, /* HP */ |
| 10726 | { } |
| 10727 | }, |
| 10728 | .chained = true, |
| 10729 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10730 | }, |
| 10731 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10732 | .type = HDA_FIXUP_PINS, |
| 10733 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10734 | { 0x14, 0x99130110 }, /* speaker */ |
| 10735 | { 0x15, 0x0121441f }, /* HP */ |
| 10736 | { 0x16, 0x99130111 }, /* speaker */ |
| 10737 | { 0x18, 0x01a19840 }, /* mic */ |
| 10738 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 10739 | { } |
| 10740 | }, |
| 10741 | .chained = true, |
| 10742 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10743 | }, |
| 10744 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10745 | .type = HDA_FIXUP_PINS, |
| 10746 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10747 | { 0x14, 0x99130110 }, /* speaker */ |
| 10748 | { 0x15, 0x01211420 }, /* HP2 */ |
| 10749 | { 0x18, 0x01a19840 }, /* mic */ |
| 10750 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 10751 | { 0x1b, 0x0121441f }, /* HP */ |
| 10752 | { } |
| 10753 | }, |
| 10754 | .chained = true, |
| 10755 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10756 | }, |
| 10757 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10758 | .type = HDA_FIXUP_PINS, |
| 10759 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10760 | { 0x14, 0x99130110 }, /* speaker */ |
| 10761 | { 0x17, 0x99130111 }, /* speaker */ |
| 10762 | { 0x18, 0x01a19840 }, /* mic */ |
| 10763 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 10764 | { 0x1b, 0x01214020 }, /* HP */ |
| 10765 | { 0x21, 0x0121401f }, /* HP */ |
| 10766 | { } |
| 10767 | }, |
| 10768 | .chained = true, |
| 10769 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 10770 | }, |
| 10771 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10772 | .type = HDA_FIXUP_PINS, |
| 10773 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 10774 | { 0x14, 0x99130110 }, /* speaker */ |
| 10775 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 10776 | { 0x15, 0x01214020 }, /* HP */ |
| 10777 | { 0x17, 0x99130111 }, /* speaker */ |
| 10778 | { 0x18, 0x01a19840 }, /* mic */ |
| 10779 | { 0x21, 0x0121401f }, /* HP */ |
| 10780 | { } |
| 10781 | }, |
| 10782 | .chained = true, |
| 10783 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 10784 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 10785 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10786 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 10787 | .v.func = alc_fixup_no_jack_detect, |
| 10788 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 10789 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10790 | .type = HDA_FIXUP_PINS, |
| 10791 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 10792 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 10793 | { } |
| 10794 | } |
| 10795 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 10796 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 10797 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 10798 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 10799 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 10800 | [ALC668_FIXUP_DELL_XPS13] = { |
| 10801 | .type = HDA_FIXUP_FUNC, |
| 10802 | .v.func = alc_fixup_dell_xps13, |
| 10803 | .chained = true, |
| 10804 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 10805 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 10806 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 10807 | .type = HDA_FIXUP_FUNC, |
| 10808 | .v.func = alc_fixup_disable_aamix, |
| 10809 | .chained = true, |
| 10810 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 10811 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 10812 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 10813 | .type = HDA_FIXUP_FUNC, |
| 10814 | .v.func = alc_fixup_auto_mute_via_amp, |
| 10815 | .chained = true, |
| 10816 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 10817 | }, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 10818 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 10819 | .type = HDA_FIXUP_PINS, |
| 10820 | .v.pins = (const struct hda_pintbl[]) { |
| 10821 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 10822 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ |
| 10823 | { } |
| 10824 | }, |
| 10825 | .chained = true, |
| 10826 | .chain_id = ALC662_FIXUP_HEADSET_MODE |
| 10827 | }, |
| 10828 | [ALC662_FIXUP_HEADSET_MODE] = { |
| 10829 | .type = HDA_FIXUP_FUNC, |
| 10830 | .v.func = alc_fixup_headset_mode_alc662, |
| 10831 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 10832 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 10833 | .type = HDA_FIXUP_PINS, |
| 10834 | .v.pins = (const struct hda_pintbl[]) { |
| 10835 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 10836 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 10837 | { } |
| 10838 | }, |
| 10839 | .chained = true, |
| 10840 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 10841 | }, |
| 10842 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 10843 | .type = HDA_FIXUP_FUNC, |
| 10844 | .v.func = alc_fixup_headset_mode_alc668, |
| 10845 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 10846 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 10847 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 10848 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 10849 | .chained = true, |
| 10850 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 10851 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 10852 | [ALC662_FIXUP_BASS_16] = { |
| 10853 | .type = HDA_FIXUP_PINS, |
| 10854 | .v.pins = (const struct hda_pintbl[]) { |
| 10855 | {0x16, 0x80106111}, /* bass speaker */ |
| 10856 | {} |
| 10857 | }, |
| 10858 | .chained = true, |
| 10859 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 10860 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 10861 | [ALC662_FIXUP_BASS_1A] = { |
| 10862 | .type = HDA_FIXUP_PINS, |
| 10863 | .v.pins = (const struct hda_pintbl[]) { |
| 10864 | {0x1a, 0x80106111}, /* bass speaker */ |
| 10865 | {} |
| 10866 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 10867 | .chained = true, |
| 10868 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 10869 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 10870 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 10871 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 10872 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 10873 | }, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 10874 | [ALC662_FIXUP_ASUS_Nx50] = { |
| 10875 | .type = HDA_FIXUP_FUNC, |
| 10876 | .v.func = alc_fixup_auto_mute_via_amp, |
| 10877 | .chained = true, |
| 10878 | .chain_id = ALC662_FIXUP_BASS_1A |
| 10879 | }, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 10880 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
| 10881 | .type = HDA_FIXUP_FUNC, |
| 10882 | .v.func = alc_fixup_headset_mode_alc668, |
| 10883 | .chain_id = ALC662_FIXUP_BASS_CHMAP |
| 10884 | }, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 10885 | [ALC668_FIXUP_ASUS_Nx51] = { |
| 10886 | .type = HDA_FIXUP_PINS, |
| 10887 | .v.pins = (const struct hda_pintbl[]) { |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 10888 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 10889 | { 0x1a, 0x90170151 }, /* bass speaker */ |
| 10890 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 10891 | {} |
| 10892 | }, |
| 10893 | .chained = true, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 10894 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 10895 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 10896 | [ALC668_FIXUP_MIC_COEF] = { |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 10897 | .type = HDA_FIXUP_VERBS, |
| 10898 | .v.verbs = (const struct hda_verb[]) { |
| 10899 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, |
| 10900 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, |
| 10901 | {} |
| 10902 | }, |
| 10903 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 10904 | [ALC668_FIXUP_ASUS_G751] = { |
| 10905 | .type = HDA_FIXUP_PINS, |
| 10906 | .v.pins = (const struct hda_pintbl[]) { |
| 10907 | { 0x16, 0x0421101f }, /* HP */ |
| 10908 | {} |
| 10909 | }, |
| 10910 | .chained = true, |
| 10911 | .chain_id = ALC668_FIXUP_MIC_COEF |
| 10912 | }, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 10913 | [ALC891_FIXUP_HEADSET_MODE] = { |
| 10914 | .type = HDA_FIXUP_FUNC, |
| 10915 | .v.func = alc_fixup_headset_mode, |
| 10916 | }, |
| 10917 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 10918 | .type = HDA_FIXUP_PINS, |
| 10919 | .v.pins = (const struct hda_pintbl[]) { |
| 10920 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 10921 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 10922 | { } |
| 10923 | }, |
| 10924 | .chained = true, |
| 10925 | .chain_id = ALC891_FIXUP_HEADSET_MODE |
| 10926 | }, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 10927 | [ALC662_FIXUP_ACER_VERITON] = { |
| 10928 | .type = HDA_FIXUP_PINS, |
| 10929 | .v.pins = (const struct hda_pintbl[]) { |
| 10930 | { 0x15, 0x50170120 }, /* no internal speaker */ |
| 10931 | { } |
| 10932 | } |
| 10933 | }, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 10934 | [ALC892_FIXUP_ASROCK_MOBO] = { |
| 10935 | .type = HDA_FIXUP_PINS, |
| 10936 | .v.pins = (const struct hda_pintbl[]) { |
| 10937 | { 0x15, 0x40f000f0 }, /* disabled */ |
| 10938 | { 0x16, 0x40f000f0 }, /* disabled */ |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 10939 | { } |
| 10940 | } |
| 10941 | }, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 10942 | [ALC662_FIXUP_USI_FUNC] = { |
| 10943 | .type = HDA_FIXUP_FUNC, |
| 10944 | .v.func = alc662_fixup_usi_headset_mic, |
| 10945 | }, |
| 10946 | [ALC662_FIXUP_USI_HEADSET_MODE] = { |
| 10947 | .type = HDA_FIXUP_PINS, |
| 10948 | .v.pins = (const struct hda_pintbl[]) { |
| 10949 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ |
| 10950 | { 0x18, 0x01a1903d }, |
| 10951 | { } |
| 10952 | }, |
| 10953 | .chained = true, |
| 10954 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 10955 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 10956 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
| 10957 | .type = HDA_FIXUP_FUNC, |
| 10958 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 10959 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10960 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { |
| 10961 | .type = HDA_FIXUP_FUNC, |
| 10962 | .v.func = alc662_fixup_aspire_ethos_hp, |
| 10963 | }, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10964 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { |
| 10965 | .type = HDA_FIXUP_PINS, |
| 10966 | .v.pins = (const struct hda_pintbl[]) { |
| 10967 | { 0x15, 0x92130110 }, /* front speakers */ |
| 10968 | { 0x18, 0x99130111 }, /* center/subwoofer */ |
| 10969 | { 0x1b, 0x11130012 }, /* surround plus jack for HP */ |
| 10970 | { } |
| 10971 | }, |
| 10972 | .chained = true, |
Takashi Iwai | 336820c | 2019-11-28 21:26:30 +0100 | [diff] [blame] | 10973 | .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 10974 | }, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 10975 | [ALC671_FIXUP_HP_HEADSET_MIC2] = { |
| 10976 | .type = HDA_FIXUP_FUNC, |
| 10977 | .v.func = alc671_fixup_hp_headset_mic2, |
| 10978 | }, |
Jian-Hong Pan | d858c70 | 2020-03-17 16:28:07 +0800 | [diff] [blame] | 10979 | [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { |
| 10980 | .type = HDA_FIXUP_PINS, |
| 10981 | .v.pins = (const struct hda_pintbl[]) { |
| 10982 | { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ |
| 10983 | { } |
| 10984 | }, |
| 10985 | .chained = true, |
| 10986 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 10987 | }, |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 10988 | [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { |
| 10989 | .type = HDA_FIXUP_PINS, |
| 10990 | .v.pins = (const struct hda_pintbl[]) { |
| 10991 | { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ |
| 10992 | { 0x1b, 0x0221144f }, |
| 10993 | { } |
| 10994 | }, |
| 10995 | .chained = true, |
| 10996 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 10997 | }, |
Hui Wang | a3fd1a9 | 2021-10-12 19:47:48 +0800 | [diff] [blame] | 10998 | [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = { |
| 10999 | .type = HDA_FIXUP_PINS, |
| 11000 | .v.pins = (const struct hda_pintbl[]) { |
| 11001 | { 0x1b, 0x04a1112c }, |
| 11002 | { } |
| 11003 | }, |
| 11004 | .chained = true, |
| 11005 | .chain_id = ALC668_FIXUP_HEADSET_MIC |
| 11006 | }, |
| 11007 | [ALC668_FIXUP_HEADSET_MIC] = { |
| 11008 | .type = HDA_FIXUP_FUNC, |
| 11009 | .v.func = alc269_fixup_headset_mic, |
| 11010 | .chained = true, |
| 11011 | .chain_id = ALC668_FIXUP_MIC_DET_COEF |
| 11012 | }, |
| 11013 | [ALC668_FIXUP_MIC_DET_COEF] = { |
| 11014 | .type = HDA_FIXUP_VERBS, |
| 11015 | .v.verbs = (const struct hda_verb[]) { |
| 11016 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 }, |
| 11017 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 }, |
| 11018 | {} |
| 11019 | }, |
| 11020 | }, |
Kailang Yang | d7f32791 | 2021-11-23 16:32:44 +0800 | [diff] [blame] | 11021 | [ALC897_FIXUP_LENOVO_HEADSET_MIC] = { |
| 11022 | .type = HDA_FIXUP_FUNC, |
| 11023 | .v.func = alc897_fixup_lenovo_headset_mic, |
| 11024 | }, |
| 11025 | [ALC897_FIXUP_HEADSET_MIC_PIN] = { |
| 11026 | .type = HDA_FIXUP_PINS, |
| 11027 | .v.pins = (const struct hda_pintbl[]) { |
| 11028 | { 0x1a, 0x03a11050 }, |
| 11029 | { } |
| 11030 | }, |
| 11031 | .chained = true, |
| 11032 | .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC |
| 11033 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 11034 | }; |
| 11035 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 11036 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 11037 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 11038 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | 02f6ff9 | 2015-12-07 11:29:31 +0100 | [diff] [blame] | 11039 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 11040 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 11041 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 11042 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 11043 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 11044 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
Takashi Iwai | 9edeb11 | 2021-04-28 13:27:02 +0200 | [diff] [blame] | 11045 | SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), |
Jian-Hong Pan | a124458 | 2020-03-17 16:28:09 +0800 | [diff] [blame] | 11046 | 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] | 11047 | 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] | 11048 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 11049 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 11050 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 11051 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
Niranjan Sivakumar | 467e143 | 2015-09-05 18:20:35 +0200 | [diff] [blame] | 11052 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 11053 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99e | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 11054 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 11055 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 11056 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 11057 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 11058 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
Jeremy Szu | 148ebf54 | 2020-10-08 18:56:44 +0800 | [diff] [blame] | 11059 | SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), |
Kaho Ng | 2da2dc9 | 2016-05-09 00:27:49 +0800 | [diff] [blame] | 11060 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
Bobi Mihalca | 83a9efb | 2016-03-23 13:32:33 +0200 | [diff] [blame] | 11061 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 11062 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 11063 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
Takashi Iwai | 9edeb11 | 2021-04-28 13:27:02 +0200 | [diff] [blame] | 11064 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 11065 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 11066 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 11067 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
| 11068 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
Hui Wang | a3fd1a9 | 2021-10-12 19:47:48 +0800 | [diff] [blame] | 11069 | SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC), |
Takashi Iwai | c7efff9 | 2017-01-04 21:38:16 +0100 | [diff] [blame] | 11070 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 11071 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 11072 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 11073 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 11074 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 11075 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 11076 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 11077 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
Kailang Yang | d7f32791 | 2021-11-23 16:32:44 +0800 | [diff] [blame] | 11078 | SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN), |
| 11079 | SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN), |
| 11080 | SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN), |
| 11081 | SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 11082 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 11083 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 11084 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 11085 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 11086 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
Huacai Chen | f1ec5be | 2020-08-02 17:26:40 +0800 | [diff] [blame] | 11087 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 11088 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 11089 | |
| 11090 | #if 0 |
| 11091 | /* Below is a quirk table taken from the old code. |
| 11092 | * Basically the device should work as is without the fixup table. |
| 11093 | * If BIOS doesn't give a proper info, enable the corresponding |
| 11094 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 11095 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 11096 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 11097 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 11098 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 11099 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 11100 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 11101 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11102 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 11103 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 11104 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 11105 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11106 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 11107 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 11108 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 11109 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 11110 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 11111 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11112 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 11113 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 11114 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11115 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 11116 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 11117 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11118 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 11119 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 11120 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 11121 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11122 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 11123 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 11124 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11125 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 11126 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11127 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11128 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 11129 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 11130 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 11131 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 11132 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 11133 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 11134 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 11135 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 11136 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 11137 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 11138 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 11139 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 11140 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 11141 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 11142 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 11143 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 11144 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 11145 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 11146 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 11147 | {} |
| 11148 | }; |
| 11149 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 11150 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 11151 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
| 11152 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 11153 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 11154 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 11155 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 11156 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 11157 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 11158 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 11159 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 11160 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 11161 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 11162 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 11163 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 11164 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 11165 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 11166 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 11167 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
| 11168 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, |
| 11169 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, |
| 11170 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, |
| 11171 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, |
| 11172 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, |
| 11173 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, |
| 11174 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, |
Takashi Iwai | 40c5167 | 2018-10-07 09:47:39 +0200 | [diff] [blame] | 11175 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 11176 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
| 11177 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, |
| 11178 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, |
| 11179 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, |
| 11180 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 11181 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Sergey Bostandzhyan | 00066e9 | 2019-09-06 11:33:43 +0200 | [diff] [blame] | 11182 | {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 11183 | {} |
| 11184 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 11185 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 11186 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 11187 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 11188 | {0x17, 0x02211010}, |
| 11189 | {0x18, 0x01a19030}, |
| 11190 | {0x1a, 0x01813040}, |
| 11191 | {0x21, 0x01014020}), |
Hui Wang | 4b4e0e3 | 2019-07-16 15:21:34 +0800 | [diff] [blame] | 11192 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 11193 | {0x16, 0x01813030}, |
| 11194 | {0x17, 0x02211010}, |
| 11195 | {0x18, 0x01a19040}, |
| 11196 | {0x21, 0x01014020}), |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 11197 | 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] | 11198 | {0x14, 0x01014010}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 11199 | {0x18, 0x01a19020}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 11200 | {0x1a, 0x0181302f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 11201 | {0x1b, 0x0221401f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 11202 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 11203 | {0x12, 0x99a30130}, |
| 11204 | {0x14, 0x90170110}, |
| 11205 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 11206 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 11207 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 11208 | {0x12, 0x99a30140}, |
| 11209 | {0x14, 0x90170110}, |
| 11210 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 11211 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 11212 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 11213 | {0x12, 0x99a30150}, |
| 11214 | {0x14, 0x90170110}, |
| 11215 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 11216 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 11217 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 11218 | {0x14, 0x90170110}, |
| 11219 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 11220 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 11221 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 11222 | {0x12, 0x90a60130}, |
| 11223 | {0x14, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 11224 | {0x15, 0x0321101f}), |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 11225 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 11226 | {0x14, 0x01014010}, |
| 11227 | {0x17, 0x90170150}, |
Kailang Yang | f2adbae | 2020-02-05 15:40:01 +0800 | [diff] [blame] | 11228 | {0x19, 0x02a11060}, |
Kailang Yang | 5af29028 | 2020-01-17 14:04:01 +0800 | [diff] [blame] | 11229 | {0x1b, 0x01813030}, |
| 11230 | {0x21, 0x02211020}), |
| 11231 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 11232 | {0x14, 0x01014010}, |
| 11233 | {0x18, 0x01a19040}, |
| 11234 | {0x1b, 0x01813030}, |
| 11235 | {0x21, 0x02211020}), |
| 11236 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
| 11237 | {0x14, 0x01014020}, |
| 11238 | {0x17, 0x90170110}, |
| 11239 | {0x18, 0x01a19050}, |
| 11240 | {0x1b, 0x01813040}, |
| 11241 | {0x21, 0x02211030}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 11242 | {} |
| 11243 | }; |
| 11244 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 11245 | /* |
| 11246 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 11247 | static int patch_alc662(struct hda_codec *codec) |
| 11248 | { |
| 11249 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 11250 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 11251 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 11252 | err = alc_alloc_spec(codec, 0x0b); |
| 11253 | if (err < 0) |
| 11254 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 11255 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 11256 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 11257 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 11258 | spec->shutup = alc_eapd_shutup; |
| 11259 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 11260 | /* handle multiple HPs as is */ |
| 11261 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 11262 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 11263 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 11264 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 11265 | switch (codec->core.vendor_id) { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 11266 | case 0x10ec0668: |
| 11267 | spec->init_hook = alc668_restore_default_value; |
| 11268 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 11269 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 11270 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 11271 | alc_pre_init(codec); |
| 11272 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 11273 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 11274 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 0fc1e44 | 2019-08-16 14:27:39 +0800 | [diff] [blame] | 11275 | 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] | 11276 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 11277 | |
| 11278 | alc_auto_parse_customize_define(codec); |
| 11279 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 11280 | if (has_cdefine_beep(codec)) |
| 11281 | spec->gen.beep_nid = 0x01; |
| 11282 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 11283 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 11284 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 11285 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 11286 | err = alc_codec_rename(codec, "ALC272X"); |
| 11287 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 11288 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 11289 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 11290 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 11291 | /* automatic parse from the BIOS config */ |
| 11292 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 11293 | if (err < 0) |
| 11294 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 11295 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 11296 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 11297 | switch (codec->core.vendor_id) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 11298 | case 0x10ec0662: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 11299 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 11300 | break; |
| 11301 | case 0x10ec0272: |
| 11302 | case 0x10ec0663: |
| 11303 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 11304 | case 0x10ec0668: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 11305 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 11306 | break; |
| 11307 | case 0x10ec0273: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 11308 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 11309 | break; |
| 11310 | } |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 11311 | if (err < 0) |
| 11312 | goto error; |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 11313 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 11314 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 11315 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 11316 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 11317 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 11318 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 11319 | error: |
| 11320 | alc_free(codec); |
| 11321 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 11322 | } |
| 11323 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 11324 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11325 | * ALC680 support |
| 11326 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11327 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11328 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 11329 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 11330 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11331 | } |
| 11332 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11333 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11334 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11335 | static int patch_alc680(struct hda_codec *codec) |
| 11336 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11337 | int err; |
| 11338 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 11339 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 11340 | err = alc_alloc_spec(codec, 0); |
| 11341 | if (err < 0) |
| 11342 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 11343 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 11344 | /* automatic parse from the BIOS config */ |
| 11345 | err = alc680_parse_auto_config(codec); |
| 11346 | if (err < 0) { |
| 11347 | alc_free(codec); |
| 11348 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11349 | } |
| 11350 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 11351 | return 0; |
| 11352 | } |
| 11353 | |
| 11354 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11355 | * patch entries |
| 11356 | */ |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11357 | static const struct hda_device_id snd_hda_id_realtek[] = { |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 11358 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11359 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
Hui Wang | 2a36c16 | 2019-09-04 13:53:27 +0800 | [diff] [blame] | 11360 | HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 11361 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
Takashi Iwai | 1948fc0 | 2021-06-18 18:17:20 +0200 | [diff] [blame] | 11362 | HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11363 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
| 11364 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 11365 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11366 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 11367 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
Kailang Yang | 7fbdcd8 | 2020-04-23 14:18:31 +0800 | [diff] [blame] | 11368 | HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11369 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
| 11370 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 11371 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11372 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
| 11373 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), |
| 11374 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), |
| 11375 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), |
| 11376 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), |
| 11377 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), |
| 11378 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 11379 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11380 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
| 11381 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), |
| 11382 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), |
| 11383 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), |
| 11384 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), |
| 11385 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 11386 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11387 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
Kailang Yang | 630e361 | 2020-05-27 14:10:26 +0800 | [diff] [blame] | 11388 | HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11389 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 11390 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11391 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
| 11392 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), |
| 11393 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 11394 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 11395 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11396 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 11397 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 11398 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
Kailang Yang | f077887 | 2019-10-24 15:13:32 +0800 | [diff] [blame] | 11399 | HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11400 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
| 11401 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
| 11402 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
| 11403 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), |
| 11404 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), |
| 11405 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), |
| 11406 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), |
| 11407 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), |
| 11408 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), |
| 11409 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), |
| 11410 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), |
| 11411 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), |
| 11412 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), |
| 11413 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 11414 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
| 11415 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), |
| 11416 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), |
Kailang Yang | 8362953 | 2019-05-02 16:03:26 +0800 | [diff] [blame] | 11417 | HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 11418 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11419 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
| 11420 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), |
| 11421 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), |
| 11422 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), |
| 11423 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), |
| 11424 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), |
| 11425 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), |
| 11426 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), |
| 11427 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), |
| 11428 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), |
| 11429 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), |
Kailang Yang | e5782a5 | 2020-11-27 14:39:23 +0800 | [diff] [blame] | 11430 | HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11431 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
| 11432 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), |
Kailang Yang | 6d9ffcf | 2020-01-03 16:24:06 +0800 | [diff] [blame] | 11433 | HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 11434 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 11435 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11436 | {} /* terminator */ |
| 11437 | }; |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11438 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 11439 | |
| 11440 | MODULE_LICENSE("GPL"); |
| 11441 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 11442 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 11443 | static struct hda_codec_driver realtek_driver = { |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 11444 | .id = snd_hda_id_realtek, |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 11445 | }; |
| 11446 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 11447 | module_hda_codec_driver(realtek_driver); |