Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Universal Interface for Intel High Definition Audio Codec |
| 3 | * |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4 | * HD audio interface patch for Realtek ALC codecs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 6 | * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw> |
| 7 | * PeiSen Hou <pshou@realtek.com.tw> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | * Takashi Iwai <tiwai@suse.de> |
Jonathan Woithe | 409a3e9 | 2012-03-27 13:01:01 +1030 | [diff] [blame] | 9 | * Jonathan Woithe <jwoithe@just42.net> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * |
| 11 | * This driver is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * This driver is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | */ |
| 25 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #include <linux/init.h> |
| 27 | #include <linux/delay.h> |
| 28 | #include <linux/slab.h> |
| 29 | #include <linux/pci.h> |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 30 | #include <linux/dmi.h> |
Paul Gortmaker | da155d5 | 2011-07-15 12:38:28 -0400 | [diff] [blame] | 31 | #include <linux/module.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #include <sound/core.h> |
Kailang Yang | 9ad0e49 | 2010-09-14 23:22:00 +0200 | [diff] [blame] | 33 | #include <sound/jack.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | #include "hda_codec.h" |
| 35 | #include "hda_local.h" |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 36 | #include "hda_auto_parser.h" |
Takashi Iwai | 1835a0f | 2011-10-27 22:12:46 +0200 | [diff] [blame] | 37 | #include "hda_jack.h" |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 38 | #include "hda_generic.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 40 | /* keep halting ALC5505 DSP, for power saving */ |
| 41 | #define HALT_REALTEK_ALC5505 |
| 42 | |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 43 | /* for GPIO Poll */ |
| 44 | #define GPIO_MASK 0x03 |
| 45 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 46 | /* extra amp-initialization sequence types */ |
| 47 | enum { |
| 48 | ALC_INIT_NONE, |
| 49 | ALC_INIT_DEFAULT, |
| 50 | ALC_INIT_GPIO1, |
| 51 | ALC_INIT_GPIO2, |
| 52 | ALC_INIT_GPIO3, |
| 53 | }; |
| 54 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 55 | enum { |
| 56 | ALC_HEADSET_MODE_UNKNOWN, |
| 57 | ALC_HEADSET_MODE_UNPLUGGED, |
| 58 | ALC_HEADSET_MODE_HEADSET, |
| 59 | ALC_HEADSET_MODE_MIC, |
| 60 | ALC_HEADSET_MODE_HEADPHONE, |
| 61 | }; |
| 62 | |
| 63 | enum { |
| 64 | ALC_HEADSET_TYPE_UNKNOWN, |
| 65 | ALC_HEADSET_TYPE_CTIA, |
| 66 | ALC_HEADSET_TYPE_OMTP, |
| 67 | }; |
| 68 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 69 | struct alc_customize_define { |
| 70 | unsigned int sku_cfg; |
| 71 | unsigned char port_connectivity; |
| 72 | unsigned char check_sum; |
| 73 | unsigned char customization; |
| 74 | unsigned char external_amp; |
| 75 | unsigned int enable_pcbeep:1; |
| 76 | unsigned int platform_type:1; |
| 77 | unsigned int swap:1; |
| 78 | unsigned int override:1; |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 79 | unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 80 | }; |
| 81 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | struct alc_spec { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 83 | struct hda_gen_spec gen; /* must be at head */ |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 84 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | /* codec parameterization */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 86 | const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | unsigned int num_mixers; |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 88 | unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 90 | struct alc_customize_define cdefine; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 91 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
| 92 | |
| 93 | /* inverted dmic fix */ |
| 94 | unsigned int inv_dmic_fixup:1; /* has inverted digital-mic workaround */ |
| 95 | unsigned int inv_dmic_muted:1; /* R-ch of inv d-mic is muted? */ |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 96 | hda_nid_t inv_dmic_pin; |
Takashi Iwai | 834be88 | 2006-03-01 14:16:17 +0100 | [diff] [blame] | 97 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 98 | /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */ |
| 99 | int mute_led_polarity; |
| 100 | hda_nid_t mute_led_nid; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 101 | hda_nid_t cap_mute_led_nid; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 102 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 103 | unsigned int gpio_led; /* used for alc269_fixup_hp_gpio_led() */ |
| 104 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 105 | hda_nid_t headset_mic_pin; |
| 106 | hda_nid_t headphone_mic_pin; |
| 107 | int current_headset_mode; |
| 108 | int current_headset_type; |
| 109 | |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 110 | /* hooks */ |
| 111 | void (*init_hook)(struct hda_codec *codec); |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 112 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 113 | void (*power_hook)(struct hda_codec *codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 114 | #endif |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 115 | void (*shutup)(struct hda_codec *codec); |
Takashi Iwai | d922b51 | 2011-04-28 12:18:53 +0200 | [diff] [blame] | 116 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 117 | int init_amp; |
Takashi Iwai | d433a67 | 2010-09-20 15:11:54 +0200 | [diff] [blame] | 118 | int codec_variant; /* flag for other variants */ |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 119 | unsigned int has_alc5505_dsp:1; |
| 120 | unsigned int no_depop_delay:1; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 121 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 122 | /* for PLL fix */ |
| 123 | hda_nid_t pll_nid; |
| 124 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 125 | unsigned int coef0; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 126 | }; |
| 127 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 128 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 129 | * COEF access helper functions |
| 130 | */ |
| 131 | |
| 132 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 133 | unsigned int coef_idx) |
| 134 | { |
| 135 | unsigned int val; |
| 136 | |
| 137 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 138 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 139 | return val; |
| 140 | } |
| 141 | |
| 142 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 143 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 144 | |
| 145 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 146 | unsigned int coef_idx, unsigned int coef_val) |
| 147 | { |
| 148 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 149 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 150 | } |
| 151 | |
| 152 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 153 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 154 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 155 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 156 | unsigned int coef_idx, unsigned int mask, |
| 157 | unsigned int bits_set) |
| 158 | { |
| 159 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 160 | |
| 161 | if (val != -1) |
| 162 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 163 | (val & ~mask) | bits_set); |
| 164 | } |
| 165 | |
| 166 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 167 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 168 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 169 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 170 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 171 | { |
| 172 | struct alc_spec *spec = codec->spec; |
| 173 | |
| 174 | if (!spec->coef0) |
| 175 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 176 | return spec->coef0; |
| 177 | } |
| 178 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 179 | /* coef writes/updates batch */ |
| 180 | struct coef_fw { |
| 181 | unsigned char nid; |
| 182 | unsigned char idx; |
| 183 | unsigned short mask; |
| 184 | unsigned short val; |
| 185 | }; |
| 186 | |
| 187 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 188 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 189 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 190 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 191 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 192 | |
| 193 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 194 | const struct coef_fw *fw) |
| 195 | { |
| 196 | for (; fw->nid; fw++) { |
| 197 | if (fw->mask == (unsigned short)-1) |
| 198 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 199 | else |
| 200 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 201 | fw->mask, fw->val); |
| 202 | } |
| 203 | } |
| 204 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 205 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 206 | * Append the given mixer and verb elements for the later use |
| 207 | * The mixer array is referred in build_controls(), and init_verbs are |
| 208 | * called in init(). |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 209 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 210 | static void add_mixer(struct alc_spec *spec, const struct snd_kcontrol_new *mix) |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 211 | { |
| 212 | if (snd_BUG_ON(spec->num_mixers >= ARRAY_SIZE(spec->mixers))) |
| 213 | return; |
| 214 | spec->mixers[spec->num_mixers++] = mix; |
| 215 | } |
| 216 | |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 217 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 218 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 219 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 220 | /* Enable GPIO mask and set output */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 221 | static const struct hda_verb alc_gpio1_init_verbs[] = { |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 222 | {0x01, AC_VERB_SET_GPIO_MASK, 0x01}, |
| 223 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, |
| 224 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, |
| 225 | { } |
| 226 | }; |
| 227 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 228 | static const struct hda_verb alc_gpio2_init_verbs[] = { |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 229 | {0x01, AC_VERB_SET_GPIO_MASK, 0x02}, |
| 230 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02}, |
| 231 | {0x01, AC_VERB_SET_GPIO_DATA, 0x02}, |
| 232 | { } |
| 233 | }; |
| 234 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 235 | static const struct hda_verb alc_gpio3_init_verbs[] = { |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 236 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
| 237 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03}, |
| 238 | {0x01, AC_VERB_SET_GPIO_DATA, 0x03}, |
| 239 | { } |
| 240 | }; |
| 241 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 242 | /* |
| 243 | * Fix hardware PLL issue |
| 244 | * On some codecs, the analog PLL gating control must be off while |
| 245 | * the default value is 1. |
| 246 | */ |
| 247 | static void alc_fix_pll(struct hda_codec *codec) |
| 248 | { |
| 249 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 250 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 251 | if (spec->pll_nid) |
| 252 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 253 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 257 | unsigned int coef_idx, unsigned int coef_bit) |
| 258 | { |
| 259 | struct alc_spec *spec = codec->spec; |
| 260 | spec->pll_nid = nid; |
| 261 | spec->pll_coef_idx = coef_idx; |
| 262 | spec->pll_coef_bit = coef_bit; |
| 263 | alc_fix_pll(codec); |
| 264 | } |
| 265 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 266 | /* update the master volume per volume-knob's unsol event */ |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 267 | static void alc_update_knob_master(struct hda_codec *codec, struct hda_jack_tbl *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 268 | { |
| 269 | unsigned int val; |
| 270 | struct snd_kcontrol *kctl; |
| 271 | struct snd_ctl_elem_value *uctl; |
| 272 | |
| 273 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 274 | if (!kctl) |
| 275 | return; |
| 276 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 277 | if (!uctl) |
| 278 | return; |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 279 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 280 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 281 | val &= HDA_AMP_VOLMASK; |
| 282 | uctl->value.integer.value[0] = val; |
| 283 | uctl->value.integer.value[1] = val; |
| 284 | kctl->put(kctl, uctl); |
| 285 | kfree(uctl); |
| 286 | } |
| 287 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 288 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 289 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 290 | /* For some reason, the res given from ALC880 is broken. |
| 291 | Here we adjust it properly. */ |
| 292 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 293 | } |
| 294 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 295 | /* additional initialization for ALC888 variants */ |
| 296 | static void alc888_coef_init(struct hda_codec *codec) |
| 297 | { |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 298 | if (alc_get_coef0(codec) == 0x20) |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 299 | /* alc888S-VC */ |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 300 | alc_write_coef_idx(codec, 7, 0x830); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 301 | else |
| 302 | /* alc888-VB */ |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 303 | alc_write_coef_idx(codec, 7, 0x3030); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 304 | } |
| 305 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 306 | /* additional initialization for ALC889 variants */ |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 307 | static void alc889_coef_init(struct hda_codec *codec) |
| 308 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 309 | alc_update_coef_idx(codec, 7, 0, 0x2010); |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 310 | } |
| 311 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 312 | /* turn on/off EAPD control (only if available) */ |
| 313 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 314 | { |
| 315 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 316 | return; |
| 317 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 318 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 319 | on ? 2 : 0); |
| 320 | } |
| 321 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 322 | /* turn on/off EAPD controls of the codec */ |
| 323 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 324 | { |
| 325 | /* We currently only handle front, HP */ |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 326 | static hda_nid_t pins[] = { |
| 327 | 0x0f, 0x10, 0x14, 0x15, 0 |
| 328 | }; |
| 329 | hda_nid_t *p; |
| 330 | for (p = pins; *p; p++) |
| 331 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 332 | } |
| 333 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 334 | /* generic shutup callback; |
| 335 | * just turning off EPAD and a little pause for avoiding pop-noise |
| 336 | */ |
| 337 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 338 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 339 | struct alc_spec *spec = codec->spec; |
| 340 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 341 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 342 | if (!spec->no_depop_delay) |
| 343 | msleep(200); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 344 | snd_hda_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 345 | } |
| 346 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 347 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 348 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 349 | { |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 350 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 351 | switch (type) { |
| 352 | case ALC_INIT_GPIO1: |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 353 | snd_hda_sequence_write(codec, alc_gpio1_init_verbs); |
| 354 | break; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 355 | case ALC_INIT_GPIO2: |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 356 | snd_hda_sequence_write(codec, alc_gpio2_init_verbs); |
| 357 | break; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 358 | case ALC_INIT_GPIO3: |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 359 | snd_hda_sequence_write(codec, alc_gpio3_init_verbs); |
| 360 | break; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 361 | case ALC_INIT_DEFAULT: |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 362 | switch (codec->vendor_id) { |
| 363 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 364 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 365 | break; |
| 366 | case 0x10ec0262: |
| 367 | case 0x10ec0880: |
| 368 | case 0x10ec0882: |
| 369 | case 0x10ec0883: |
| 370 | case 0x10ec0885: |
Takashi Iwai | 4a5a4c5 | 2009-02-06 12:46:59 +0100 | [diff] [blame] | 371 | case 0x10ec0887: |
Takashi Iwai | 20b67dd | 2011-03-23 22:54:32 +0100 | [diff] [blame] | 372 | /*case 0x10ec0889:*/ /* this causes an SPDIF problem */ |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 373 | case 0x10ec0900: |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 374 | alc889_coef_init(codec); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 375 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 376 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 377 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 378 | break; |
Takashi Iwai | 0aea778 | 2010-01-25 15:44:11 +0100 | [diff] [blame] | 379 | #if 0 /* XXX: This may cause the silent output on speaker on some machines */ |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 380 | case 0x10ec0267: |
| 381 | case 0x10ec0268: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 382 | alc_update_coef_idx(codec, 7, 0, 0x3000); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 383 | break; |
Takashi Iwai | 0aea778 | 2010-01-25 15:44:11 +0100 | [diff] [blame] | 384 | #endif /* XXX */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 385 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 386 | break; |
| 387 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 388 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 389 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 390 | |
| 391 | /* |
| 392 | * Realtek SSID verification |
| 393 | */ |
| 394 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 395 | /* Could be any non-zero and even value. When used as fixup, tells |
| 396 | * the driver to ignore any present sku defines. |
| 397 | */ |
| 398 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 399 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 400 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 401 | const struct hda_fixup *fix, int action) |
| 402 | { |
| 403 | struct alc_spec *spec = codec->spec; |
| 404 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 405 | spec->cdefine.fixup = 1; |
| 406 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 407 | } |
| 408 | } |
| 409 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 410 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 411 | const struct hda_fixup *fix, int action) |
| 412 | { |
| 413 | struct alc_spec *spec = codec->spec; |
| 414 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 415 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 416 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 417 | codec->depop_delay = 0; |
| 418 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 419 | } |
| 420 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 421 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 422 | { |
| 423 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 424 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 425 | struct alc_spec *spec = codec->spec; |
| 426 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 427 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 428 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 429 | if (spec->cdefine.fixup) { |
| 430 | ass = spec->cdefine.sku_cfg; |
| 431 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 432 | return -1; |
| 433 | goto do_sku; |
| 434 | } |
| 435 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 436 | if (!codec->bus->pci) |
| 437 | return -1; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 438 | ass = codec->subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 439 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 440 | goto do_sku; |
| 441 | |
| 442 | nid = 0x1d; |
| 443 | if (codec->vendor_id == 0x10ec0260) |
| 444 | nid = 0x17; |
| 445 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 446 | |
| 447 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 448 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
| 449 | codec->chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 450 | return -1; |
| 451 | } |
| 452 | |
| 453 | /* check sum */ |
| 454 | tmp = 0; |
| 455 | for (i = 1; i < 16; i++) { |
| 456 | if ((ass >> i) & 1) |
| 457 | tmp++; |
| 458 | } |
| 459 | if (((ass >> 16) & 0xf) != tmp) |
| 460 | return -1; |
| 461 | |
| 462 | spec->cdefine.port_connectivity = ass >> 30; |
| 463 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 464 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 465 | spec->cdefine.customization = ass >> 8; |
| 466 | do_sku: |
| 467 | spec->cdefine.sku_cfg = ass; |
| 468 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 469 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 470 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 471 | spec->cdefine.override = ass & 0x1; |
| 472 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 473 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 474 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 475 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 476 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 477 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 478 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 479 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 480 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 481 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 482 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 483 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 484 | |
| 485 | return 0; |
| 486 | } |
| 487 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 488 | /* return the position of NID in the list, or -1 if not found */ |
| 489 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 490 | { |
| 491 | int i; |
| 492 | for (i = 0; i < nums; i++) |
| 493 | if (list[i] == nid) |
| 494 | return i; |
| 495 | return -1; |
| 496 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 497 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 498 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 499 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 500 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 501 | } |
| 502 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 503 | /* check subsystem ID and set up device-specific initialization; |
| 504 | * return 1 if initialized, 0 if invalid SSID |
| 505 | */ |
| 506 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 507 | * 31 ~ 16 : Manufacture ID |
| 508 | * 15 ~ 8 : SKU ID |
| 509 | * 7 ~ 0 : Assembly ID |
| 510 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 511 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 512 | 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] | 513 | { |
| 514 | unsigned int ass, tmp, i; |
| 515 | unsigned nid; |
| 516 | struct alc_spec *spec = codec->spec; |
| 517 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 518 | if (spec->cdefine.fixup) { |
| 519 | ass = spec->cdefine.sku_cfg; |
| 520 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 521 | return 0; |
| 522 | goto do_sku; |
| 523 | } |
| 524 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 525 | ass = codec->subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 526 | if (codec->bus->pci && |
| 527 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 528 | goto do_sku; |
| 529 | |
| 530 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 531 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 532 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 533 | * 29~21 : reserve |
| 534 | * 20 : PCBEEP input |
| 535 | * 19~16 : Check sum (15:1) |
| 536 | * 15~1 : Custom |
| 537 | * 0 : override |
| 538 | */ |
| 539 | nid = 0x1d; |
| 540 | if (codec->vendor_id == 0x10ec0260) |
| 541 | nid = 0x17; |
| 542 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 543 | codec_dbg(codec, |
| 544 | "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] | 545 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 546 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 547 | return 0; |
| 548 | if ((ass >> 30) != 1) /* no physical connection */ |
| 549 | return 0; |
| 550 | |
| 551 | /* check sum */ |
| 552 | tmp = 0; |
| 553 | for (i = 1; i < 16; i++) { |
| 554 | if ((ass >> i) & 1) |
| 555 | tmp++; |
| 556 | } |
| 557 | if (((ass >> 16) & 0xf) != tmp) |
| 558 | return 0; |
| 559 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 560 | codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 561 | ass & 0xffff, codec->vendor_id); |
| 562 | /* |
| 563 | * 0 : override |
| 564 | * 1 : Swap Jack |
| 565 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 566 | * 3~5 : External Amplifier control |
| 567 | * 7~6 : Reserved |
| 568 | */ |
| 569 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
| 570 | switch (tmp) { |
| 571 | case 1: |
| 572 | spec->init_amp = ALC_INIT_GPIO1; |
| 573 | break; |
| 574 | case 3: |
| 575 | spec->init_amp = ALC_INIT_GPIO2; |
| 576 | break; |
| 577 | case 7: |
| 578 | spec->init_amp = ALC_INIT_GPIO3; |
| 579 | break; |
| 580 | case 5: |
Takashi Iwai | 5a8cfb4 | 2010-11-26 17:11:18 +0100 | [diff] [blame] | 581 | default: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 582 | spec->init_amp = ALC_INIT_DEFAULT; |
| 583 | break; |
| 584 | } |
| 585 | |
| 586 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 587 | * when the external headphone out jack is plugged" |
| 588 | */ |
| 589 | if (!(ass & 0x8000)) |
| 590 | return 1; |
| 591 | /* |
| 592 | * 10~8 : Jack location |
| 593 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 594 | * 14~13: Resvered |
| 595 | * 15 : 1 --> enable the function "Mute internal speaker |
| 596 | * when the external headphone out jack is plugged" |
| 597 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 598 | if (!spec->gen.autocfg.hp_pins[0] && |
| 599 | !(spec->gen.autocfg.line_out_pins[0] && |
| 600 | spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 601 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 602 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 603 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 604 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 605 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 606 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 607 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 608 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 609 | return 1; |
| 610 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 611 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 612 | /* Check the validity of ALC subsystem-id |
| 613 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 614 | 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] | 615 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 616 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 617 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 618 | codec_dbg(codec, |
| 619 | "realtek: Enable default setup for auto mode as fallback\n"); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 620 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 621 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 622 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 623 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 624 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 625 | */ |
| 626 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 627 | static hda_nid_t get_adc_nid(struct hda_codec *codec, int adc_idx, int imux_idx) |
Takashi Iwai | 757899a | 2010-07-30 10:48:14 +0200 | [diff] [blame] | 628 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 629 | struct hda_gen_spec *spec = codec->spec; |
| 630 | if (spec->dyn_adc_switch) |
| 631 | adc_idx = spec->dyn_adc_idx[imux_idx]; |
| 632 | return spec->adc_nids[adc_idx]; |
Takashi Iwai | f9e336f | 2008-10-31 16:37:07 +0100 | [diff] [blame] | 633 | } |
| 634 | |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 635 | static void alc_inv_dmic_sync_adc(struct hda_codec *codec, int adc_idx) |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 636 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 637 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 638 | struct hda_input_mux *imux = &spec->gen.input_mux; |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 639 | struct nid_path *path; |
| 640 | hda_nid_t nid; |
| 641 | int i, dir, parm; |
| 642 | unsigned int val; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 643 | |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 644 | for (i = 0; i < imux->num_items; i++) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 645 | if (spec->gen.imux_pins[i] == spec->inv_dmic_pin) |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 646 | break; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 647 | } |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 648 | if (i >= imux->num_items) |
| 649 | return; |
Takashi Iwai | a23b688 | 2009-03-23 15:21:36 +0100 | [diff] [blame] | 650 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 651 | path = snd_hda_get_nid_path(codec, spec->inv_dmic_pin, |
| 652 | get_adc_nid(codec, adc_idx, i)); |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 653 | val = path->ctls[NID_PATH_MUTE_CTL]; |
| 654 | if (!val) |
| 655 | return; |
| 656 | nid = get_amp_nid_(val); |
| 657 | dir = get_amp_direction_(val); |
| 658 | parm = AC_AMP_SET_RIGHT | |
| 659 | (dir == HDA_OUTPUT ? AC_AMP_SET_OUTPUT : AC_AMP_SET_INPUT); |
Takashi Iwai | a23b688 | 2009-03-23 15:21:36 +0100 | [diff] [blame] | 660 | |
Takashi Iwai | c4f3ebe | 2012-12-20 11:33:20 +0100 | [diff] [blame] | 661 | /* flush all cached amps at first */ |
Takashi Iwai | dc870f3 | 2013-01-22 15:24:30 +0100 | [diff] [blame] | 662 | snd_hda_codec_flush_cache(codec); |
Takashi Iwai | c4f3ebe | 2012-12-20 11:33:20 +0100 | [diff] [blame] | 663 | |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 664 | /* we care only right channel */ |
| 665 | val = snd_hda_codec_amp_read(codec, nid, 1, dir, 0); |
| 666 | if (val & 0x80) /* if already muted, we don't need to touch */ |
| 667 | return; |
| 668 | val |= 0x80; |
| 669 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
| 670 | parm | val); |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 671 | } |
| 672 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 673 | /* |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 674 | * Inverted digital-mic handling |
| 675 | * |
| 676 | * First off, it's a bit tricky. The "Inverted Internal Mic Capture Switch" |
| 677 | * gives the additional mute only to the right channel of the digital mic |
| 678 | * capture stream. This is a workaround for avoiding the almost silence |
| 679 | * by summing the stereo stream from some (known to be ForteMedia) |
| 680 | * digital mic unit. |
| 681 | * |
| 682 | * The logic is to call alc_inv_dmic_sync() after each action (possibly) |
| 683 | * modifying ADC amp. When the mute flag is set, it mutes the R-channel |
| 684 | * without caching so that the cache can still keep the original value. |
| 685 | * The cached value is then restored when the flag is set off or any other |
| 686 | * than d-mic is used as the current input source. |
| 687 | */ |
| 688 | static void alc_inv_dmic_sync(struct hda_codec *codec, bool force) |
| 689 | { |
| 690 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 691 | int src, nums; |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 692 | |
| 693 | if (!spec->inv_dmic_fixup) |
| 694 | return; |
| 695 | if (!spec->inv_dmic_muted && !force) |
| 696 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 697 | nums = spec->gen.dyn_adc_switch ? 1 : spec->gen.num_adc_nids; |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 698 | for (src = 0; src < nums; src++) { |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 699 | bool dmic_fixup = false; |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 700 | |
| 701 | if (spec->inv_dmic_muted && |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 702 | spec->gen.imux_pins[spec->gen.cur_mux[src]] == spec->inv_dmic_pin) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 703 | dmic_fixup = true; |
| 704 | if (!dmic_fixup && !force) |
| 705 | continue; |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 706 | alc_inv_dmic_sync_adc(codec, src); |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 707 | } |
| 708 | } |
| 709 | |
Takashi Iwai | a90229e | 2013-01-18 14:10:00 +0100 | [diff] [blame] | 710 | static void alc_inv_dmic_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 711 | struct snd_kcontrol *kcontrol, |
| 712 | struct snd_ctl_elem_value *ucontrol) |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 713 | { |
| 714 | alc_inv_dmic_sync(codec, false); |
| 715 | } |
| 716 | |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 717 | static int alc_inv_dmic_sw_get(struct snd_kcontrol *kcontrol, |
| 718 | struct snd_ctl_elem_value *ucontrol) |
| 719 | { |
| 720 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 721 | struct alc_spec *spec = codec->spec; |
| 722 | |
| 723 | ucontrol->value.integer.value[0] = !spec->inv_dmic_muted; |
| 724 | return 0; |
| 725 | } |
| 726 | |
| 727 | static int alc_inv_dmic_sw_put(struct snd_kcontrol *kcontrol, |
| 728 | struct snd_ctl_elem_value *ucontrol) |
| 729 | { |
| 730 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 731 | struct alc_spec *spec = codec->spec; |
| 732 | unsigned int val = !ucontrol->value.integer.value[0]; |
| 733 | |
| 734 | if (val == spec->inv_dmic_muted) |
| 735 | return 0; |
| 736 | spec->inv_dmic_muted = val; |
| 737 | alc_inv_dmic_sync(codec, true); |
| 738 | return 0; |
| 739 | } |
| 740 | |
| 741 | static const struct snd_kcontrol_new alc_inv_dmic_sw = { |
| 742 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
Takashi Iwai | bc54976 | 2012-12-18 15:35:11 +0100 | [diff] [blame] | 743 | .name = "Inverted Internal Mic Capture Switch", |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 744 | .info = snd_ctl_boolean_mono_info, |
| 745 | .get = alc_inv_dmic_sw_get, |
| 746 | .put = alc_inv_dmic_sw_put, |
| 747 | }; |
| 748 | |
| 749 | static int alc_add_inv_dmic_mixer(struct hda_codec *codec, hda_nid_t nid) |
| 750 | { |
| 751 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 752 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 753 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &alc_inv_dmic_sw)) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 754 | return -ENOMEM; |
| 755 | spec->inv_dmic_fixup = 1; |
| 756 | spec->inv_dmic_muted = 0; |
| 757 | spec->inv_dmic_pin = nid; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 758 | spec->gen.cap_sync_hook = alc_inv_dmic_hook; |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 759 | return 0; |
| 760 | } |
| 761 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 762 | /* typically the digital mic is put at node 0x12 */ |
| 763 | static void alc_fixup_inv_dmic_0x12(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 764 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 765 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 766 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 767 | alc_add_inv_dmic_mixer(codec, 0x12); |
| 768 | } |
| 769 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 770 | |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 771 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 772 | /* additional beep mixers; the actual parameters are overwritten at build */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 773 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 774 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
Jaroslav Kysela | 123c07a | 2009-10-21 14:48:23 +0200 | [diff] [blame] | 775 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 776 | { } /* end */ |
| 777 | }; |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 778 | #endif |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 779 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 780 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 781 | { |
| 782 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 783 | int i, err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 784 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 785 | err = snd_hda_gen_build_controls(codec); |
| 786 | if (err < 0) |
| 787 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 788 | |
| 789 | for (i = 0; i < spec->num_mixers; i++) { |
| 790 | err = snd_hda_add_new_ctls(codec, spec->mixers[i]); |
| 791 | if (err < 0) |
| 792 | return err; |
| 793 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 794 | |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 795 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 796 | /* create beep controls if needed */ |
| 797 | if (spec->beep_amp) { |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 798 | const struct snd_kcontrol_new *knew; |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 799 | for (knew = alc_beep_mixer; knew->name; knew++) { |
| 800 | struct snd_kcontrol *kctl; |
| 801 | kctl = snd_ctl_new1(knew, codec); |
| 802 | if (!kctl) |
| 803 | return -ENOMEM; |
| 804 | kctl->private_value = spec->beep_amp; |
Jaroslav Kysela | 5e26dfd | 2009-12-10 13:57:01 +0100 | [diff] [blame] | 805 | err = snd_hda_ctl_add(codec, 0, kctl); |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 806 | if (err < 0) |
| 807 | return err; |
| 808 | } |
| 809 | } |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 810 | #endif |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 811 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 812 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 813 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 814 | } |
| 815 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 816 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 817 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 818 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 819 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 820 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 821 | static int alc_init(struct hda_codec *codec) |
| 822 | { |
| 823 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 824 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 825 | if (spec->init_hook) |
| 826 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 827 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 828 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 829 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 830 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 831 | snd_hda_gen_init(codec); |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 832 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 833 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 834 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 835 | return 0; |
| 836 | } |
| 837 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 838 | static inline void alc_shutup(struct hda_codec *codec) |
| 839 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 840 | struct alc_spec *spec = codec->spec; |
| 841 | |
| 842 | if (spec && spec->shutup) |
| 843 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 844 | else |
| 845 | snd_hda_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 846 | } |
| 847 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 848 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 849 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 850 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 851 | static void alc_power_eapd(struct hda_codec *codec) |
| 852 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 853 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 854 | } |
| 855 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 856 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 857 | { |
| 858 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 859 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 860 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 861 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 862 | return 0; |
| 863 | } |
| 864 | #endif |
| 865 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 866 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 867 | static int alc_resume(struct hda_codec *codec) |
| 868 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 869 | struct alc_spec *spec = codec->spec; |
| 870 | |
| 871 | if (!spec->no_depop_delay) |
| 872 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 873 | codec->patch_ops.init(codec); |
| 874 | snd_hda_codec_resume_amp(codec); |
| 875 | snd_hda_codec_resume_cache(codec); |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 876 | alc_inv_dmic_sync(codec, true); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 877 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 878 | return 0; |
| 879 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 880 | #endif |
| 881 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 882 | /* |
| 883 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 884 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 885 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 886 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 887 | .init = alc_init, |
| 888 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 889 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 890 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 891 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 892 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 893 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 894 | #endif |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 895 | .reboot_notify = alc_shutup, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 896 | }; |
| 897 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 898 | |
Kailang Yang | c027ddc | 2010-03-19 11:33:06 +0100 | [diff] [blame] | 899 | /* replace the codec chip_name with the given string */ |
| 900 | static int alc_codec_rename(struct hda_codec *codec, const char *name) |
| 901 | { |
| 902 | kfree(codec->chip_name); |
| 903 | codec->chip_name = kstrdup(name, GFP_KERNEL); |
| 904 | if (!codec->chip_name) { |
| 905 | alc_free(codec); |
| 906 | return -ENOMEM; |
| 907 | } |
| 908 | return 0; |
| 909 | } |
| 910 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 911 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 912 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 913 | */ |
| 914 | struct alc_codec_rename_table { |
| 915 | unsigned int vendor_id; |
| 916 | unsigned short coef_mask; |
| 917 | unsigned short coef_bits; |
| 918 | const char *name; |
| 919 | }; |
| 920 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 921 | struct alc_codec_rename_pci_table { |
| 922 | unsigned int codec_vendor_id; |
| 923 | unsigned short pci_subvendor; |
| 924 | unsigned short pci_subdevice; |
| 925 | const char *name; |
| 926 | }; |
| 927 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 928 | static struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 929 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 930 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 931 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 932 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 933 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 934 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 935 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 936 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 937 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 938 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 939 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 940 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 941 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 942 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 943 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 944 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 945 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 946 | { } /* terminator */ |
| 947 | }; |
| 948 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 949 | static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
| 950 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 951 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 952 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 953 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 954 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 955 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 956 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 957 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 958 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 959 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
| 960 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 961 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 962 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 963 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 964 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 965 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 966 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 967 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 968 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 969 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 970 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 971 | { } /* terminator */ |
| 972 | }; |
| 973 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 974 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 975 | { |
| 976 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 977 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 978 | |
| 979 | for (p = rename_tbl; p->vendor_id; p++) { |
| 980 | if (p->vendor_id != codec->vendor_id) |
| 981 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 982 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 983 | return alc_codec_rename(codec, p->name); |
| 984 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 985 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 986 | if (!codec->bus->pci) |
| 987 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 988 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
| 989 | if (q->codec_vendor_id != codec->vendor_id) |
| 990 | continue; |
| 991 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 992 | continue; |
| 993 | if (!q->pci_subdevice || |
| 994 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 995 | return alc_codec_rename(codec, q->name); |
| 996 | } |
| 997 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 998 | return 0; |
| 999 | } |
| 1000 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 1001 | |
| 1002 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1003 | * Digital-beep handlers |
| 1004 | */ |
| 1005 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
| 1006 | #define set_beep_amp(spec, nid, idx, dir) \ |
| 1007 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
| 1008 | |
| 1009 | static const struct snd_pci_quirk beep_white_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1010 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1011 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1012 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1013 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1014 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1015 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1016 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1017 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1018 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
| 1019 | {} |
| 1020 | }; |
| 1021 | |
| 1022 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1023 | { |
| 1024 | struct alc_spec *spec = codec->spec; |
| 1025 | const struct snd_pci_quirk *q; |
| 1026 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); |
| 1027 | if (q) |
| 1028 | return q->value; |
| 1029 | return spec->cdefine.enable_pcbeep; |
| 1030 | } |
| 1031 | #else |
| 1032 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ |
| 1033 | #define has_cdefine_beep(codec) 0 |
| 1034 | #endif |
| 1035 | |
| 1036 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1037 | /* return 1 if successful, 0 if the proper config is not found, |
| 1038 | * or a negative error code |
| 1039 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1040 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1041 | const hda_nid_t *ignore_nids, |
| 1042 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1043 | { |
| 1044 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1045 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1046 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1047 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1048 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1049 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1050 | if (err < 0) |
| 1051 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1052 | |
| 1053 | if (ssid_nids) |
| 1054 | alc_ssid_check(codec, ssid_nids); |
| 1055 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1056 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1057 | if (err < 0) |
| 1058 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1059 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1060 | return 1; |
| 1061 | } |
| 1062 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1063 | /* common preparation job for alc_spec */ |
| 1064 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1065 | { |
| 1066 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1067 | int err; |
| 1068 | |
| 1069 | if (!spec) |
| 1070 | return -ENOMEM; |
| 1071 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1072 | snd_hda_gen_spec_init(&spec->gen); |
| 1073 | spec->gen.mixer_nid = mixer_nid; |
| 1074 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1075 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1076 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1077 | codec->spdif_status_reset = 1; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1078 | |
| 1079 | err = alc_codec_rename_from_preset(codec); |
| 1080 | if (err < 0) { |
| 1081 | kfree(spec); |
| 1082 | return err; |
| 1083 | } |
| 1084 | return 0; |
| 1085 | } |
| 1086 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1087 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1088 | { |
| 1089 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1090 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1091 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1092 | } |
| 1093 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1094 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1095 | * ALC880 fix-ups |
| 1096 | */ |
| 1097 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1098 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1099 | ALC880_FIXUP_GPIO2, |
| 1100 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1101 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1102 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1103 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1104 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1105 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1106 | ALC880_FIXUP_VOL_KNOB, |
| 1107 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1108 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1109 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1110 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1111 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1112 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1113 | ALC880_FIXUP_3ST_BASE, |
| 1114 | ALC880_FIXUP_3ST, |
| 1115 | ALC880_FIXUP_3ST_DIG, |
| 1116 | ALC880_FIXUP_5ST_BASE, |
| 1117 | ALC880_FIXUP_5ST, |
| 1118 | ALC880_FIXUP_5ST_DIG, |
| 1119 | ALC880_FIXUP_6ST_BASE, |
| 1120 | ALC880_FIXUP_6ST, |
| 1121 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1122 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1123 | }; |
| 1124 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1125 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1126 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1127 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1128 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1129 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame^] | 1130 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1131 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1132 | } |
| 1133 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1134 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1135 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1136 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1137 | .v.verbs = alc_gpio1_init_verbs, |
| 1138 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1139 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1140 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1141 | .v.verbs = alc_gpio2_init_verbs, |
| 1142 | }, |
| 1143 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1144 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1145 | .v.verbs = (const struct hda_verb[]) { |
| 1146 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1147 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1148 | { } |
| 1149 | }, |
| 1150 | .chained = true, |
| 1151 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1152 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1153 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1154 | .type = HDA_FIXUP_PINS, |
| 1155 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1156 | /* disable bogus unused pins */ |
| 1157 | { 0x16, 0x411111f0 }, |
| 1158 | { 0x18, 0x411111f0 }, |
| 1159 | { 0x1a, 0x411111f0 }, |
| 1160 | { } |
| 1161 | } |
| 1162 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1163 | [ALC880_FIXUP_LG_LW25] = { |
| 1164 | .type = HDA_FIXUP_PINS, |
| 1165 | .v.pins = (const struct hda_pintbl[]) { |
| 1166 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1167 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1168 | { } |
| 1169 | } |
| 1170 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1171 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1172 | .type = HDA_FIXUP_PINS, |
| 1173 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1174 | /* disable bogus unused pins */ |
| 1175 | { 0x17, 0x411111f0 }, |
| 1176 | { } |
| 1177 | }, |
| 1178 | .chained = true, |
| 1179 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1180 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1181 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1182 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1183 | .v.verbs = (const struct hda_verb[]) { |
| 1184 | /* change to EAPD mode */ |
| 1185 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1186 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1187 | {} |
| 1188 | }, |
| 1189 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1190 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1191 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1192 | .v.verbs = (const struct hda_verb[]) { |
| 1193 | /* change to EAPD mode */ |
| 1194 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1195 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1196 | {} |
| 1197 | }, |
| 1198 | .chained = true, |
| 1199 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1200 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1201 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1202 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1203 | .v.func = alc880_fixup_vol_knob, |
| 1204 | }, |
| 1205 | [ALC880_FIXUP_FUJITSU] = { |
| 1206 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1207 | .type = HDA_FIXUP_PINS, |
| 1208 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1209 | { 0x14, 0x0121411f }, /* HP */ |
| 1210 | { 0x15, 0x99030120 }, /* speaker */ |
| 1211 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1212 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1213 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1214 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1215 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1216 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1217 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1218 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1219 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1220 | { } |
| 1221 | }, |
| 1222 | .chained = true, |
| 1223 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1224 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1225 | [ALC880_FIXUP_F1734] = { |
| 1226 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1227 | .type = HDA_FIXUP_PINS, |
| 1228 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1229 | { 0x14, 0x0121411f }, /* HP */ |
| 1230 | { 0x15, 0x99030120 }, /* speaker */ |
| 1231 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1232 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1233 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1234 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1235 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1236 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1237 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1238 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1239 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1240 | { } |
| 1241 | }, |
| 1242 | .chained = true, |
| 1243 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1244 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1245 | [ALC880_FIXUP_UNIWILL] = { |
| 1246 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1247 | .type = HDA_FIXUP_PINS, |
| 1248 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1249 | { 0x14, 0x0121411f }, /* HP */ |
| 1250 | { 0x15, 0x99030120 }, /* speaker */ |
| 1251 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1252 | { } |
| 1253 | }, |
| 1254 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1255 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1256 | .type = HDA_FIXUP_PINS, |
| 1257 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1258 | /* disable bogus unused pins */ |
| 1259 | { 0x17, 0x411111f0 }, |
| 1260 | { 0x19, 0x411111f0 }, |
| 1261 | { 0x1b, 0x411111f0 }, |
| 1262 | { 0x1f, 0x411111f0 }, |
| 1263 | { } |
| 1264 | } |
| 1265 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1266 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1267 | .type = HDA_FIXUP_PINS, |
| 1268 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1269 | /* set up the whole pins as BIOS is utterly broken */ |
| 1270 | { 0x14, 0x99030120 }, /* speaker */ |
| 1271 | { 0x15, 0x0121411f }, /* HP */ |
| 1272 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1273 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1274 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1275 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1276 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1277 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1278 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1279 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1280 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1281 | { } |
| 1282 | } |
| 1283 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1284 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1285 | .type = HDA_FIXUP_PINS, |
| 1286 | .v.pins = (const struct hda_pintbl[]) { |
| 1287 | /* set up the whole pins as BIOS is utterly broken */ |
| 1288 | { 0x14, 0x0121411f }, /* HP */ |
| 1289 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1290 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1291 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1292 | { 0x18, 0x90a60160 }, /* mic */ |
| 1293 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1294 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1295 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1296 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1297 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1298 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1299 | { } |
| 1300 | }, |
| 1301 | .chained = true, |
| 1302 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1303 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1304 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1305 | .type = HDA_FIXUP_PINS, |
| 1306 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1307 | { 0x14, 0x01014010 }, /* line-out */ |
| 1308 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1309 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1310 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1311 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1312 | { 0x19, 0x0121411f }, /* HP */ |
| 1313 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1314 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1315 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1316 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1317 | /* 0x1e is filled in below */ |
| 1318 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1319 | { } |
| 1320 | } |
| 1321 | }, |
| 1322 | [ALC880_FIXUP_3ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1323 | .type = HDA_FIXUP_PINS, |
| 1324 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1325 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1326 | { } |
| 1327 | }, |
| 1328 | .chained = true, |
| 1329 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1330 | }, |
| 1331 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1332 | .type = HDA_FIXUP_PINS, |
| 1333 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1334 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1335 | { } |
| 1336 | }, |
| 1337 | .chained = true, |
| 1338 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1339 | }, |
| 1340 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1341 | .type = HDA_FIXUP_PINS, |
| 1342 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1343 | { 0x14, 0x01014010 }, /* front */ |
| 1344 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1345 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1346 | { 0x17, 0x01016412 }, /* surr */ |
| 1347 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1348 | { 0x19, 0x0121411f }, /* HP */ |
| 1349 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1350 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1351 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1352 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1353 | /* 0x1e is filled in below */ |
| 1354 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1355 | { } |
| 1356 | } |
| 1357 | }, |
| 1358 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1359 | .type = HDA_FIXUP_PINS, |
| 1360 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1361 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1362 | { } |
| 1363 | }, |
| 1364 | .chained = true, |
| 1365 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1366 | }, |
| 1367 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1368 | .type = HDA_FIXUP_PINS, |
| 1369 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1370 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1371 | { } |
| 1372 | }, |
| 1373 | .chained = true, |
| 1374 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1375 | }, |
| 1376 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1377 | .type = HDA_FIXUP_PINS, |
| 1378 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1379 | { 0x14, 0x01014010 }, /* front */ |
| 1380 | { 0x15, 0x01016412 }, /* surr */ |
| 1381 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1382 | { 0x17, 0x01012414 }, /* side */ |
| 1383 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1384 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1385 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1386 | { 0x1b, 0x0121411f }, /* HP */ |
| 1387 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1388 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1389 | /* 0x1e is filled in below */ |
| 1390 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1391 | { } |
| 1392 | } |
| 1393 | }, |
| 1394 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1395 | .type = HDA_FIXUP_PINS, |
| 1396 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1397 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1398 | { } |
| 1399 | }, |
| 1400 | .chained = true, |
| 1401 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1402 | }, |
| 1403 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1404 | .type = HDA_FIXUP_PINS, |
| 1405 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1406 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1407 | { } |
| 1408 | }, |
| 1409 | .chained = true, |
| 1410 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1411 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1412 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1413 | .type = HDA_FIXUP_PINS, |
| 1414 | .v.pins = (const struct hda_pintbl[]) { |
| 1415 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1416 | { } |
| 1417 | }, |
| 1418 | .chained_before = true, |
| 1419 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1420 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1421 | }; |
| 1422 | |
| 1423 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1424 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1425 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1426 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1427 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1428 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1429 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1430 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1431 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1432 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1433 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1434 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1435 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1436 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1437 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1438 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1439 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1440 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1441 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1442 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1443 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1444 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1445 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1446 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1447 | |
| 1448 | /* Below is the copied entries from alc880_quirks.c. |
| 1449 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1450 | * on these machines, thus they are kept to be compatible with |
| 1451 | * the old static quirks. Once when it's confirmed to work without |
| 1452 | * these overrides, it'd be better to remove. |
| 1453 | */ |
| 1454 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1455 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1456 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1457 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1458 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1459 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1460 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1461 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1462 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1463 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1464 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1465 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1466 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1467 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1468 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1469 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1470 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1471 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1472 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1473 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1474 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1475 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1476 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1477 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1478 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1479 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1480 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1481 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1482 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1483 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1484 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1485 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1486 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1487 | /* default Intel */ |
| 1488 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1489 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1490 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1491 | {} |
| 1492 | }; |
| 1493 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1494 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1495 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1496 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1497 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1498 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1499 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1500 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1501 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1502 | {} |
| 1503 | }; |
| 1504 | |
| 1505 | |
| 1506 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1507 | * OK, here we have finally the patch for ALC880 |
| 1508 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1509 | static int patch_alc880(struct hda_codec *codec) |
| 1510 | { |
| 1511 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1512 | int err; |
| 1513 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1514 | err = alc_alloc_spec(codec, 0x0b); |
| 1515 | if (err < 0) |
| 1516 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1517 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1518 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1519 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1520 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1521 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1522 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1523 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1524 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1525 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1526 | /* automatic parse from the BIOS config */ |
| 1527 | err = alc880_parse_auto_config(codec); |
| 1528 | if (err < 0) |
| 1529 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1530 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1531 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1532 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1533 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1534 | codec->patch_ops = alc_patch_ops; |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 1535 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1536 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1537 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1538 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1539 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1540 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1541 | |
| 1542 | error: |
| 1543 | alc_free(codec); |
| 1544 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1545 | } |
| 1546 | |
| 1547 | |
| 1548 | /* |
| 1549 | * ALC260 support |
| 1550 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1551 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1552 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1553 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1554 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1555 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1556 | } |
| 1557 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1558 | /* |
| 1559 | * Pin config fixes |
| 1560 | */ |
| 1561 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1562 | ALC260_FIXUP_HP_DC5750, |
| 1563 | ALC260_FIXUP_HP_PIN_0F, |
| 1564 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1565 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1566 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1567 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1568 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1569 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1570 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1571 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1572 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1573 | }; |
| 1574 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1575 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1576 | { |
| 1577 | struct alc_spec *spec = codec->spec; |
| 1578 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1579 | spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1580 | } |
| 1581 | |
| 1582 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1583 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1584 | { |
| 1585 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1586 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1587 | /* although the machine has only one output pin, we need to |
| 1588 | * toggle GPIO1 according to the jack state |
| 1589 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1590 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1591 | spec->gen.detect_hp = 1; |
| 1592 | spec->gen.automute_speaker = 1; |
| 1593 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame^] | 1594 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1595 | snd_hda_gen_hp_automute); |
Takashi Iwai | c9ce6b2 | 2012-12-18 18:12:44 +0100 | [diff] [blame] | 1596 | snd_hda_add_verbs(codec, alc_gpio1_init_verbs); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1597 | } |
| 1598 | } |
| 1599 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1600 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1601 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1602 | { |
| 1603 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1604 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1605 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1606 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1607 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1608 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1609 | /* disable bogus I/O pins */ |
| 1610 | { 0x10, 0x411111f0 }, |
| 1611 | { 0x11, 0x411111f0 }, |
| 1612 | { 0x14, 0x411111f0 }, |
| 1613 | { 0x15, 0x411111f0 }, |
| 1614 | { 0x16, 0x411111f0 }, |
| 1615 | { 0x17, 0x411111f0 }, |
| 1616 | { 0x19, 0x411111f0 }, |
| 1617 | { } |
| 1618 | }; |
| 1619 | |
| 1620 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1621 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1622 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1623 | break; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1624 | case HDA_FIXUP_ACT_PROBE: |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1625 | spec->init_amp = ALC_INIT_NONE; |
| 1626 | break; |
| 1627 | } |
| 1628 | } |
| 1629 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1630 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1631 | const struct hda_fixup *fix, int action) |
| 1632 | { |
| 1633 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1634 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1635 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1636 | } |
| 1637 | |
| 1638 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1639 | const struct hda_fixup *fix, int action) |
| 1640 | { |
| 1641 | struct alc_spec *spec = codec->spec; |
| 1642 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1643 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1644 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1645 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1646 | } |
| 1647 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1648 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1649 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1650 | .type = HDA_FIXUP_PINS, |
| 1651 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1652 | { 0x11, 0x90130110 }, /* speaker */ |
| 1653 | { } |
| 1654 | } |
| 1655 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1656 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1657 | .type = HDA_FIXUP_PINS, |
| 1658 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1659 | { 0x0f, 0x01214000 }, /* HP */ |
| 1660 | { } |
| 1661 | } |
| 1662 | }, |
| 1663 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1664 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1665 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1666 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1667 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1668 | { } |
| 1669 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1670 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1671 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1672 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1673 | .v.verbs = alc_gpio1_init_verbs, |
| 1674 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1675 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1676 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1677 | .v.func = alc260_fixup_gpio1_toggle, |
| 1678 | .chained = true, |
| 1679 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1680 | }, |
| 1681 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1682 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1683 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1684 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1685 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1686 | { } |
| 1687 | }, |
| 1688 | .chained = true, |
| 1689 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1690 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1691 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1692 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1693 | .v.func = alc260_fixup_gpio1_toggle, |
| 1694 | .chained = true, |
| 1695 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1696 | }, |
| 1697 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1698 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1699 | .v.func = alc260_fixup_kn1, |
| 1700 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1701 | [ALC260_FIXUP_FSC_S7020] = { |
| 1702 | .type = HDA_FIXUP_FUNC, |
| 1703 | .v.func = alc260_fixup_fsc_s7020, |
| 1704 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1705 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1706 | .type = HDA_FIXUP_FUNC, |
| 1707 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1708 | .chained = true, |
| 1709 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1710 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1711 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1712 | .type = HDA_FIXUP_PINS, |
| 1713 | .v.pins = (const struct hda_pintbl[]) { |
| 1714 | /* Pin configs are missing completely on some VAIOs */ |
| 1715 | { 0x0f, 0x01211020 }, |
| 1716 | { 0x10, 0x0001003f }, |
| 1717 | { 0x11, 0x411111f0 }, |
| 1718 | { 0x12, 0x01a15930 }, |
| 1719 | { 0x13, 0x411111f0 }, |
| 1720 | { 0x14, 0x411111f0 }, |
| 1721 | { 0x15, 0x411111f0 }, |
| 1722 | { 0x16, 0x411111f0 }, |
| 1723 | { 0x17, 0x411111f0 }, |
| 1724 | { 0x18, 0x411111f0 }, |
| 1725 | { 0x19, 0x411111f0 }, |
| 1726 | { } |
| 1727 | } |
| 1728 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1729 | }; |
| 1730 | |
| 1731 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1732 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1733 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1734 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1735 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1736 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1737 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1738 | 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] | 1739 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1740 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1741 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1742 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1743 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1744 | {} |
| 1745 | }; |
| 1746 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1747 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1748 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1749 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1750 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1751 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1752 | {} |
| 1753 | }; |
| 1754 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1755 | /* |
| 1756 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1757 | static int patch_alc260(struct hda_codec *codec) |
| 1758 | { |
| 1759 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1760 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1761 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1762 | err = alc_alloc_spec(codec, 0x07); |
| 1763 | if (err < 0) |
| 1764 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1765 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1766 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1767 | /* as quite a few machines require HP amp for speaker outputs, |
| 1768 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1769 | * it's almost harmless. |
| 1770 | */ |
| 1771 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1772 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1773 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1774 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1775 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1776 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1777 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1778 | /* automatic parse from the BIOS config */ |
| 1779 | err = alc260_parse_auto_config(codec); |
| 1780 | if (err < 0) |
| 1781 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1782 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1783 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1784 | set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1785 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1786 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1787 | spec->shutup = alc_eapd_shutup; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1788 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1789 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1790 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1791 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1792 | |
| 1793 | error: |
| 1794 | alc_free(codec); |
| 1795 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1796 | } |
| 1797 | |
| 1798 | |
| 1799 | /* |
| 1800 | * ALC882/883/885/888/889 support |
| 1801 | * |
| 1802 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1803 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1804 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1805 | * 6-channel independent captures. |
| 1806 | * |
| 1807 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1808 | * driver yet). |
| 1809 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1810 | |
| 1811 | /* |
| 1812 | * Pin config fixes |
| 1813 | */ |
| 1814 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1815 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1816 | ALC882_FIXUP_LENOVO_Y530, |
| 1817 | ALC882_FIXUP_PB_M5210, |
| 1818 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1819 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1820 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1821 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1822 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1823 | ALC888_FIXUP_EEE1601, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1824 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1825 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1826 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1827 | ALC882_FIXUP_GPIO1, |
| 1828 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1829 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1830 | ALC889_FIXUP_COEF, |
| 1831 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1832 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1833 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1834 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1835 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1836 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1837 | ALC889_FIXUP_MBP_VREF, |
| 1838 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1839 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1840 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1841 | ALC889_FIXUP_MP11_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1842 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1843 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1844 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1845 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1846 | }; |
| 1847 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1848 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1849 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1850 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1851 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1852 | return; |
| 1853 | alc889_coef_init(codec); |
| 1854 | } |
| 1855 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1856 | /* toggle speaker-output according to the hp-jack state */ |
| 1857 | static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) |
| 1858 | { |
| 1859 | unsigned int gpiostate, gpiomask, gpiodir; |
| 1860 | |
| 1861 | gpiostate = snd_hda_codec_read(codec, codec->afg, 0, |
| 1862 | AC_VERB_GET_GPIO_DATA, 0); |
| 1863 | |
| 1864 | if (!muted) |
| 1865 | gpiostate |= (1 << pin); |
| 1866 | else |
| 1867 | gpiostate &= ~(1 << pin); |
| 1868 | |
| 1869 | gpiomask = snd_hda_codec_read(codec, codec->afg, 0, |
| 1870 | AC_VERB_GET_GPIO_MASK, 0); |
| 1871 | gpiomask |= (1 << pin); |
| 1872 | |
| 1873 | gpiodir = snd_hda_codec_read(codec, codec->afg, 0, |
| 1874 | AC_VERB_GET_GPIO_DIRECTION, 0); |
| 1875 | gpiodir |= (1 << pin); |
| 1876 | |
| 1877 | |
| 1878 | snd_hda_codec_write(codec, codec->afg, 0, |
| 1879 | AC_VERB_SET_GPIO_MASK, gpiomask); |
| 1880 | snd_hda_codec_write(codec, codec->afg, 0, |
| 1881 | AC_VERB_SET_GPIO_DIRECTION, gpiodir); |
| 1882 | |
| 1883 | msleep(1); |
| 1884 | |
| 1885 | snd_hda_codec_write(codec, codec->afg, 0, |
| 1886 | AC_VERB_SET_GPIO_DATA, gpiostate); |
| 1887 | } |
| 1888 | |
| 1889 | /* set up GPIO at initialization */ |
| 1890 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1891 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1892 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1893 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1894 | return; |
| 1895 | alc882_gpio_mute(codec, 0, 0); |
| 1896 | alc882_gpio_mute(codec, 1, 0); |
| 1897 | } |
| 1898 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1899 | /* Fix the connection of some pins for ALC889: |
| 1900 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1901 | * work correctly (bko#42740) |
| 1902 | */ |
| 1903 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1904 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1905 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1906 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1907 | /* fake the connections during parsing the tree */ |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1908 | hda_nid_t conn1[2] = { 0x0c, 0x0d }; |
| 1909 | hda_nid_t conn2[2] = { 0x0e, 0x0f }; |
| 1910 | snd_hda_override_conn_list(codec, 0x14, 2, conn1); |
| 1911 | snd_hda_override_conn_list(codec, 0x15, 2, conn1); |
| 1912 | snd_hda_override_conn_list(codec, 0x18, 2, conn2); |
| 1913 | snd_hda_override_conn_list(codec, 0x1a, 2, conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1914 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1915 | /* restore the connections */ |
| 1916 | hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1917 | snd_hda_override_conn_list(codec, 0x14, 5, conn); |
| 1918 | snd_hda_override_conn_list(codec, 0x15, 5, conn); |
| 1919 | snd_hda_override_conn_list(codec, 0x18, 5, conn); |
| 1920 | snd_hda_override_conn_list(codec, 0x1a, 5, conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1921 | } |
| 1922 | } |
| 1923 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1924 | /* Set VREF on HP pin */ |
| 1925 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1926 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1927 | { |
| 1928 | struct alc_spec *spec = codec->spec; |
| 1929 | static hda_nid_t nids[2] = { 0x14, 0x15 }; |
| 1930 | int i; |
| 1931 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1932 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1933 | return; |
| 1934 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1935 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1936 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1937 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1938 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1939 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1940 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1941 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1942 | break; |
| 1943 | } |
| 1944 | } |
| 1945 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1946 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 1947 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1948 | { |
| 1949 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1950 | int i; |
| 1951 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1952 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1953 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1954 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1955 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1956 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1957 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1958 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1959 | } |
| 1960 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1961 | /* Set VREF on speaker pins on imac91 */ |
| 1962 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 1963 | const struct hda_fixup *fix, int action) |
| 1964 | { |
| 1965 | static hda_nid_t nids[2] = { 0x18, 0x1a }; |
| 1966 | |
| 1967 | if (action == HDA_FIXUP_ACT_INIT) |
| 1968 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1969 | } |
| 1970 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1971 | /* Set VREF on speaker pins on mba11 */ |
| 1972 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 1973 | const struct hda_fixup *fix, int action) |
| 1974 | { |
| 1975 | static hda_nid_t nids[1] = { 0x18 }; |
| 1976 | |
| 1977 | if (action == HDA_FIXUP_ACT_INIT) |
| 1978 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1979 | } |
| 1980 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1981 | /* Set VREF on speaker pins on mba21 */ |
| 1982 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 1983 | const struct hda_fixup *fix, int action) |
| 1984 | { |
| 1985 | static hda_nid_t nids[2] = { 0x18, 0x19 }; |
| 1986 | |
| 1987 | if (action == HDA_FIXUP_ACT_INIT) |
| 1988 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1989 | } |
| 1990 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1991 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 1992 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 1993 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1994 | */ |
| 1995 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1996 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1997 | { |
| 1998 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 1999 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2000 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2001 | spec->gen.no_multi_io = 1; |
| 2002 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2003 | } |
| 2004 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2005 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 2006 | const struct hda_fixup *fix, int action); |
| 2007 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2008 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2009 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2010 | .type = HDA_FIXUP_PINS, |
| 2011 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2012 | { 0x15, 0x01080104 }, /* side */ |
| 2013 | { 0x16, 0x01011012 }, /* rear */ |
| 2014 | { 0x17, 0x01016011 }, /* clfe */ |
| 2015 | { } |
| 2016 | } |
| 2017 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2018 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2019 | .type = HDA_FIXUP_PINS, |
| 2020 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2021 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2022 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2023 | { } |
| 2024 | } |
| 2025 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2026 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2027 | .type = HDA_FIXUP_PINCTLS, |
| 2028 | .v.pins = (const struct hda_pintbl[]) { |
| 2029 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2030 | {} |
| 2031 | } |
| 2032 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2033 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2034 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2035 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2036 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2037 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2038 | .type = HDA_FIXUP_PINS, |
| 2039 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2040 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2041 | { } |
| 2042 | } |
| 2043 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2044 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2045 | .type = HDA_FIXUP_PINS, |
| 2046 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2047 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2048 | { } |
| 2049 | } |
| 2050 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2051 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2052 | .type = HDA_FIXUP_PINS, |
| 2053 | .v.pins = (const struct hda_pintbl[]) { |
| 2054 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2055 | { } |
| 2056 | }, |
| 2057 | .chained = true, |
| 2058 | .chain_id = ALC889_FIXUP_CD, |
| 2059 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2060 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2061 | .type = HDA_FIXUP_PINS, |
| 2062 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2063 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2064 | { } |
| 2065 | } |
| 2066 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2067 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2068 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2069 | .v.verbs = (const struct hda_verb[]) { |
| 2070 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2071 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2072 | { } |
| 2073 | } |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2074 | }, |
| 2075 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2076 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2077 | .v.verbs = (const struct hda_verb[]) { |
| 2078 | /* change to EAPD mode */ |
| 2079 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2080 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2081 | { } |
| 2082 | } |
| 2083 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2084 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2085 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2086 | .v.verbs = (const struct hda_verb[]) { |
| 2087 | /* change to EAPD mode */ |
| 2088 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2089 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2090 | { } |
| 2091 | } |
| 2092 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2093 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2094 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2095 | .v.verbs = (const struct hda_verb[]) { |
| 2096 | /* eanable EAPD on Acer laptops */ |
| 2097 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2098 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2099 | { } |
| 2100 | } |
| 2101 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2102 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2103 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2104 | .v.verbs = alc_gpio1_init_verbs, |
| 2105 | }, |
| 2106 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2107 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2108 | .v.verbs = alc_gpio2_init_verbs, |
| 2109 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2110 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2111 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2112 | .v.verbs = alc_gpio3_init_verbs, |
| 2113 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2114 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2115 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2116 | .v.verbs = alc_gpio1_init_verbs, |
| 2117 | .chained = true, |
| 2118 | .chain_id = ALC882_FIXUP_EAPD, |
| 2119 | }, |
| 2120 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2121 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2122 | .v.func = alc889_fixup_coef, |
| 2123 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2124 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2125 | .type = HDA_FIXUP_PINS, |
| 2126 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2127 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2128 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2129 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2130 | }, |
| 2131 | .chained = true, |
| 2132 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2133 | }, |
| 2134 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2135 | .type = HDA_FIXUP_PINS, |
| 2136 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2137 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2138 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2139 | { } |
| 2140 | }, |
| 2141 | .chained = true, |
| 2142 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2143 | }, |
| 2144 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2145 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2146 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2147 | .v.verbs = (const struct hda_verb[]) { |
| 2148 | /* Enable all DACs */ |
| 2149 | /* DAC DISABLE/MUTE 1? */ |
| 2150 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2151 | * apparently. Init=0x38 */ |
| 2152 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2153 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2154 | /* DAC DISABLE/MUTE 2? */ |
| 2155 | /* some bit here disables the other DACs. |
| 2156 | * Init=0x4900 */ |
| 2157 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2158 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2159 | /* DMIC fix |
| 2160 | * This laptop has a stereo digital microphone. |
| 2161 | * The mics are only 1cm apart which makes the stereo |
| 2162 | * useless. However, either the mic or the ALC889 |
| 2163 | * makes the signal become a difference/sum signal |
| 2164 | * instead of standard stereo, which is annoying. |
| 2165 | * So instead we flip this bit which makes the |
| 2166 | * codec replicate the sum signal to both channels, |
| 2167 | * turning it into a normal mono mic. |
| 2168 | */ |
| 2169 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2170 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2171 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2172 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2173 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2174 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2175 | }, |
| 2176 | .chained = true, |
| 2177 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2178 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2179 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2180 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2181 | .v.func = alc885_fixup_macpro_gpio, |
| 2182 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2183 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2184 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2185 | .v.func = alc889_fixup_dac_route, |
| 2186 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2187 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2188 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2189 | .v.func = alc889_fixup_mbp_vref, |
| 2190 | .chained = true, |
| 2191 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2192 | }, |
| 2193 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2194 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2195 | .v.func = alc889_fixup_imac91_vref, |
| 2196 | .chained = true, |
| 2197 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2198 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2199 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2200 | .type = HDA_FIXUP_FUNC, |
| 2201 | .v.func = alc889_fixup_mba11_vref, |
| 2202 | .chained = true, |
| 2203 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2204 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2205 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2206 | .type = HDA_FIXUP_FUNC, |
| 2207 | .v.func = alc889_fixup_mba21_vref, |
| 2208 | .chained = true, |
| 2209 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2210 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2211 | [ALC889_FIXUP_MP11_VREF] = { |
| 2212 | .type = HDA_FIXUP_FUNC, |
| 2213 | .v.func = alc889_fixup_mba11_vref, |
| 2214 | .chained = true, |
| 2215 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2216 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2217 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2218 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2219 | .v.func = alc_fixup_inv_dmic_0x12, |
| 2220 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2221 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2222 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2223 | .v.func = alc882_fixup_no_primary_hp, |
| 2224 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2225 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2226 | .type = HDA_FIXUP_PINS, |
| 2227 | .v.pins = (const struct hda_pintbl[]) { |
| 2228 | {0x16, 0x99130130}, /* bass speaker */ |
| 2229 | {} |
| 2230 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2231 | .chained = true, |
| 2232 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2233 | }, |
| 2234 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2235 | .type = HDA_FIXUP_FUNC, |
| 2236 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2237 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2238 | }; |
| 2239 | |
| 2240 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2241 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2242 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2243 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2244 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2245 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2246 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2247 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2248 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2249 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2250 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2251 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2252 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2253 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2254 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2255 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2256 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2257 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2258 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2259 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2260 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2261 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2262 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2263 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2264 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2265 | 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] | 2266 | 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] | 2267 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2268 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2269 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2270 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2271 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2272 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2273 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
Fernando Luis Vázquez Cao | 12e31a7 | 2013-02-12 16:47:44 +0900 | [diff] [blame] | 2274 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2275 | |
| 2276 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2277 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2278 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2279 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2280 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2281 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2282 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2283 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2284 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2285 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2286 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2287 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2288 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2289 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2290 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2291 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2292 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2293 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Josh Boyer | 29ebe40 | 2012-04-12 13:55:36 -0400 | [diff] [blame] | 2294 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 0519363 | 2012-11-12 10:07:36 +0100 | [diff] [blame] | 2295 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2296 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2297 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), |
| 2298 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2299 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2300 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
Takashi Iwai | bca4013 | 2012-05-07 11:13:14 +0200 | [diff] [blame] | 2301 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2302 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2303 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2304 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2305 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2306 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2307 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2308 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2309 | {} |
| 2310 | }; |
| 2311 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2312 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2313 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2314 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2315 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2316 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2317 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2318 | {} |
| 2319 | }; |
| 2320 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2321 | /* |
| 2322 | * BIOS auto configuration |
| 2323 | */ |
| 2324 | /* almost identical with ALC880 parser... */ |
| 2325 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2326 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2327 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2328 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2329 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2330 | } |
| 2331 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2332 | /* |
| 2333 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2334 | static int patch_alc882(struct hda_codec *codec) |
| 2335 | { |
| 2336 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2337 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2338 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2339 | err = alc_alloc_spec(codec, 0x0b); |
| 2340 | if (err < 0) |
| 2341 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2342 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2343 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2344 | |
| 2345 | switch (codec->vendor_id) { |
| 2346 | case 0x10ec0882: |
| 2347 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2348 | case 0x10ec0900: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2349 | break; |
| 2350 | default: |
| 2351 | /* ALC883 and variants */ |
| 2352 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2353 | break; |
| 2354 | } |
| 2355 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2356 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2357 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2358 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2359 | |
| 2360 | alc_auto_parse_customize_define(codec); |
| 2361 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2362 | if (has_cdefine_beep(codec)) |
| 2363 | spec->gen.beep_nid = 0x01; |
| 2364 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2365 | /* automatic parse from the BIOS config */ |
| 2366 | err = alc882_parse_auto_config(codec); |
| 2367 | if (err < 0) |
| 2368 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2369 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2370 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2371 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2372 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2373 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2374 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2375 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2376 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2377 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2378 | |
| 2379 | error: |
| 2380 | alc_free(codec); |
| 2381 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2382 | } |
| 2383 | |
| 2384 | |
| 2385 | /* |
| 2386 | * ALC262 support |
| 2387 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2388 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2389 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2390 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2391 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2392 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2393 | } |
| 2394 | |
| 2395 | /* |
| 2396 | * Pin config fixes |
| 2397 | */ |
| 2398 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2399 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2400 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2401 | ALC262_FIXUP_HP_Z200, |
| 2402 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2403 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2404 | ALC262_FIXUP_BENQ, |
| 2405 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2406 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2407 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2408 | }; |
| 2409 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2410 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2411 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2412 | .type = HDA_FIXUP_PINS, |
| 2413 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2414 | { 0x14, 0x99130110 }, /* speaker */ |
| 2415 | { 0x15, 0x0221142f }, /* front HP */ |
| 2416 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2417 | { } |
| 2418 | } |
| 2419 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2420 | [ALC262_FIXUP_FSC_S7110] = { |
| 2421 | .type = HDA_FIXUP_PINS, |
| 2422 | .v.pins = (const struct hda_pintbl[]) { |
| 2423 | { 0x15, 0x90170110 }, /* speaker */ |
| 2424 | { } |
| 2425 | }, |
| 2426 | .chained = true, |
| 2427 | .chain_id = ALC262_FIXUP_BENQ, |
| 2428 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2429 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2430 | .type = HDA_FIXUP_PINS, |
| 2431 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2432 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2433 | { } |
| 2434 | } |
| 2435 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2436 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2437 | .type = HDA_FIXUP_PINS, |
| 2438 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2439 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2440 | { } |
| 2441 | } |
| 2442 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2443 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2444 | .type = HDA_FIXUP_PINCTLS, |
| 2445 | .v.pins = (const struct hda_pintbl[]) { |
| 2446 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2447 | {} |
| 2448 | }, |
| 2449 | .chained = true, |
| 2450 | .chain_id = ALC262_FIXUP_BENQ, |
| 2451 | }, |
| 2452 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2453 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2454 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2455 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2456 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2457 | {} |
| 2458 | } |
| 2459 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2460 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2461 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2462 | .v.verbs = (const struct hda_verb[]) { |
| 2463 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2464 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2465 | {} |
| 2466 | } |
| 2467 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2468 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2469 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2470 | .v.func = alc_fixup_inv_dmic_0x12, |
| 2471 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2472 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2473 | .type = HDA_FIXUP_FUNC, |
| 2474 | .v.func = alc_fixup_no_depop_delay, |
| 2475 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2476 | }; |
| 2477 | |
| 2478 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2479 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2480 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2481 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2482 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
| 2483 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2484 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2485 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2486 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2487 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2488 | {} |
| 2489 | }; |
| 2490 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2491 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2492 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
| 2493 | {} |
| 2494 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2495 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2496 | /* |
| 2497 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2498 | static int patch_alc262(struct hda_codec *codec) |
| 2499 | { |
| 2500 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2501 | int err; |
| 2502 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2503 | err = alc_alloc_spec(codec, 0x0b); |
| 2504 | if (err < 0) |
| 2505 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2506 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2507 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2508 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2509 | |
| 2510 | #if 0 |
| 2511 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2512 | * under-run |
| 2513 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2514 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2515 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2516 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2517 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2518 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2519 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2520 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2521 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2522 | alc_auto_parse_customize_define(codec); |
| 2523 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2524 | if (has_cdefine_beep(codec)) |
| 2525 | spec->gen.beep_nid = 0x01; |
| 2526 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2527 | /* automatic parse from the BIOS config */ |
| 2528 | err = alc262_parse_auto_config(codec); |
| 2529 | if (err < 0) |
| 2530 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2531 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2532 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2533 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2534 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2535 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2536 | spec->shutup = alc_eapd_shutup; |
| 2537 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2538 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2539 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2540 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2541 | |
| 2542 | error: |
| 2543 | alc_free(codec); |
| 2544 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2545 | } |
| 2546 | |
| 2547 | /* |
| 2548 | * ALC268 |
| 2549 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2550 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
| 2551 | static const struct hda_bind_ctls alc268_bind_beep_sw = { |
| 2552 | .ops = &snd_hda_bind_sw, |
| 2553 | .values = { |
| 2554 | HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT), |
| 2555 | HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT), |
| 2556 | 0 |
| 2557 | }, |
| 2558 | }; |
| 2559 | |
| 2560 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2561 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
| 2562 | HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw), |
| 2563 | { } |
| 2564 | }; |
| 2565 | |
| 2566 | /* set PCBEEP vol = 0, mute connections */ |
| 2567 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2568 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2569 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2570 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2571 | { } |
| 2572 | }; |
| 2573 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2574 | enum { |
| 2575 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2576 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2577 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2578 | }; |
| 2579 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2580 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2581 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2582 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2583 | .v.func = alc_fixup_inv_dmic_0x12, |
| 2584 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2585 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2586 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2587 | .v.verbs = (const struct hda_verb[]) { |
| 2588 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2589 | {} |
| 2590 | } |
| 2591 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2592 | [ALC268_FIXUP_SPDIF] = { |
| 2593 | .type = HDA_FIXUP_PINS, |
| 2594 | .v.pins = (const struct hda_pintbl[]) { |
| 2595 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2596 | {} |
| 2597 | } |
| 2598 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2599 | }; |
| 2600 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2601 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2602 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2603 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
| 2604 | {} |
| 2605 | }; |
| 2606 | |
| 2607 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2608 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2609 | 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] | 2610 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2611 | * same PCI SSID 1179:ff00 |
| 2612 | */ |
| 2613 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2614 | {} |
| 2615 | }; |
| 2616 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2617 | /* |
| 2618 | * BIOS auto configuration |
| 2619 | */ |
| 2620 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2621 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2622 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2623 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2624 | } |
| 2625 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2626 | /* |
| 2627 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2628 | static int patch_alc268(struct hda_codec *codec) |
| 2629 | { |
| 2630 | struct alc_spec *spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2631 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2632 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2633 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2634 | err = alc_alloc_spec(codec, 0); |
| 2635 | if (err < 0) |
| 2636 | return err; |
| 2637 | |
| 2638 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2639 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2640 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2641 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2642 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2643 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2644 | /* automatic parse from the BIOS config */ |
| 2645 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2646 | if (err < 0) |
| 2647 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2648 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2649 | if (err > 0 && !spec->gen.no_analog && |
| 2650 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
| 2651 | add_mixer(spec, alc268_beep_mixer); |
| 2652 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2653 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2654 | /* override the amp caps for beep generator */ |
| 2655 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2656 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2657 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2658 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2659 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2660 | } |
| 2661 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2662 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2663 | spec->shutup = alc_eapd_shutup; |
| 2664 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2665 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2666 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2667 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2668 | |
| 2669 | error: |
| 2670 | alc_free(codec); |
| 2671 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2672 | } |
| 2673 | |
| 2674 | /* |
| 2675 | * ALC269 |
| 2676 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2677 | |
| 2678 | static int playback_pcm_open(struct hda_pcm_stream *hinfo, |
| 2679 | struct hda_codec *codec, |
| 2680 | struct snd_pcm_substream *substream) |
| 2681 | { |
| 2682 | struct hda_gen_spec *spec = codec->spec; |
| 2683 | return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream, |
| 2684 | hinfo); |
| 2685 | } |
| 2686 | |
| 2687 | static int playback_pcm_prepare(struct hda_pcm_stream *hinfo, |
| 2688 | struct hda_codec *codec, |
| 2689 | unsigned int stream_tag, |
| 2690 | unsigned int format, |
| 2691 | struct snd_pcm_substream *substream) |
| 2692 | { |
| 2693 | struct hda_gen_spec *spec = codec->spec; |
| 2694 | return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, |
| 2695 | stream_tag, format, substream); |
| 2696 | } |
| 2697 | |
| 2698 | static int playback_pcm_cleanup(struct hda_pcm_stream *hinfo, |
| 2699 | struct hda_codec *codec, |
| 2700 | struct snd_pcm_substream *substream) |
| 2701 | { |
| 2702 | struct hda_gen_spec *spec = codec->spec; |
| 2703 | return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); |
| 2704 | } |
| 2705 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2706 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
| 2707 | .substreams = 1, |
| 2708 | .channels_min = 2, |
| 2709 | .channels_max = 8, |
| 2710 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
| 2711 | /* NID is set in alc_build_pcms */ |
| 2712 | .ops = { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2713 | .open = playback_pcm_open, |
| 2714 | .prepare = playback_pcm_prepare, |
| 2715 | .cleanup = playback_pcm_cleanup |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2716 | }, |
| 2717 | }; |
| 2718 | |
| 2719 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
| 2720 | .substreams = 1, |
| 2721 | .channels_min = 2, |
| 2722 | .channels_max = 2, |
| 2723 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
| 2724 | /* NID is set in alc_build_pcms */ |
| 2725 | }; |
| 2726 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2727 | /* different alc269-variants */ |
| 2728 | enum { |
| 2729 | ALC269_TYPE_ALC269VA, |
| 2730 | ALC269_TYPE_ALC269VB, |
| 2731 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2732 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2733 | ALC269_TYPE_ALC280, |
| 2734 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2735 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2736 | ALC269_TYPE_ALC284, |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 2737 | ALC269_TYPE_ALC285, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2738 | ALC269_TYPE_ALC286, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2739 | ALC269_TYPE_ALC255, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2740 | }; |
| 2741 | |
| 2742 | /* |
| 2743 | * BIOS auto configuration |
| 2744 | */ |
| 2745 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 2746 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2747 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2748 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 2749 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2750 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2751 | const hda_nid_t *ssids; |
| 2752 | |
| 2753 | switch (spec->codec_variant) { |
| 2754 | case ALC269_TYPE_ALC269VA: |
| 2755 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2756 | case ALC269_TYPE_ALC280: |
| 2757 | case ALC269_TYPE_ALC284: |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 2758 | case ALC269_TYPE_ALC285: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2759 | ssids = alc269va_ssids; |
| 2760 | break; |
| 2761 | case ALC269_TYPE_ALC269VB: |
| 2762 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2763 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2764 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2765 | case ALC269_TYPE_ALC286: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2766 | case ALC269_TYPE_ALC255: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2767 | ssids = alc269_ssids; |
| 2768 | break; |
| 2769 | default: |
| 2770 | ssids = alc269_ssids; |
| 2771 | break; |
| 2772 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2773 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2774 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2775 | } |
| 2776 | |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2777 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 2778 | |
| 2779 | static void alc286_shutup(struct hda_codec *codec) |
| 2780 | { |
| 2781 | int i; |
| 2782 | int mic_pin = find_ext_mic_pin(codec); |
| 2783 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 2784 | * the default pin setup at the next load of the driver |
| 2785 | */ |
| 2786 | if (codec->bus->shutdown) |
| 2787 | return; |
| 2788 | for (i = 0; i < codec->init_pins.used; i++) { |
| 2789 | struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i); |
| 2790 | /* use read here for syncing after issuing each verb */ |
| 2791 | if (pin->nid != mic_pin) |
| 2792 | snd_hda_codec_read(codec, pin->nid, 0, |
| 2793 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 2794 | } |
| 2795 | codec->pins_shutup = 1; |
| 2796 | } |
| 2797 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2798 | 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] | 2799 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2800 | 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] | 2801 | } |
| 2802 | |
| 2803 | static void alc269_shutup(struct hda_codec *codec) |
| 2804 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2805 | struct alc_spec *spec = codec->spec; |
| 2806 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2807 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 2808 | alc269vb_toggle_power_output(codec, 0); |
| 2809 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 2810 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2811 | msleep(150); |
| 2812 | } |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 2813 | snd_hda_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2814 | } |
| 2815 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2816 | static struct coef_fw alc282_coefs[] = { |
| 2817 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
| 2818 | WRITE_COEF(0x05, 0x0700), /* FIFO and filter clock */ |
| 2819 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 2820 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 2821 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 2822 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 2823 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 2824 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 2825 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 2826 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 2827 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 2828 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 2829 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 2830 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 2831 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 2832 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 2833 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 2834 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 2835 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 2836 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 2837 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 2838 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 2839 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 2840 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 2841 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 2842 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 2843 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 2844 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 2845 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 2846 | {} |
| 2847 | }; |
| 2848 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2849 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 2850 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2851 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2852 | } |
| 2853 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 2854 | static void alc282_init(struct hda_codec *codec) |
| 2855 | { |
| 2856 | struct alc_spec *spec = codec->spec; |
| 2857 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2858 | bool hp_pin_sense; |
| 2859 | int coef78; |
| 2860 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2861 | alc282_restore_default_value(codec); |
| 2862 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 2863 | if (!hp_pin) |
| 2864 | return; |
| 2865 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2866 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 2867 | |
| 2868 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 2869 | /* Headphone capless set to high power mode */ |
| 2870 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 2871 | |
| 2872 | if (hp_pin_sense) |
| 2873 | msleep(2); |
| 2874 | |
| 2875 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2876 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2877 | |
| 2878 | if (hp_pin_sense) |
| 2879 | msleep(85); |
| 2880 | |
| 2881 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2882 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 2883 | |
| 2884 | if (hp_pin_sense) |
| 2885 | msleep(100); |
| 2886 | |
| 2887 | /* Headphone capless set to normal mode */ |
| 2888 | alc_write_coef_idx(codec, 0x78, coef78); |
| 2889 | } |
| 2890 | |
| 2891 | static void alc282_shutup(struct hda_codec *codec) |
| 2892 | { |
| 2893 | struct alc_spec *spec = codec->spec; |
| 2894 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2895 | bool hp_pin_sense; |
| 2896 | int coef78; |
| 2897 | |
| 2898 | if (!hp_pin) { |
| 2899 | alc269_shutup(codec); |
| 2900 | return; |
| 2901 | } |
| 2902 | |
| 2903 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2904 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 2905 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 2906 | |
| 2907 | if (hp_pin_sense) |
| 2908 | msleep(2); |
| 2909 | |
| 2910 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2911 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2912 | |
| 2913 | if (hp_pin_sense) |
| 2914 | msleep(85); |
| 2915 | |
| 2916 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2917 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 2918 | |
| 2919 | if (hp_pin_sense) |
| 2920 | msleep(100); |
| 2921 | |
| 2922 | alc_auto_setup_eapd(codec, false); |
| 2923 | snd_hda_shutup_pins(codec); |
| 2924 | alc_write_coef_idx(codec, 0x78, coef78); |
| 2925 | } |
| 2926 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2927 | static struct coef_fw alc283_coefs[] = { |
| 2928 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
| 2929 | WRITE_COEF(0x05, 0x0700), /* FIFO and filter clock */ |
| 2930 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 2931 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 2932 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 2933 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 2934 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 2935 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 2936 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 2937 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 2938 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 2939 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 2940 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 2941 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 2942 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 2943 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 2944 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 2945 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 2946 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 2947 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 2948 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 2949 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 2950 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 2951 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 2952 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 2953 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 2954 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 2955 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 2956 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 2957 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 2958 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 2959 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
| 2960 | {} |
| 2961 | }; |
| 2962 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 2963 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 2964 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2965 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 2966 | } |
| 2967 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2968 | static void alc283_init(struct hda_codec *codec) |
| 2969 | { |
| 2970 | struct alc_spec *spec = codec->spec; |
| 2971 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2972 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2973 | |
Kailang Yang | 8314f22 | 2014-04-03 17:28:39 +0800 | [diff] [blame] | 2974 | if (!spec->gen.autocfg.hp_outs) { |
| 2975 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 2976 | hp_pin = spec->gen.autocfg.line_out_pins[0]; |
| 2977 | } |
| 2978 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 2979 | alc283_restore_default_value(codec); |
| 2980 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2981 | if (!hp_pin) |
| 2982 | return; |
| 2983 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2984 | |
| 2985 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 2986 | /* Headphone capless set to high power mode */ |
| 2987 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 2988 | |
| 2989 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2990 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2991 | |
| 2992 | if (hp_pin_sense) |
| 2993 | msleep(85); |
| 2994 | |
| 2995 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2996 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 2997 | |
| 2998 | if (hp_pin_sense) |
| 2999 | msleep(85); |
| 3000 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3001 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3002 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3003 | /* Headphone capless set to normal mode */ |
| 3004 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3005 | } |
| 3006 | |
| 3007 | static void alc283_shutup(struct hda_codec *codec) |
| 3008 | { |
| 3009 | struct alc_spec *spec = codec->spec; |
| 3010 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3011 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3012 | |
Kailang Yang | 8314f22 | 2014-04-03 17:28:39 +0800 | [diff] [blame] | 3013 | if (!spec->gen.autocfg.hp_outs) { |
| 3014 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 3015 | hp_pin = spec->gen.autocfg.line_out_pins[0]; |
| 3016 | } |
| 3017 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3018 | if (!hp_pin) { |
| 3019 | alc269_shutup(codec); |
| 3020 | return; |
| 3021 | } |
| 3022 | |
| 3023 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3024 | |
| 3025 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3026 | |
| 3027 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3028 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3029 | |
| 3030 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3031 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3032 | |
| 3033 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3034 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3035 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3036 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3037 | |
| 3038 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3039 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3040 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3041 | snd_hda_shutup_pins(codec); |
| 3042 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3043 | } |
| 3044 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3045 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3046 | unsigned int val) |
| 3047 | { |
| 3048 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3049 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3050 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3051 | } |
| 3052 | |
| 3053 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3054 | { |
| 3055 | unsigned int val; |
| 3056 | |
| 3057 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3058 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3059 | & 0xffff; |
| 3060 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3061 | << 16; |
| 3062 | return val; |
| 3063 | } |
| 3064 | |
| 3065 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3066 | { |
| 3067 | unsigned int val; |
| 3068 | |
| 3069 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3070 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3071 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3072 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3073 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3074 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3075 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3076 | val = alc5505_coef_get(codec, 0x6220); |
| 3077 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3078 | } |
| 3079 | |
| 3080 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3081 | { |
| 3082 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3083 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3084 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3085 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3086 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3087 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3088 | } |
| 3089 | |
| 3090 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3091 | { |
| 3092 | unsigned int val; |
| 3093 | |
| 3094 | alc5505_dsp_halt(codec); |
| 3095 | alc5505_dsp_back_from_halt(codec); |
| 3096 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3097 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3098 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3099 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3100 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3101 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3102 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3103 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3104 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3105 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3106 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3107 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3108 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3109 | |
| 3110 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3111 | if (val <= 3) |
| 3112 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3113 | else |
| 3114 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3115 | |
| 3116 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3117 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3118 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3119 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3120 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3121 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3122 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3123 | |
| 3124 | #ifdef HALT_REALTEK_ALC5505 |
| 3125 | alc5505_dsp_halt(codec); |
| 3126 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3127 | } |
| 3128 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3129 | #ifdef HALT_REALTEK_ALC5505 |
| 3130 | #define alc5505_dsp_suspend(codec) /* NOP */ |
| 3131 | #define alc5505_dsp_resume(codec) /* NOP */ |
| 3132 | #else |
| 3133 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3134 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3135 | #endif |
| 3136 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3137 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3138 | static int alc269_suspend(struct hda_codec *codec) |
| 3139 | { |
| 3140 | struct alc_spec *spec = codec->spec; |
| 3141 | |
| 3142 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3143 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3144 | return alc_suspend(codec); |
| 3145 | } |
| 3146 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3147 | static int alc269_resume(struct hda_codec *codec) |
| 3148 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3149 | struct alc_spec *spec = codec->spec; |
| 3150 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3151 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3152 | alc269vb_toggle_power_output(codec, 0); |
| 3153 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3154 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3155 | msleep(150); |
| 3156 | } |
| 3157 | |
| 3158 | codec->patch_ops.init(codec); |
| 3159 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3160 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3161 | alc269vb_toggle_power_output(codec, 1); |
| 3162 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3163 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3164 | msleep(200); |
| 3165 | } |
| 3166 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3167 | snd_hda_codec_resume_amp(codec); |
| 3168 | snd_hda_codec_resume_cache(codec); |
Takashi Iwai | 0623a88 | 2013-06-25 09:28:40 +0200 | [diff] [blame] | 3169 | alc_inv_dmic_sync(codec, true); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3170 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3171 | |
| 3172 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3173 | * suspend, and won't restore the data after resume, so we restore it |
| 3174 | * in the driver. |
| 3175 | */ |
| 3176 | if (spec->gpio_led) |
| 3177 | snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_SET_GPIO_DATA, |
| 3178 | spec->gpio_led); |
| 3179 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3180 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3181 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3182 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3183 | return 0; |
| 3184 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3185 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3186 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3187 | 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] | 3188 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3189 | { |
| 3190 | struct alc_spec *spec = codec->spec; |
| 3191 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3192 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3193 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3194 | } |
| 3195 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3196 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3197 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3198 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3199 | if (action == HDA_FIXUP_ACT_INIT) |
| 3200 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3201 | } |
| 3202 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3203 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3204 | const struct hda_fixup *fix, int action) |
| 3205 | { |
| 3206 | struct alc_spec *spec = codec->spec; |
| 3207 | |
| 3208 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3209 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3210 | } |
| 3211 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3212 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3213 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3214 | { |
| 3215 | static const struct hda_verb verbs[] = { |
| 3216 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3217 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3218 | {} |
| 3219 | }; |
| 3220 | unsigned int cfg; |
| 3221 | |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 3222 | if (strcmp(codec->chip_name, "ALC271X") && |
| 3223 | strcmp(codec->chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3224 | return; |
| 3225 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3226 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3227 | snd_hda_sequence_write(codec, verbs); |
| 3228 | } |
| 3229 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3230 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3231 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3232 | { |
| 3233 | struct alc_spec *spec = codec->spec; |
| 3234 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3235 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3236 | return; |
| 3237 | |
| 3238 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3239 | * fix the sample rate of analog I/O to 44.1kHz |
| 3240 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3241 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3242 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3243 | } |
| 3244 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3245 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3246 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3247 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3248 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3249 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3250 | * Below is a workaround specific to ALC269 to control the dmic |
| 3251 | * signal source as mono. |
| 3252 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3253 | if (action == HDA_FIXUP_ACT_INIT) |
| 3254 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3255 | } |
| 3256 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3257 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3258 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3259 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3260 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3261 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3262 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3263 | } |
| 3264 | |
| 3265 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3266 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3267 | { |
| 3268 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3269 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3270 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3271 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3272 | } |
| 3273 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3274 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
| 3275 | struct hda_jack_tbl *jack) |
| 3276 | { |
| 3277 | struct alc_spec *spec = codec->spec; |
| 3278 | int vref; |
| 3279 | msleep(200); |
| 3280 | snd_hda_gen_hp_automute(codec, jack); |
| 3281 | |
| 3282 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 3283 | msleep(100); |
| 3284 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3285 | vref); |
| 3286 | msleep(500); |
| 3287 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3288 | vref); |
| 3289 | } |
| 3290 | |
| 3291 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 3292 | const struct hda_fixup *fix, int action) |
| 3293 | { |
| 3294 | struct alc_spec *spec = codec->spec; |
| 3295 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3296 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3297 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 3298 | } |
| 3299 | } |
| 3300 | |
| 3301 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3302 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
| 3303 | static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3304 | { |
| 3305 | struct hda_codec *codec = private_data; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3306 | struct alc_spec *spec = codec->spec; |
| 3307 | unsigned int pinval; |
| 3308 | |
| 3309 | if (spec->mute_led_polarity) |
| 3310 | enabled = !enabled; |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 3311 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
| 3312 | pinval &= ~AC_PINCTL_VREFEN; |
| 3313 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3314 | if (spec->mute_led_nid) |
| 3315 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3316 | } |
| 3317 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3318 | /* Make sure the led works even in runtime suspend */ |
| 3319 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 3320 | hda_nid_t nid, |
| 3321 | unsigned int power_state) |
| 3322 | { |
| 3323 | struct alc_spec *spec = codec->spec; |
| 3324 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3325 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 3326 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3327 | return power_state; |
| 3328 | |
| 3329 | /* Set pin ctl again, it might have just been set to 0 */ |
| 3330 | snd_hda_set_pin_ctl(codec, nid, |
| 3331 | snd_hda_codec_get_pin_target(codec, nid)); |
| 3332 | |
| 3333 | return AC_PWRST_D0; |
| 3334 | } |
| 3335 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3336 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 3337 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3338 | { |
| 3339 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3340 | const struct dmi_device *dev = NULL; |
| 3341 | |
| 3342 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3343 | return; |
| 3344 | |
| 3345 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 3346 | int pol, pin; |
| 3347 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 3348 | continue; |
| 3349 | if (pin < 0x0a || pin >= 0x10) |
| 3350 | break; |
| 3351 | spec->mute_led_polarity = pol; |
| 3352 | spec->mute_led_nid = pin - 0x0a + 0x18; |
| 3353 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 3354 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3355 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3356 | codec_dbg(codec, |
| 3357 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3358 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3359 | break; |
| 3360 | } |
| 3361 | } |
| 3362 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3363 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 3364 | const struct hda_fixup *fix, int action) |
| 3365 | { |
| 3366 | struct alc_spec *spec = codec->spec; |
| 3367 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3368 | spec->mute_led_polarity = 0; |
| 3369 | spec->mute_led_nid = 0x18; |
| 3370 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 3371 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3372 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3373 | } |
| 3374 | } |
| 3375 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3376 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 3377 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3378 | { |
| 3379 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 3380 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3381 | spec->mute_led_polarity = 0; |
| 3382 | spec->mute_led_nid = 0x19; |
| 3383 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 3384 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3385 | codec->power_filter = led_power_filter; |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3386 | } |
| 3387 | } |
| 3388 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3389 | /* turn on/off mute LED per vmaster hook */ |
| 3390 | static void alc269_fixup_hp_gpio_mute_hook(void *private_data, int enabled) |
| 3391 | { |
| 3392 | struct hda_codec *codec = private_data; |
| 3393 | struct alc_spec *spec = codec->spec; |
| 3394 | unsigned int oldval = spec->gpio_led; |
| 3395 | |
| 3396 | if (enabled) |
| 3397 | spec->gpio_led &= ~0x08; |
| 3398 | else |
| 3399 | spec->gpio_led |= 0x08; |
| 3400 | if (spec->gpio_led != oldval) |
| 3401 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 3402 | spec->gpio_led); |
| 3403 | } |
| 3404 | |
| 3405 | /* turn on/off mic-mute LED per capture hook */ |
| 3406 | static void alc269_fixup_hp_gpio_mic_mute_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 3407 | struct snd_kcontrol *kcontrol, |
| 3408 | struct snd_ctl_elem_value *ucontrol) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3409 | { |
| 3410 | struct alc_spec *spec = codec->spec; |
| 3411 | unsigned int oldval = spec->gpio_led; |
| 3412 | |
| 3413 | if (!ucontrol) |
| 3414 | return; |
| 3415 | |
| 3416 | if (ucontrol->value.integer.value[0] || |
| 3417 | ucontrol->value.integer.value[1]) |
| 3418 | spec->gpio_led &= ~0x10; |
| 3419 | else |
| 3420 | spec->gpio_led |= 0x10; |
| 3421 | if (spec->gpio_led != oldval) |
| 3422 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 3423 | spec->gpio_led); |
| 3424 | } |
| 3425 | |
| 3426 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3427 | const struct hda_fixup *fix, int action) |
| 3428 | { |
| 3429 | struct alc_spec *spec = codec->spec; |
| 3430 | static const struct hda_verb gpio_init[] = { |
| 3431 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, |
| 3432 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, |
| 3433 | {} |
| 3434 | }; |
| 3435 | |
| 3436 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3437 | spec->gen.vmaster_mute.hook = alc269_fixup_hp_gpio_mute_hook; |
| 3438 | spec->gen.cap_sync_hook = alc269_fixup_hp_gpio_mic_mute_hook; |
| 3439 | spec->gpio_led = 0; |
| 3440 | snd_hda_add_verbs(codec, gpio_init); |
| 3441 | } |
| 3442 | } |
| 3443 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3444 | /* turn on/off mic-mute LED per capture hook */ |
| 3445 | static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec *codec, |
| 3446 | struct snd_kcontrol *kcontrol, |
| 3447 | struct snd_ctl_elem_value *ucontrol) |
| 3448 | { |
| 3449 | struct alc_spec *spec = codec->spec; |
| 3450 | unsigned int pinval, enable, disable; |
| 3451 | |
Hui Wang | fc1fad9 | 2014-07-08 17:56:14 +0800 | [diff] [blame] | 3452 | pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3453 | pinval &= ~AC_PINCTL_VREFEN; |
| 3454 | enable = pinval | AC_PINCTL_VREF_80; |
| 3455 | disable = pinval | AC_PINCTL_VREF_HIZ; |
| 3456 | |
| 3457 | if (!ucontrol) |
| 3458 | return; |
| 3459 | |
| 3460 | if (ucontrol->value.integer.value[0] || |
| 3461 | ucontrol->value.integer.value[1]) |
| 3462 | pinval = disable; |
| 3463 | else |
| 3464 | pinval = enable; |
| 3465 | |
| 3466 | if (spec->cap_mute_led_nid) |
| 3467 | snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval); |
| 3468 | } |
| 3469 | |
| 3470 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 3471 | const struct hda_fixup *fix, int action) |
| 3472 | { |
| 3473 | struct alc_spec *spec = codec->spec; |
| 3474 | static const struct hda_verb gpio_init[] = { |
| 3475 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x08 }, |
| 3476 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x08 }, |
| 3477 | {} |
| 3478 | }; |
| 3479 | |
| 3480 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3481 | spec->gen.vmaster_mute.hook = alc269_fixup_hp_gpio_mute_hook; |
| 3482 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; |
| 3483 | spec->gpio_led = 0; |
| 3484 | spec->cap_mute_led_nid = 0x18; |
| 3485 | snd_hda_add_verbs(codec, gpio_init); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3486 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3487 | } |
| 3488 | } |
| 3489 | |
| 3490 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 3491 | const struct hda_fixup *fix, int action) |
| 3492 | { |
| 3493 | struct alc_spec *spec = codec->spec; |
| 3494 | |
| 3495 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3496 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 3497 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; |
| 3498 | spec->mute_led_polarity = 0; |
| 3499 | spec->mute_led_nid = 0x1a; |
| 3500 | spec->cap_mute_led_nid = 0x18; |
| 3501 | spec->gen.vmaster_mute_enum = 1; |
| 3502 | codec->power_filter = led_power_filter; |
| 3503 | } |
| 3504 | } |
| 3505 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3506 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 3507 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3508 | static struct coef_fw coef0255[] = { |
| 3509 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
| 3510 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 3511 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 3512 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 3513 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 3514 | {} |
| 3515 | }; |
| 3516 | static struct coef_fw coef0233[] = { |
| 3517 | WRITE_COEF(0x1b, 0x0c0b), |
| 3518 | WRITE_COEF(0x45, 0xc429), |
| 3519 | UPDATE_COEF(0x35, 0x4000, 0), |
| 3520 | WRITE_COEF(0x06, 0x2104), |
| 3521 | WRITE_COEF(0x1a, 0x0001), |
| 3522 | WRITE_COEF(0x26, 0x0004), |
| 3523 | WRITE_COEF(0x32, 0x42a3), |
| 3524 | {} |
| 3525 | }; |
| 3526 | static struct coef_fw coef0292[] = { |
| 3527 | WRITE_COEF(0x76, 0x000e), |
| 3528 | WRITE_COEF(0x6c, 0x2400), |
| 3529 | WRITE_COEF(0x18, 0x7308), |
| 3530 | WRITE_COEF(0x6b, 0xc429), |
| 3531 | {} |
| 3532 | }; |
| 3533 | static struct coef_fw coef0293[] = { |
| 3534 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 3535 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 3536 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 3537 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 3538 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 3539 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 3540 | {} |
| 3541 | }; |
| 3542 | static struct coef_fw coef0668[] = { |
| 3543 | WRITE_COEF(0x15, 0x0d40), |
| 3544 | WRITE_COEF(0xb7, 0x802b), |
| 3545 | {} |
| 3546 | }; |
| 3547 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3548 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3549 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3550 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3551 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3552 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3553 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3554 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3555 | break; |
| 3556 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3557 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3558 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3559 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3560 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3561 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3562 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3563 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3564 | break; |
| 3565 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3566 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3567 | } |
| 3568 | |
| 3569 | |
| 3570 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 3571 | hda_nid_t mic_pin) |
| 3572 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3573 | static struct coef_fw coef0255[] = { |
| 3574 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 3575 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 3576 | {} |
| 3577 | }; |
| 3578 | static struct coef_fw coef0233[] = { |
| 3579 | UPDATE_COEF(0x35, 0, 1<<14), |
| 3580 | WRITE_COEF(0x06, 0x2100), |
| 3581 | WRITE_COEF(0x1a, 0x0021), |
| 3582 | WRITE_COEF(0x26, 0x008c), |
| 3583 | {} |
| 3584 | }; |
| 3585 | static struct coef_fw coef0292[] = { |
| 3586 | WRITE_COEF(0x19, 0xa208), |
| 3587 | WRITE_COEF(0x2e, 0xacf0), |
| 3588 | {} |
| 3589 | }; |
| 3590 | static struct coef_fw coef0293[] = { |
| 3591 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 3592 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 3593 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 3594 | {} |
| 3595 | }; |
| 3596 | static struct coef_fw coef0688[] = { |
| 3597 | WRITE_COEF(0xb7, 0x802b), |
| 3598 | WRITE_COEF(0xb5, 0x1040), |
| 3599 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 3600 | {} |
| 3601 | }; |
| 3602 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3603 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3604 | case 0x10ec0255: |
| 3605 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 3606 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3607 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3608 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3609 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3610 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3611 | case 0x10ec0283: |
| 3612 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 3613 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3614 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3615 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3616 | break; |
| 3617 | case 0x10ec0292: |
| 3618 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3619 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3620 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3621 | case 0x10ec0293: |
| 3622 | /* Set to TRS mode */ |
| 3623 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 3624 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3625 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3626 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3627 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3628 | case 0x10ec0668: |
| 3629 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 3630 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3631 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3632 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3633 | break; |
| 3634 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3635 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3636 | } |
| 3637 | |
| 3638 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 3639 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3640 | static struct coef_fw coef0255[] = { |
| 3641 | WRITE_COEF(0x45, 0xc089), |
| 3642 | WRITE_COEF(0x45, 0xc489), |
| 3643 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 3644 | WRITE_COEF(0x49, 0x0049), |
| 3645 | {} |
| 3646 | }; |
| 3647 | static struct coef_fw coef0233[] = { |
| 3648 | WRITE_COEF(0x06, 0x2100), |
| 3649 | WRITE_COEF(0x32, 0x4ea3), |
| 3650 | {} |
| 3651 | }; |
| 3652 | static struct coef_fw coef0292[] = { |
| 3653 | WRITE_COEF(0x76, 0x000e), |
| 3654 | WRITE_COEF(0x6c, 0x2400), |
| 3655 | WRITE_COEF(0x6b, 0xc429), |
| 3656 | WRITE_COEF(0x18, 0x7308), |
| 3657 | {} |
| 3658 | }; |
| 3659 | static struct coef_fw coef0293[] = { |
| 3660 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 3661 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 3662 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 3663 | {} |
| 3664 | }; |
| 3665 | static struct coef_fw coef0688[] = { |
| 3666 | WRITE_COEF(0x11, 0x0041), |
| 3667 | WRITE_COEF(0x15, 0x0d40), |
| 3668 | WRITE_COEF(0xb7, 0x802b), |
| 3669 | {} |
| 3670 | }; |
| 3671 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3672 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3673 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3674 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3675 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3676 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3677 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3678 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3679 | break; |
| 3680 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3681 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3682 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3683 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3684 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3685 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3686 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3687 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3688 | break; |
| 3689 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3690 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3691 | } |
| 3692 | |
| 3693 | /* Iphone type */ |
| 3694 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 3695 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3696 | static struct coef_fw coef0255[] = { |
| 3697 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 3698 | WRITE_COEF(0x1b, 0x0c2b), |
| 3699 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 3700 | {} |
| 3701 | }; |
| 3702 | static struct coef_fw coef0233[] = { |
| 3703 | WRITE_COEF(0x45, 0xd429), |
| 3704 | WRITE_COEF(0x1b, 0x0c2b), |
| 3705 | WRITE_COEF(0x32, 0x4ea3), |
| 3706 | {} |
| 3707 | }; |
| 3708 | static struct coef_fw coef0292[] = { |
| 3709 | WRITE_COEF(0x6b, 0xd429), |
| 3710 | WRITE_COEF(0x76, 0x0008), |
| 3711 | WRITE_COEF(0x18, 0x7388), |
| 3712 | {} |
| 3713 | }; |
| 3714 | static struct coef_fw coef0293[] = { |
| 3715 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 3716 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 3717 | {} |
| 3718 | }; |
| 3719 | static struct coef_fw coef0688[] = { |
| 3720 | WRITE_COEF(0x11, 0x0001), |
| 3721 | WRITE_COEF(0x15, 0x0d60), |
| 3722 | WRITE_COEF(0xc3, 0x0000), |
| 3723 | {} |
| 3724 | }; |
| 3725 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3726 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3727 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3728 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3729 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3730 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3731 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3732 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3733 | break; |
| 3734 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3735 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3736 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3737 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3738 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3739 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3740 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3741 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3742 | break; |
| 3743 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3744 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3745 | } |
| 3746 | |
| 3747 | /* Nokia type */ |
| 3748 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 3749 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3750 | static struct coef_fw coef0255[] = { |
| 3751 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 3752 | WRITE_COEF(0x1b, 0x0c2b), |
| 3753 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 3754 | {} |
| 3755 | }; |
| 3756 | static struct coef_fw coef0233[] = { |
| 3757 | WRITE_COEF(0x45, 0xe429), |
| 3758 | WRITE_COEF(0x1b, 0x0c2b), |
| 3759 | WRITE_COEF(0x32, 0x4ea3), |
| 3760 | {} |
| 3761 | }; |
| 3762 | static struct coef_fw coef0292[] = { |
| 3763 | WRITE_COEF(0x6b, 0xe429), |
| 3764 | WRITE_COEF(0x76, 0x0008), |
| 3765 | WRITE_COEF(0x18, 0x7388), |
| 3766 | {} |
| 3767 | }; |
| 3768 | static struct coef_fw coef0293[] = { |
| 3769 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 3770 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 3771 | {} |
| 3772 | }; |
| 3773 | static struct coef_fw coef0688[] = { |
| 3774 | WRITE_COEF(0x11, 0x0001), |
| 3775 | WRITE_COEF(0x15, 0x0d50), |
| 3776 | WRITE_COEF(0xc3, 0x0000), |
| 3777 | {} |
| 3778 | }; |
| 3779 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3780 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3781 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3782 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3783 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3784 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3785 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3786 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3787 | break; |
| 3788 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3789 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3790 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3791 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3792 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3793 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3794 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3795 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3796 | break; |
| 3797 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3798 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3799 | } |
| 3800 | |
| 3801 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 3802 | { |
| 3803 | int val; |
| 3804 | bool is_ctia = false; |
| 3805 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3806 | static struct coef_fw coef0255[] = { |
| 3807 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 3808 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 3809 | conteol) */ |
| 3810 | {} |
| 3811 | }; |
| 3812 | static struct coef_fw coef0293[] = { |
| 3813 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 3814 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 3815 | {} |
| 3816 | }; |
| 3817 | static struct coef_fw coef0688[] = { |
| 3818 | WRITE_COEF(0x11, 0x0001), |
| 3819 | WRITE_COEF(0xb7, 0x802b), |
| 3820 | WRITE_COEF(0x15, 0x0d60), |
| 3821 | WRITE_COEF(0xc3, 0x0c00), |
| 3822 | {} |
| 3823 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3824 | |
| 3825 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3826 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3827 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3828 | msleep(300); |
| 3829 | val = alc_read_coef_idx(codec, 0x46); |
| 3830 | is_ctia = (val & 0x0070) == 0x0070; |
| 3831 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3832 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3833 | case 0x10ec0283: |
| 3834 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 3835 | msleep(300); |
| 3836 | val = alc_read_coef_idx(codec, 0x46); |
| 3837 | is_ctia = (val & 0x0070) == 0x0070; |
| 3838 | break; |
| 3839 | case 0x10ec0292: |
| 3840 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 3841 | msleep(300); |
| 3842 | val = alc_read_coef_idx(codec, 0x6c); |
| 3843 | is_ctia = (val & 0x001c) == 0x001c; |
| 3844 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3845 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3846 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3847 | msleep(300); |
| 3848 | val = alc_read_coef_idx(codec, 0x46); |
| 3849 | is_ctia = (val & 0x0070) == 0x0070; |
| 3850 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3851 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3852 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3853 | msleep(300); |
| 3854 | val = alc_read_coef_idx(codec, 0xbe); |
| 3855 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 3856 | break; |
| 3857 | } |
| 3858 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3859 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3860 | is_ctia ? "yes" : "no"); |
| 3861 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 3862 | } |
| 3863 | |
| 3864 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 3865 | { |
| 3866 | struct alc_spec *spec = codec->spec; |
| 3867 | |
| 3868 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; |
| 3869 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3870 | |
| 3871 | int new_headset_mode; |
| 3872 | |
| 3873 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 3874 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 3875 | else if (mux_pin == spec->headset_mic_pin) |
| 3876 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 3877 | else if (mux_pin == spec->headphone_mic_pin) |
| 3878 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 3879 | else |
| 3880 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 3881 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 3882 | if (new_headset_mode == spec->current_headset_mode) { |
| 3883 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3884 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 3885 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3886 | |
| 3887 | switch (new_headset_mode) { |
| 3888 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 3889 | alc_headset_mode_unplugged(codec); |
| 3890 | spec->gen.hp_jack_present = false; |
| 3891 | break; |
| 3892 | case ALC_HEADSET_MODE_HEADSET: |
| 3893 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 3894 | alc_determine_headset_type(codec); |
| 3895 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 3896 | alc_headset_mode_ctia(codec); |
| 3897 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 3898 | alc_headset_mode_omtp(codec); |
| 3899 | spec->gen.hp_jack_present = true; |
| 3900 | break; |
| 3901 | case ALC_HEADSET_MODE_MIC: |
| 3902 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 3903 | spec->gen.hp_jack_present = false; |
| 3904 | break; |
| 3905 | case ALC_HEADSET_MODE_HEADPHONE: |
| 3906 | alc_headset_mode_default(codec); |
| 3907 | spec->gen.hp_jack_present = true; |
| 3908 | break; |
| 3909 | } |
| 3910 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 3911 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 3912 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
| 3913 | if (spec->headphone_mic_pin) |
| 3914 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 3915 | PIN_VREFHIZ); |
| 3916 | } |
| 3917 | spec->current_headset_mode = new_headset_mode; |
| 3918 | |
| 3919 | snd_hda_gen_update_outputs(codec); |
| 3920 | } |
| 3921 | |
| 3922 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 3923 | struct snd_kcontrol *kcontrol, |
| 3924 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3925 | { |
| 3926 | alc_update_headset_mode(codec); |
| 3927 | } |
| 3928 | |
| 3929 | static void alc_update_headset_jack_cb(struct hda_codec *codec, struct hda_jack_tbl *jack) |
| 3930 | { |
| 3931 | struct alc_spec *spec = codec->spec; |
David Henningsson | 5db4d34 | 2013-11-22 12:17:06 +0100 | [diff] [blame] | 3932 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3933 | snd_hda_gen_hp_automute(codec, jack); |
| 3934 | } |
| 3935 | |
| 3936 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 3937 | { |
| 3938 | int i; |
| 3939 | struct alc_spec *spec = codec->spec; |
| 3940 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 3941 | |
| 3942 | /* Find mic pins */ |
| 3943 | for (i = 0; i < cfg->num_inputs; i++) { |
| 3944 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 3945 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 3946 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 3947 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 3948 | } |
| 3949 | |
| 3950 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 3951 | spec->gen.automute_hook = alc_update_headset_mode; |
| 3952 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 3953 | } |
| 3954 | |
| 3955 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 3956 | const struct hda_fixup *fix, int action) |
| 3957 | { |
| 3958 | struct alc_spec *spec = codec->spec; |
| 3959 | |
| 3960 | switch (action) { |
| 3961 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 3962 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 3963 | break; |
| 3964 | case HDA_FIXUP_ACT_PROBE: |
| 3965 | alc_probe_headset_mode(codec); |
| 3966 | break; |
| 3967 | case HDA_FIXUP_ACT_INIT: |
| 3968 | spec->current_headset_mode = 0; |
| 3969 | alc_update_headset_mode(codec); |
| 3970 | break; |
| 3971 | } |
| 3972 | } |
| 3973 | |
| 3974 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 3975 | const struct hda_fixup *fix, int action) |
| 3976 | { |
| 3977 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3978 | struct alc_spec *spec = codec->spec; |
| 3979 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3980 | } |
| 3981 | else |
| 3982 | alc_fixup_headset_mode(codec, fix, action); |
| 3983 | } |
| 3984 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 3985 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 3986 | { |
| 3987 | /* Set to iphone type */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3988 | static struct coef_fw fw[] = { |
| 3989 | WRITE_COEF(0x1b, 0x880b), |
| 3990 | WRITE_COEF(0x45, 0xd089), |
| 3991 | WRITE_COEF(0x1b, 0x080b), |
| 3992 | WRITE_COEF(0x46, 0x0004), |
| 3993 | WRITE_COEF(0x1b, 0x0c0b), |
| 3994 | {} |
| 3995 | }; |
| 3996 | alc_process_coef_fw(codec, fw); |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 3997 | msleep(30); |
| 3998 | } |
| 3999 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4000 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 4001 | const struct hda_fixup *fix, int action) |
| 4002 | { |
| 4003 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4004 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4005 | } |
| 4006 | alc_fixup_headset_mode(codec, fix, action); |
| 4007 | } |
| 4008 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4009 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 4010 | const struct hda_fixup *fix, int action) |
| 4011 | { |
| 4012 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4013 | struct alc_spec *spec = codec->spec; |
| 4014 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4015 | alc255_set_default_jack_type(codec); |
| 4016 | } |
| 4017 | else |
| 4018 | alc_fixup_headset_mode(codec, fix, action); |
| 4019 | } |
| 4020 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 4021 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 4022 | const struct hda_fixup *fix, int action) |
| 4023 | { |
| 4024 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4025 | struct alc_spec *spec = codec->spec; |
| 4026 | spec->gen.auto_mute_via_amp = 1; |
| 4027 | } |
| 4028 | } |
| 4029 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4030 | static void alc_no_shutup(struct hda_codec *codec) |
| 4031 | { |
| 4032 | } |
| 4033 | |
| 4034 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 4035 | const struct hda_fixup *fix, int action) |
| 4036 | { |
| 4037 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4038 | struct alc_spec *spec = codec->spec; |
| 4039 | spec->shutup = alc_no_shutup; |
| 4040 | } |
| 4041 | } |
| 4042 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 4043 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 4044 | const struct hda_fixup *fix, int action) |
| 4045 | { |
| 4046 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4047 | struct alc_spec *spec = codec->spec; |
| 4048 | /* Disable AA-loopback as it causes white noise */ |
| 4049 | spec->gen.mixer_nid = 0; |
| 4050 | } |
| 4051 | } |
| 4052 | |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4053 | static unsigned int alc_power_filter_xps13(struct hda_codec *codec, |
| 4054 | hda_nid_t nid, |
| 4055 | unsigned int power_state) |
| 4056 | { |
| 4057 | struct alc_spec *spec = codec->spec; |
| 4058 | |
| 4059 | /* Avoid pop noises when headphones are plugged in */ |
| 4060 | if (spec->gen.hp_jack_present) |
Gabriele Mazzotta | de3da4f | 2014-08-08 19:34:41 +0200 | [diff] [blame] | 4061 | if (nid == codec->afg || nid == 0x02 || nid == 0x15) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4062 | return AC_PWRST_D0; |
| 4063 | return power_state; |
| 4064 | } |
| 4065 | |
| 4066 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 4067 | const struct hda_fixup *fix, int action) |
| 4068 | { |
| 4069 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 4070 | struct alc_spec *spec = codec->spec; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 4071 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 4072 | int i; |
| 4073 | |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4074 | spec->shutup = alc_no_shutup; |
| 4075 | codec->power_filter = alc_power_filter_xps13; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 4076 | |
| 4077 | /* Make the internal mic the default input source. */ |
| 4078 | for (i = 0; i < imux->num_items; i++) { |
| 4079 | if (spec->gen.imux_pins[i] == 0x12) { |
| 4080 | spec->gen.cur_mux[0] = i; |
| 4081 | break; |
| 4082 | } |
| 4083 | } |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4084 | } |
| 4085 | } |
| 4086 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4087 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 4088 | const struct hda_fixup *fix, int action) |
| 4089 | { |
| 4090 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4091 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4092 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4093 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 4094 | } |
| 4095 | alc_fixup_headset_mode(codec, fix, action); |
| 4096 | } |
| 4097 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 4098 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 4099 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 4100 | { |
| 4101 | struct alc_spec *spec = codec->spec; |
| 4102 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 4103 | hda_nid_t nid; |
| 4104 | unsigned int defcfg; |
| 4105 | int i; |
| 4106 | |
| 4107 | for (i = 0; i < cfg->num_inputs; i++) { |
| 4108 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 4109 | continue; |
| 4110 | nid = cfg->inputs[i].pin; |
| 4111 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 4112 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 4113 | continue; |
| 4114 | return nid; |
| 4115 | } |
| 4116 | |
| 4117 | return 0; |
| 4118 | } |
| 4119 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4120 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4121 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4122 | int action) |
| 4123 | { |
| 4124 | struct alc_spec *spec = codec->spec; |
| 4125 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 4126 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 4127 | int mic_pin = find_ext_mic_pin(codec); |
| 4128 | int hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 4129 | |
| 4130 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 4131 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 4132 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 4133 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4134 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4135 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4136 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 4137 | const struct hda_fixup *fix, |
| 4138 | int action) |
| 4139 | { |
| 4140 | struct alc_spec *spec = codec->spec; |
| 4141 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 4142 | int i; |
| 4143 | |
| 4144 | /* The mic boosts on level 2 and 3 are too noisy |
| 4145 | on the internal mic input. |
| 4146 | Therefore limit the boost to 0 or 1. */ |
| 4147 | |
| 4148 | if (action != HDA_FIXUP_ACT_PROBE) |
| 4149 | return; |
| 4150 | |
| 4151 | for (i = 0; i < cfg->num_inputs; i++) { |
| 4152 | hda_nid_t nid = cfg->inputs[i].pin; |
| 4153 | unsigned int defcfg; |
| 4154 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 4155 | continue; |
| 4156 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 4157 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 4158 | continue; |
| 4159 | |
| 4160 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 4161 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 4162 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 4163 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 4164 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 4165 | } |
| 4166 | } |
| 4167 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4168 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
| 4169 | struct hda_jack_tbl *jack) |
| 4170 | { |
| 4171 | struct alc_spec *spec = codec->spec; |
| 4172 | int vref; |
| 4173 | |
| 4174 | msleep(200); |
| 4175 | snd_hda_gen_hp_automute(codec, jack); |
| 4176 | |
| 4177 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 4178 | |
| 4179 | msleep(600); |
| 4180 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 4181 | vref); |
| 4182 | } |
| 4183 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4184 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 4185 | const struct hda_fixup *fix, int action) |
| 4186 | { |
| 4187 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4188 | |
| 4189 | switch (action) { |
| 4190 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4191 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 4192 | /* Disable AA-loopback as it causes white noise */ |
| 4193 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 4194 | break; |
| 4195 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 4196 | /* MIC2-VREF control */ |
| 4197 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4198 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4199 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4200 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4201 | break; |
| 4202 | } |
| 4203 | } |
| 4204 | |
| 4205 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 4206 | const struct hda_fixup *fix, int action) |
| 4207 | { |
| 4208 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4209 | |
| 4210 | switch (action) { |
| 4211 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4212 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 4213 | break; |
| 4214 | case HDA_FIXUP_ACT_INIT: |
| 4215 | /* MIC2-VREF control */ |
| 4216 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4217 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4218 | break; |
| 4219 | } |
| 4220 | } |
| 4221 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4222 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 4223 | static void asus_tx300_automute(struct hda_codec *codec) |
| 4224 | { |
| 4225 | struct alc_spec *spec = codec->spec; |
| 4226 | snd_hda_gen_update_outputs(codec); |
| 4227 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 4228 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 4229 | } |
| 4230 | |
| 4231 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 4232 | const struct hda_fixup *fix, int action) |
| 4233 | { |
| 4234 | struct alc_spec *spec = codec->spec; |
| 4235 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 4236 | static const struct hda_verb gpio2_verbs[] = { |
| 4237 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, |
| 4238 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, |
| 4239 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x04 }, |
| 4240 | {} |
| 4241 | }; |
| 4242 | static const struct hda_pintbl dock_pins[] = { |
| 4243 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 4244 | {} |
| 4245 | }; |
| 4246 | struct snd_kcontrol *kctl; |
| 4247 | |
| 4248 | switch (action) { |
| 4249 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 4250 | snd_hda_add_verbs(codec, gpio2_verbs); |
| 4251 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 4252 | spec->gen.auto_mute_via_amp = 1; |
| 4253 | spec->gen.automute_hook = asus_tx300_automute; |
| 4254 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4255 | snd_hda_gen_hp_automute); |
| 4256 | break; |
| 4257 | case HDA_FIXUP_ACT_BUILD: |
| 4258 | /* this is a bit tricky; give more sane names for the main |
| 4259 | * (tablet) speaker and the dock speaker, respectively |
| 4260 | */ |
| 4261 | kctl = snd_hda_find_mixer_ctl(codec, "Speaker Playback Switch"); |
| 4262 | if (kctl) |
| 4263 | strcpy(kctl->id.name, "Dock Speaker Playback Switch"); |
| 4264 | kctl = snd_hda_find_mixer_ctl(codec, "Bass Speaker Playback Switch"); |
| 4265 | if (kctl) |
| 4266 | strcpy(kctl->id.name, "Speaker Playback Switch"); |
| 4267 | break; |
| 4268 | } |
| 4269 | } |
| 4270 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4271 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 4272 | const struct hda_fixup *fix, int action) |
| 4273 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4274 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4275 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 4276 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 4277 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
| 4278 | hda_nid_t conn1[2] = { 0x0c }; |
| 4279 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 4280 | snd_hda_override_conn_list(codec, 0x15, 1, conn1); |
| 4281 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4282 | } |
| 4283 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 4284 | /* for hda_fixup_thinkpad_acpi() */ |
| 4285 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4286 | |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4287 | /* for dell wmi mic mute led */ |
| 4288 | #include "dell_wmi_helper.c" |
| 4289 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4290 | enum { |
| 4291 | ALC269_FIXUP_SONY_VAIO, |
| 4292 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 4293 | ALC269_FIXUP_DELL_M101Z, |
| 4294 | ALC269_FIXUP_SKU_IGNORE, |
| 4295 | ALC269_FIXUP_ASUS_G73JW, |
| 4296 | ALC269_FIXUP_LENOVO_EAPD, |
| 4297 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 4298 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4299 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4300 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4301 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 4302 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4303 | ALC269_FIXUP_QUANTA_MUTE, |
| 4304 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 4305 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4306 | ALC269_FIXUP_AMIC, |
| 4307 | ALC269_FIXUP_DMIC, |
| 4308 | ALC269VB_FIXUP_AMIC, |
| 4309 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4310 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4311 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4312 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4313 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4314 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 4315 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4316 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4317 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4318 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4319 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4320 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4321 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 4322 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4323 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4324 | ALC269_FIXUP_HEADSET_MODE, |
| 4325 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4326 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 4327 | ALC269_FIXUP_ASUS_X101_VERB, |
| 4328 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4329 | ALC271_FIXUP_AMIC_MIC2, |
| 4330 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 4331 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 4332 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4333 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 4334 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 4335 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 4336 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 4337 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4338 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4339 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4340 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 4341 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4342 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4343 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 4344 | ALC290_FIXUP_SUBWOOFER, |
| 4345 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4346 | ALC269_FIXUP_THINKPAD_ACPI, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4347 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4348 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4349 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4350 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4351 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 4352 | ALC292_FIXUP_TPT440_DOCK, |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 4353 | ALC283_FIXUP_BXBT2807_MIC, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4354 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 4355 | ALC282_FIXUP_ASPIRE_V5_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4356 | }; |
| 4357 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4358 | static const struct hda_fixup alc269_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4359 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 4360 | .type = HDA_FIXUP_PINCTLS, |
| 4361 | .v.pins = (const struct hda_pintbl[]) { |
| 4362 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4363 | {} |
| 4364 | } |
| 4365 | }, |
| 4366 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4367 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4368 | .v.verbs = (const struct hda_verb[]) { |
| 4369 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, |
| 4370 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, |
| 4371 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, |
| 4372 | { } |
| 4373 | }, |
| 4374 | .chained = true, |
| 4375 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 4376 | }, |
| 4377 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4378 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4379 | .v.verbs = (const struct hda_verb[]) { |
| 4380 | /* Enables internal speaker */ |
| 4381 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 4382 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 4383 | {} |
| 4384 | } |
| 4385 | }, |
| 4386 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4387 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 4388 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4389 | }, |
| 4390 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4391 | .type = HDA_FIXUP_PINS, |
| 4392 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4393 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 4394 | { } |
| 4395 | } |
| 4396 | }, |
| 4397 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4398 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4399 | .v.verbs = (const struct hda_verb[]) { |
| 4400 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 4401 | {} |
| 4402 | } |
| 4403 | }, |
| 4404 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4405 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4406 | .v.func = alc269_fixup_hweq, |
| 4407 | .chained = true, |
| 4408 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 4409 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 4410 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 4411 | .type = HDA_FIXUP_FUNC, |
| 4412 | .v.func = alc_fixup_disable_aamix, |
| 4413 | .chained = true, |
| 4414 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 4415 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4416 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4417 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4418 | .v.func = alc271_fixup_dmic, |
| 4419 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4420 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4421 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4422 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 4423 | .chained = true, |
| 4424 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4425 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4426 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4427 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4428 | .v.func = alc269_fixup_stereo_dmic, |
| 4429 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 4430 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 4431 | .type = HDA_FIXUP_FUNC, |
| 4432 | .v.func = alc269_fixup_headset_mic, |
| 4433 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4434 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4435 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4436 | .v.func = alc269_fixup_quanta_mute, |
| 4437 | }, |
| 4438 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4439 | .type = HDA_FIXUP_PINS, |
| 4440 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4441 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 4442 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 4443 | { } |
| 4444 | }, |
| 4445 | .chained = true, |
| 4446 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 4447 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 4448 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 4449 | .type = HDA_FIXUP_PINS, |
| 4450 | .v.pins = (const struct hda_pintbl[]) { |
| 4451 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 4452 | { } |
| 4453 | }, |
| 4454 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4455 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4456 | .type = HDA_FIXUP_PINS, |
| 4457 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4458 | { 0x14, 0x99130110 }, /* speaker */ |
| 4459 | { 0x15, 0x0121401f }, /* HP out */ |
| 4460 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4461 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 4462 | { } |
| 4463 | }, |
| 4464 | }, |
| 4465 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4466 | .type = HDA_FIXUP_PINS, |
| 4467 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4468 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4469 | { 0x14, 0x99130110 }, /* speaker */ |
| 4470 | { 0x15, 0x0121401f }, /* HP out */ |
| 4471 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4472 | { } |
| 4473 | }, |
| 4474 | }, |
| 4475 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4476 | .type = HDA_FIXUP_PINS, |
| 4477 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4478 | { 0x14, 0x99130110 }, /* speaker */ |
| 4479 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4480 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 4481 | { 0x21, 0x0121401f }, /* HP out */ |
| 4482 | { } |
| 4483 | }, |
| 4484 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 4485 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4486 | .type = HDA_FIXUP_PINS, |
| 4487 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4488 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4489 | { 0x14, 0x99130110 }, /* speaker */ |
| 4490 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4491 | { 0x21, 0x0121401f }, /* HP out */ |
| 4492 | { } |
| 4493 | }, |
| 4494 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4495 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4496 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4497 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4498 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4499 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 4500 | .type = HDA_FIXUP_FUNC, |
| 4501 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 4502 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4503 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4504 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4505 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4506 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4507 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 4508 | .type = HDA_FIXUP_FUNC, |
| 4509 | .v.func = alc269_fixup_hp_gpio_led, |
| 4510 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4511 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 4512 | .type = HDA_FIXUP_FUNC, |
| 4513 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 4514 | }, |
| 4515 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 4516 | .type = HDA_FIXUP_FUNC, |
| 4517 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 4518 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4519 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4520 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 4521 | .v.func = alc_fixup_inv_dmic_0x12, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4522 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4523 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 4524 | .type = HDA_FIXUP_FUNC, |
| 4525 | .v.func = alc_fixup_no_shutup, |
| 4526 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4527 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4528 | .type = HDA_FIXUP_PINS, |
| 4529 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4530 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 4531 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 4532 | { } |
| 4533 | }, |
| 4534 | .chained = true, |
| 4535 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 4536 | }, |
| 4537 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4538 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4539 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 4540 | .chained = true, |
| 4541 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4542 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4543 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 4544 | .type = HDA_FIXUP_PINS, |
| 4545 | .v.pins = (const struct hda_pintbl[]) { |
| 4546 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4547 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 4548 | { } |
| 4549 | }, |
| 4550 | .chained = true, |
| 4551 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 4552 | }, |
| 4553 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 4554 | .type = HDA_FIXUP_PINS, |
| 4555 | .v.pins = (const struct hda_pintbl[]) { |
| 4556 | { 0x16, 0x21014020 }, /* dock line out */ |
| 4557 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 4558 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4559 | { } |
| 4560 | }, |
| 4561 | .chained = true, |
| 4562 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 4563 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4564 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 4565 | .type = HDA_FIXUP_PINS, |
| 4566 | .v.pins = (const struct hda_pintbl[]) { |
| 4567 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4568 | { } |
| 4569 | }, |
| 4570 | .chained = true, |
| 4571 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 4572 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4573 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 4574 | .type = HDA_FIXUP_FUNC, |
| 4575 | .v.func = alc_fixup_headset_mode, |
| 4576 | }, |
| 4577 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 4578 | .type = HDA_FIXUP_FUNC, |
| 4579 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 4580 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4581 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 4582 | .type = HDA_FIXUP_PINS, |
| 4583 | .v.pins = (const struct hda_pintbl[]) { |
| 4584 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4585 | { } |
| 4586 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 4587 | .chained = true, |
| 4588 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4589 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4590 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 4591 | .type = HDA_FIXUP_FUNC, |
| 4592 | .v.func = alc269_fixup_x101_headset_mic, |
| 4593 | }, |
| 4594 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 4595 | .type = HDA_FIXUP_VERBS, |
| 4596 | .v.verbs = (const struct hda_verb[]) { |
| 4597 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 4598 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 4599 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 4600 | { } |
| 4601 | }, |
| 4602 | .chained = true, |
| 4603 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 4604 | }, |
| 4605 | [ALC269_FIXUP_ASUS_X101] = { |
| 4606 | .type = HDA_FIXUP_PINS, |
| 4607 | .v.pins = (const struct hda_pintbl[]) { |
| 4608 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 4609 | { } |
| 4610 | }, |
| 4611 | .chained = true, |
| 4612 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 4613 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4614 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4615 | .type = HDA_FIXUP_PINS, |
| 4616 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4617 | { 0x14, 0x99130110 }, /* speaker */ |
| 4618 | { 0x19, 0x01a19c20 }, /* mic */ |
| 4619 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 4620 | { 0x21, 0x0121401f }, /* HP out */ |
| 4621 | { } |
| 4622 | }, |
| 4623 | }, |
| 4624 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4625 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4626 | .v.func = alc271_hp_gate_mic_jack, |
| 4627 | .chained = true, |
| 4628 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 4629 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 4630 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 4631 | .type = HDA_FIXUP_FUNC, |
| 4632 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 4633 | .chained = true, |
| 4634 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 4635 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 4636 | [ALC269_FIXUP_ACER_AC700] = { |
| 4637 | .type = HDA_FIXUP_PINS, |
| 4638 | .v.pins = (const struct hda_pintbl[]) { |
| 4639 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4640 | { 0x14, 0x99130110 }, /* speaker */ |
| 4641 | { 0x18, 0x03a11c20 }, /* mic */ |
| 4642 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 4643 | { 0x21, 0x0321101f }, /* HP out */ |
| 4644 | { } |
| 4645 | }, |
| 4646 | .chained = true, |
| 4647 | .chain_id = ALC271_FIXUP_DMIC, |
| 4648 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4649 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 4650 | .type = HDA_FIXUP_FUNC, |
| 4651 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 4652 | .chained = true, |
| 4653 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4654 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 4655 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 4656 | .type = HDA_FIXUP_FUNC, |
| 4657 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 4658 | .chained = true, |
| 4659 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 4660 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 4661 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 4662 | .type = HDA_FIXUP_VERBS, |
| 4663 | .v.verbs = (const struct hda_verb[]) { |
| 4664 | /* class-D output amp +5dB */ |
| 4665 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 4666 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 4667 | {} |
| 4668 | }, |
| 4669 | .chained = true, |
| 4670 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 4671 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 4672 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 4673 | .type = HDA_FIXUP_FUNC, |
| 4674 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 4675 | .chained = true, |
| 4676 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 4677 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 4678 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 4679 | .type = HDA_FIXUP_PINS, |
| 4680 | .v.pins = (const struct hda_pintbl[]) { |
| 4681 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4682 | { 0x18, 0x03a11d20 }, /* mic */ |
| 4683 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 4684 | { } |
| 4685 | }, |
| 4686 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4687 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 4688 | .type = HDA_FIXUP_FUNC, |
| 4689 | .v.func = alc283_fixup_chromebook, |
| 4690 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4691 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 4692 | .type = HDA_FIXUP_FUNC, |
| 4693 | .v.func = alc283_fixup_sense_combo_jack, |
| 4694 | .chained = true, |
| 4695 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 4696 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4697 | [ALC282_FIXUP_ASUS_TX300] = { |
| 4698 | .type = HDA_FIXUP_FUNC, |
| 4699 | .v.func = alc282_fixup_asus_tx300, |
| 4700 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 4701 | [ALC283_FIXUP_INT_MIC] = { |
| 4702 | .type = HDA_FIXUP_VERBS, |
| 4703 | .v.verbs = (const struct hda_verb[]) { |
| 4704 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 4705 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 4706 | { } |
| 4707 | }, |
| 4708 | .chained = true, |
| 4709 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 4710 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4711 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 4712 | .type = HDA_FIXUP_PINS, |
| 4713 | .v.pins = (const struct hda_pintbl[]) { |
| 4714 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 4715 | { } |
| 4716 | }, |
| 4717 | .chained = true, |
| 4718 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 4719 | }, |
| 4720 | [ALC290_FIXUP_SUBWOOFER] = { |
| 4721 | .type = HDA_FIXUP_PINS, |
| 4722 | .v.pins = (const struct hda_pintbl[]) { |
| 4723 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 4724 | { } |
| 4725 | }, |
| 4726 | .chained = true, |
| 4727 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 4728 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4729 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 4730 | .type = HDA_FIXUP_FUNC, |
| 4731 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4732 | }, |
| 4733 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 4734 | .type = HDA_FIXUP_FUNC, |
| 4735 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4736 | .chained = true, |
| 4737 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 4738 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4739 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 4740 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 4741 | .v.func = hda_fixup_thinkpad_acpi, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4742 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4743 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 4744 | .type = HDA_FIXUP_PINS, |
| 4745 | .v.pins = (const struct hda_pintbl[]) { |
| 4746 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4747 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 4748 | { } |
| 4749 | }, |
| 4750 | .chained = true, |
| 4751 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 4752 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4753 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 4754 | .type = HDA_FIXUP_PINS, |
| 4755 | .v.pins = (const struct hda_pintbl[]) { |
| 4756 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4757 | { } |
| 4758 | }, |
| 4759 | .chained = true, |
| 4760 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 4761 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4762 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 4763 | .type = HDA_FIXUP_FUNC, |
| 4764 | .v.func = alc_fixup_headset_mode_alc255, |
| 4765 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4766 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 4767 | .type = HDA_FIXUP_FUNC, |
| 4768 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 4769 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4770 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 4771 | .type = HDA_FIXUP_PINS, |
| 4772 | .v.pins = (const struct hda_pintbl[]) { |
| 4773 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 4774 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4775 | { } |
| 4776 | }, |
| 4777 | .chained = true, |
| 4778 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 4779 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 4780 | [ALC292_FIXUP_TPT440_DOCK] = { |
| 4781 | .type = HDA_FIXUP_PINS, |
| 4782 | .v.pins = (const struct hda_pintbl[]) { |
| 4783 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 4784 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 4785 | { } |
| 4786 | }, |
| 4787 | .chained = true, |
| 4788 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 4789 | }, |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 4790 | [ALC283_FIXUP_BXBT2807_MIC] = { |
| 4791 | .type = HDA_FIXUP_PINS, |
| 4792 | .v.pins = (const struct hda_pintbl[]) { |
| 4793 | { 0x19, 0x04a110f0 }, |
| 4794 | { }, |
| 4795 | }, |
| 4796 | }, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4797 | [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED] = { |
| 4798 | .type = HDA_FIXUP_FUNC, |
| 4799 | .v.func = alc_fixup_dell_wmi, |
| 4800 | .chained_before = true, |
| 4801 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 4802 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 4803 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 4804 | .type = HDA_FIXUP_PINS, |
| 4805 | .v.pins = (const struct hda_pintbl[]) { |
| 4806 | { 0x12, 0x90a60130 }, |
| 4807 | { 0x14, 0x90170110 }, |
| 4808 | { 0x17, 0x40000008 }, |
| 4809 | { 0x18, 0x411111f0 }, |
| 4810 | { 0x19, 0x411111f0 }, |
| 4811 | { 0x1a, 0x411111f0 }, |
| 4812 | { 0x1b, 0x411111f0 }, |
| 4813 | { 0x1d, 0x40f89b2d }, |
| 4814 | { 0x1e, 0x411111f0 }, |
| 4815 | { 0x21, 0x0321101f }, |
| 4816 | { }, |
| 4817 | }, |
| 4818 | }, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4819 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4820 | }; |
| 4821 | |
| 4822 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 4823 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4824 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 4825 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 4826 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
| 4827 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 4828 | SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 4829 | 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] | 4830 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 4831 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4832 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4833 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4834 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4835 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4836 | SND_PCI_QUIRK(0x1028, 0x0610, "Dell", ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4837 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 4838 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4839 | SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4840 | 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] | 4841 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4842 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4843 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4844 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4845 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4846 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 4847 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4848 | /* ALC282 */ |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4849 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4850 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4851 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 4852 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 4853 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 4854 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4855 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4856 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4857 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4858 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4859 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4860 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4861 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4862 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4863 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4864 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4865 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4866 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4867 | SND_PCI_QUIRK(0x103c, 0x8004, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4868 | /* ALC290 */ |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4869 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4870 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4871 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4872 | SND_PCI_QUIRK(0x103c, 0x2246, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4873 | SND_PCI_QUIRK(0x103c, 0x2247, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4874 | SND_PCI_QUIRK(0x103c, 0x2248, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4875 | SND_PCI_QUIRK(0x103c, 0x2249, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4876 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4877 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4878 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4879 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4880 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4881 | SND_PCI_QUIRK(0x103c, 0x2258, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4882 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4883 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4884 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4885 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4886 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4887 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4888 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4889 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4890 | SND_PCI_QUIRK(0x103c, 0x2277, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4891 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4892 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4893 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4894 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4895 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4896 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4897 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4898 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4899 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4900 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4901 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4902 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4903 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4904 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4905 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 4906 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 4907 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 4908 | 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] | 4909 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4910 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4911 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4912 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4913 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 4914 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 4915 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 4916 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4917 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | f88abaa | 2014-02-07 12:07:59 +0100 | [diff] [blame] | 4918 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4919 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4920 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 4921 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 4922 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 4923 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4924 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 4925 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 4926 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_BXBT2807_MIC), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4927 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 4928 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 4929 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 4930 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 4931 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | 707fba3 | 2012-08-02 09:04:39 +0200 | [diff] [blame] | 4932 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
Felix Kaechele | c8415a4 | 2012-08-06 23:02:01 +0200 | [diff] [blame] | 4933 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Stefán Freyr | 84f98fd | 2012-10-19 22:46:00 +0200 | [diff] [blame] | 4934 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 4935 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4936 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 4937 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 4938 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK), |
| 4939 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 4940 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 4941 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 4942 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 4943 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4944 | SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 4945 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 4946 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 4947 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 4948 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 4949 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4950 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 4951 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4952 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 4953 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4954 | /* Below is a quirk table taken from the old code. |
| 4955 | * Basically the device should work as is without the fixup table. |
| 4956 | * If BIOS doesn't give a proper info, enable the corresponding |
| 4957 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 4958 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4959 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 4960 | ALC269_FIXUP_AMIC), |
| 4961 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4962 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 4963 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 4964 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 4965 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 4966 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 4967 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 4968 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 4969 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 4970 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 4971 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 4972 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 4973 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 4974 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 4975 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 4976 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 4977 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 4978 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 4979 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 4980 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 4981 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 4982 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 4983 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 4984 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 4985 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 4986 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 4987 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 4988 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 4989 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 4990 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 4991 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 4992 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 4993 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 4994 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 4995 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 4996 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 4997 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 4998 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 4999 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 5000 | #endif |
| 5001 | {} |
| 5002 | }; |
| 5003 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 5004 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 5005 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 5006 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 5007 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 5008 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
| 5009 | {} |
| 5010 | }; |
| 5011 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5012 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5013 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 5014 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 5015 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 5016 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 5017 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5018 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5019 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5020 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 5021 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 5022 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 5023 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5024 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 5025 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5026 | {} |
| 5027 | }; |
| 5028 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 5029 | #define ALC255_STANDARD_PINS \ |
| 5030 | {0x18, 0x411111f0}, \ |
| 5031 | {0x19, 0x411111f0}, \ |
| 5032 | {0x1a, 0x411111f0}, \ |
| 5033 | {0x1b, 0x411111f0}, \ |
| 5034 | {0x1e, 0x411111f0} |
| 5035 | |
| 5036 | #define ALC282_STANDARD_PINS \ |
| 5037 | {0x14, 0x90170110}, \ |
| 5038 | {0x18, 0x411111f0}, \ |
| 5039 | {0x1a, 0x411111f0}, \ |
| 5040 | {0x1b, 0x411111f0}, \ |
| 5041 | {0x1e, 0x411111f0} |
| 5042 | |
| 5043 | #define ALC290_STANDARD_PINS \ |
| 5044 | {0x12, 0x99a30130}, \ |
| 5045 | {0x13, 0x40000000}, \ |
| 5046 | {0x16, 0x411111f0}, \ |
| 5047 | {0x17, 0x411111f0}, \ |
| 5048 | {0x19, 0x411111f0}, \ |
| 5049 | {0x1b, 0x411111f0}, \ |
| 5050 | {0x1e, 0x411111f0} |
| 5051 | |
| 5052 | #define ALC292_STANDARD_PINS \ |
| 5053 | {0x14, 0x90170110}, \ |
| 5054 | {0x15, 0x0221401f}, \ |
| 5055 | {0x1a, 0x411111f0}, \ |
| 5056 | {0x1b, 0x411111f0}, \ |
| 5057 | {0x1d, 0x40700001}, \ |
| 5058 | {0x1e, 0x411111f0} |
| 5059 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 5060 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5061 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5062 | ALC255_STANDARD_PINS, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5063 | {0x12, 0x40300000}, |
| 5064 | {0x14, 0x90170110}, |
| 5065 | {0x17, 0x411111f0}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5066 | {0x1d, 0x40538029}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5067 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5068 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5069 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5070 | {0x12, 0x90a60140}, |
| 5071 | {0x14, 0x90170110}, |
| 5072 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5073 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5074 | {0x21, 0x02211020}), |
| 5075 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5076 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5077 | {0x12, 0x90a60160}, |
| 5078 | {0x14, 0x90170120}, |
| 5079 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5080 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5081 | {0x21, 0x02211030}), |
| 5082 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5083 | {0x12, 0x90a60160}, |
| 5084 | {0x14, 0x90170120}, |
| 5085 | {0x17, 0x90170140}, |
| 5086 | {0x18, 0x40000000}, |
| 5087 | {0x19, 0x411111f0}, |
| 5088 | {0x1a, 0x411111f0}, |
| 5089 | {0x1b, 0x411111f0}, |
| 5090 | {0x1d, 0x41163b05}, |
| 5091 | {0x1e, 0x411111f0}, |
| 5092 | {0x21, 0x0321102f}), |
| 5093 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5094 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5095 | {0x12, 0x90a60160}, |
| 5096 | {0x14, 0x90170130}, |
| 5097 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5098 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5099 | {0x21, 0x02211040}), |
| 5100 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5101 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5102 | {0x12, 0x90a60160}, |
| 5103 | {0x14, 0x90170140}, |
| 5104 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5105 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5106 | {0x21, 0x02211050}), |
| 5107 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5108 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5109 | {0x12, 0x90a60170}, |
| 5110 | {0x14, 0x90170120}, |
| 5111 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5112 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5113 | {0x21, 0x02211030}), |
| 5114 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5115 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5116 | {0x12, 0x90a60170}, |
| 5117 | {0x14, 0x90170130}, |
| 5118 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5119 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5120 | {0x21, 0x02211040}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 5121 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 5122 | {0x12, 0x90a60140}, |
| 5123 | {0x13, 0x40000000}, |
| 5124 | {0x14, 0x90170110}, |
| 5125 | {0x15, 0x0421101f}, |
| 5126 | {0x16, 0x411111f0}, |
| 5127 | {0x17, 0x411111f0}, |
| 5128 | {0x18, 0x02811030}, |
| 5129 | {0x19, 0x411111f0}, |
| 5130 | {0x1a, 0x04a1103f}, |
| 5131 | {0x1b, 0x02011020}, |
| 5132 | {0x1d, 0x40700001}, |
| 5133 | {0x1e, 0x411111f0}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5134 | 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] | 5135 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5136 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5137 | {0x17, 0x40000000}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5138 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5139 | {0x1d, 0x40f41905}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5140 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5141 | 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] | 5142 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5143 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5144 | {0x17, 0x40020008}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5145 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5146 | {0x1d, 0x40e00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5147 | {0x21, 0x03211040}), |
| 5148 | 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] | 5149 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5150 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5151 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5152 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5153 | {0x1d, 0x40e00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5154 | {0x21, 0x03211020}), |
| 5155 | 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] | 5156 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5157 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5158 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5159 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5160 | {0x1d, 0x40f00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5161 | {0x21, 0x03211020}), |
| 5162 | 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] | 5163 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5164 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5165 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5166 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5167 | {0x1d, 0x40f00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5168 | {0x21, 0x0421101f}), |
| 5169 | 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] | 5170 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5171 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5172 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5173 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5174 | {0x1d, 0x40f00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5175 | {0x21, 0x04211020}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5176 | 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] | 5177 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5178 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5179 | {0x17, 0x40000000}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5180 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5181 | {0x1d, 0x40f00001}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5182 | {0x21, 0x04211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5183 | 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] | 5184 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5185 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5186 | {0x17, 0x40020008}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5187 | {0x19, 0x411111f0}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5188 | {0x1d, 0x40e00001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5189 | {0x21, 0x0321101f}), |
| 5190 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5191 | {0x12, 0x90a60160}, |
| 5192 | {0x14, 0x90170120}, |
| 5193 | {0x17, 0x40000000}, |
| 5194 | {0x18, 0x411111f0}, |
| 5195 | {0x19, 0x411111f0}, |
| 5196 | {0x1a, 0x411111f0}, |
| 5197 | {0x1b, 0x411111f0}, |
| 5198 | {0x1d, 0x40700001}, |
| 5199 | {0x1e, 0x411111f0}, |
| 5200 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5201 | 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] | 5202 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5203 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5204 | {0x17, 0x40020008}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5205 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5206 | {0x1d, 0x40e00001}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5207 | {0x21, 0x0321101f}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5208 | 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] | 5209 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5210 | {0x14, 0x411111f0}, |
| 5211 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5212 | {0x18, 0x90170112}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5213 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5214 | {0x1d, 0x4075812d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5215 | 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] | 5216 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5217 | {0x14, 0x411111f0}, |
| 5218 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5219 | {0x18, 0x90170110}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5220 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5221 | {0x1d, 0x4075812d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5222 | 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] | 5223 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5224 | {0x14, 0x411111f0}, |
| 5225 | {0x15, 0x0421101f}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5226 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5227 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5228 | {0x1d, 0x4075812d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5229 | 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] | 5230 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5231 | {0x14, 0x411111f0}, |
| 5232 | {0x15, 0x04211020}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5233 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5234 | {0x1a, 0x04a11040}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5235 | {0x1d, 0x4076a12d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5236 | 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] | 5237 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5238 | {0x14, 0x90170110}, |
| 5239 | {0x15, 0x04211020}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5240 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5241 | {0x1a, 0x04a11040}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5242 | {0x1d, 0x4076a12d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5243 | 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] | 5244 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5245 | {0x14, 0x90170110}, |
| 5246 | {0x15, 0x04211020}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5247 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5248 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5249 | {0x1d, 0x4076a12d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5250 | 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] | 5251 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5252 | {0x14, 0x90170110}, |
| 5253 | {0x15, 0x0421101f}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5254 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5255 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5256 | {0x1d, 0x4075812d}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5257 | 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] | 5258 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5259 | {0x12, 0x90a60140}, |
| 5260 | {0x13, 0x411111f0}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5261 | {0x16, 0x01014020}, |
| 5262 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5263 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5264 | 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] | 5265 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5266 | {0x12, 0x90a60140}, |
| 5267 | {0x13, 0x411111f0}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5268 | {0x16, 0x01014020}, |
| 5269 | {0x18, 0x02a19031}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5270 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5271 | 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] | 5272 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5273 | {0x12, 0x90a60140}, |
| 5274 | {0x13, 0x411111f0}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5275 | {0x16, 0x411111f0}, |
| 5276 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5277 | {0x19, 0x411111f0}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5278 | 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] | 5279 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5280 | {0x12, 0x40000000}, |
| 5281 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5282 | {0x16, 0x21014020}, |
| 5283 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5284 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 5285 | 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] | 5286 | ALC292_STANDARD_PINS, |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 5287 | {0x12, 0x40000000}, |
| 5288 | {0x13, 0x90a60140}, |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 5289 | {0x16, 0x411111f0}, |
| 5290 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5291 | {0x19, 0x411111f0}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 5292 | {} |
| 5293 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5294 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 5295 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5296 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 5297 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5298 | int val; |
| 5299 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 5300 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 5301 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 5302 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5303 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5304 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 5305 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 5306 | } |
| 5307 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5308 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5309 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 5310 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 5311 | } |
| 5312 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5313 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5314 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5315 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5316 | } |
| 5317 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5318 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5319 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 5320 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5321 | /* Capless ramp up clock control */ |
| 5322 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 5323 | } |
| 5324 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 5325 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5326 | /* Class D power on reset */ |
| 5327 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 5328 | } |
| 5329 | } |
| 5330 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5331 | /* Class D */ |
| 5332 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5333 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5334 | /* HP */ |
| 5335 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5336 | } |
| 5337 | |
| 5338 | /* |
| 5339 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5340 | static int patch_alc269(struct hda_codec *codec) |
| 5341 | { |
| 5342 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5343 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5344 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5345 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5346 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5347 | return err; |
| 5348 | |
| 5349 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 5350 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5351 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5352 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
Herton Ronaldo Krzesinski | 9f720bb9 | 2012-09-27 10:38:14 -0300 | [diff] [blame] | 5353 | alc269_fixup_tbl, alc269_fixups); |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 5354 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups); |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 5355 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 5356 | alc269_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5357 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Herton Ronaldo Krzesinski | 9f720bb9 | 2012-09-27 10:38:14 -0300 | [diff] [blame] | 5358 | |
| 5359 | alc_auto_parse_customize_define(codec); |
| 5360 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5361 | if (has_cdefine_beep(codec)) |
| 5362 | spec->gen.beep_nid = 0x01; |
| 5363 | |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5364 | switch (codec->vendor_id) { |
| 5365 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5366 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5367 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 5368 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 5369 | if (codec->bus->pci && |
| 5370 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5371 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 5372 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5373 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5374 | break; |
| 5375 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 5376 | if (codec->bus->pci && |
| 5377 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5378 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 5379 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5380 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5381 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 5382 | case 0x0030: |
| 5383 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 5384 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5385 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5386 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5387 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5388 | if (err < 0) |
| 5389 | goto error; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 5390 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5391 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5392 | break; |
| 5393 | |
| 5394 | case 0x10ec0280: |
| 5395 | case 0x10ec0290: |
| 5396 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 5397 | break; |
| 5398 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5399 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 5400 | spec->shutup = alc282_shutup; |
| 5401 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5402 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 5403 | case 0x10ec0233: |
| 5404 | case 0x10ec0283: |
| 5405 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 5406 | spec->shutup = alc283_shutup; |
| 5407 | spec->init_hook = alc283_init; |
| 5408 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5409 | case 0x10ec0284: |
| 5410 | case 0x10ec0292: |
| 5411 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 5412 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 5413 | case 0x10ec0285: |
| 5414 | case 0x10ec0293: |
| 5415 | spec->codec_variant = ALC269_TYPE_ALC285; |
| 5416 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 5417 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 5418 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 5419 | spec->codec_variant = ALC269_TYPE_ALC286; |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 5420 | spec->shutup = alc286_shutup; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 5421 | break; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 5422 | case 0x10ec0255: |
| 5423 | spec->codec_variant = ALC269_TYPE_ALC255; |
| 5424 | break; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5425 | } |
| 5426 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 5427 | 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] | 5428 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 5429 | spec->init_hook = alc5505_dsp_init; |
| 5430 | } |
| 5431 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5432 | /* automatic parse from the BIOS config */ |
| 5433 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5434 | if (err < 0) |
| 5435 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5436 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5437 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5438 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
| 5439 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5440 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 5441 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 5442 | codec->patch_ops.suspend = alc269_suspend; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5443 | codec->patch_ops.resume = alc269_resume; |
| 5444 | #endif |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 5445 | if (!spec->shutup) |
| 5446 | spec->shutup = alc269_shutup; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5447 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5448 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 5449 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5450 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5451 | |
| 5452 | error: |
| 5453 | alc_free(codec); |
| 5454 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5455 | } |
| 5456 | |
| 5457 | /* |
| 5458 | * ALC861 |
| 5459 | */ |
| 5460 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5461 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 5462 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5463 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5464 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 5465 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5466 | } |
| 5467 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5468 | /* Pin config fixes */ |
| 5469 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5470 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 5471 | ALC861_FIXUP_AMP_VREF_0F, |
| 5472 | ALC861_FIXUP_NO_JACK_DETECT, |
| 5473 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 5474 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5475 | }; |
| 5476 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5477 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 5478 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5479 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5480 | { |
| 5481 | struct alc_spec *spec = codec->spec; |
| 5482 | unsigned int val; |
| 5483 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5484 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5485 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 5486 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5487 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 5488 | val |= AC_PINCTL_IN_EN; |
| 5489 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 5490 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 5491 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5492 | } |
| 5493 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5494 | /* suppress the jack-detection */ |
| 5495 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5496 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5497 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5498 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5499 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 5500 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5501 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5502 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5503 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5504 | .type = HDA_FIXUP_PINS, |
| 5505 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5506 | { 0x0b, 0x0221101f }, /* HP */ |
| 5507 | { 0x0f, 0x90170310 }, /* speaker */ |
| 5508 | { } |
| 5509 | } |
| 5510 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5511 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5512 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5513 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 5514 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5515 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5516 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5517 | .v.func = alc_fixup_no_jack_detect, |
| 5518 | }, |
| 5519 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5520 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5521 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 5522 | .chained = true, |
| 5523 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 5524 | }, |
| 5525 | [ALC660_FIXUP_ASUS_W7J] = { |
| 5526 | .type = HDA_FIXUP_VERBS, |
| 5527 | .v.verbs = (const struct hda_verb[]) { |
| 5528 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 5529 | * for enabling outputs |
| 5530 | */ |
| 5531 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 5532 | { } |
| 5533 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5534 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5535 | }; |
| 5536 | |
| 5537 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 5538 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 5539 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5540 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 5541 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 5542 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 5543 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 5544 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 5545 | 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] | 5546 | {} |
| 5547 | }; |
| 5548 | |
| 5549 | /* |
| 5550 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5551 | static int patch_alc861(struct hda_codec *codec) |
| 5552 | { |
| 5553 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5554 | int err; |
| 5555 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5556 | err = alc_alloc_spec(codec, 0x15); |
| 5557 | if (err < 0) |
| 5558 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5559 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5560 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5561 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5562 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5563 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 5564 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5565 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5566 | /* automatic parse from the BIOS config */ |
| 5567 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5568 | if (err < 0) |
| 5569 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5570 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5571 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5572 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5573 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5574 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 5575 | #ifdef CONFIG_PM |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5576 | spec->power_hook = alc_power_eapd; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5577 | #endif |
| 5578 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5579 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 5580 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5581 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5582 | |
| 5583 | error: |
| 5584 | alc_free(codec); |
| 5585 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5586 | } |
| 5587 | |
| 5588 | /* |
| 5589 | * ALC861-VD support |
| 5590 | * |
| 5591 | * Based on ALC882 |
| 5592 | * |
| 5593 | * In addition, an independent DAC |
| 5594 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5595 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 5596 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5597 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5598 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 5599 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5600 | } |
| 5601 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5602 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5603 | ALC660VD_FIX_ASUS_GPIO1, |
| 5604 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5605 | }; |
| 5606 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5607 | /* exclude VREF80 */ |
| 5608 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5609 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5610 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5611 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 5612 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 5613 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5614 | } |
| 5615 | } |
| 5616 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5617 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5618 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5619 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5620 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5621 | /* reset GPIO1 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5622 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
| 5623 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, |
| 5624 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, |
| 5625 | { } |
| 5626 | } |
| 5627 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5628 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5629 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5630 | .v.func = alc861vd_fixup_dallas, |
| 5631 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5632 | }; |
| 5633 | |
| 5634 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5635 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5636 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5637 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5638 | {} |
| 5639 | }; |
| 5640 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5641 | /* |
| 5642 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5643 | static int patch_alc861vd(struct hda_codec *codec) |
| 5644 | { |
| 5645 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5646 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5647 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5648 | err = alc_alloc_spec(codec, 0x0b); |
| 5649 | if (err < 0) |
| 5650 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5651 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5652 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5653 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5654 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5655 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 5656 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5657 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5658 | /* automatic parse from the BIOS config */ |
| 5659 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5660 | if (err < 0) |
| 5661 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5662 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5663 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5664 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5665 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5666 | codec->patch_ops = alc_patch_ops; |
| 5667 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5668 | spec->shutup = alc_eapd_shutup; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5669 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5670 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 5671 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5672 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5673 | |
| 5674 | error: |
| 5675 | alc_free(codec); |
| 5676 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5677 | } |
| 5678 | |
| 5679 | /* |
| 5680 | * ALC662 support |
| 5681 | * |
| 5682 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 5683 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 5684 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 5685 | * 6-channel independent captures. |
| 5686 | * |
| 5687 | * In addition, an independent DAC for the multi-playback (not used in this |
| 5688 | * driver yet). |
| 5689 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5690 | |
| 5691 | /* |
| 5692 | * BIOS auto configuration |
| 5693 | */ |
| 5694 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 5695 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 5696 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 5697 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5698 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 5699 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 5700 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 5701 | |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 5702 | if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 || |
Rainer Koenig | 1d87caa | 2013-04-04 08:40:38 +0200 | [diff] [blame] | 5703 | codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670 || |
| 5704 | codec->vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5705 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 5706 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5707 | ssids = alc662_ssids; |
| 5708 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 5709 | } |
| 5710 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5711 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5712 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 5713 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 5714 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 5715 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5716 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 5717 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 5718 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5719 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5720 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5721 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5722 | } |
| 5723 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 5724 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 5725 | { .channels = 2, |
| 5726 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 5727 | { .channels = 4, |
| 5728 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 5729 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 5730 | { } |
| 5731 | }; |
| 5732 | |
| 5733 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 5734 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 5735 | const struct hda_fixup *fix, int action) |
| 5736 | { |
| 5737 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 5738 | struct alc_spec *spec = codec->spec; |
| 5739 | spec->gen.pcm_rec[0].stream[0].chmap = asus_pcm_2_1_chmaps; |
| 5740 | } |
| 5741 | } |
| 5742 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5743 | /* turn on/off mute LED per vmaster hook */ |
| 5744 | static void alc662_led_gpio1_mute_hook(void *private_data, int enabled) |
| 5745 | { |
| 5746 | struct hda_codec *codec = private_data; |
| 5747 | struct alc_spec *spec = codec->spec; |
| 5748 | unsigned int oldval = spec->gpio_led; |
| 5749 | |
| 5750 | if (enabled) |
| 5751 | spec->gpio_led &= ~0x01; |
| 5752 | else |
| 5753 | spec->gpio_led |= 0x01; |
| 5754 | if (spec->gpio_led != oldval) |
| 5755 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 5756 | spec->gpio_led); |
| 5757 | } |
| 5758 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 5759 | /* avoid D3 for keeping GPIO up */ |
| 5760 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 5761 | hda_nid_t nid, |
| 5762 | unsigned int power_state) |
| 5763 | { |
| 5764 | struct alc_spec *spec = codec->spec; |
| 5765 | if (nid == codec->afg && power_state == AC_PWRST_D3 && spec->gpio_led) |
| 5766 | return AC_PWRST_D0; |
| 5767 | return power_state; |
| 5768 | } |
| 5769 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5770 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 5771 | const struct hda_fixup *fix, int action) |
| 5772 | { |
| 5773 | struct alc_spec *spec = codec->spec; |
| 5774 | static const struct hda_verb gpio_init[] = { |
| 5775 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x01 }, |
| 5776 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01 }, |
| 5777 | {} |
| 5778 | }; |
| 5779 | |
| 5780 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5781 | spec->gen.vmaster_mute.hook = alc662_led_gpio1_mute_hook; |
| 5782 | spec->gpio_led = 0; |
| 5783 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 5784 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5785 | } |
| 5786 | } |
| 5787 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5788 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 5789 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5790 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5791 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5792 | ALC272_FIXUP_MARIO, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 5793 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 5794 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 5795 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5796 | ALC662_FIXUP_ASUS_MODE1, |
| 5797 | ALC662_FIXUP_ASUS_MODE2, |
| 5798 | ALC662_FIXUP_ASUS_MODE3, |
| 5799 | ALC662_FIXUP_ASUS_MODE4, |
| 5800 | ALC662_FIXUP_ASUS_MODE5, |
| 5801 | ALC662_FIXUP_ASUS_MODE6, |
| 5802 | ALC662_FIXUP_ASUS_MODE7, |
| 5803 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 5804 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 5805 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 5806 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5807 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
| 5808 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 5809 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 5810 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 5811 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 5812 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5813 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5814 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5815 | ALC668_FIXUP_DELL_XPS13, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5816 | }; |
| 5817 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5818 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 5819 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5820 | .type = HDA_FIXUP_PINS, |
| 5821 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 5822 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 5823 | { } |
| 5824 | } |
| 5825 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5826 | [ALC662_FIXUP_LED_GPIO1] = { |
| 5827 | .type = HDA_FIXUP_FUNC, |
| 5828 | .v.func = alc662_fixup_led_gpio1, |
| 5829 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5830 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5831 | .type = HDA_FIXUP_PINS, |
| 5832 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5833 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 5834 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5835 | }, |
| 5836 | .chained = true, |
| 5837 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5838 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5839 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5840 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 5841 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 5842 | }, |
| 5843 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5844 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 5845 | .v.verbs = (const struct hda_verb[]) { |
| 5846 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 5847 | {} |
| 5848 | } |
| 5849 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 5850 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5851 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 5852 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 5853 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 5854 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5855 | .type = HDA_FIXUP_PINS, |
| 5856 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 5857 | { 0x14, 0x0221201f }, /* HP out */ |
| 5858 | { } |
| 5859 | }, |
| 5860 | .chained = true, |
| 5861 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5862 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5863 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5864 | .type = HDA_FIXUP_PINS, |
| 5865 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5866 | { 0x14, 0x99130110 }, /* speaker */ |
| 5867 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5868 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5869 | { 0x21, 0x0121401f }, /* HP out */ |
| 5870 | { } |
| 5871 | }, |
| 5872 | .chained = true, |
| 5873 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5874 | }, |
| 5875 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5876 | .type = HDA_FIXUP_PINS, |
| 5877 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 5878 | { 0x14, 0x99130110 }, /* speaker */ |
| 5879 | { 0x18, 0x01a19820 }, /* mic */ |
| 5880 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5881 | { 0x1b, 0x0121401f }, /* HP out */ |
| 5882 | { } |
| 5883 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5884 | .chained = true, |
| 5885 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5886 | }, |
| 5887 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5888 | .type = HDA_FIXUP_PINS, |
| 5889 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5890 | { 0x14, 0x99130110 }, /* speaker */ |
| 5891 | { 0x15, 0x0121441f }, /* HP */ |
| 5892 | { 0x18, 0x01a19840 }, /* mic */ |
| 5893 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5894 | { 0x21, 0x01211420 }, /* HP2 */ |
| 5895 | { } |
| 5896 | }, |
| 5897 | .chained = true, |
| 5898 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5899 | }, |
| 5900 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5901 | .type = HDA_FIXUP_PINS, |
| 5902 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5903 | { 0x14, 0x99130110 }, /* speaker */ |
| 5904 | { 0x16, 0x99130111 }, /* speaker */ |
| 5905 | { 0x18, 0x01a19840 }, /* mic */ |
| 5906 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5907 | { 0x21, 0x0121441f }, /* HP */ |
| 5908 | { } |
| 5909 | }, |
| 5910 | .chained = true, |
| 5911 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5912 | }, |
| 5913 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5914 | .type = HDA_FIXUP_PINS, |
| 5915 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5916 | { 0x14, 0x99130110 }, /* speaker */ |
| 5917 | { 0x15, 0x0121441f }, /* HP */ |
| 5918 | { 0x16, 0x99130111 }, /* speaker */ |
| 5919 | { 0x18, 0x01a19840 }, /* mic */ |
| 5920 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5921 | { } |
| 5922 | }, |
| 5923 | .chained = true, |
| 5924 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5925 | }, |
| 5926 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5927 | .type = HDA_FIXUP_PINS, |
| 5928 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5929 | { 0x14, 0x99130110 }, /* speaker */ |
| 5930 | { 0x15, 0x01211420 }, /* HP2 */ |
| 5931 | { 0x18, 0x01a19840 }, /* mic */ |
| 5932 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5933 | { 0x1b, 0x0121441f }, /* HP */ |
| 5934 | { } |
| 5935 | }, |
| 5936 | .chained = true, |
| 5937 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5938 | }, |
| 5939 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5940 | .type = HDA_FIXUP_PINS, |
| 5941 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5942 | { 0x14, 0x99130110 }, /* speaker */ |
| 5943 | { 0x17, 0x99130111 }, /* speaker */ |
| 5944 | { 0x18, 0x01a19840 }, /* mic */ |
| 5945 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5946 | { 0x1b, 0x01214020 }, /* HP */ |
| 5947 | { 0x21, 0x0121401f }, /* HP */ |
| 5948 | { } |
| 5949 | }, |
| 5950 | .chained = true, |
| 5951 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5952 | }, |
| 5953 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5954 | .type = HDA_FIXUP_PINS, |
| 5955 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5956 | { 0x14, 0x99130110 }, /* speaker */ |
| 5957 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 5958 | { 0x15, 0x01214020 }, /* HP */ |
| 5959 | { 0x17, 0x99130111 }, /* speaker */ |
| 5960 | { 0x18, 0x01a19840 }, /* mic */ |
| 5961 | { 0x21, 0x0121401f }, /* HP */ |
| 5962 | { } |
| 5963 | }, |
| 5964 | .chained = true, |
| 5965 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 5966 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 5967 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5968 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 5969 | .v.func = alc_fixup_no_jack_detect, |
| 5970 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 5971 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5972 | .type = HDA_FIXUP_PINS, |
| 5973 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 5974 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 5975 | { } |
| 5976 | } |
| 5977 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 5978 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5979 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 5980 | .v.func = alc_fixup_inv_dmic_0x12, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 5981 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5982 | [ALC668_FIXUP_DELL_XPS13] = { |
| 5983 | .type = HDA_FIXUP_FUNC, |
| 5984 | .v.func = alc_fixup_dell_xps13, |
| 5985 | .chained = true, |
| 5986 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 5987 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5988 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 5989 | .type = HDA_FIXUP_FUNC, |
| 5990 | .v.func = alc_fixup_disable_aamix, |
| 5991 | .chained = true, |
| 5992 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 5993 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5994 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 5995 | .type = HDA_FIXUP_FUNC, |
| 5996 | .v.func = alc_fixup_auto_mute_via_amp, |
| 5997 | .chained = true, |
| 5998 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 5999 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6000 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 6001 | .type = HDA_FIXUP_PINS, |
| 6002 | .v.pins = (const struct hda_pintbl[]) { |
| 6003 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6004 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 6005 | { } |
| 6006 | }, |
| 6007 | .chained = true, |
| 6008 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 6009 | }, |
| 6010 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 6011 | .type = HDA_FIXUP_FUNC, |
| 6012 | .v.func = alc_fixup_headset_mode_alc668, |
| 6013 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6014 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 6015 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 6016 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 6017 | .chained = true, |
| 6018 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 6019 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 6020 | [ALC662_FIXUP_BASS_16] = { |
| 6021 | .type = HDA_FIXUP_PINS, |
| 6022 | .v.pins = (const struct hda_pintbl[]) { |
| 6023 | {0x16, 0x80106111}, /* bass speaker */ |
| 6024 | {} |
| 6025 | }, |
| 6026 | .chained = true, |
| 6027 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 6028 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6029 | [ALC662_FIXUP_BASS_1A] = { |
| 6030 | .type = HDA_FIXUP_PINS, |
| 6031 | .v.pins = (const struct hda_pintbl[]) { |
| 6032 | {0x1a, 0x80106111}, /* bass speaker */ |
| 6033 | {} |
| 6034 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6035 | .chained = true, |
| 6036 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6037 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6038 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6039 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 6040 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6041 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6042 | }; |
| 6043 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 6044 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6045 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 6046 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 6047 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 6048 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 6049 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 6050 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 6051 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6052 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 6053 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 6054 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 6055 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 6056 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99e | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 6057 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 6058 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 6059 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 6060 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6061 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A), |
| 6062 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 6063 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
| 6064 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6065 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 6066 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6067 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 6068 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 6069 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6070 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 6071 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 6072 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6073 | |
| 6074 | #if 0 |
| 6075 | /* Below is a quirk table taken from the old code. |
| 6076 | * Basically the device should work as is without the fixup table. |
| 6077 | * If BIOS doesn't give a proper info, enable the corresponding |
| 6078 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 6079 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6080 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 6081 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 6082 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 6083 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 6084 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6085 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6086 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6087 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 6088 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 6089 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6090 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 6091 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 6092 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 6093 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 6094 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 6095 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6096 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 6097 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 6098 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6099 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 6100 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 6101 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6102 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 6103 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 6104 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 6105 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6106 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 6107 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 6108 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6109 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 6110 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6111 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6112 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 6113 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 6114 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 6115 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 6116 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 6117 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 6118 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 6119 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6120 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 6121 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 6122 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6123 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 6124 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 6125 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 6126 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 6127 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 6128 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6129 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 6130 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6131 | {} |
| 6132 | }; |
| 6133 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6134 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 6135 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6136 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 6137 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 6138 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 6139 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 6140 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 6141 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 6142 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 6143 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 6144 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 6145 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 6146 | {} |
| 6147 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6148 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 6149 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6150 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6151 | {0x12, 0x99a30130}, |
| 6152 | {0x14, 0x90170110}, |
| 6153 | {0x15, 0x0321101f}, |
| 6154 | {0x16, 0x03011020}, |
| 6155 | {0x18, 0x40000008}, |
| 6156 | {0x19, 0x411111f0}, |
| 6157 | {0x1a, 0x411111f0}, |
| 6158 | {0x1b, 0x411111f0}, |
| 6159 | {0x1d, 0x41000001}, |
| 6160 | {0x1e, 0x411111f0}, |
| 6161 | {0x1f, 0x411111f0}), |
| 6162 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6163 | {0x12, 0x99a30140}, |
| 6164 | {0x14, 0x90170110}, |
| 6165 | {0x15, 0x0321101f}, |
| 6166 | {0x16, 0x03011020}, |
| 6167 | {0x18, 0x40000008}, |
| 6168 | {0x19, 0x411111f0}, |
| 6169 | {0x1a, 0x411111f0}, |
| 6170 | {0x1b, 0x411111f0}, |
| 6171 | {0x1d, 0x41000001}, |
| 6172 | {0x1e, 0x411111f0}, |
| 6173 | {0x1f, 0x411111f0}), |
| 6174 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6175 | {0x12, 0x99a30150}, |
| 6176 | {0x14, 0x90170110}, |
| 6177 | {0x15, 0x0321101f}, |
| 6178 | {0x16, 0x03011020}, |
| 6179 | {0x18, 0x40000008}, |
| 6180 | {0x19, 0x411111f0}, |
| 6181 | {0x1a, 0x411111f0}, |
| 6182 | {0x1b, 0x411111f0}, |
| 6183 | {0x1d, 0x41000001}, |
| 6184 | {0x1e, 0x411111f0}, |
| 6185 | {0x1f, 0x411111f0}), |
| 6186 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6187 | {0x12, 0x411111f0}, |
| 6188 | {0x14, 0x90170110}, |
| 6189 | {0x15, 0x0321101f}, |
| 6190 | {0x16, 0x03011020}, |
| 6191 | {0x18, 0x40000008}, |
| 6192 | {0x19, 0x411111f0}, |
| 6193 | {0x1a, 0x411111f0}, |
| 6194 | {0x1b, 0x411111f0}, |
| 6195 | {0x1d, 0x41000001}, |
| 6196 | {0x1e, 0x411111f0}, |
| 6197 | {0x1f, 0x411111f0}), |
| 6198 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 6199 | {0x12, 0x90a60130}, |
| 6200 | {0x14, 0x90170110}, |
| 6201 | {0x15, 0x0321101f}, |
| 6202 | {0x16, 0x40000000}, |
| 6203 | {0x18, 0x411111f0}, |
| 6204 | {0x19, 0x411111f0}, |
| 6205 | {0x1a, 0x411111f0}, |
| 6206 | {0x1b, 0x411111f0}, |
| 6207 | {0x1d, 0x40d6832d}, |
| 6208 | {0x1e, 0x411111f0}, |
| 6209 | {0x1f, 0x411111f0}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 6210 | {} |
| 6211 | }; |
| 6212 | |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 6213 | static void alc662_fill_coef(struct hda_codec *codec) |
| 6214 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 6215 | int coef; |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 6216 | |
| 6217 | coef = alc_get_coef0(codec); |
| 6218 | |
| 6219 | switch (codec->vendor_id) { |
| 6220 | case 0x10ec0662: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 6221 | if ((coef & 0x00f0) == 0x0030) |
| 6222 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 6223 | break; |
| 6224 | case 0x10ec0272: |
| 6225 | case 0x10ec0273: |
| 6226 | case 0x10ec0663: |
| 6227 | case 0x10ec0665: |
| 6228 | case 0x10ec0670: |
| 6229 | case 0x10ec0671: |
| 6230 | case 0x10ec0672: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 6231 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 6232 | break; |
| 6233 | } |
| 6234 | } |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6235 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6236 | /* |
| 6237 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6238 | static int patch_alc662(struct hda_codec *codec) |
| 6239 | { |
| 6240 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6241 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6242 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6243 | err = alc_alloc_spec(codec, 0x0b); |
| 6244 | if (err < 0) |
| 6245 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6246 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6247 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 6248 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6249 | /* handle multiple HPs as is */ |
| 6250 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 6251 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 6252 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 6253 | |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 6254 | spec->init_hook = alc662_fill_coef; |
| 6255 | alc662_fill_coef(codec); |
| 6256 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6257 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 6258 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 6259 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6260 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 6261 | |
| 6262 | alc_auto_parse_customize_define(codec); |
| 6263 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 6264 | if (has_cdefine_beep(codec)) |
| 6265 | spec->gen.beep_nid = 0x01; |
| 6266 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 6267 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 6268 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6269 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 6270 | err = alc_codec_rename(codec, "ALC272X"); |
| 6271 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6272 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 6273 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 6274 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 6275 | /* automatic parse from the BIOS config */ |
| 6276 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6277 | if (err < 0) |
| 6278 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6279 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 6280 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 6281 | switch (codec->vendor_id) { |
| 6282 | case 0x10ec0662: |
| 6283 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 6284 | break; |
| 6285 | case 0x10ec0272: |
| 6286 | case 0x10ec0663: |
| 6287 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 6288 | case 0x10ec0668: |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 6289 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
| 6290 | break; |
| 6291 | case 0x10ec0273: |
| 6292 | set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
| 6293 | break; |
| 6294 | } |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 6295 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 6296 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6297 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 6298 | spec->shutup = alc_eapd_shutup; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6299 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6300 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 6301 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6302 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6303 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6304 | error: |
| 6305 | alc_free(codec); |
| 6306 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 6307 | } |
| 6308 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6309 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6310 | * ALC680 support |
| 6311 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6312 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6313 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 6314 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 6315 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6316 | } |
| 6317 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6318 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6319 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6320 | static int patch_alc680(struct hda_codec *codec) |
| 6321 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6322 | int err; |
| 6323 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 6324 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6325 | err = alc_alloc_spec(codec, 0); |
| 6326 | if (err < 0) |
| 6327 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 6328 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 6329 | /* automatic parse from the BIOS config */ |
| 6330 | err = alc680_parse_auto_config(codec); |
| 6331 | if (err < 0) { |
| 6332 | alc_free(codec); |
| 6333 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6334 | } |
| 6335 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6336 | codec->patch_ops = alc_patch_ops; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6337 | |
| 6338 | return 0; |
| 6339 | } |
| 6340 | |
| 6341 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6342 | * patch entries |
| 6343 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 6344 | static const struct hda_codec_preset snd_hda_preset_realtek[] = { |
Kailang Yang | 296f033 | 2011-05-18 11:52:36 +0200 | [diff] [blame] | 6345 | { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 }, |
Kailang Yang | ba4c4d0 | 2013-11-26 15:17:50 +0800 | [diff] [blame] | 6346 | { .id = 0x10ec0231, .name = "ALC231", .patch = patch_alc269 }, |
Kailang Yang | 84dfd0a | 2013-03-07 09:19:38 +0100 | [diff] [blame] | 6347 | { .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 }, |
Kailang Yang | 92f974d | 2014-06-06 17:05:33 +0800 | [diff] [blame] | 6348 | { .id = 0x10ec0235, .name = "ALC233", .patch = patch_alc269 }, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 6349 | { .id = 0x10ec0255, .name = "ALC255", .patch = patch_alc269 }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6350 | { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 6351 | { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 }, |
Kailang Yang | f6a9224 | 2007-12-13 16:52:54 +0100 | [diff] [blame] | 6352 | { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, |
Kailang Yang | a361d84 | 2007-06-05 12:30:55 +0200 | [diff] [blame] | 6353 | { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 }, |
Kailang Yang | f6a9224 | 2007-12-13 16:52:54 +0100 | [diff] [blame] | 6354 | { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 }, |
Kailang Yang | ebb83ee | 2009-12-17 12:23:00 +0100 | [diff] [blame] | 6355 | { .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 }, |
Kailang Yang | 01afd41 | 2008-10-15 11:22:09 +0200 | [diff] [blame] | 6356 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, |
Kailang Yang | ebb83ee | 2009-12-17 12:23:00 +0100 | [diff] [blame] | 6357 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, |
Kailang Yang | 296f033 | 2011-05-18 11:52:36 +0200 | [diff] [blame] | 6358 | { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, |
David Henningsson | befae82 | 2012-06-25 19:49:28 +0200 | [diff] [blame] | 6359 | { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 }, |
David Henningsson | 4e01ec6 | 2012-07-18 07:38:46 +0200 | [diff] [blame] | 6360 | { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 }, |
Kailang Yang | 7ff34ad | 2012-10-06 17:02:30 +0200 | [diff] [blame] | 6361 | { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 }, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 6362 | { .id = 0x10ec0284, .name = "ALC284", .patch = patch_alc269 }, |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 6363 | { .id = 0x10ec0285, .name = "ALC285", .patch = patch_alc269 }, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 6364 | { .id = 0x10ec0286, .name = "ALC286", .patch = patch_alc269 }, |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 6365 | { .id = 0x10ec0288, .name = "ALC288", .patch = patch_alc269 }, |
Kailang Yang | 7ff34ad | 2012-10-06 17:02:30 +0200 | [diff] [blame] | 6366 | { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 }, |
David Henningsson | af02dde | 2012-11-21 08:57:58 +0100 | [diff] [blame] | 6367 | { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 }, |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 6368 | { .id = 0x10ec0293, .name = "ALC293", .patch = patch_alc269 }, |
Jakub Schmidtke | f32610e | 2007-02-02 18:17:27 +0100 | [diff] [blame] | 6369 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6370 | .patch = patch_alc861 }, |
Jakub Schmidtke | f32610e | 2007-02-02 18:17:27 +0100 | [diff] [blame] | 6371 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, |
| 6372 | { .id = 0x10ec0861, .name = "ALC861", .patch = patch_alc861 }, |
| 6373 | { .id = 0x10ec0862, .name = "ALC861-VD", .patch = patch_alc861vd }, |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6374 | { .id = 0x10ec0662, .rev = 0x100002, .name = "ALC662 rev2", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6375 | .patch = patch_alc882 }, |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6376 | { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1", |
| 6377 | .patch = patch_alc662 }, |
David Henningsson | cc667a7 | 2011-10-18 14:07:51 +0200 | [diff] [blame] | 6378 | { .id = 0x10ec0662, .rev = 0x100300, .name = "ALC662 rev3", |
| 6379 | .patch = patch_alc662 }, |
Kailang Yang | 6dda9f4 | 2008-05-27 12:05:31 +0200 | [diff] [blame] | 6380 | { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 6381 | { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, |
Kailang Yang | 7200943 | 2014-06-06 16:51:18 +0800 | [diff] [blame] | 6382 | { .id = 0x10ec0667, .name = "ALC667", .patch = patch_alc662 }, |
Kailang Yang | 19a6282 | 2012-11-08 10:25:37 +0100 | [diff] [blame] | 6383 | { .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 }, |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 6384 | { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, |
Rainer Koenig | 1d87caa | 2013-04-04 08:40:38 +0200 | [diff] [blame] | 6385 | { .id = 0x10ec0671, .name = "ALC671", .patch = patch_alc662 }, |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6386 | { .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 }, |
Kailang Yang | b6c5fba | 2014-06-05 11:13:44 +0800 | [diff] [blame] | 6387 | { .id = 0x10ec0867, .name = "ALC891", .patch = patch_alc882 }, |
Jakub Schmidtke | f32610e | 2007-02-02 18:17:27 +0100 | [diff] [blame] | 6388 | { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6389 | { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6390 | { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 }, |
Clive Messer | 669faba | 2008-09-30 15:49:13 +0200 | [diff] [blame] | 6391 | { .id = 0x10ec0885, .rev = 0x100101, .name = "ALC889A", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6392 | .patch = patch_alc882 }, |
Takashi Iwai | cb308f9 | 2008-04-16 14:13:29 +0200 | [diff] [blame] | 6393 | { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6394 | .patch = patch_alc882 }, |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 6395 | { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6396 | { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 }, |
Kailang Yang | 4442608 | 2008-10-15 11:18:05 +0200 | [diff] [blame] | 6397 | { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6398 | .patch = patch_alc882 }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6399 | { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc882 }, |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6400 | { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 }, |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 6401 | { .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6402 | { .id = 0x10ec0899, .name = "ALC898", .patch = patch_alc882 }, |
Kailang Yang | 19a6282 | 2012-11-08 10:25:37 +0100 | [diff] [blame] | 6403 | { .id = 0x10ec0900, .name = "ALC1150", .patch = patch_alc882 }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6404 | {} /* terminator */ |
| 6405 | }; |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 6406 | |
| 6407 | MODULE_ALIAS("snd-hda-codec-id:10ec*"); |
| 6408 | |
| 6409 | MODULE_LICENSE("GPL"); |
| 6410 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 6411 | |
| 6412 | static struct hda_codec_preset_list realtek_list = { |
| 6413 | .preset = snd_hda_preset_realtek, |
| 6414 | .owner = THIS_MODULE, |
| 6415 | }; |
| 6416 | |
| 6417 | static int __init patch_realtek_init(void) |
| 6418 | { |
| 6419 | return snd_hda_add_codec_preset(&realtek_list); |
| 6420 | } |
| 6421 | |
| 6422 | static void __exit patch_realtek_exit(void) |
| 6423 | { |
| 6424 | snd_hda_delete_codec_preset(&realtek_list); |
| 6425 | } |
| 6426 | |
| 6427 | module_init(patch_realtek_init) |
| 6428 | module_exit(patch_realtek_exit) |