Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Universal Interface for Intel High Definition Audio Codec |
| 3 | * |
| 4 | * HD audio interface patch for SigmaTel STAC92xx |
| 5 | * |
| 6 | * Copyright (c) 2005 Embedded Alley Solutions, Inc. |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 7 | * Matt Porter <mporter@embeddedalley.com> |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 8 | * |
| 9 | * Based on patch_cmedia.c and patch_realtek.c |
| 10 | * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de> |
| 11 | * |
| 12 | * This driver is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation; either version 2 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This driver is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program; if not, write to the Free Software |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 | */ |
| 26 | |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 27 | #include <linux/init.h> |
| 28 | #include <linux/delay.h> |
| 29 | #include <linux/slab.h> |
| 30 | #include <linux/pci.h> |
Vitaliy Kulikov | 5bdaaad | 2009-11-04 07:57:45 +0100 | [diff] [blame] | 31 | #include <linux/dmi.h> |
Paul Gortmaker | da155d5 | 2011-07-15 12:38:28 -0400 | [diff] [blame] | 32 | #include <linux/module.h> |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 33 | #include <sound/core.h> |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 34 | #include <sound/asoundef.h> |
Matthew Ranostay | 45a6ac1 | 2008-10-15 14:45:38 -0400 | [diff] [blame] | 35 | #include <sound/jack.h> |
Clemens Ladisch | a74ccea | 2010-10-22 15:52:34 +0200 | [diff] [blame] | 36 | #include <sound/tlv.h> |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 37 | #include "hda_codec.h" |
| 38 | #include "hda_local.h" |
Takashi Iwai | 128bc4b | 2012-05-07 17:42:31 +0200 | [diff] [blame] | 39 | #include "hda_auto_parser.h" |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 40 | #include "hda_beep.h" |
Takashi Iwai | 1835a0f | 2011-10-27 22:12:46 +0200 | [diff] [blame] | 41 | #include "hda_jack.h" |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 42 | #include "hda_generic.h" |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 43 | |
Takashi Iwai | c6e4c66 | 2008-11-25 11:58:19 +0100 | [diff] [blame] | 44 | enum { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 45 | STAC_VREF_EVENT = 8, |
Takashi Iwai | c6e4c66 | 2008-11-25 11:58:19 +0100 | [diff] [blame] | 46 | STAC_PWR_EVENT, |
Takashi Iwai | c6e4c66 | 2008-11-25 11:58:19 +0100 | [diff] [blame] | 47 | }; |
Matt | 4e55096 | 2005-07-04 17:51:39 +0200 | [diff] [blame] | 48 | |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 49 | enum { |
| 50 | STAC_REF, |
Tobin Davis | bf27778 | 2008-02-03 20:31:47 +0100 | [diff] [blame] | 51 | STAC_9200_OQO, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 52 | STAC_9200_DELL_D21, |
| 53 | STAC_9200_DELL_D22, |
| 54 | STAC_9200_DELL_D23, |
| 55 | STAC_9200_DELL_M21, |
| 56 | STAC_9200_DELL_M22, |
| 57 | STAC_9200_DELL_M23, |
| 58 | STAC_9200_DELL_M24, |
| 59 | STAC_9200_DELL_M25, |
| 60 | STAC_9200_DELL_M26, |
| 61 | STAC_9200_DELL_M27, |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 62 | STAC_9200_M4, |
| 63 | STAC_9200_M4_2, |
Takashi Iwai | 117f257 | 2008-03-18 09:53:23 +0100 | [diff] [blame] | 64 | STAC_9200_PANASONIC, |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 65 | STAC_9200_EAPD_INIT, |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 66 | STAC_9200_MODELS |
| 67 | }; |
| 68 | |
| 69 | enum { |
| 70 | STAC_9205_REF, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 71 | STAC_9205_DELL_M42, |
Tobin Davis | ae0a8ed | 2007-08-13 15:50:29 +0200 | [diff] [blame] | 72 | STAC_9205_DELL_M43, |
| 73 | STAC_9205_DELL_M44, |
Takashi Iwai | d9a4268 | 2009-01-22 17:40:18 +0100 | [diff] [blame] | 74 | STAC_9205_EAPD, |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 75 | STAC_9205_MODELS |
| 76 | }; |
| 77 | |
| 78 | enum { |
Takashi Iwai | 9e43f0d | 2008-12-17 14:51:01 +0100 | [diff] [blame] | 79 | STAC_92HD73XX_NO_JD, /* no jack-detection */ |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 80 | STAC_92HD73XX_REF, |
Wu Fengguang | ae70944 | 2009-08-19 17:05:11 +0800 | [diff] [blame] | 81 | STAC_92HD73XX_INTEL, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 82 | STAC_DELL_M6_AMIC, |
| 83 | STAC_DELL_M6_DMIC, |
| 84 | STAC_DELL_M6_BOTH, |
Matthew Ranostay | 6b3ab21 | 2008-11-03 08:12:43 -0500 | [diff] [blame] | 85 | STAC_DELL_EQ, |
Takashi Iwai | 842ae63 | 2009-09-02 07:43:08 +0200 | [diff] [blame] | 86 | STAC_ALIENWARE_M17X, |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 87 | STAC_92HD73XX_MODELS |
| 88 | }; |
| 89 | |
| 90 | enum { |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 91 | STAC_92HD83XXX_REF, |
Matthew Ranostay | 32ed3f4 | 2009-01-22 20:53:29 -0500 | [diff] [blame] | 92 | STAC_92HD83XXX_PWR_REF, |
Matthew Ranostay | 8bb0ac5 | 2009-02-12 16:50:01 -0500 | [diff] [blame] | 93 | STAC_DELL_S14, |
Julian Wollrath | f7f9bdf | 2011-11-09 10:02:40 +0100 | [diff] [blame] | 94 | STAC_DELL_VOSTRO_3500, |
Vitaliy Kulikov | 0c27c18 | 2011-07-22 17:50:37 -0500 | [diff] [blame] | 95 | STAC_92HD83XXX_HP_cNB11_INTQUAD, |
Steven Eastland | 4831559 | 2010-08-06 15:07:35 -0600 | [diff] [blame] | 96 | STAC_HP_DV7_4000, |
Vitaliy Kulikov | 5556e14 | 2012-02-27 16:47:37 -0600 | [diff] [blame] | 97 | STAC_HP_ZEPHYR, |
Takashi Iwai | a3e1997 | 2012-07-26 08:17:20 +0200 | [diff] [blame] | 98 | STAC_92HD83XXX_HP_LED, |
Takashi Iwai | ff8a1e2 | 2012-07-31 10:16:59 +0200 | [diff] [blame] | 99 | STAC_92HD83XXX_HP_INV_LED, |
Takashi Iwai | 62cbde1 | 2012-09-14 11:58:54 +0200 | [diff] [blame] | 100 | STAC_92HD83XXX_HP_MIC_LED, |
David Henningsson | 8d032a8 | 2012-10-09 12:48:40 +0200 | [diff] [blame] | 101 | STAC_92HD83XXX_HEADSET_JACK, |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 102 | STAC_92HD83XXX_HP, |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 103 | STAC_92HD83XXX_MODELS |
| 104 | }; |
| 105 | |
| 106 | enum { |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 107 | STAC_92HD71BXX_REF, |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 108 | STAC_DELL_M4_1, |
| 109 | STAC_DELL_M4_2, |
Matthew Ranostay | 3a7abfd | 2008-11-20 21:21:43 -0500 | [diff] [blame] | 110 | STAC_DELL_M4_3, |
Matthew Ranostay | 6a14f58 | 2008-09-12 12:02:30 -0400 | [diff] [blame] | 111 | STAC_HP_M4, |
Takashi Iwai | 2a6ce6e | 2010-05-12 10:16:20 +0200 | [diff] [blame] | 112 | STAC_HP_DV4, |
Takashi Iwai | 1b0652e | 2009-01-14 08:27:35 +0100 | [diff] [blame] | 113 | STAC_HP_DV5, |
Christoph Plattner | ae6241f | 2009-03-08 23:19:05 +0100 | [diff] [blame] | 114 | STAC_HP_HDX, |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 115 | STAC_92HD71BXX_HP, |
| 116 | STAC_92HD71BXX_NO_DMIC, |
| 117 | STAC_92HD71BXX_NO_SMUX, |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 118 | STAC_92HD71BXX_MODELS |
| 119 | }; |
| 120 | |
| 121 | enum { |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 122 | STAC_925x_REF, |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 123 | STAC_M1, |
| 124 | STAC_M1_2, |
| 125 | STAC_M2, |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 126 | STAC_M2_2, |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 127 | STAC_M3, |
| 128 | STAC_M5, |
| 129 | STAC_M6, |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 130 | STAC_925x_MODELS |
| 131 | }; |
| 132 | |
| 133 | enum { |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 134 | STAC_D945_REF, |
| 135 | STAC_D945GTP3, |
| 136 | STAC_D945GTP5, |
Ivan N. Zlatev | 5d5d3bc | 2007-05-29 16:03:00 +0200 | [diff] [blame] | 137 | STAC_INTEL_MAC_V1, |
| 138 | STAC_INTEL_MAC_V2, |
| 139 | STAC_INTEL_MAC_V3, |
| 140 | STAC_INTEL_MAC_V4, |
| 141 | STAC_INTEL_MAC_V5, |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 142 | STAC_INTEL_MAC_AUTO, |
Mauro Carvalho Chehab | 8c65008 | 2008-08-04 10:39:59 -0300 | [diff] [blame] | 143 | STAC_ECS_202, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 144 | STAC_922X_DELL_D81, |
| 145 | STAC_922X_DELL_D82, |
| 146 | STAC_922X_DELL_M81, |
| 147 | STAC_922X_DELL_M82, |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 148 | STAC_922X_INTEL_MAC_GPIO, |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 149 | STAC_922X_MODELS |
| 150 | }; |
| 151 | |
| 152 | enum { |
Takashi Iwai | e28d832 | 2008-12-17 13:48:29 +0100 | [diff] [blame] | 153 | STAC_D965_REF_NO_JD, /* no jack-detection */ |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 154 | STAC_D965_REF, |
| 155 | STAC_D965_3ST, |
| 156 | STAC_D965_5ST, |
Takashi Iwai | 679d92e | 2009-05-24 19:00:08 +0200 | [diff] [blame] | 157 | STAC_D965_5ST_NO_FP, |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 158 | STAC_D965_VERBS, |
Tobin Davis | 4ff076e | 2007-08-07 11:48:12 +0200 | [diff] [blame] | 159 | STAC_DELL_3ST, |
Matthew Ranostay | 8e9068b | 2007-12-17 11:58:13 +0100 | [diff] [blame] | 160 | STAC_DELL_BIOS, |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 161 | STAC_DELL_BIOS_SPDIF, |
| 162 | STAC_927X_DELL_DMIC, |
Takashi Iwai | 5493053 | 2009-10-11 17:38:29 +0200 | [diff] [blame] | 163 | STAC_927X_VOLKNOB, |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 164 | STAC_927X_MODELS |
| 165 | }; |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 166 | |
Takashi Iwai | 307282c | 2009-03-12 18:17:58 +0100 | [diff] [blame] | 167 | enum { |
Takashi Iwai | 307282c | 2009-03-12 18:17:58 +0100 | [diff] [blame] | 168 | STAC_9872_VAIO, |
| 169 | STAC_9872_MODELS |
| 170 | }; |
| 171 | |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 172 | struct sigmatel_spec { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 173 | struct hda_gen_spec gen; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 174 | |
Matthew Ranostay | c0cea0d | 2008-11-16 11:42:34 -0500 | [diff] [blame] | 175 | unsigned int eapd_switch: 1; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 176 | unsigned int linear_tone_beep:1; |
David Henningsson | 8d032a8 | 2012-10-09 12:48:40 +0200 | [diff] [blame] | 177 | unsigned int headset_jack:1; /* 4-pin headset jack (hp + mono mic) */ |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 178 | unsigned int volknob_init:1; /* special volume-knob initialization */ |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 179 | unsigned int powerdown_adcs:1; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 180 | |
Matthew Ranostay | 4fe5195c | 2008-01-29 15:28:44 +0100 | [diff] [blame] | 181 | /* gpio lines */ |
Matthew Ranostay | 0fc9dec | 2008-04-14 13:32:54 +0200 | [diff] [blame] | 182 | unsigned int eapd_mask; |
Matthew Ranostay | 4fe5195c | 2008-01-29 15:28:44 +0100 | [diff] [blame] | 183 | unsigned int gpio_mask; |
| 184 | unsigned int gpio_dir; |
| 185 | unsigned int gpio_data; |
| 186 | unsigned int gpio_mute; |
Takashi Iwai | 86d190e | 2009-05-26 15:18:58 +0200 | [diff] [blame] | 187 | unsigned int gpio_led; |
Vitaliy Kulikov | c357aab | 2009-12-11 07:51:54 +0100 | [diff] [blame] | 188 | unsigned int gpio_led_polarity; |
Takashi Iwai | f1a7374 | 2011-12-04 13:44:06 +0100 | [diff] [blame] | 189 | unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */ |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 190 | unsigned int vref_led; |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 191 | int default_polarity; |
Matthew Ranostay | 4fe5195c | 2008-01-29 15:28:44 +0100 | [diff] [blame] | 192 | |
Takashi Iwai | 62cbde1 | 2012-09-14 11:58:54 +0200 | [diff] [blame] | 193 | unsigned int mic_mute_led_gpio; /* capture mute LED GPIO */ |
| 194 | bool mic_mute_led_on; /* current mic mute state */ |
| 195 | |
Matthew Ranostay | 8daaaa9 | 2008-08-15 07:45:52 +0200 | [diff] [blame] | 196 | /* stream */ |
| 197 | unsigned int stream_delay; |
| 198 | |
Matthew Ranostay | 4fe5195c | 2008-01-29 15:28:44 +0100 | [diff] [blame] | 199 | /* analog loopback */ |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 200 | const struct snd_kcontrol_new *aloopback_ctl; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 201 | unsigned int aloopback; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 202 | unsigned char aloopback_mask; |
| 203 | unsigned char aloopback_shift; |
Takashi Iwai | 8259980 | 2007-07-31 15:56:24 +0200 | [diff] [blame] | 204 | |
Matthew Ranostay | a64135a | 2008-01-10 16:55:06 +0100 | [diff] [blame] | 205 | /* power management */ |
Takashi Iwai | c882246 | 2012-05-15 09:11:36 +0200 | [diff] [blame] | 206 | unsigned int power_map_bits; |
Matthew Ranostay | a64135a | 2008-01-10 16:55:06 +0100 | [diff] [blame] | 207 | unsigned int num_pwrs; |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 208 | const hda_nid_t *pwr_nids; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 209 | unsigned int active_adcs; |
Matthew Ranostay | a64135a | 2008-01-10 16:55:06 +0100 | [diff] [blame] | 210 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 211 | /* beep widgets */ |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 212 | hda_nid_t anabeep_nid; |
| 213 | hda_nid_t digbeep_nid; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 214 | }; |
| 215 | |
Takashi Iwai | c882246 | 2012-05-15 09:11:36 +0200 | [diff] [blame] | 216 | #define AC_VERB_IDT_SET_POWER_MAP 0x7ec |
| 217 | #define AC_VERB_IDT_GET_POWER_MAP 0xfec |
| 218 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 219 | static const hda_nid_t stac92hd73xx_pwr_nids[8] = { |
Matthew Ranostay | a64135a | 2008-01-10 16:55:06 +0100 | [diff] [blame] | 220 | 0x0a, 0x0b, 0x0c, 0xd, 0x0e, |
| 221 | 0x0f, 0x10, 0x11 |
| 222 | }; |
| 223 | |
Charles Chin | afef2cf | 2011-11-11 08:05:28 +0100 | [diff] [blame] | 224 | static const hda_nid_t stac92hd83xxx_pwr_nids[7] = { |
| 225 | 0x0a, 0x0b, 0x0c, 0xd, 0x0e, |
| 226 | 0x0f, 0x10 |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 227 | }; |
| 228 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 229 | static const hda_nid_t stac92hd71bxx_pwr_nids[3] = { |
Matthew Ranostay | a64135a | 2008-01-10 16:55:06 +0100 | [diff] [blame] | 230 | 0x0a, 0x0d, 0x0f |
| 231 | }; |
| 232 | |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 233 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 234 | /* |
| 235 | * PCM hooks |
| 236 | */ |
| 237 | static void stac_playback_pcm_hook(struct hda_pcm_stream *hinfo, |
| 238 | struct hda_codec *codec, |
| 239 | struct snd_pcm_substream *substream, |
| 240 | int action) |
Matt Porter | 8b65727 | 2006-10-26 17:12:59 +0200 | [diff] [blame] | 241 | { |
Matt Porter | 8b65727 | 2006-10-26 17:12:59 +0200 | [diff] [blame] | 242 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 243 | if (action == HDA_GEN_PCM_ACT_OPEN && spec->stream_delay) |
| 244 | msleep(spec->stream_delay); |
Matt Porter | 8b65727 | 2006-10-26 17:12:59 +0200 | [diff] [blame] | 245 | } |
| 246 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 247 | static void stac_capture_pcm_hook(struct hda_pcm_stream *hinfo, |
| 248 | struct hda_codec *codec, |
| 249 | struct snd_pcm_substream *substream, |
| 250 | int action) |
Matt Porter | 8b65727 | 2006-10-26 17:12:59 +0200 | [diff] [blame] | 251 | { |
Matt Porter | 8b65727 | 2006-10-26 17:12:59 +0200 | [diff] [blame] | 252 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 253 | int i, idx = 0; |
Matt Porter | 8b65727 | 2006-10-26 17:12:59 +0200 | [diff] [blame] | 254 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 255 | if (!spec->powerdown_adcs) |
| 256 | return; |
Matt Porter | 8b65727 | 2006-10-26 17:12:59 +0200 | [diff] [blame] | 257 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 258 | for (i = 0; i < spec->gen.num_all_adcs; i++) { |
| 259 | if (spec->gen.all_adcs[i] == hinfo->nid) { |
| 260 | idx = i; |
| 261 | break; |
| 262 | } |
Matthew Ranostay | 00ef50c | 2008-09-27 18:13:47 -0400 | [diff] [blame] | 263 | } |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 264 | |
| 265 | switch (action) { |
| 266 | case HDA_GEN_PCM_ACT_OPEN: |
| 267 | msleep(40); |
| 268 | snd_hda_codec_write(codec, hinfo->nid, 0, |
| 269 | AC_VERB_SET_POWER_STATE, AC_PWRST_D0); |
| 270 | spec->active_adcs |= (1 << idx); |
| 271 | break; |
| 272 | case HDA_GEN_PCM_ACT_CLOSE: |
| 273 | snd_hda_codec_write(codec, hinfo->nid, 0, |
| 274 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); |
| 275 | spec->active_adcs &= ~(1 << idx); |
| 276 | break; |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | /* |
| 281 | * Early 2006 Intel Macintoshes with STAC9220X5 codecs seem to have a |
| 282 | * funky external mute control using GPIO pins. |
| 283 | */ |
| 284 | |
| 285 | static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, |
| 286 | unsigned int dir_mask, unsigned int data) |
| 287 | { |
| 288 | unsigned int gpiostate, gpiomask, gpiodir; |
| 289 | |
| 290 | snd_printdd("%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); |
| 291 | |
| 292 | gpiostate = snd_hda_codec_read(codec, codec->afg, 0, |
| 293 | AC_VERB_GET_GPIO_DATA, 0); |
| 294 | gpiostate = (gpiostate & ~dir_mask) | (data & dir_mask); |
| 295 | |
| 296 | gpiomask = snd_hda_codec_read(codec, codec->afg, 0, |
| 297 | AC_VERB_GET_GPIO_MASK, 0); |
| 298 | gpiomask |= mask; |
| 299 | |
| 300 | gpiodir = snd_hda_codec_read(codec, codec->afg, 0, |
| 301 | AC_VERB_GET_GPIO_DIRECTION, 0); |
| 302 | gpiodir |= dir_mask; |
| 303 | |
| 304 | /* Configure GPIOx as CMOS */ |
| 305 | snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0); |
| 306 | |
| 307 | snd_hda_codec_write(codec, codec->afg, 0, |
| 308 | AC_VERB_SET_GPIO_MASK, gpiomask); |
| 309 | snd_hda_codec_read(codec, codec->afg, 0, |
| 310 | AC_VERB_SET_GPIO_DIRECTION, gpiodir); /* sync */ |
| 311 | |
| 312 | msleep(1); |
| 313 | |
| 314 | snd_hda_codec_read(codec, codec->afg, 0, |
| 315 | AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */ |
| 316 | } |
| 317 | |
| 318 | /* hook for controlling mic-mute LED GPIO */ |
Takashi Iwai | a90229e | 2013-01-18 14:10:00 +0100 | [diff] [blame^] | 319 | static void stac_capture_led_hook(struct hda_codec *codec, |
| 320 | struct snd_ctl_elem_value *ucontrol) |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 321 | { |
| 322 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | a90229e | 2013-01-18 14:10:00 +0100 | [diff] [blame^] | 323 | bool mute; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 324 | |
Takashi Iwai | a90229e | 2013-01-18 14:10:00 +0100 | [diff] [blame^] | 325 | if (!ucontrol) |
| 326 | return; |
| 327 | |
| 328 | mute = !(ucontrol->value.integer.value[0] || |
| 329 | ucontrol->value.integer.value[1]); |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 330 | if (spec->mic_mute_led_on != mute) { |
| 331 | spec->mic_mute_led_on = mute; |
| 332 | if (mute) |
| 333 | spec->gpio_data |= spec->mic_mute_led_gpio; |
| 334 | else |
| 335 | spec->gpio_data &= ~spec->mic_mute_led_gpio; |
| 336 | stac_gpio_set(codec, spec->gpio_mask, |
| 337 | spec->gpio_dir, spec->gpio_data); |
| 338 | } |
Matthew Ranostay | d973775 | 2008-09-07 12:03:41 +0200 | [diff] [blame] | 339 | } |
| 340 | |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 341 | static int stac_vrefout_set(struct hda_codec *codec, |
| 342 | hda_nid_t nid, unsigned int new_vref) |
| 343 | { |
| 344 | int error, pinctl; |
| 345 | |
| 346 | snd_printdd("%s, nid %x ctl %x\n", __func__, nid, new_vref); |
| 347 | pinctl = snd_hda_codec_read(codec, nid, 0, |
| 348 | AC_VERB_GET_PIN_WIDGET_CONTROL, 0); |
| 349 | |
| 350 | if (pinctl < 0) |
| 351 | return pinctl; |
| 352 | |
| 353 | pinctl &= 0xff; |
| 354 | pinctl &= ~AC_PINCTL_VREFEN; |
| 355 | pinctl |= (new_vref & AC_PINCTL_VREFEN); |
| 356 | |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 357 | error = snd_hda_set_pin_ctl_cache(codec, nid, pinctl); |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 358 | if (error < 0) |
| 359 | return error; |
| 360 | |
| 361 | return 1; |
| 362 | } |
| 363 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 364 | /* update mute-LED accoring to the master switch */ |
| 365 | static void stac_update_led_status(struct hda_codec *codec, int enabled) |
Nickolas Lloyd | 2fc9989 | 2009-05-15 15:33:30 +0200 | [diff] [blame] | 366 | { |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 367 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 368 | int muted = !enabled; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 369 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 370 | if (!spec->gpio_led) |
| 371 | return; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 372 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 373 | /* LED state is inverted on these systems */ |
| 374 | if (spec->gpio_led_polarity) |
| 375 | muted = !muted; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 376 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 377 | if (!spec->vref_mute_led_nid) { |
| 378 | if (muted) |
| 379 | spec->gpio_data |= spec->gpio_led; |
| 380 | else |
| 381 | spec->gpio_data &= ~spec->gpio_led; |
| 382 | stac_gpio_set(codec, spec->gpio_mask, |
| 383 | spec->gpio_dir, spec->gpio_data); |
Takashi Iwai | 5207e10 | 2009-07-30 13:09:08 +0200 | [diff] [blame] | 384 | } else { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 385 | spec->vref_led = muted ? AC_PINCTL_VREF_50 : AC_PINCTL_VREF_GRD; |
| 386 | stac_vrefout_set(codec, spec->vref_mute_led_nid, |
| 387 | spec->vref_led); |
Takashi Iwai | 5207e10 | 2009-07-30 13:09:08 +0200 | [diff] [blame] | 388 | } |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 389 | } |
| 390 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 391 | /* vmaster hook to update mute LED */ |
| 392 | static void stac_vmaster_hook(void *private_data, int val) |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 393 | { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 394 | stac_update_led_status(private_data, val); |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 395 | } |
| 396 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 397 | /* automute hook to handle GPIO mute and EAPD updates */ |
| 398 | static void stac_update_outputs(struct hda_codec *codec) |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 399 | { |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 400 | struct sigmatel_spec *spec = codec->spec; |
| 401 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 402 | if (spec->gpio_mute) |
| 403 | spec->gen.master_mute = |
| 404 | !(snd_hda_codec_read(codec, codec->afg, 0, |
| 405 | AC_VERB_GET_GPIO_DATA, 0) & spec->gpio_mute); |
| 406 | |
| 407 | snd_hda_gen_update_outputs(codec); |
| 408 | |
| 409 | if (spec->eapd_mask && spec->eapd_switch) { |
| 410 | unsigned int val = spec->gpio_data; |
| 411 | if (spec->gen.speaker_muted) |
| 412 | val &= ~spec->eapd_mask; |
| 413 | else |
| 414 | val |= spec->eapd_mask; |
| 415 | if (spec->gpio_data != val) |
| 416 | stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, |
| 417 | val); |
| 418 | } |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 419 | } |
| 420 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 421 | static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, |
| 422 | bool enable, bool do_write) |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 423 | { |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 424 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 425 | unsigned int idx, val; |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 426 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 427 | for (idx = 0; idx < spec->num_pwrs; idx++) { |
| 428 | if (spec->pwr_nids[idx] == nid) |
| 429 | break; |
| 430 | } |
| 431 | if (idx >= spec->num_pwrs) |
| 432 | return; |
| 433 | |
| 434 | idx = 1 << idx; |
| 435 | |
| 436 | val = spec->power_map_bits; |
| 437 | if (enable) |
| 438 | val &= ~idx; |
| 439 | else |
| 440 | val |= idx; |
| 441 | |
| 442 | /* power down unused output ports */ |
| 443 | if (val != spec->power_map_bits) { |
| 444 | spec->power_map_bits = val; |
| 445 | if (do_write) |
| 446 | snd_hda_codec_write(codec, codec->afg, 0, |
| 447 | AC_VERB_IDT_SET_POWER_MAP, val); |
| 448 | } |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 449 | } |
| 450 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 451 | /* update power bit per jack plug/unplug */ |
| 452 | static void jack_update_power(struct hda_codec *codec, |
| 453 | struct hda_jack_tbl *jack) |
| 454 | { |
| 455 | struct sigmatel_spec *spec = codec->spec; |
| 456 | int i; |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 457 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 458 | if (!spec->num_pwrs) |
| 459 | return; |
| 460 | |
| 461 | if (jack && jack->nid) { |
| 462 | stac_toggle_power_map(codec, jack->nid, |
| 463 | snd_hda_jack_detect(codec, jack->nid), |
| 464 | true); |
| 465 | return; |
| 466 | } |
| 467 | |
| 468 | /* update all jacks */ |
| 469 | for (i = 0; i < spec->num_pwrs; i++) { |
| 470 | hda_nid_t nid = spec->pwr_nids[i]; |
| 471 | jack = snd_hda_jack_tbl_get(codec, nid); |
| 472 | if (!jack || !jack->action) |
| 473 | continue; |
| 474 | if (jack->action == STAC_PWR_EVENT || |
| 475 | jack->action <= HDA_GEN_LAST_EVENT) |
| 476 | stac_toggle_power_map(codec, nid, |
| 477 | snd_hda_jack_detect(codec, nid), |
| 478 | false); |
| 479 | } |
| 480 | |
| 481 | snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_IDT_SET_POWER_MAP, |
| 482 | spec->power_map_bits); |
| 483 | } |
| 484 | |
| 485 | static void stac_hp_automute(struct hda_codec *codec, |
| 486 | struct hda_jack_tbl *jack) |
| 487 | { |
| 488 | snd_hda_gen_hp_automute(codec, jack); |
| 489 | jack_update_power(codec, jack); |
| 490 | } |
| 491 | |
| 492 | static void stac_line_automute(struct hda_codec *codec, |
| 493 | struct hda_jack_tbl *jack) |
| 494 | { |
| 495 | snd_hda_gen_line_automute(codec, jack); |
| 496 | jack_update_power(codec, jack); |
| 497 | } |
| 498 | |
| 499 | static void stac_vref_event(struct hda_codec *codec, struct hda_jack_tbl *event) |
| 500 | { |
| 501 | unsigned int data; |
| 502 | |
| 503 | data = snd_hda_codec_read(codec, codec->afg, 0, |
| 504 | AC_VERB_GET_GPIO_DATA, 0); |
| 505 | /* toggle VREF state based on GPIOx status */ |
| 506 | snd_hda_codec_write(codec, codec->afg, 0, 0x7e0, |
| 507 | !!(data & (1 << event->private_data))); |
| 508 | } |
| 509 | |
| 510 | /* initialize the power map and enable the power event to jacks that |
| 511 | * haven't been assigned to automute |
| 512 | */ |
| 513 | static void stac_init_power_map(struct hda_codec *codec) |
| 514 | { |
| 515 | struct sigmatel_spec *spec = codec->spec; |
| 516 | int i; |
| 517 | |
| 518 | for (i = 0; i < spec->num_pwrs; i++) { |
| 519 | hda_nid_t nid = spec->pwr_nids[i]; |
| 520 | unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); |
| 521 | def_conf = get_defcfg_connect(def_conf); |
| 522 | if (snd_hda_jack_tbl_get(codec, nid)) |
| 523 | continue; |
| 524 | if (def_conf == AC_JACK_PORT_COMPLEX && |
| 525 | !(spec->vref_mute_led_nid == nid || |
| 526 | is_jack_detectable(codec, nid))) { |
| 527 | snd_hda_jack_detect_enable_callback(codec, nid, |
| 528 | STAC_PWR_EVENT, |
| 529 | jack_update_power); |
| 530 | } else { |
| 531 | if (def_conf == AC_JACK_PORT_NONE) |
| 532 | stac_toggle_power_map(codec, nid, false, false); |
| 533 | else |
| 534 | stac_toggle_power_map(codec, nid, true, false); |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | /* |
| 540 | */ |
| 541 | |
| 542 | static inline bool get_int_hint(struct hda_codec *codec, const char *key, |
| 543 | int *valp) |
| 544 | { |
| 545 | return !snd_hda_get_int_hint(codec, key, valp); |
| 546 | } |
| 547 | |
| 548 | /* override some hints from the hwdep entry */ |
| 549 | static void stac_store_hints(struct hda_codec *codec) |
| 550 | { |
| 551 | struct sigmatel_spec *spec = codec->spec; |
| 552 | int val; |
| 553 | |
| 554 | if (get_int_hint(codec, "gpio_mask", &spec->gpio_mask)) { |
| 555 | spec->eapd_mask = spec->gpio_dir = spec->gpio_data = |
| 556 | spec->gpio_mask; |
| 557 | } |
| 558 | if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir)) |
| 559 | spec->gpio_mask &= spec->gpio_mask; |
| 560 | if (get_int_hint(codec, "gpio_data", &spec->gpio_data)) |
| 561 | spec->gpio_dir &= spec->gpio_mask; |
| 562 | if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask)) |
| 563 | spec->eapd_mask &= spec->gpio_mask; |
| 564 | if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute)) |
| 565 | spec->gpio_mute &= spec->gpio_mask; |
| 566 | val = snd_hda_get_bool_hint(codec, "eapd_switch"); |
| 567 | if (val >= 0) |
| 568 | spec->eapd_switch = val; |
| 569 | } |
| 570 | |
| 571 | /* |
| 572 | * loopback controls |
| 573 | */ |
| 574 | |
| 575 | #define stac_aloopback_info snd_ctl_boolean_mono_info |
| 576 | |
| 577 | static int stac_aloopback_get(struct snd_kcontrol *kcontrol, |
| 578 | struct snd_ctl_elem_value *ucontrol) |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 579 | { |
| 580 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 581 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 582 | struct sigmatel_spec *spec = codec->spec; |
| 583 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 584 | ucontrol->value.integer.value[0] = !!(spec->aloopback & |
| 585 | (spec->aloopback_mask << idx)); |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 586 | return 0; |
| 587 | } |
| 588 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 589 | static int stac_aloopback_put(struct snd_kcontrol *kcontrol, |
| 590 | struct snd_ctl_elem_value *ucontrol) |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 591 | { |
| 592 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 593 | struct sigmatel_spec *spec = codec->spec; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 594 | unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 595 | unsigned int dac_mode; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 596 | unsigned int val, idx_val; |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 597 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 598 | idx_val = spec->aloopback_mask << idx; |
| 599 | if (ucontrol->value.integer.value[0]) |
| 600 | val = spec->aloopback | idx_val; |
| 601 | else |
| 602 | val = spec->aloopback & ~idx_val; |
Takashi Iwai | 68ea7b2 | 2007-11-15 15:54:38 +0100 | [diff] [blame] | 603 | if (spec->aloopback == val) |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 604 | return 0; |
| 605 | |
Takashi Iwai | 68ea7b2 | 2007-11-15 15:54:38 +0100 | [diff] [blame] | 606 | spec->aloopback = val; |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 607 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 608 | /* Only return the bits defined by the shift value of the |
| 609 | * first two bytes of the mask |
| 610 | */ |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 611 | dac_mode = snd_hda_codec_read(codec, codec->afg, 0, |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 612 | kcontrol->private_value & 0xFFFF, 0x0); |
| 613 | dac_mode >>= spec->aloopback_shift; |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 614 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 615 | if (spec->aloopback & idx_val) { |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 616 | snd_hda_power_up(codec); |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 617 | dac_mode |= idx_val; |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 618 | } else { |
| 619 | snd_hda_power_down(codec); |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 620 | dac_mode &= ~idx_val; |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | snd_hda_codec_write_cache(codec, codec->afg, 0, |
| 624 | kcontrol->private_value >> 16, dac_mode); |
| 625 | |
| 626 | return 1; |
| 627 | } |
| 628 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 629 | #define STAC_ANALOG_LOOPBACK(verb_read, verb_write, cnt) \ |
| 630 | { \ |
| 631 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
| 632 | .name = "Analog Loopback", \ |
| 633 | .count = cnt, \ |
| 634 | .info = stac_aloopback_info, \ |
| 635 | .get = stac_aloopback_get, \ |
| 636 | .put = stac_aloopback_put, \ |
| 637 | .private_value = verb_read | (verb_write << 16), \ |
| 638 | } |
| 639 | |
| 640 | /* |
| 641 | * Mute LED handling on HP laptops |
| 642 | */ |
| 643 | |
| 644 | /* check whether it's a HP laptop with a docking port */ |
| 645 | static bool hp_bnb2011_with_dock(struct hda_codec *codec) |
| 646 | { |
| 647 | if (codec->vendor_id != 0x111d7605 && |
| 648 | codec->vendor_id != 0x111d76d1) |
| 649 | return false; |
| 650 | |
| 651 | switch (codec->subsystem_id) { |
| 652 | case 0x103c1618: |
| 653 | case 0x103c1619: |
| 654 | case 0x103c161a: |
| 655 | case 0x103c161b: |
| 656 | case 0x103c161c: |
| 657 | case 0x103c161d: |
| 658 | case 0x103c161e: |
| 659 | case 0x103c161f: |
| 660 | |
| 661 | case 0x103c162a: |
| 662 | case 0x103c162b: |
| 663 | |
| 664 | case 0x103c1630: |
| 665 | case 0x103c1631: |
| 666 | |
| 667 | case 0x103c1633: |
| 668 | case 0x103c1634: |
| 669 | case 0x103c1635: |
| 670 | |
| 671 | case 0x103c3587: |
| 672 | case 0x103c3588: |
| 673 | case 0x103c3589: |
| 674 | case 0x103c358a: |
| 675 | |
| 676 | case 0x103c3667: |
| 677 | case 0x103c3668: |
| 678 | case 0x103c3669: |
| 679 | |
| 680 | return true; |
| 681 | } |
| 682 | return false; |
| 683 | } |
| 684 | |
| 685 | static bool hp_blike_system(u32 subsystem_id) |
| 686 | { |
| 687 | switch (subsystem_id) { |
| 688 | case 0x103c1520: |
| 689 | case 0x103c1521: |
| 690 | case 0x103c1523: |
| 691 | case 0x103c1524: |
| 692 | case 0x103c1525: |
| 693 | case 0x103c1722: |
| 694 | case 0x103c1723: |
| 695 | case 0x103c1724: |
| 696 | case 0x103c1725: |
| 697 | case 0x103c1726: |
| 698 | case 0x103c1727: |
| 699 | case 0x103c1728: |
| 700 | case 0x103c1729: |
| 701 | case 0x103c172a: |
| 702 | case 0x103c172b: |
| 703 | case 0x103c307e: |
| 704 | case 0x103c307f: |
| 705 | case 0x103c3080: |
| 706 | case 0x103c3081: |
| 707 | case 0x103c7007: |
| 708 | case 0x103c7008: |
| 709 | return true; |
| 710 | } |
| 711 | return false; |
| 712 | } |
| 713 | |
| 714 | static void set_hp_led_gpio(struct hda_codec *codec) |
| 715 | { |
| 716 | struct sigmatel_spec *spec = codec->spec; |
| 717 | unsigned int gpio; |
| 718 | |
| 719 | if (spec->gpio_led) |
| 720 | return; |
| 721 | |
| 722 | gpio = snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP); |
| 723 | gpio &= AC_GPIO_IO_COUNT; |
| 724 | if (gpio > 3) |
| 725 | spec->gpio_led = 0x08; /* GPIO 3 */ |
| 726 | else |
| 727 | spec->gpio_led = 0x01; /* GPIO 0 */ |
| 728 | } |
| 729 | |
| 730 | /* |
| 731 | * This method searches for the mute LED GPIO configuration |
| 732 | * provided as OEM string in SMBIOS. The format of that string |
| 733 | * is HP_Mute_LED_P_G or HP_Mute_LED_P |
| 734 | * where P can be 0 or 1 and defines mute LED GPIO control state (low/high) |
| 735 | * that corresponds to the NOT muted state of the master volume |
| 736 | * and G is the index of the GPIO to use as the mute LED control (0..9) |
| 737 | * If _G portion is missing it is assigned based on the codec ID |
| 738 | * |
| 739 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) |
| 740 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings |
| 741 | * |
| 742 | * |
| 743 | * The dv-series laptops don't seem to have the HP_Mute_LED* strings in |
| 744 | * SMBIOS - at least the ones I have seen do not have them - which include |
| 745 | * my own system (HP Pavilion dv6-1110ax) and my cousin's |
| 746 | * HP Pavilion dv9500t CTO. |
| 747 | * Need more information on whether it is true across the entire series. |
| 748 | * -- kunal |
| 749 | */ |
| 750 | static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity) |
| 751 | { |
| 752 | struct sigmatel_spec *spec = codec->spec; |
| 753 | const struct dmi_device *dev = NULL; |
| 754 | |
| 755 | if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { |
| 756 | get_int_hint(codec, "gpio_led_polarity", |
| 757 | &spec->gpio_led_polarity); |
| 758 | return 1; |
| 759 | } |
| 760 | |
| 761 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 762 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", |
| 763 | &spec->gpio_led_polarity, |
| 764 | &spec->gpio_led) == 2) { |
| 765 | unsigned int max_gpio; |
| 766 | max_gpio = snd_hda_param_read(codec, codec->afg, |
| 767 | AC_PAR_GPIO_CAP); |
| 768 | max_gpio &= AC_GPIO_IO_COUNT; |
| 769 | if (spec->gpio_led < max_gpio) |
| 770 | spec->gpio_led = 1 << spec->gpio_led; |
| 771 | else |
| 772 | spec->vref_mute_led_nid = spec->gpio_led; |
| 773 | return 1; |
| 774 | } |
| 775 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
| 776 | &spec->gpio_led_polarity) == 1) { |
| 777 | set_hp_led_gpio(codec); |
| 778 | return 1; |
| 779 | } |
| 780 | /* BIOS bug: unfilled OEM string */ |
| 781 | if (strstr(dev->name, "HP_Mute_LED_P_G")) { |
| 782 | set_hp_led_gpio(codec); |
| 783 | if (default_polarity >= 0) |
| 784 | spec->gpio_led_polarity = default_polarity; |
| 785 | else |
| 786 | spec->gpio_led_polarity = 1; |
| 787 | return 1; |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | /* |
| 792 | * Fallback case - if we don't find the DMI strings, |
| 793 | * we statically set the GPIO - if not a B-series system |
| 794 | * and default polarity is provided |
| 795 | */ |
| 796 | if (!hp_blike_system(codec->subsystem_id) && |
| 797 | (default_polarity == 0 || default_polarity == 1)) { |
| 798 | set_hp_led_gpio(codec); |
| 799 | spec->gpio_led_polarity = default_polarity; |
| 800 | return 1; |
| 801 | } |
| 802 | return 0; |
| 803 | } |
| 804 | |
| 805 | /* |
| 806 | * PC beep controls |
| 807 | */ |
| 808 | |
| 809 | /* create PC beep volume controls */ |
| 810 | static int stac_auto_create_beep_ctls(struct hda_codec *codec, |
| 811 | hda_nid_t nid) |
| 812 | { |
| 813 | struct sigmatel_spec *spec = codec->spec; |
| 814 | u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT); |
| 815 | struct snd_kcontrol_new *knew; |
| 816 | static struct snd_kcontrol_new abeep_mute_ctl = |
| 817 | HDA_CODEC_MUTE(NULL, 0, 0, 0); |
| 818 | static struct snd_kcontrol_new dbeep_mute_ctl = |
| 819 | HDA_CODEC_MUTE_BEEP(NULL, 0, 0, 0); |
| 820 | static struct snd_kcontrol_new beep_vol_ctl = |
| 821 | HDA_CODEC_VOLUME(NULL, 0, 0, 0); |
| 822 | |
| 823 | /* check for mute support for the the amp */ |
| 824 | if ((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT) { |
| 825 | const struct snd_kcontrol_new *temp; |
| 826 | if (spec->anabeep_nid == nid) |
| 827 | temp = &abeep_mute_ctl; |
| 828 | else |
| 829 | temp = &dbeep_mute_ctl; |
| 830 | knew = snd_hda_gen_add_kctl(&spec->gen, |
| 831 | "Beep Playback Switch", temp); |
| 832 | if (!knew) |
| 833 | return -ENOMEM; |
| 834 | knew->private_value = |
| 835 | HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT); |
| 836 | } |
| 837 | |
| 838 | /* check to see if there is volume support for the amp */ |
| 839 | if ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) { |
| 840 | knew = snd_hda_gen_add_kctl(&spec->gen, |
| 841 | "Beep Playback Volume", |
| 842 | &beep_vol_ctl); |
| 843 | if (!knew) |
| 844 | return -ENOMEM; |
| 845 | knew->private_value = |
| 846 | HDA_COMPOSE_AMP_VAL(nid, 1, 0, HDA_OUTPUT); |
| 847 | } |
| 848 | return 0; |
| 849 | } |
| 850 | |
| 851 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
| 852 | #define stac_dig_beep_switch_info snd_ctl_boolean_mono_info |
| 853 | |
| 854 | static int stac_dig_beep_switch_get(struct snd_kcontrol *kcontrol, |
| 855 | struct snd_ctl_elem_value *ucontrol) |
| 856 | { |
| 857 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 858 | ucontrol->value.integer.value[0] = codec->beep->enabled; |
| 859 | return 0; |
| 860 | } |
| 861 | |
| 862 | static int stac_dig_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 863 | struct snd_ctl_elem_value *ucontrol) |
| 864 | { |
| 865 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 866 | return snd_hda_enable_beep_device(codec, ucontrol->value.integer.value[0]); |
| 867 | } |
| 868 | |
| 869 | static const struct snd_kcontrol_new stac_dig_beep_ctrl = { |
| 870 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 871 | .name = "Beep Playback Switch", |
| 872 | .info = stac_dig_beep_switch_info, |
| 873 | .get = stac_dig_beep_switch_get, |
| 874 | .put = stac_dig_beep_switch_put, |
| 875 | }; |
| 876 | |
| 877 | static int stac_beep_switch_ctl(struct hda_codec *codec) |
| 878 | { |
| 879 | struct sigmatel_spec *spec = codec->spec; |
| 880 | |
| 881 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &stac_dig_beep_ctrl)) |
| 882 | return -ENOMEM; |
| 883 | return 0; |
| 884 | } |
| 885 | #endif |
| 886 | |
| 887 | /* |
| 888 | */ |
| 889 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 890 | static const struct hda_verb stac9200_core_init[] = { |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 891 | /* set dac0mux for dac converter */ |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 892 | { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00}, |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 893 | {} |
| 894 | }; |
| 895 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 896 | static const struct hda_verb stac9200_eapd_init[] = { |
Takashi Iwai | 1194b5b | 2007-10-10 10:04:26 +0200 | [diff] [blame] | 897 | /* set dac0mux for dac converter */ |
| 898 | {0x07, AC_VERB_SET_CONNECT_SEL, 0x00}, |
| 899 | {0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02}, |
| 900 | {} |
| 901 | }; |
| 902 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 903 | static const struct hda_verb dell_eq_core_init[] = { |
Matthew Ranostay | d654a66 | 2008-03-14 08:46:51 +0100 | [diff] [blame] | 904 | /* set master volume to max value without distortion |
| 905 | * and direct control */ |
| 906 | { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec}, |
Matthew Ranostay | d654a66 | 2008-03-14 08:46:51 +0100 | [diff] [blame] | 907 | {} |
| 908 | }; |
| 909 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 910 | static const struct hda_verb stac92hd73xx_core_init[] = { |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 911 | /* set master volume and direct control */ |
| 912 | { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 913 | {} |
| 914 | }; |
| 915 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 916 | static const struct hda_verb stac92hd83xxx_core_init[] = { |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 917 | /* power state controls amps */ |
| 918 | { 0x01, AC_VERB_SET_EAPD, 1 << 2}, |
Herton Ronaldo Krzesinski | 574f3c4 | 2008-12-23 16:53:00 -0200 | [diff] [blame] | 919 | {} |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 920 | }; |
| 921 | |
Vitaliy Kulikov | 5556e14 | 2012-02-27 16:47:37 -0600 | [diff] [blame] | 922 | static const struct hda_verb stac92hd83xxx_hp_zephyr_init[] = { |
| 923 | { 0x22, 0x785, 0x43 }, |
| 924 | { 0x22, 0x782, 0xe0 }, |
| 925 | { 0x22, 0x795, 0x00 }, |
| 926 | {} |
| 927 | }; |
| 928 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 929 | static const struct hda_verb stac92hd71bxx_core_init[] = { |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 930 | /* set master volume and direct control */ |
| 931 | { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, |
Herton Ronaldo Krzesinski | 574f3c4 | 2008-12-23 16:53:00 -0200 | [diff] [blame] | 932 | {} |
Matthew Ranostay | 541eee8 | 2007-12-14 12:08:04 +0100 | [diff] [blame] | 933 | }; |
| 934 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 935 | static const struct hda_verb stac92hd71bxx_unmute_core_init[] = { |
Matthew Ranostay | ca8d33f | 2009-01-26 09:33:52 -0500 | [diff] [blame] | 936 | /* unmute right and left channels for nodes 0x0f, 0xa, 0x0d */ |
| 937 | { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 938 | { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 939 | { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 940 | {} |
| 941 | }; |
| 942 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 943 | static const struct hda_verb stac925x_core_init[] = { |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 944 | /* set dac0mux for dac converter */ |
| 945 | { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, |
Takashi Iwai | c9280d6 | 2009-01-15 17:31:00 +0100 | [diff] [blame] | 946 | /* mute the master volume */ |
| 947 | { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 948 | {} |
| 949 | }; |
| 950 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 951 | static const struct hda_verb stac922x_core_init[] = { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 952 | /* set master volume and direct control */ |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 953 | { 0x16, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 954 | {} |
| 955 | }; |
| 956 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 957 | static const struct hda_verb d965_core_init[] = { |
Takashi Iwai | 19039bd | 2006-06-28 15:52:16 +0200 | [diff] [blame] | 958 | /* unmute node 0x1b */ |
| 959 | { 0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 960 | /* select node 0x03 as DAC */ |
Takashi Iwai | 19039bd | 2006-06-28 15:52:16 +0200 | [diff] [blame] | 961 | { 0x0b, AC_VERB_SET_CONNECT_SEL, 0x01}, |
| 962 | {} |
| 963 | }; |
| 964 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 965 | static const struct hda_verb dell_3st_core_init[] = { |
Takashi Iwai | ccca7cd | 2009-10-13 15:32:21 +0200 | [diff] [blame] | 966 | /* don't set delta bit */ |
| 967 | {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0x7f}, |
| 968 | /* unmute node 0x1b */ |
| 969 | {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, |
| 970 | /* select node 0x03 as DAC */ |
| 971 | {0x0b, AC_VERB_SET_CONNECT_SEL, 0x01}, |
| 972 | {} |
| 973 | }; |
| 974 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 975 | static const struct hda_verb stac927x_core_init[] = { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 976 | /* set master volume and direct control */ |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 977 | { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 978 | /* enable analog pc beep path */ |
| 979 | { 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5}, |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 980 | {} |
| 981 | }; |
| 982 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 983 | static const struct hda_verb stac927x_volknob_core_init[] = { |
Takashi Iwai | 5493053 | 2009-10-11 17:38:29 +0200 | [diff] [blame] | 984 | /* don't set delta bit */ |
| 985 | {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0x7f}, |
| 986 | /* enable analog pc beep path */ |
| 987 | {0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5}, |
| 988 | {} |
| 989 | }; |
| 990 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 991 | static const struct hda_verb stac9205_core_init[] = { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 992 | /* set master volume and direct control */ |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 993 | { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 994 | /* enable analog pc beep path */ |
| 995 | { 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5}, |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 996 | {} |
| 997 | }; |
| 998 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 999 | static const struct snd_kcontrol_new stac92hd73xx_6ch_loopback = |
| 1000 | STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 3); |
Matthew Ranostay | b22b482 | 2008-01-22 12:32:30 +0100 | [diff] [blame] | 1001 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1002 | static const struct snd_kcontrol_new stac92hd73xx_8ch_loopback = |
| 1003 | STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 4); |
Maxim Levitsky | 5f10c4a | 2007-09-03 15:29:37 +0200 | [diff] [blame] | 1004 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1005 | static const struct snd_kcontrol_new stac92hd73xx_10ch_loopback = |
| 1006 | STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 5); |
Nickolas Lloyd | 2fc9989 | 2009-05-15 15:33:30 +0200 | [diff] [blame] | 1007 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1008 | static const struct snd_kcontrol_new stac92hd71bxx_loopback = |
| 1009 | STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2); |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 1010 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1011 | static const struct snd_kcontrol_new stac9205_loopback = |
| 1012 | STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0, 1); |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 1013 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1014 | static const struct snd_kcontrol_new stac927x_loopback = |
| 1015 | STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB, 1); |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 1016 | |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1017 | static const struct hda_pintbl ref9200_pin_configs[] = { |
| 1018 | { 0x08, 0x01c47010 }, |
| 1019 | { 0x09, 0x01447010 }, |
| 1020 | { 0x0d, 0x0221401f }, |
| 1021 | { 0x0e, 0x01114010 }, |
| 1022 | { 0x0f, 0x02a19020 }, |
| 1023 | { 0x10, 0x01a19021 }, |
| 1024 | { 0x11, 0x90100140 }, |
| 1025 | { 0x12, 0x01813122 }, |
| 1026 | {} |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 1027 | }; |
| 1028 | |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1029 | static const struct hda_pintbl gateway9200_m4_pin_configs[] = { |
| 1030 | { 0x08, 0x400000fe }, |
| 1031 | { 0x09, 0x404500f4 }, |
| 1032 | { 0x0d, 0x400100f0 }, |
| 1033 | { 0x0e, 0x90110010 }, |
| 1034 | { 0x0f, 0x400100f1 }, |
| 1035 | { 0x10, 0x02a1902e }, |
| 1036 | { 0x11, 0x500000f2 }, |
| 1037 | { 0x12, 0x500000f3 }, |
| 1038 | {} |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1039 | }; |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1040 | |
| 1041 | static const struct hda_pintbl gateway9200_m4_2_pin_configs[] = { |
| 1042 | { 0x08, 0x400000fe }, |
| 1043 | { 0x09, 0x404500f4 }, |
| 1044 | { 0x0d, 0x400100f0 }, |
| 1045 | { 0x0e, 0x90110010 }, |
| 1046 | { 0x0f, 0x400100f1 }, |
| 1047 | { 0x10, 0x02a1902e }, |
| 1048 | { 0x11, 0x500000f2 }, |
| 1049 | { 0x12, 0x500000f3 }, |
| 1050 | {} |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1051 | }; |
| 1052 | |
| 1053 | /* |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1054 | STAC 9200 pin configs for |
| 1055 | 102801A8 |
| 1056 | 102801DE |
| 1057 | 102801E8 |
| 1058 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1059 | static const struct hda_pintbl dell9200_d21_pin_configs[] = { |
| 1060 | { 0x08, 0x400001f0 }, |
| 1061 | { 0x09, 0x400001f1 }, |
| 1062 | { 0x0d, 0x02214030 }, |
| 1063 | { 0x0e, 0x01014010 }, |
| 1064 | { 0x0f, 0x02a19020 }, |
| 1065 | { 0x10, 0x01a19021 }, |
| 1066 | { 0x11, 0x90100140 }, |
| 1067 | { 0x12, 0x01813122 }, |
| 1068 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1069 | }; |
| 1070 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1071 | /* |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1072 | STAC 9200 pin configs for |
| 1073 | 102801C0 |
| 1074 | 102801C1 |
| 1075 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1076 | static const struct hda_pintbl dell9200_d22_pin_configs[] = { |
| 1077 | { 0x08, 0x400001f0 }, |
| 1078 | { 0x09, 0x400001f1 }, |
| 1079 | { 0x0d, 0x0221401f }, |
| 1080 | { 0x0e, 0x01014010 }, |
| 1081 | { 0x0f, 0x01813020 }, |
| 1082 | { 0x10, 0x02a19021 }, |
| 1083 | { 0x11, 0x90100140 }, |
| 1084 | { 0x12, 0x400001f2 }, |
| 1085 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1086 | }; |
| 1087 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1088 | /* |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1089 | STAC 9200 pin configs for |
| 1090 | 102801C4 (Dell Dimension E310) |
| 1091 | 102801C5 |
| 1092 | 102801C7 |
| 1093 | 102801D9 |
| 1094 | 102801DA |
| 1095 | 102801E3 |
| 1096 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1097 | static const struct hda_pintbl dell9200_d23_pin_configs[] = { |
| 1098 | { 0x08, 0x400001f0 }, |
| 1099 | { 0x09, 0x400001f1 }, |
| 1100 | { 0x0d, 0x0221401f }, |
| 1101 | { 0x0e, 0x01014010 }, |
| 1102 | { 0x0f, 0x01813020 }, |
| 1103 | { 0x10, 0x01a19021 }, |
| 1104 | { 0x11, 0x90100140 }, |
| 1105 | { 0x12, 0x400001f2 }, |
| 1106 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1107 | }; |
| 1108 | |
| 1109 | |
| 1110 | /* |
| 1111 | STAC 9200-32 pin configs for |
| 1112 | 102801B5 (Dell Inspiron 630m) |
| 1113 | 102801D8 (Dell Inspiron 640m) |
| 1114 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1115 | static const struct hda_pintbl dell9200_m21_pin_configs[] = { |
| 1116 | { 0x08, 0x40c003fa }, |
| 1117 | { 0x09, 0x03441340 }, |
| 1118 | { 0x0d, 0x0321121f }, |
| 1119 | { 0x0e, 0x90170310 }, |
| 1120 | { 0x0f, 0x408003fb }, |
| 1121 | { 0x10, 0x03a11020 }, |
| 1122 | { 0x11, 0x401003fc }, |
| 1123 | { 0x12, 0x403003fd }, |
| 1124 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1125 | }; |
| 1126 | |
| 1127 | /* |
| 1128 | STAC 9200-32 pin configs for |
| 1129 | 102801C2 (Dell Latitude D620) |
| 1130 | 102801C8 |
| 1131 | 102801CC (Dell Latitude D820) |
| 1132 | 102801D4 |
| 1133 | 102801D6 |
| 1134 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1135 | static const struct hda_pintbl dell9200_m22_pin_configs[] = { |
| 1136 | { 0x08, 0x40c003fa }, |
| 1137 | { 0x09, 0x0144131f }, |
| 1138 | { 0x0d, 0x0321121f }, |
| 1139 | { 0x0e, 0x90170310 }, |
| 1140 | { 0x0f, 0x90a70321 }, |
| 1141 | { 0x10, 0x03a11020 }, |
| 1142 | { 0x11, 0x401003fb }, |
| 1143 | { 0x12, 0x40f000fc }, |
| 1144 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1145 | }; |
| 1146 | |
| 1147 | /* |
| 1148 | STAC 9200-32 pin configs for |
| 1149 | 102801CE (Dell XPS M1710) |
| 1150 | 102801CF (Dell Precision M90) |
| 1151 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1152 | static const struct hda_pintbl dell9200_m23_pin_configs[] = { |
| 1153 | { 0x08, 0x40c003fa }, |
| 1154 | { 0x09, 0x01441340 }, |
| 1155 | { 0x0d, 0x0421421f }, |
| 1156 | { 0x0e, 0x90170310 }, |
| 1157 | { 0x0f, 0x408003fb }, |
| 1158 | { 0x10, 0x04a1102e }, |
| 1159 | { 0x11, 0x90170311 }, |
| 1160 | { 0x12, 0x403003fc }, |
| 1161 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1162 | }; |
| 1163 | |
| 1164 | /* |
| 1165 | STAC 9200-32 pin configs for |
| 1166 | 102801C9 |
| 1167 | 102801CA |
| 1168 | 102801CB (Dell Latitude 120L) |
| 1169 | 102801D3 |
| 1170 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1171 | static const struct hda_pintbl dell9200_m24_pin_configs[] = { |
| 1172 | { 0x08, 0x40c003fa }, |
| 1173 | { 0x09, 0x404003fb }, |
| 1174 | { 0x0d, 0x0321121f }, |
| 1175 | { 0x0e, 0x90170310 }, |
| 1176 | { 0x0f, 0x408003fc }, |
| 1177 | { 0x10, 0x03a11020 }, |
| 1178 | { 0x11, 0x401003fd }, |
| 1179 | { 0x12, 0x403003fe }, |
| 1180 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1181 | }; |
| 1182 | |
| 1183 | /* |
| 1184 | STAC 9200-32 pin configs for |
| 1185 | 102801BD (Dell Inspiron E1505n) |
| 1186 | 102801EE |
| 1187 | 102801EF |
| 1188 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1189 | static const struct hda_pintbl dell9200_m25_pin_configs[] = { |
| 1190 | { 0x08, 0x40c003fa }, |
| 1191 | { 0x09, 0x01441340 }, |
| 1192 | { 0x0d, 0x0421121f }, |
| 1193 | { 0x0e, 0x90170310 }, |
| 1194 | { 0x0f, 0x408003fb }, |
| 1195 | { 0x10, 0x04a11020 }, |
| 1196 | { 0x11, 0x401003fc }, |
| 1197 | { 0x12, 0x403003fd }, |
| 1198 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1199 | }; |
| 1200 | |
| 1201 | /* |
| 1202 | STAC 9200-32 pin configs for |
| 1203 | 102801F5 (Dell Inspiron 1501) |
| 1204 | 102801F6 |
| 1205 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1206 | static const struct hda_pintbl dell9200_m26_pin_configs[] = { |
| 1207 | { 0x08, 0x40c003fa }, |
| 1208 | { 0x09, 0x404003fb }, |
| 1209 | { 0x0d, 0x0421121f }, |
| 1210 | { 0x0e, 0x90170310 }, |
| 1211 | { 0x0f, 0x408003fc }, |
| 1212 | { 0x10, 0x04a11020 }, |
| 1213 | { 0x11, 0x401003fd }, |
| 1214 | { 0x12, 0x403003fe }, |
| 1215 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1216 | }; |
| 1217 | |
| 1218 | /* |
| 1219 | STAC 9200-32 |
| 1220 | 102801CD (Dell Inspiron E1705/9400) |
| 1221 | */ |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1222 | static const struct hda_pintbl dell9200_m27_pin_configs[] = { |
| 1223 | { 0x08, 0x40c003fa }, |
| 1224 | { 0x09, 0x01441340 }, |
| 1225 | { 0x0d, 0x0421121f }, |
| 1226 | { 0x0e, 0x90170310 }, |
| 1227 | { 0x0f, 0x90170310 }, |
| 1228 | { 0x10, 0x04a11020 }, |
| 1229 | { 0x11, 0x90170310 }, |
| 1230 | { 0x12, 0x40f003fc }, |
| 1231 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1232 | }; |
| 1233 | |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1234 | static const struct hda_pintbl oqo9200_pin_configs[] = { |
| 1235 | { 0x08, 0x40c000f0 }, |
| 1236 | { 0x09, 0x404000f1 }, |
| 1237 | { 0x0d, 0x0221121f }, |
| 1238 | { 0x0e, 0x02211210 }, |
| 1239 | { 0x0f, 0x90170111 }, |
| 1240 | { 0x10, 0x90a70120 }, |
| 1241 | { 0x11, 0x400000f2 }, |
| 1242 | { 0x12, 0x400000f3 }, |
| 1243 | {} |
Tobin Davis | bf27778 | 2008-02-03 20:31:47 +0100 | [diff] [blame] | 1244 | }; |
| 1245 | |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1246 | |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1247 | static void stac9200_fixup_panasonic(struct hda_codec *codec, |
| 1248 | const struct hda_fixup *fix, int action) |
| 1249 | { |
| 1250 | struct sigmatel_spec *spec = codec->spec; |
| 1251 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1252 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1253 | spec->gpio_mask = spec->gpio_dir = 0x09; |
| 1254 | spec->gpio_data = 0x00; |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1255 | /* CF-74 has no headphone detection, and the driver should *NOT* |
| 1256 | * do detection and HP/speaker toggle because the hardware does it. |
| 1257 | */ |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1258 | spec->gen.suppress_auto_mute = 1; |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1259 | } |
| 1260 | } |
| 1261 | |
| 1262 | |
| 1263 | static const struct hda_fixup stac9200_fixups[] = { |
| 1264 | [STAC_REF] = { |
| 1265 | .type = HDA_FIXUP_PINS, |
| 1266 | .v.pins = ref9200_pin_configs, |
| 1267 | }, |
| 1268 | [STAC_9200_OQO] = { |
| 1269 | .type = HDA_FIXUP_PINS, |
| 1270 | .v.pins = oqo9200_pin_configs, |
| 1271 | .chained = true, |
| 1272 | .chain_id = STAC_9200_EAPD_INIT, |
| 1273 | }, |
| 1274 | [STAC_9200_DELL_D21] = { |
| 1275 | .type = HDA_FIXUP_PINS, |
| 1276 | .v.pins = dell9200_d21_pin_configs, |
| 1277 | }, |
| 1278 | [STAC_9200_DELL_D22] = { |
| 1279 | .type = HDA_FIXUP_PINS, |
| 1280 | .v.pins = dell9200_d22_pin_configs, |
| 1281 | }, |
| 1282 | [STAC_9200_DELL_D23] = { |
| 1283 | .type = HDA_FIXUP_PINS, |
| 1284 | .v.pins = dell9200_d23_pin_configs, |
| 1285 | }, |
| 1286 | [STAC_9200_DELL_M21] = { |
| 1287 | .type = HDA_FIXUP_PINS, |
| 1288 | .v.pins = dell9200_m21_pin_configs, |
| 1289 | }, |
| 1290 | [STAC_9200_DELL_M22] = { |
| 1291 | .type = HDA_FIXUP_PINS, |
| 1292 | .v.pins = dell9200_m22_pin_configs, |
| 1293 | }, |
| 1294 | [STAC_9200_DELL_M23] = { |
| 1295 | .type = HDA_FIXUP_PINS, |
| 1296 | .v.pins = dell9200_m23_pin_configs, |
| 1297 | }, |
| 1298 | [STAC_9200_DELL_M24] = { |
| 1299 | .type = HDA_FIXUP_PINS, |
| 1300 | .v.pins = dell9200_m24_pin_configs, |
| 1301 | }, |
| 1302 | [STAC_9200_DELL_M25] = { |
| 1303 | .type = HDA_FIXUP_PINS, |
| 1304 | .v.pins = dell9200_m25_pin_configs, |
| 1305 | }, |
| 1306 | [STAC_9200_DELL_M26] = { |
| 1307 | .type = HDA_FIXUP_PINS, |
| 1308 | .v.pins = dell9200_m26_pin_configs, |
| 1309 | }, |
| 1310 | [STAC_9200_DELL_M27] = { |
| 1311 | .type = HDA_FIXUP_PINS, |
| 1312 | .v.pins = dell9200_m27_pin_configs, |
| 1313 | }, |
| 1314 | [STAC_9200_M4] = { |
| 1315 | .type = HDA_FIXUP_PINS, |
| 1316 | .v.pins = gateway9200_m4_pin_configs, |
| 1317 | .chained = true, |
| 1318 | .chain_id = STAC_9200_EAPD_INIT, |
| 1319 | }, |
| 1320 | [STAC_9200_M4_2] = { |
| 1321 | .type = HDA_FIXUP_PINS, |
| 1322 | .v.pins = gateway9200_m4_2_pin_configs, |
| 1323 | .chained = true, |
| 1324 | .chain_id = STAC_9200_EAPD_INIT, |
| 1325 | }, |
| 1326 | [STAC_9200_PANASONIC] = { |
| 1327 | .type = HDA_FIXUP_FUNC, |
| 1328 | .v.func = stac9200_fixup_panasonic, |
| 1329 | }, |
| 1330 | [STAC_9200_EAPD_INIT] = { |
| 1331 | .type = HDA_FIXUP_VERBS, |
| 1332 | .v.verbs = (const struct hda_verb[]) { |
| 1333 | {0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02}, |
| 1334 | {} |
| 1335 | }, |
| 1336 | }, |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 1337 | }; |
| 1338 | |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1339 | static const struct hda_model_fixup stac9200_models[] = { |
| 1340 | { .id = STAC_REF, .name = "ref" }, |
| 1341 | { .id = STAC_9200_OQO, .name = "oqo" }, |
| 1342 | { .id = STAC_9200_DELL_D21, .name = "dell-d21" }, |
| 1343 | { .id = STAC_9200_DELL_D22, .name = "dell-d22" }, |
| 1344 | { .id = STAC_9200_DELL_D23, .name = "dell-d23" }, |
| 1345 | { .id = STAC_9200_DELL_M21, .name = "dell-m21" }, |
| 1346 | { .id = STAC_9200_DELL_M22, .name = "dell-m22" }, |
| 1347 | { .id = STAC_9200_DELL_M23, .name = "dell-m23" }, |
| 1348 | { .id = STAC_9200_DELL_M24, .name = "dell-m24" }, |
| 1349 | { .id = STAC_9200_DELL_M25, .name = "dell-m25" }, |
| 1350 | { .id = STAC_9200_DELL_M26, .name = "dell-m26" }, |
| 1351 | { .id = STAC_9200_DELL_M27, .name = "dell-m27" }, |
| 1352 | { .id = STAC_9200_M4, .name = "gateway-m4" }, |
| 1353 | { .id = STAC_9200_M4_2, .name = "gateway-m4-2" }, |
| 1354 | { .id = STAC_9200_PANASONIC, .name = "panasonic" }, |
| 1355 | {} |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 1356 | }; |
| 1357 | |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 1358 | static const struct snd_pci_quirk stac9200_fixup_tbl[] = { |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 1359 | /* SigmaTel reference board */ |
| 1360 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
| 1361 | "DFI LanParty", STAC_REF), |
Matthew Ranostay | 577aa2c | 2009-01-22 22:55:44 -0500 | [diff] [blame] | 1362 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
| 1363 | "DFI LanParty", STAC_REF), |
Matt Porter | e737707 | 2006-11-06 11:20:38 +0100 | [diff] [blame] | 1364 | /* Dell laptops have BIOS problem */ |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1365 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a8, |
| 1366 | "unknown Dell", STAC_9200_DELL_D21), |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 1367 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01b5, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1368 | "Dell Inspiron 630m", STAC_9200_DELL_M21), |
| 1369 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01bd, |
| 1370 | "Dell Inspiron E1505n", STAC_9200_DELL_M25), |
| 1371 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c0, |
| 1372 | "unknown Dell", STAC_9200_DELL_D22), |
| 1373 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c1, |
| 1374 | "unknown Dell", STAC_9200_DELL_D22), |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 1375 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c2, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1376 | "Dell Latitude D620", STAC_9200_DELL_M22), |
| 1377 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c5, |
| 1378 | "unknown Dell", STAC_9200_DELL_D23), |
| 1379 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c7, |
| 1380 | "unknown Dell", STAC_9200_DELL_D23), |
| 1381 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c8, |
| 1382 | "unknown Dell", STAC_9200_DELL_M22), |
| 1383 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c9, |
| 1384 | "unknown Dell", STAC_9200_DELL_M24), |
| 1385 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ca, |
| 1386 | "unknown Dell", STAC_9200_DELL_M24), |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 1387 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cb, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1388 | "Dell Latitude 120L", STAC_9200_DELL_M24), |
Cory T. Tusar | 877b866 | 2007-01-30 17:30:55 +0100 | [diff] [blame] | 1389 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cc, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1390 | "Dell Latitude D820", STAC_9200_DELL_M22), |
Mikael Nilsson | 46f02ca | 2007-02-13 12:46:16 +0100 | [diff] [blame] | 1391 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cd, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1392 | "Dell Inspiron E1705/9400", STAC_9200_DELL_M27), |
Mikael Nilsson | 46f02ca | 2007-02-13 12:46:16 +0100 | [diff] [blame] | 1393 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ce, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1394 | "Dell XPS M1710", STAC_9200_DELL_M23), |
Takashi Iwai | f0f9674 | 2007-02-14 00:59:17 +0100 | [diff] [blame] | 1395 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1396 | "Dell Precision M90", STAC_9200_DELL_M23), |
| 1397 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d3, |
| 1398 | "unknown Dell", STAC_9200_DELL_M22), |
| 1399 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d4, |
| 1400 | "unknown Dell", STAC_9200_DELL_M22), |
Daniel T Chen | 8286c53 | 2007-05-15 11:46:23 +0200 | [diff] [blame] | 1401 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1402 | "unknown Dell", STAC_9200_DELL_M22), |
Tobin Davis | 49c605d | 2007-05-17 09:38:24 +0200 | [diff] [blame] | 1403 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d8, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1404 | "Dell Inspiron 640m", STAC_9200_DELL_M21), |
| 1405 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d9, |
| 1406 | "unknown Dell", STAC_9200_DELL_D23), |
| 1407 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01da, |
| 1408 | "unknown Dell", STAC_9200_DELL_D23), |
| 1409 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01de, |
| 1410 | "unknown Dell", STAC_9200_DELL_D21), |
| 1411 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01e3, |
| 1412 | "unknown Dell", STAC_9200_DELL_D23), |
| 1413 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01e8, |
| 1414 | "unknown Dell", STAC_9200_DELL_D21), |
| 1415 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ee, |
| 1416 | "unknown Dell", STAC_9200_DELL_M25), |
| 1417 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ef, |
| 1418 | "unknown Dell", STAC_9200_DELL_M25), |
Tobin Davis | 49c605d | 2007-05-17 09:38:24 +0200 | [diff] [blame] | 1419 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f5, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 1420 | "Dell Inspiron 1501", STAC_9200_DELL_M26), |
| 1421 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f6, |
| 1422 | "unknown Dell", STAC_9200_DELL_M26), |
Tobin Davis | 49c605d | 2007-05-17 09:38:24 +0200 | [diff] [blame] | 1423 | /* Panasonic */ |
Takashi Iwai | 117f257 | 2008-03-18 09:53:23 +0100 | [diff] [blame] | 1424 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC), |
Takashi Iwai | 1194b5b | 2007-10-10 10:04:26 +0200 | [diff] [blame] | 1425 | /* Gateway machines needs EAPD to be set on resume */ |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1426 | SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4), |
| 1427 | SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2), |
| 1428 | SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", STAC_9200_M4_2), |
Tobin Davis | bf27778 | 2008-02-03 20:31:47 +0100 | [diff] [blame] | 1429 | /* OQO Mobile */ |
| 1430 | SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO), |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 1431 | {} /* terminator */ |
| 1432 | }; |
| 1433 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1434 | static const struct hda_pintbl ref925x_pin_configs[] = { |
| 1435 | { 0x07, 0x40c003f0 }, |
| 1436 | { 0x08, 0x424503f2 }, |
| 1437 | { 0x0a, 0x01813022 }, |
| 1438 | { 0x0b, 0x02a19021 }, |
| 1439 | { 0x0c, 0x90a70320 }, |
| 1440 | { 0x0d, 0x02214210 }, |
| 1441 | { 0x10, 0x01019020 }, |
| 1442 | { 0x11, 0x9033032e }, |
| 1443 | {} |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 1444 | }; |
| 1445 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1446 | static const struct hda_pintbl stac925xM1_pin_configs[] = { |
| 1447 | { 0x07, 0x40c003f4 }, |
| 1448 | { 0x08, 0x424503f2 }, |
| 1449 | { 0x0a, 0x400000f3 }, |
| 1450 | { 0x0b, 0x02a19020 }, |
| 1451 | { 0x0c, 0x40a000f0 }, |
| 1452 | { 0x0d, 0x90100210 }, |
| 1453 | { 0x10, 0x400003f1 }, |
| 1454 | { 0x11, 0x9033032e }, |
| 1455 | {} |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 1456 | }; |
| 1457 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1458 | static const struct hda_pintbl stac925xM1_2_pin_configs[] = { |
| 1459 | { 0x07, 0x40c003f4 }, |
| 1460 | { 0x08, 0x424503f2 }, |
| 1461 | { 0x0a, 0x400000f3 }, |
| 1462 | { 0x0b, 0x02a19020 }, |
| 1463 | { 0x0c, 0x40a000f0 }, |
| 1464 | { 0x0d, 0x90100210 }, |
| 1465 | { 0x10, 0x400003f1 }, |
| 1466 | { 0x11, 0x9033032e }, |
| 1467 | {} |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1468 | }; |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1469 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1470 | static const struct hda_pintbl stac925xM2_pin_configs[] = { |
| 1471 | { 0x07, 0x40c003f4 }, |
| 1472 | { 0x08, 0x424503f2 }, |
| 1473 | { 0x0a, 0x400000f3 }, |
| 1474 | { 0x0b, 0x02a19020 }, |
| 1475 | { 0x0c, 0x40a000f0 }, |
| 1476 | { 0x0d, 0x90100210 }, |
| 1477 | { 0x10, 0x400003f1 }, |
| 1478 | { 0x11, 0x9033032e }, |
| 1479 | {} |
Tobin Davis | 2c11f95 | 2007-05-17 09:36:34 +0200 | [diff] [blame] | 1480 | }; |
| 1481 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1482 | static const struct hda_pintbl stac925xM2_2_pin_configs[] = { |
| 1483 | { 0x07, 0x40c003f4 }, |
| 1484 | { 0x08, 0x424503f2 }, |
| 1485 | { 0x0a, 0x400000f3 }, |
| 1486 | { 0x0b, 0x02a19020 }, |
| 1487 | { 0x0c, 0x40a000f0 }, |
| 1488 | { 0x0d, 0x90100210 }, |
| 1489 | { 0x10, 0x400003f1 }, |
| 1490 | { 0x11, 0x9033032e }, |
| 1491 | {} |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1492 | }; |
| 1493 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1494 | static const struct hda_pintbl stac925xM3_pin_configs[] = { |
| 1495 | { 0x07, 0x40c003f4 }, |
| 1496 | { 0x08, 0x424503f2 }, |
| 1497 | { 0x0a, 0x400000f3 }, |
| 1498 | { 0x0b, 0x02a19020 }, |
| 1499 | { 0x0c, 0x40a000f0 }, |
| 1500 | { 0x0d, 0x90100210 }, |
| 1501 | { 0x10, 0x400003f1 }, |
| 1502 | { 0x11, 0x503303f3 }, |
| 1503 | {} |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1504 | }; |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1505 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1506 | static const struct hda_pintbl stac925xM5_pin_configs[] = { |
| 1507 | { 0x07, 0x40c003f4 }, |
| 1508 | { 0x08, 0x424503f2 }, |
| 1509 | { 0x0a, 0x400000f3 }, |
| 1510 | { 0x0b, 0x02a19020 }, |
| 1511 | { 0x0c, 0x40a000f0 }, |
| 1512 | { 0x0d, 0x90100210 }, |
| 1513 | { 0x10, 0x400003f1 }, |
| 1514 | { 0x11, 0x9033032e }, |
| 1515 | {} |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1516 | }; |
| 1517 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1518 | static const struct hda_pintbl stac925xM6_pin_configs[] = { |
| 1519 | { 0x07, 0x40c003f4 }, |
| 1520 | { 0x08, 0x424503f2 }, |
| 1521 | { 0x0a, 0x400000f3 }, |
| 1522 | { 0x0b, 0x02a19020 }, |
| 1523 | { 0x0c, 0x40a000f0 }, |
| 1524 | { 0x0d, 0x90100210 }, |
| 1525 | { 0x10, 0x400003f1 }, |
| 1526 | { 0x11, 0x90330320 }, |
| 1527 | {} |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 1528 | }; |
| 1529 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1530 | static const struct hda_fixup stac925x_fixups[] = { |
| 1531 | [STAC_REF] = { |
| 1532 | .type = HDA_FIXUP_PINS, |
| 1533 | .v.pins = ref925x_pin_configs, |
| 1534 | }, |
| 1535 | [STAC_M1] = { |
| 1536 | .type = HDA_FIXUP_PINS, |
| 1537 | .v.pins = stac925xM1_pin_configs, |
| 1538 | }, |
| 1539 | [STAC_M1_2] = { |
| 1540 | .type = HDA_FIXUP_PINS, |
| 1541 | .v.pins = stac925xM1_2_pin_configs, |
| 1542 | }, |
| 1543 | [STAC_M2] = { |
| 1544 | .type = HDA_FIXUP_PINS, |
| 1545 | .v.pins = stac925xM2_pin_configs, |
| 1546 | }, |
| 1547 | [STAC_M2_2] = { |
| 1548 | .type = HDA_FIXUP_PINS, |
| 1549 | .v.pins = stac925xM2_2_pin_configs, |
| 1550 | }, |
| 1551 | [STAC_M3] = { |
| 1552 | .type = HDA_FIXUP_PINS, |
| 1553 | .v.pins = stac925xM3_pin_configs, |
| 1554 | }, |
| 1555 | [STAC_M5] = { |
| 1556 | .type = HDA_FIXUP_PINS, |
| 1557 | .v.pins = stac925xM5_pin_configs, |
| 1558 | }, |
| 1559 | [STAC_M6] = { |
| 1560 | .type = HDA_FIXUP_PINS, |
| 1561 | .v.pins = stac925xM6_pin_configs, |
| 1562 | }, |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 1563 | }; |
| 1564 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1565 | static const struct hda_model_fixup stac925x_models[] = { |
| 1566 | { .id = STAC_REF, .name = "ref" }, |
| 1567 | { .id = STAC_M1, .name = "m1" }, |
| 1568 | { .id = STAC_M1_2, .name = "m1-2" }, |
| 1569 | { .id = STAC_M2, .name = "m2" }, |
| 1570 | { .id = STAC_M2_2, .name = "m2-2" }, |
| 1571 | { .id = STAC_M3, .name = "m3" }, |
| 1572 | { .id = STAC_M5, .name = "m5" }, |
| 1573 | { .id = STAC_M6, .name = "m6" }, |
| 1574 | {} |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 1575 | }; |
| 1576 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 1577 | static const struct snd_pci_quirk stac925x_fixup_tbl[] = { |
| 1578 | /* SigmaTel reference board */ |
| 1579 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), |
| 1580 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, "DFI LanParty", STAC_REF), |
| 1581 | SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), |
| 1582 | |
| 1583 | /* Default table for unknown ID */ |
| 1584 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2), |
| 1585 | |
| 1586 | /* gateway machines are checked via codec ssid */ |
Mauro Carvalho Chehab | 58eec42 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1587 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2), |
| 1588 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5), |
| 1589 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1), |
| 1590 | SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2), |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1591 | SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2), |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1592 | /* Not sure about the brand name for those */ |
| 1593 | SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1), |
| 1594 | SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3), |
| 1595 | SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6), |
| 1596 | SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2), |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 1597 | {} /* terminator */ |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 1598 | }; |
| 1599 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1600 | static const struct hda_pintbl ref92hd73xx_pin_configs[] = { |
| 1601 | { 0x0a, 0x02214030 }, |
| 1602 | { 0x0b, 0x02a19040 }, |
| 1603 | { 0x0c, 0x01a19020 }, |
| 1604 | { 0x0d, 0x02214030 }, |
| 1605 | { 0x0e, 0x0181302e }, |
| 1606 | { 0x0f, 0x01014010 }, |
| 1607 | { 0x10, 0x01014020 }, |
| 1608 | { 0x11, 0x01014030 }, |
| 1609 | { 0x12, 0x02319040 }, |
| 1610 | { 0x13, 0x90a000f0 }, |
| 1611 | { 0x14, 0x90a000f0 }, |
| 1612 | { 0x22, 0x01452050 }, |
| 1613 | { 0x23, 0x01452050 }, |
| 1614 | {} |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1615 | }; |
| 1616 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1617 | static const struct hda_pintbl dell_m6_pin_configs[] = { |
| 1618 | { 0x0a, 0x0321101f }, |
| 1619 | { 0x0b, 0x4f00000f }, |
| 1620 | { 0x0c, 0x4f0000f0 }, |
| 1621 | { 0x0d, 0x90170110 }, |
| 1622 | { 0x0e, 0x03a11020 }, |
| 1623 | { 0x0f, 0x0321101f }, |
| 1624 | { 0x10, 0x4f0000f0 }, |
| 1625 | { 0x11, 0x4f0000f0 }, |
| 1626 | { 0x12, 0x4f0000f0 }, |
| 1627 | { 0x13, 0x90a60160 }, |
| 1628 | { 0x14, 0x4f0000f0 }, |
| 1629 | { 0x22, 0x4f0000f0 }, |
| 1630 | { 0x23, 0x4f0000f0 }, |
| 1631 | {} |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 1632 | }; |
| 1633 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1634 | static const struct hda_pintbl alienware_m17x_pin_configs[] = { |
| 1635 | { 0x0a, 0x0321101f }, |
| 1636 | { 0x0b, 0x0321101f }, |
| 1637 | { 0x0c, 0x03a11020 }, |
| 1638 | { 0x0d, 0x03014020 }, |
| 1639 | { 0x0e, 0x90170110 }, |
| 1640 | { 0x0f, 0x4f0000f0 }, |
| 1641 | { 0x10, 0x4f0000f0 }, |
| 1642 | { 0x11, 0x4f0000f0 }, |
| 1643 | { 0x12, 0x4f0000f0 }, |
| 1644 | { 0x13, 0x90a60160 }, |
| 1645 | { 0x14, 0x4f0000f0 }, |
| 1646 | { 0x22, 0x4f0000f0 }, |
| 1647 | { 0x23, 0x904601b0 }, |
| 1648 | {} |
Takashi Iwai | 842ae63 | 2009-09-02 07:43:08 +0200 | [diff] [blame] | 1649 | }; |
| 1650 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1651 | static const struct hda_pintbl intel_dg45id_pin_configs[] = { |
| 1652 | { 0x0a, 0x02214230 }, |
| 1653 | { 0x0b, 0x02A19240 }, |
| 1654 | { 0x0c, 0x01013214 }, |
| 1655 | { 0x0d, 0x01014210 }, |
| 1656 | { 0x0e, 0x01A19250 }, |
| 1657 | { 0x0f, 0x01011212 }, |
| 1658 | { 0x10, 0x01016211 }, |
| 1659 | {} |
Alexey Fisher | 52dc438 | 2009-12-12 11:16:41 +0200 | [diff] [blame] | 1660 | }; |
| 1661 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1662 | static void stac92hd73xx_fixup_ref(struct hda_codec *codec, |
| 1663 | const struct hda_fixup *fix, int action) |
| 1664 | { |
| 1665 | struct sigmatel_spec *spec = codec->spec; |
| 1666 | |
| 1667 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1668 | return; |
| 1669 | |
| 1670 | snd_hda_apply_pincfgs(codec, ref92hd73xx_pin_configs); |
| 1671 | spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0; |
| 1672 | } |
| 1673 | |
| 1674 | static void stac92hd73xx_fixup_dell(struct hda_codec *codec) |
| 1675 | { |
| 1676 | struct sigmatel_spec *spec = codec->spec; |
| 1677 | |
| 1678 | snd_hda_apply_pincfgs(codec, dell_m6_pin_configs); |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1679 | spec->eapd_switch = 0; |
| 1680 | } |
| 1681 | |
| 1682 | static void stac92hd73xx_fixup_dell_eq(struct hda_codec *codec, |
| 1683 | const struct hda_fixup *fix, int action) |
| 1684 | { |
| 1685 | struct sigmatel_spec *spec = codec->spec; |
| 1686 | |
| 1687 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1688 | return; |
| 1689 | |
| 1690 | stac92hd73xx_fixup_dell(codec); |
| 1691 | snd_hda_add_verbs(codec, dell_eq_core_init); |
| 1692 | spec->volknob_init = 1; |
| 1693 | } |
| 1694 | |
| 1695 | /* Analog Mics */ |
| 1696 | static void stac92hd73xx_fixup_dell_m6_amic(struct hda_codec *codec, |
| 1697 | const struct hda_fixup *fix, int action) |
| 1698 | { |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1699 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1700 | return; |
| 1701 | |
| 1702 | stac92hd73xx_fixup_dell(codec); |
| 1703 | snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1704 | } |
| 1705 | |
| 1706 | /* Digital Mics */ |
| 1707 | static void stac92hd73xx_fixup_dell_m6_dmic(struct hda_codec *codec, |
| 1708 | const struct hda_fixup *fix, int action) |
| 1709 | { |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1710 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1711 | return; |
| 1712 | |
| 1713 | stac92hd73xx_fixup_dell(codec); |
| 1714 | snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1715 | } |
| 1716 | |
| 1717 | /* Both */ |
| 1718 | static void stac92hd73xx_fixup_dell_m6_both(struct hda_codec *codec, |
| 1719 | const struct hda_fixup *fix, int action) |
| 1720 | { |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1721 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1722 | return; |
| 1723 | |
| 1724 | stac92hd73xx_fixup_dell(codec); |
| 1725 | snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); |
| 1726 | snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1727 | } |
| 1728 | |
| 1729 | static void stac92hd73xx_fixup_alienware_m17x(struct hda_codec *codec, |
| 1730 | const struct hda_fixup *fix, int action) |
| 1731 | { |
| 1732 | struct sigmatel_spec *spec = codec->spec; |
| 1733 | |
| 1734 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1735 | return; |
| 1736 | |
| 1737 | snd_hda_apply_pincfgs(codec, alienware_m17x_pin_configs); |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1738 | spec->eapd_switch = 0; |
| 1739 | } |
| 1740 | |
| 1741 | static void stac92hd73xx_fixup_no_jd(struct hda_codec *codec, |
| 1742 | const struct hda_fixup *fix, int action) |
| 1743 | { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 1744 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 1745 | codec->no_jack_detect = 1; |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1746 | } |
| 1747 | |
| 1748 | static const struct hda_fixup stac92hd73xx_fixups[] = { |
| 1749 | [STAC_92HD73XX_REF] = { |
| 1750 | .type = HDA_FIXUP_FUNC, |
| 1751 | .v.func = stac92hd73xx_fixup_ref, |
| 1752 | }, |
| 1753 | [STAC_DELL_M6_AMIC] = { |
| 1754 | .type = HDA_FIXUP_FUNC, |
| 1755 | .v.func = stac92hd73xx_fixup_dell_m6_amic, |
| 1756 | }, |
| 1757 | [STAC_DELL_M6_DMIC] = { |
| 1758 | .type = HDA_FIXUP_FUNC, |
| 1759 | .v.func = stac92hd73xx_fixup_dell_m6_dmic, |
| 1760 | }, |
| 1761 | [STAC_DELL_M6_BOTH] = { |
| 1762 | .type = HDA_FIXUP_FUNC, |
| 1763 | .v.func = stac92hd73xx_fixup_dell_m6_both, |
| 1764 | }, |
| 1765 | [STAC_DELL_EQ] = { |
| 1766 | .type = HDA_FIXUP_FUNC, |
| 1767 | .v.func = stac92hd73xx_fixup_dell_eq, |
| 1768 | }, |
| 1769 | [STAC_ALIENWARE_M17X] = { |
| 1770 | .type = HDA_FIXUP_FUNC, |
| 1771 | .v.func = stac92hd73xx_fixup_alienware_m17x, |
| 1772 | }, |
| 1773 | [STAC_92HD73XX_INTEL] = { |
| 1774 | .type = HDA_FIXUP_PINS, |
| 1775 | .v.pins = intel_dg45id_pin_configs, |
| 1776 | }, |
| 1777 | [STAC_92HD73XX_NO_JD] = { |
| 1778 | .type = HDA_FIXUP_FUNC, |
| 1779 | .v.func = stac92hd73xx_fixup_no_jd, |
| 1780 | } |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 1781 | }; |
| 1782 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1783 | static const struct hda_model_fixup stac92hd73xx_models[] = { |
| 1784 | { .id = STAC_92HD73XX_NO_JD, .name = "no-jd" }, |
| 1785 | { .id = STAC_92HD73XX_REF, .name = "ref" }, |
| 1786 | { .id = STAC_92HD73XX_INTEL, .name = "intel" }, |
| 1787 | { .id = STAC_DELL_M6_AMIC, .name = "dell-m6-amic" }, |
| 1788 | { .id = STAC_DELL_M6_DMIC, .name = "dell-m6-dmic" }, |
| 1789 | { .id = STAC_DELL_M6_BOTH, .name = "dell-m6" }, |
| 1790 | { .id = STAC_DELL_EQ, .name = "dell-eq" }, |
| 1791 | { .id = STAC_ALIENWARE_M17X, .name = "alienware" }, |
| 1792 | {} |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 1793 | }; |
| 1794 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1795 | static const struct snd_pci_quirk stac92hd73xx_fixup_tbl[] = { |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 1796 | /* SigmaTel reference board */ |
| 1797 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1798 | "DFI LanParty", STAC_92HD73XX_REF), |
Matthew Ranostay | 577aa2c | 2009-01-22 22:55:44 -0500 | [diff] [blame] | 1799 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
| 1800 | "DFI LanParty", STAC_92HD73XX_REF), |
Wu Fengguang | ae70944 | 2009-08-19 17:05:11 +0800 | [diff] [blame] | 1801 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5002, |
| 1802 | "Intel DG45ID", STAC_92HD73XX_INTEL), |
| 1803 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5003, |
| 1804 | "Intel DG45FC", STAC_92HD73XX_INTEL), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1805 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1806 | "Dell Studio 1535", STAC_DELL_M6_DMIC), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1807 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1808 | "unknown Dell", STAC_DELL_M6_DMIC), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1809 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0256, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1810 | "unknown Dell", STAC_DELL_M6_BOTH), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1811 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0257, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1812 | "unknown Dell", STAC_DELL_M6_BOTH), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1813 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025e, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1814 | "unknown Dell", STAC_DELL_M6_AMIC), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1815 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025f, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1816 | "unknown Dell", STAC_DELL_M6_AMIC), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 1817 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1818 | "unknown Dell", STAC_DELL_M6_DMIC), |
| 1819 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0272, |
| 1820 | "unknown Dell", STAC_DELL_M6_DMIC), |
Takashi Iwai | b0fc5e0 | 2008-11-21 08:37:03 +0100 | [diff] [blame] | 1821 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x029f, |
Takashi Iwai | 661cd8f | 2008-11-25 15:18:29 +0100 | [diff] [blame] | 1822 | "Dell Studio 1537", STAC_DELL_M6_DMIC), |
Joerg Schirottke | fa620e9 | 2008-12-19 08:13:49 +0100 | [diff] [blame] | 1823 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, |
| 1824 | "Dell Studio 17", STAC_DELL_M6_DMIC), |
Takashi Iwai | 626f5ce | 2009-07-28 00:54:39 +0200 | [diff] [blame] | 1825 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, |
| 1826 | "Dell Studio 1555", STAC_DELL_M6_DMIC), |
Daniel J Blueman | 8ef5837 | 2009-11-14 18:20:04 +0000 | [diff] [blame] | 1827 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd, |
| 1828 | "Dell Studio 1557", STAC_DELL_M6_DMIC), |
Daniel T Chen | aac78da | 2010-04-21 20:41:52 -0400 | [diff] [blame] | 1829 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, |
David Henningsson | ffe535e | 2012-01-16 10:52:20 +0100 | [diff] [blame] | 1830 | "Dell Studio XPS 1645", STAC_DELL_M6_DMIC), |
Daniel T Chen | 5c1bccf | 2010-04-22 17:54:45 -0400 | [diff] [blame] | 1831 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413, |
David Henningsson | e033ebf | 2011-05-16 12:09:29 +0200 | [diff] [blame] | 1832 | "Dell Studio 1558", STAC_DELL_M6_DMIC), |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 1833 | /* codec SSID matching */ |
Takashi Iwai | 842ae63 | 2009-09-02 07:43:08 +0200 | [diff] [blame] | 1834 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a1, |
| 1835 | "Alienware M17x", STAC_ALIENWARE_M17X), |
Daniel T Chen | 0defe09 | 2010-12-01 19:16:07 -0500 | [diff] [blame] | 1836 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a, |
| 1837 | "Alienware M17x", STAC_ALIENWARE_M17X), |
Takashi Iwai | dbd1b54 | 2011-11-19 11:41:30 +0100 | [diff] [blame] | 1838 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490, |
Albert Pool | b9ecc4e | 2012-01-19 22:08:50 +0100 | [diff] [blame] | 1839 | "Alienware M17x R3", STAC_DELL_EQ), |
Takashi Iwai | 842ae63 | 2009-09-02 07:43:08 +0200 | [diff] [blame] | 1840 | {} /* terminator */ |
| 1841 | }; |
| 1842 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 1843 | static const struct hda_pintbl ref92hd83xxx_pin_configs[] = { |
| 1844 | { 0x0a, 0x02214030 }, |
| 1845 | { 0x0b, 0x02211010 }, |
| 1846 | { 0x0c, 0x02a19020 }, |
| 1847 | { 0x0d, 0x02170130 }, |
| 1848 | { 0x0e, 0x01014050 }, |
| 1849 | { 0x0f, 0x01819040 }, |
| 1850 | { 0x10, 0x01014020 }, |
| 1851 | { 0x11, 0x90a3014e }, |
| 1852 | { 0x1f, 0x01451160 }, |
| 1853 | { 0x20, 0x98560170 }, |
| 1854 | {} |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 1855 | }; |
| 1856 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 1857 | static const struct hda_pintbl dell_s14_pin_configs[] = { |
| 1858 | { 0x0a, 0x0221403f }, |
| 1859 | { 0x0b, 0x0221101f }, |
| 1860 | { 0x0c, 0x02a19020 }, |
| 1861 | { 0x0d, 0x90170110 }, |
| 1862 | { 0x0e, 0x40f000f0 }, |
| 1863 | { 0x0f, 0x40f000f0 }, |
| 1864 | { 0x10, 0x40f000f0 }, |
| 1865 | { 0x11, 0x90a60160 }, |
| 1866 | { 0x1f, 0x40f000f0 }, |
| 1867 | { 0x20, 0x40f000f0 }, |
| 1868 | {} |
Matthew Ranostay | 8bb0ac5 | 2009-02-12 16:50:01 -0500 | [diff] [blame] | 1869 | }; |
| 1870 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 1871 | static const struct hda_pintbl dell_vostro_3500_pin_configs[] = { |
| 1872 | { 0x0a, 0x02a11020 }, |
| 1873 | { 0x0b, 0x0221101f }, |
| 1874 | { 0x0c, 0x400000f0 }, |
| 1875 | { 0x0d, 0x90170110 }, |
| 1876 | { 0x0e, 0x400000f1 }, |
| 1877 | { 0x0f, 0x400000f2 }, |
| 1878 | { 0x10, 0x400000f3 }, |
| 1879 | { 0x11, 0x90a60160 }, |
| 1880 | { 0x1f, 0x400000f4 }, |
| 1881 | { 0x20, 0x400000f5 }, |
| 1882 | {} |
Julian Wollrath | f7f9bdf | 2011-11-09 10:02:40 +0100 | [diff] [blame] | 1883 | }; |
| 1884 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 1885 | static const struct hda_pintbl hp_dv7_4000_pin_configs[] = { |
| 1886 | { 0x0a, 0x03a12050 }, |
| 1887 | { 0x0b, 0x0321201f }, |
| 1888 | { 0x0c, 0x40f000f0 }, |
| 1889 | { 0x0d, 0x90170110 }, |
| 1890 | { 0x0e, 0x40f000f0 }, |
| 1891 | { 0x0f, 0x40f000f0 }, |
| 1892 | { 0x10, 0x90170110 }, |
| 1893 | { 0x11, 0xd5a30140 }, |
| 1894 | { 0x1f, 0x40f000f0 }, |
| 1895 | { 0x20, 0x40f000f0 }, |
| 1896 | {} |
Steven Eastland | 4831559 | 2010-08-06 15:07:35 -0600 | [diff] [blame] | 1897 | }; |
| 1898 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 1899 | static const struct hda_pintbl hp_zephyr_pin_configs[] = { |
| 1900 | { 0x0a, 0x01813050 }, |
| 1901 | { 0x0b, 0x0421201f }, |
| 1902 | { 0x0c, 0x04a1205e }, |
| 1903 | { 0x0d, 0x96130310 }, |
| 1904 | { 0x0e, 0x96130310 }, |
| 1905 | { 0x0f, 0x0101401f }, |
| 1906 | { 0x10, 0x1111611f }, |
| 1907 | { 0x11, 0xd5a30130 }, |
| 1908 | {} |
Vitaliy Kulikov | 5556e14 | 2012-02-27 16:47:37 -0600 | [diff] [blame] | 1909 | }; |
| 1910 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 1911 | static const struct hda_pintbl hp_cNB11_intquad_pin_configs[] = { |
| 1912 | { 0x0a, 0x40f000f0 }, |
| 1913 | { 0x0b, 0x0221101f }, |
| 1914 | { 0x0c, 0x02a11020 }, |
| 1915 | { 0x0d, 0x92170110 }, |
| 1916 | { 0x0e, 0x40f000f0 }, |
| 1917 | { 0x0f, 0x92170110 }, |
| 1918 | { 0x10, 0x40f000f0 }, |
| 1919 | { 0x11, 0xd5a30130 }, |
| 1920 | { 0x1f, 0x40f000f0 }, |
| 1921 | { 0x20, 0x40f000f0 }, |
| 1922 | {} |
Vitaliy Kulikov | 0c27c18 | 2011-07-22 17:50:37 -0500 | [diff] [blame] | 1923 | }; |
| 1924 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 1925 | static void stac92hd83xxx_fixup_hp(struct hda_codec *codec, |
| 1926 | const struct hda_fixup *fix, int action) |
| 1927 | { |
| 1928 | struct sigmatel_spec *spec = codec->spec; |
| 1929 | |
| 1930 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1931 | return; |
| 1932 | |
| 1933 | if (hp_bnb2011_with_dock(codec)) { |
| 1934 | snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f); |
| 1935 | snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); |
| 1936 | } |
| 1937 | |
| 1938 | if (find_mute_led_cfg(codec, spec->default_polarity)) |
| 1939 | snd_printd("mute LED gpio %d polarity %d\n", |
| 1940 | spec->gpio_led, |
| 1941 | spec->gpio_led_polarity); |
| 1942 | } |
| 1943 | |
| 1944 | static void stac92hd83xxx_fixup_hp_zephyr(struct hda_codec *codec, |
| 1945 | const struct hda_fixup *fix, int action) |
| 1946 | { |
| 1947 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 1948 | return; |
| 1949 | |
| 1950 | snd_hda_apply_pincfgs(codec, hp_zephyr_pin_configs); |
| 1951 | snd_hda_add_verbs(codec, stac92hd83xxx_hp_zephyr_init); |
| 1952 | } |
| 1953 | |
| 1954 | static void stac92hd83xxx_fixup_hp_led(struct hda_codec *codec, |
| 1955 | const struct hda_fixup *fix, int action) |
| 1956 | { |
| 1957 | struct sigmatel_spec *spec = codec->spec; |
| 1958 | |
| 1959 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 1960 | spec->default_polarity = 0; |
| 1961 | } |
| 1962 | |
| 1963 | static void stac92hd83xxx_fixup_hp_inv_led(struct hda_codec *codec, |
| 1964 | const struct hda_fixup *fix, int action) |
| 1965 | { |
| 1966 | struct sigmatel_spec *spec = codec->spec; |
| 1967 | |
| 1968 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 1969 | spec->default_polarity = 1; |
| 1970 | } |
| 1971 | |
| 1972 | static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec, |
| 1973 | const struct hda_fixup *fix, int action) |
| 1974 | { |
| 1975 | struct sigmatel_spec *spec = codec->spec; |
| 1976 | |
| 1977 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 1978 | spec->mic_mute_led_gpio = 0x08; /* GPIO3 */ |
| 1979 | } |
| 1980 | |
| 1981 | static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, |
| 1982 | const struct hda_fixup *fix, int action) |
| 1983 | { |
| 1984 | struct sigmatel_spec *spec = codec->spec; |
| 1985 | |
| 1986 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 1987 | spec->headset_jack = 1; |
| 1988 | } |
| 1989 | |
| 1990 | static const struct hda_fixup stac92hd83xxx_fixups[] = { |
| 1991 | [STAC_92HD83XXX_REF] = { |
| 1992 | .type = HDA_FIXUP_PINS, |
| 1993 | .v.pins = ref92hd83xxx_pin_configs, |
| 1994 | }, |
| 1995 | [STAC_92HD83XXX_PWR_REF] = { |
| 1996 | .type = HDA_FIXUP_PINS, |
| 1997 | .v.pins = ref92hd83xxx_pin_configs, |
| 1998 | }, |
| 1999 | [STAC_DELL_S14] = { |
| 2000 | .type = HDA_FIXUP_PINS, |
| 2001 | .v.pins = dell_s14_pin_configs, |
| 2002 | }, |
| 2003 | [STAC_DELL_VOSTRO_3500] = { |
| 2004 | .type = HDA_FIXUP_PINS, |
| 2005 | .v.pins = dell_vostro_3500_pin_configs, |
| 2006 | }, |
| 2007 | [STAC_92HD83XXX_HP_cNB11_INTQUAD] = { |
| 2008 | .type = HDA_FIXUP_PINS, |
| 2009 | .v.pins = hp_cNB11_intquad_pin_configs, |
| 2010 | .chained = true, |
| 2011 | .chain_id = STAC_92HD83XXX_HP, |
| 2012 | }, |
| 2013 | [STAC_92HD83XXX_HP] = { |
| 2014 | .type = HDA_FIXUP_FUNC, |
| 2015 | .v.func = stac92hd83xxx_fixup_hp, |
| 2016 | }, |
| 2017 | [STAC_HP_DV7_4000] = { |
| 2018 | .type = HDA_FIXUP_PINS, |
| 2019 | .v.pins = hp_dv7_4000_pin_configs, |
| 2020 | .chained = true, |
| 2021 | .chain_id = STAC_92HD83XXX_HP, |
| 2022 | }, |
| 2023 | [STAC_HP_ZEPHYR] = { |
| 2024 | .type = HDA_FIXUP_FUNC, |
| 2025 | .v.func = stac92hd83xxx_fixup_hp_zephyr, |
| 2026 | .chained = true, |
| 2027 | .chain_id = STAC_92HD83XXX_HP, |
| 2028 | }, |
| 2029 | [STAC_92HD83XXX_HP_LED] = { |
| 2030 | .type = HDA_FIXUP_FUNC, |
| 2031 | .v.func = stac92hd83xxx_fixup_hp_led, |
| 2032 | .chained = true, |
| 2033 | .chain_id = STAC_92HD83XXX_HP, |
| 2034 | }, |
| 2035 | [STAC_92HD83XXX_HP_INV_LED] = { |
| 2036 | .type = HDA_FIXUP_FUNC, |
| 2037 | .v.func = stac92hd83xxx_fixup_hp_inv_led, |
| 2038 | .chained = true, |
| 2039 | .chain_id = STAC_92HD83XXX_HP, |
| 2040 | }, |
| 2041 | [STAC_92HD83XXX_HP_MIC_LED] = { |
| 2042 | .type = HDA_FIXUP_FUNC, |
| 2043 | .v.func = stac92hd83xxx_fixup_hp_mic_led, |
| 2044 | .chained = true, |
| 2045 | .chain_id = STAC_92HD83XXX_HP, |
| 2046 | }, |
| 2047 | [STAC_92HD83XXX_HEADSET_JACK] = { |
| 2048 | .type = HDA_FIXUP_FUNC, |
| 2049 | .v.func = stac92hd83xxx_fixup_headset_jack, |
| 2050 | }, |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 2051 | }; |
| 2052 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 2053 | static const struct hda_model_fixup stac92hd83xxx_models[] = { |
| 2054 | { .id = STAC_92HD83XXX_REF, .name = "ref" }, |
| 2055 | { .id = STAC_92HD83XXX_PWR_REF, .name = "mic-ref" }, |
| 2056 | { .id = STAC_DELL_S14, .name = "dell-s14" }, |
| 2057 | { .id = STAC_DELL_VOSTRO_3500, .name = "dell-vostro-3500" }, |
| 2058 | { .id = STAC_92HD83XXX_HP_cNB11_INTQUAD, .name = "hp_cNB11_intquad" }, |
| 2059 | { .id = STAC_HP_DV7_4000, .name = "hp-dv7-4000" }, |
| 2060 | { .id = STAC_HP_ZEPHYR, .name = "hp-zephyr" }, |
| 2061 | { .id = STAC_92HD83XXX_HP_LED, .name = "hp-led" }, |
| 2062 | { .id = STAC_92HD83XXX_HP_INV_LED, .name = "hp-inv-led" }, |
| 2063 | { .id = STAC_92HD83XXX_HP_MIC_LED, .name = "hp-mic-led" }, |
| 2064 | { .id = STAC_92HD83XXX_HEADSET_JACK, .name = "headset-jack" }, |
| 2065 | {} |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 2066 | }; |
| 2067 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 2068 | static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = { |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 2069 | /* SigmaTel reference board */ |
| 2070 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
Takashi Iwai | f9d088b | 2009-01-13 11:54:49 +0100 | [diff] [blame] | 2071 | "DFI LanParty", STAC_92HD83XXX_REF), |
Matthew Ranostay | 577aa2c | 2009-01-22 22:55:44 -0500 | [diff] [blame] | 2072 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
| 2073 | "DFI LanParty", STAC_92HD83XXX_REF), |
Matthew Ranostay | 8bb0ac5 | 2009-02-12 16:50:01 -0500 | [diff] [blame] | 2074 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba, |
| 2075 | "unknown Dell", STAC_DELL_S14), |
David Henningsson | 8d032a8 | 2012-10-09 12:48:40 +0200 | [diff] [blame] | 2076 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0532, |
| 2077 | "Dell Latitude E6230", STAC_92HD83XXX_HEADSET_JACK), |
| 2078 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0533, |
| 2079 | "Dell Latitude E6330", STAC_92HD83XXX_HEADSET_JACK), |
| 2080 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0534, |
| 2081 | "Dell Latitude E6430", STAC_92HD83XXX_HEADSET_JACK), |
| 2082 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0535, |
| 2083 | "Dell Latitude E6530", STAC_92HD83XXX_HEADSET_JACK), |
| 2084 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x053c, |
| 2085 | "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK), |
| 2086 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x053d, |
| 2087 | "Dell Latitude E5530", STAC_92HD83XXX_HEADSET_JACK), |
| 2088 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0549, |
| 2089 | "Dell Latitude E5430", STAC_92HD83XXX_HEADSET_JACK), |
| 2090 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x057d, |
| 2091 | "Dell Latitude E6430s", STAC_92HD83XXX_HEADSET_JACK), |
| 2092 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0584, |
| 2093 | "Dell Latitude E6430U", STAC_92HD83XXX_HEADSET_JACK), |
Julian Wollrath | f7f9bdf | 2011-11-09 10:02:40 +0100 | [diff] [blame] | 2094 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x1028, |
| 2095 | "Dell Vostro 3500", STAC_DELL_VOSTRO_3500), |
Vitaliy Kulikov | 0c27c18 | 2011-07-22 17:50:37 -0500 | [diff] [blame] | 2096 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1656, |
| 2097 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2098 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1657, |
| 2099 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2100 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1658, |
| 2101 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2102 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1659, |
Takashi Iwai | 8ae5865 | 2012-12-13 14:33:42 +0100 | [diff] [blame] | 2103 | "HP Pavilion dv7", STAC_HP_DV7_4000), |
Vitaliy Kulikov | 0c27c18 | 2011-07-22 17:50:37 -0500 | [diff] [blame] | 2104 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165A, |
| 2105 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2106 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165B, |
| 2107 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
Takashi Iwai | 62cbde1 | 2012-09-14 11:58:54 +0200 | [diff] [blame] | 2108 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df, |
| 2109 | "HP Folio", STAC_92HD83XXX_HP_MIC_LED), |
Vitaliy Kulikov | 0c27c18 | 2011-07-22 17:50:37 -0500 | [diff] [blame] | 2110 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3388, |
| 2111 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2112 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3389, |
| 2113 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2114 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355B, |
| 2115 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2116 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355C, |
| 2117 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2118 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355D, |
| 2119 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2120 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355E, |
| 2121 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2122 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x355F, |
| 2123 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2124 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3560, |
| 2125 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2126 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358B, |
| 2127 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2128 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358C, |
| 2129 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2130 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x358D, |
| 2131 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2132 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3591, |
| 2133 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2134 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3592, |
| 2135 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2136 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3593, |
| 2137 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
Vitaliy Kulikov | 5556e14 | 2012-02-27 16:47:37 -0600 | [diff] [blame] | 2138 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3561, |
| 2139 | "HP", STAC_HP_ZEPHYR), |
Takashi Iwai | a3e1997 | 2012-07-26 08:17:20 +0200 | [diff] [blame] | 2140 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3660, |
| 2141 | "HP Mini", STAC_92HD83XXX_HP_LED), |
Gustavo Maciel Dias Vieira | 5afc13a | 2012-10-26 12:51:53 -0200 | [diff] [blame] | 2142 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x144E, |
| 2143 | "HP Pavilion dv5", STAC_92HD83XXX_HP_INV_LED), |
Takashi Iwai | 8c698fe | 2013-01-15 11:20:50 +0100 | [diff] [blame] | 2144 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x148a, |
| 2145 | "HP Mini", STAC_92HD83XXX_HP_LED), |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 2146 | SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD83XXX_HP), |
Herton Ronaldo Krzesinski | 574f3c4 | 2008-12-23 16:53:00 -0200 | [diff] [blame] | 2147 | {} /* terminator */ |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 2148 | }; |
| 2149 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 2150 | /* HP dv7 bass switch - GPIO5 */ |
| 2151 | #define stac_hp_bass_gpio_info snd_ctl_boolean_mono_info |
| 2152 | static int stac_hp_bass_gpio_get(struct snd_kcontrol *kcontrol, |
| 2153 | struct snd_ctl_elem_value *ucontrol) |
| 2154 | { |
| 2155 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2156 | struct sigmatel_spec *spec = codec->spec; |
| 2157 | ucontrol->value.integer.value[0] = !!(spec->gpio_data & 0x20); |
| 2158 | return 0; |
| 2159 | } |
| 2160 | |
| 2161 | static int stac_hp_bass_gpio_put(struct snd_kcontrol *kcontrol, |
| 2162 | struct snd_ctl_elem_value *ucontrol) |
| 2163 | { |
| 2164 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2165 | struct sigmatel_spec *spec = codec->spec; |
| 2166 | unsigned int gpio_data; |
| 2167 | |
| 2168 | gpio_data = (spec->gpio_data & ~0x20) | |
| 2169 | (ucontrol->value.integer.value[0] ? 0x20 : 0); |
| 2170 | if (gpio_data == spec->gpio_data) |
| 2171 | return 0; |
| 2172 | spec->gpio_data = gpio_data; |
| 2173 | stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); |
| 2174 | return 1; |
| 2175 | } |
| 2176 | |
| 2177 | static const struct snd_kcontrol_new stac_hp_bass_sw_ctrl = { |
| 2178 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2179 | .info = stac_hp_bass_gpio_info, |
| 2180 | .get = stac_hp_bass_gpio_get, |
| 2181 | .put = stac_hp_bass_gpio_put, |
| 2182 | }; |
| 2183 | |
| 2184 | static int stac_add_hp_bass_switch(struct hda_codec *codec) |
| 2185 | { |
| 2186 | struct sigmatel_spec *spec = codec->spec; |
| 2187 | |
| 2188 | if (!snd_hda_gen_add_kctl(&spec->gen, "Bass Speaker Playback Switch", |
| 2189 | &stac_hp_bass_sw_ctrl)) |
| 2190 | return -ENOMEM; |
| 2191 | |
| 2192 | spec->gpio_mask |= 0x20; |
| 2193 | spec->gpio_dir |= 0x20; |
| 2194 | spec->gpio_data |= 0x20; |
| 2195 | return 0; |
| 2196 | } |
| 2197 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2198 | static const struct hda_pintbl ref92hd71bxx_pin_configs[] = { |
| 2199 | { 0x0a, 0x02214030 }, |
| 2200 | { 0x0b, 0x02a19040 }, |
| 2201 | { 0x0c, 0x01a19020 }, |
| 2202 | { 0x0d, 0x01014010 }, |
| 2203 | { 0x0e, 0x0181302e }, |
| 2204 | { 0x0f, 0x01014010 }, |
| 2205 | { 0x14, 0x01019020 }, |
| 2206 | { 0x18, 0x90a000f0 }, |
| 2207 | { 0x19, 0x90a000f0 }, |
| 2208 | { 0x1e, 0x01452050 }, |
| 2209 | { 0x1f, 0x01452050 }, |
| 2210 | {} |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 2211 | }; |
| 2212 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2213 | static const struct hda_pintbl dell_m4_1_pin_configs[] = { |
| 2214 | { 0x0a, 0x0421101f }, |
| 2215 | { 0x0b, 0x04a11221 }, |
| 2216 | { 0x0c, 0x40f000f0 }, |
| 2217 | { 0x0d, 0x90170110 }, |
| 2218 | { 0x0e, 0x23a1902e }, |
| 2219 | { 0x0f, 0x23014250 }, |
| 2220 | { 0x14, 0x40f000f0 }, |
| 2221 | { 0x18, 0x90a000f0 }, |
| 2222 | { 0x19, 0x40f000f0 }, |
| 2223 | { 0x1e, 0x4f0000f0 }, |
| 2224 | { 0x1f, 0x4f0000f0 }, |
| 2225 | {} |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 2226 | }; |
| 2227 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2228 | static const struct hda_pintbl dell_m4_2_pin_configs[] = { |
| 2229 | { 0x0a, 0x0421101f }, |
| 2230 | { 0x0b, 0x04a11221 }, |
| 2231 | { 0x0c, 0x90a70330 }, |
| 2232 | { 0x0d, 0x90170110 }, |
| 2233 | { 0x0e, 0x23a1902e }, |
| 2234 | { 0x0f, 0x23014250 }, |
| 2235 | { 0x14, 0x40f000f0 }, |
| 2236 | { 0x18, 0x40f000f0 }, |
| 2237 | { 0x19, 0x40f000f0 }, |
| 2238 | { 0x1e, 0x044413b0 }, |
| 2239 | { 0x1f, 0x044413b0 }, |
| 2240 | {} |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 2241 | }; |
| 2242 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2243 | static const struct hda_pintbl dell_m4_3_pin_configs[] = { |
| 2244 | { 0x0a, 0x0421101f }, |
| 2245 | { 0x0b, 0x04a11221 }, |
| 2246 | { 0x0c, 0x90a70330 }, |
| 2247 | { 0x0d, 0x90170110 }, |
| 2248 | { 0x0e, 0x40f000f0 }, |
| 2249 | { 0x0f, 0x40f000f0 }, |
| 2250 | { 0x14, 0x40f000f0 }, |
| 2251 | { 0x18, 0x90a000f0 }, |
| 2252 | { 0x19, 0x40f000f0 }, |
| 2253 | { 0x1e, 0x044413b0 }, |
| 2254 | { 0x1f, 0x044413b0 }, |
| 2255 | {} |
Matthew Ranostay | 3a7abfd | 2008-11-20 21:21:43 -0500 | [diff] [blame] | 2256 | }; |
| 2257 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2258 | static void stac92hd71bxx_fixup_ref(struct hda_codec *codec, |
| 2259 | const struct hda_fixup *fix, int action) |
| 2260 | { |
| 2261 | struct sigmatel_spec *spec = codec->spec; |
| 2262 | |
| 2263 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2264 | return; |
| 2265 | |
| 2266 | snd_hda_apply_pincfgs(codec, ref92hd71bxx_pin_configs); |
| 2267 | spec->gpio_mask = spec->gpio_dir = spec->gpio_data = 0; |
| 2268 | } |
| 2269 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2270 | static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec, |
| 2271 | const struct hda_fixup *fix, int action) |
| 2272 | { |
| 2273 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 2274 | struct hda_jack_tbl *jack; |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2275 | |
| 2276 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2277 | return; |
| 2278 | |
| 2279 | /* Enable VREF power saving on GPIO1 detect */ |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2280 | snd_hda_codec_write_cache(codec, codec->afg, 0, |
| 2281 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02); |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 2282 | snd_hda_jack_detect_enable_callback(codec, codec->afg, |
| 2283 | STAC_VREF_EVENT, |
| 2284 | stac_vref_event); |
| 2285 | jack = snd_hda_jack_tbl_get(codec, codec->afg); |
| 2286 | if (jack) |
| 2287 | jack->private_data = 0x02; |
| 2288 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2289 | spec->gpio_mask |= 0x02; |
| 2290 | |
| 2291 | /* enable internal microphone */ |
| 2292 | snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040); |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2293 | } |
| 2294 | |
| 2295 | static void stac92hd71bxx_fixup_hp_dv4(struct hda_codec *codec, |
| 2296 | const struct hda_fixup *fix, int action) |
| 2297 | { |
| 2298 | struct sigmatel_spec *spec = codec->spec; |
| 2299 | |
| 2300 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2301 | return; |
| 2302 | spec->gpio_led = 0x01; |
| 2303 | } |
| 2304 | |
| 2305 | static void stac92hd71bxx_fixup_hp_dv5(struct hda_codec *codec, |
| 2306 | const struct hda_fixup *fix, int action) |
| 2307 | { |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2308 | unsigned int cap; |
| 2309 | |
| 2310 | switch (action) { |
| 2311 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2312 | snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); |
Takashi Iwai | f6655d5 | 2013-01-17 08:49:01 +0100 | [diff] [blame] | 2313 | break; |
| 2314 | |
| 2315 | case HDA_FIXUP_ACT_PROBE: |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2316 | /* enable bass on HP dv7 */ |
| 2317 | cap = snd_hda_param_read(codec, 0x1, AC_PAR_GPIO_CAP); |
| 2318 | cap &= AC_GPIO_IO_COUNT; |
| 2319 | if (cap >= 6) |
| 2320 | stac_add_hp_bass_switch(codec); |
| 2321 | break; |
| 2322 | } |
| 2323 | } |
| 2324 | |
| 2325 | static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec, |
| 2326 | const struct hda_fixup *fix, int action) |
| 2327 | { |
| 2328 | struct sigmatel_spec *spec = codec->spec; |
| 2329 | |
| 2330 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2331 | return; |
| 2332 | spec->gpio_led = 0x08; |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2333 | } |
| 2334 | |
| 2335 | |
| 2336 | static void stac92hd71bxx_fixup_hp(struct hda_codec *codec, |
| 2337 | const struct hda_fixup *fix, int action) |
| 2338 | { |
| 2339 | struct sigmatel_spec *spec = codec->spec; |
| 2340 | |
| 2341 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2342 | return; |
| 2343 | |
| 2344 | if (hp_blike_system(codec->subsystem_id)) { |
| 2345 | unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, 0x0f); |
| 2346 | if (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT || |
| 2347 | get_defcfg_device(pin_cfg) == AC_JACK_SPEAKER || |
| 2348 | get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT) { |
| 2349 | /* It was changed in the BIOS to just satisfy MS DTM. |
| 2350 | * Lets turn it back into slaved HP |
| 2351 | */ |
| 2352 | pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE)) |
| 2353 | | (AC_JACK_HP_OUT << |
| 2354 | AC_DEFCFG_DEVICE_SHIFT); |
| 2355 | pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC |
| 2356 | | AC_DEFCFG_SEQUENCE))) |
| 2357 | | 0x1f; |
| 2358 | snd_hda_codec_set_pincfg(codec, 0x0f, pin_cfg); |
| 2359 | } |
| 2360 | } |
| 2361 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 2362 | if (find_mute_led_cfg(codec, 1)) |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2363 | snd_printd("mute LED gpio %d polarity %d\n", |
| 2364 | spec->gpio_led, |
| 2365 | spec->gpio_led_polarity); |
| 2366 | |
| 2367 | } |
| 2368 | |
| 2369 | static const struct hda_fixup stac92hd71bxx_fixups[] = { |
| 2370 | [STAC_92HD71BXX_REF] = { |
| 2371 | .type = HDA_FIXUP_FUNC, |
| 2372 | .v.func = stac92hd71bxx_fixup_ref, |
| 2373 | }, |
| 2374 | [STAC_DELL_M4_1] = { |
| 2375 | .type = HDA_FIXUP_PINS, |
| 2376 | .v.pins = dell_m4_1_pin_configs, |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2377 | }, |
| 2378 | [STAC_DELL_M4_2] = { |
| 2379 | .type = HDA_FIXUP_PINS, |
| 2380 | .v.pins = dell_m4_2_pin_configs, |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2381 | }, |
| 2382 | [STAC_DELL_M4_3] = { |
| 2383 | .type = HDA_FIXUP_PINS, |
| 2384 | .v.pins = dell_m4_3_pin_configs, |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2385 | }, |
| 2386 | [STAC_HP_M4] = { |
| 2387 | .type = HDA_FIXUP_FUNC, |
| 2388 | .v.func = stac92hd71bxx_fixup_hp_m4, |
| 2389 | .chained = true, |
| 2390 | .chain_id = STAC_92HD71BXX_HP, |
| 2391 | }, |
| 2392 | [STAC_HP_DV4] = { |
| 2393 | .type = HDA_FIXUP_FUNC, |
| 2394 | .v.func = stac92hd71bxx_fixup_hp_dv4, |
| 2395 | .chained = true, |
| 2396 | .chain_id = STAC_HP_DV5, |
| 2397 | }, |
| 2398 | [STAC_HP_DV5] = { |
| 2399 | .type = HDA_FIXUP_FUNC, |
| 2400 | .v.func = stac92hd71bxx_fixup_hp_dv5, |
| 2401 | .chained = true, |
| 2402 | .chain_id = STAC_92HD71BXX_HP, |
| 2403 | }, |
| 2404 | [STAC_HP_HDX] = { |
| 2405 | .type = HDA_FIXUP_FUNC, |
| 2406 | .v.func = stac92hd71bxx_fixup_hp_hdx, |
| 2407 | .chained = true, |
| 2408 | .chain_id = STAC_92HD71BXX_HP, |
| 2409 | }, |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2410 | [STAC_92HD71BXX_HP] = { |
| 2411 | .type = HDA_FIXUP_FUNC, |
| 2412 | .v.func = stac92hd71bxx_fixup_hp, |
| 2413 | }, |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 2414 | }; |
| 2415 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2416 | static const struct hda_model_fixup stac92hd71bxx_models[] = { |
| 2417 | { .id = STAC_92HD71BXX_REF, .name = "ref" }, |
| 2418 | { .id = STAC_DELL_M4_1, .name = "dell-m4-1" }, |
| 2419 | { .id = STAC_DELL_M4_2, .name = "dell-m4-2" }, |
| 2420 | { .id = STAC_DELL_M4_3, .name = "dell-m4-3" }, |
| 2421 | { .id = STAC_HP_M4, .name = "hp-m4" }, |
| 2422 | { .id = STAC_HP_DV4, .name = "hp-dv4" }, |
| 2423 | { .id = STAC_HP_DV5, .name = "hp-dv5" }, |
| 2424 | { .id = STAC_HP_HDX, .name = "hp-hdx" }, |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 2425 | { .id = STAC_HP_DV4, .name = "hp-dv4-1222nr" }, |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2426 | {} |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 2427 | }; |
| 2428 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2429 | static const struct snd_pci_quirk stac92hd71bxx_fixup_tbl[] = { |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 2430 | /* SigmaTel reference board */ |
| 2431 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
| 2432 | "DFI LanParty", STAC_92HD71BXX_REF), |
Matthew Ranostay | 577aa2c | 2009-01-22 22:55:44 -0500 | [diff] [blame] | 2433 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
| 2434 | "DFI LanParty", STAC_92HD71BXX_REF), |
Vitaliy Kulikov | 5bdaaad | 2009-11-04 07:57:45 +0100 | [diff] [blame] | 2435 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x1720, |
| 2436 | "HP", STAC_HP_DV5), |
Takashi Iwai | 58d8395 | 2009-03-13 17:04:34 +0100 | [diff] [blame] | 2437 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080, |
| 2438 | "HP", STAC_HP_DV5), |
Takashi Iwai | 2ae466f | 2009-02-16 14:16:36 +0100 | [diff] [blame] | 2439 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0, |
Takashi Iwai | 2a6ce6e | 2010-05-12 10:16:20 +0200 | [diff] [blame] | 2440 | "HP dv4-7", STAC_HP_DV4), |
Takashi Iwai | 2ae466f | 2009-02-16 14:16:36 +0100 | [diff] [blame] | 2441 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3600, |
| 2442 | "HP dv4-7", STAC_HP_DV5), |
Takashi Iwai | 6fce61a | 2009-03-10 07:48:57 +0100 | [diff] [blame] | 2443 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3610, |
| 2444 | "HP HDX", STAC_HP_HDX), /* HDX18 */ |
Matthew Ranostay | 9a9e235 | 2008-09-26 10:37:03 -0400 | [diff] [blame] | 2445 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, |
Takashi Iwai | 2ae466f | 2009-02-16 14:16:36 +0100 | [diff] [blame] | 2446 | "HP mini 1000", STAC_HP_M4), |
Christoph Plattner | ae6241f | 2009-03-08 23:19:05 +0100 | [diff] [blame] | 2447 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b, |
Takashi Iwai | 6fce61a | 2009-03-10 07:48:57 +0100 | [diff] [blame] | 2448 | "HP HDX", STAC_HP_HDX), /* HDX16 */ |
Takashi Iwai | 6e34c03 | 2009-09-14 15:42:18 +0200 | [diff] [blame] | 2449 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620, |
| 2450 | "HP dv6", STAC_HP_DV5), |
Kunal Gangakhedkar | e3d2530 | 2010-03-20 23:08:01 +0530 | [diff] [blame] | 2451 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061, |
| 2452 | "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */ |
Luke Yelavich | 9b2167d | 2010-10-06 15:45:46 +1100 | [diff] [blame] | 2453 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x363e, |
| 2454 | "HP DV6", STAC_HP_DV5), |
Takashi Iwai | 1972d02 | 2009-08-06 08:44:43 +0200 | [diff] [blame] | 2455 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010, |
| 2456 | "HP", STAC_HP_DV5), |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 2457 | SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD71BXX_HP), |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 2458 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, |
| 2459 | "unknown Dell", STAC_DELL_M4_1), |
| 2460 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234, |
| 2461 | "unknown Dell", STAC_DELL_M4_1), |
| 2462 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0250, |
| 2463 | "unknown Dell", STAC_DELL_M4_1), |
| 2464 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x024f, |
| 2465 | "unknown Dell", STAC_DELL_M4_1), |
| 2466 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x024d, |
| 2467 | "unknown Dell", STAC_DELL_M4_1), |
| 2468 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0251, |
| 2469 | "unknown Dell", STAC_DELL_M4_1), |
| 2470 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0277, |
| 2471 | "unknown Dell", STAC_DELL_M4_1), |
| 2472 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0263, |
| 2473 | "unknown Dell", STAC_DELL_M4_2), |
| 2474 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0265, |
| 2475 | "unknown Dell", STAC_DELL_M4_2), |
| 2476 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0262, |
| 2477 | "unknown Dell", STAC_DELL_M4_2), |
| 2478 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0264, |
| 2479 | "unknown Dell", STAC_DELL_M4_2), |
Matthew Ranostay | 3a7abfd | 2008-11-20 21:21:43 -0500 | [diff] [blame] | 2480 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02aa, |
| 2481 | "unknown Dell", STAC_DELL_M4_3), |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 2482 | {} /* terminator */ |
| 2483 | }; |
| 2484 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2485 | static const struct hda_pintbl ref922x_pin_configs[] = { |
| 2486 | { 0x0a, 0x01014010 }, |
| 2487 | { 0x0b, 0x01016011 }, |
| 2488 | { 0x0c, 0x01012012 }, |
| 2489 | { 0x0d, 0x0221401f }, |
| 2490 | { 0x0e, 0x01813122 }, |
| 2491 | { 0x0f, 0x01011014 }, |
| 2492 | { 0x10, 0x01441030 }, |
| 2493 | { 0x11, 0x01c41030 }, |
| 2494 | { 0x15, 0x40000100 }, |
| 2495 | { 0x1b, 0x40000100 }, |
| 2496 | {} |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 2497 | }; |
| 2498 | |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 2499 | /* |
| 2500 | STAC 922X pin configs for |
| 2501 | 102801A7 |
| 2502 | 102801AB |
| 2503 | 102801A9 |
| 2504 | 102801D1 |
| 2505 | 102801D2 |
| 2506 | */ |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2507 | static const struct hda_pintbl dell_922x_d81_pin_configs[] = { |
| 2508 | { 0x0a, 0x02214030 }, |
| 2509 | { 0x0b, 0x01a19021 }, |
| 2510 | { 0x0c, 0x01111012 }, |
| 2511 | { 0x0d, 0x01114010 }, |
| 2512 | { 0x0e, 0x02a19020 }, |
| 2513 | { 0x0f, 0x01117011 }, |
| 2514 | { 0x10, 0x400001f0 }, |
| 2515 | { 0x11, 0x400001f1 }, |
| 2516 | { 0x15, 0x01813122 }, |
| 2517 | { 0x1b, 0x400001f2 }, |
| 2518 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 2519 | }; |
| 2520 | |
| 2521 | /* |
| 2522 | STAC 922X pin configs for |
| 2523 | 102801AC |
| 2524 | 102801D0 |
| 2525 | */ |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2526 | static const struct hda_pintbl dell_922x_d82_pin_configs[] = { |
| 2527 | { 0x0a, 0x02214030 }, |
| 2528 | { 0x0b, 0x01a19021 }, |
| 2529 | { 0x0c, 0x01111012 }, |
| 2530 | { 0x0d, 0x01114010 }, |
| 2531 | { 0x0e, 0x02a19020 }, |
| 2532 | { 0x0f, 0x01117011 }, |
| 2533 | { 0x10, 0x01451140 }, |
| 2534 | { 0x11, 0x400001f0 }, |
| 2535 | { 0x15, 0x01813122 }, |
| 2536 | { 0x1b, 0x400001f1 }, |
| 2537 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 2538 | }; |
| 2539 | |
| 2540 | /* |
| 2541 | STAC 922X pin configs for |
| 2542 | 102801BF |
| 2543 | */ |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2544 | static const struct hda_pintbl dell_922x_m81_pin_configs[] = { |
| 2545 | { 0x0a, 0x0321101f }, |
| 2546 | { 0x0b, 0x01112024 }, |
| 2547 | { 0x0c, 0x01111222 }, |
| 2548 | { 0x0d, 0x91174220 }, |
| 2549 | { 0x0e, 0x03a11050 }, |
| 2550 | { 0x0f, 0x01116221 }, |
| 2551 | { 0x10, 0x90a70330 }, |
| 2552 | { 0x11, 0x01452340 }, |
| 2553 | { 0x15, 0x40C003f1 }, |
| 2554 | { 0x1b, 0x405003f0 }, |
| 2555 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 2556 | }; |
| 2557 | |
| 2558 | /* |
| 2559 | STAC 9221 A1 pin configs for |
| 2560 | 102801D7 (Dell XPS M1210) |
| 2561 | */ |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2562 | static const struct hda_pintbl dell_922x_m82_pin_configs[] = { |
| 2563 | { 0x0a, 0x02211211 }, |
| 2564 | { 0x0b, 0x408103ff }, |
| 2565 | { 0x0c, 0x02a1123e }, |
| 2566 | { 0x0d, 0x90100310 }, |
| 2567 | { 0x0e, 0x408003f1 }, |
| 2568 | { 0x0f, 0x0221121f }, |
| 2569 | { 0x10, 0x03451340 }, |
| 2570 | { 0x11, 0x40c003f2 }, |
| 2571 | { 0x15, 0x508003f3 }, |
| 2572 | { 0x1b, 0x405003f4 }, |
| 2573 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 2574 | }; |
| 2575 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2576 | static const struct hda_pintbl d945gtp3_pin_configs[] = { |
| 2577 | { 0x0a, 0x0221401f }, |
| 2578 | { 0x0b, 0x01a19022 }, |
| 2579 | { 0x0c, 0x01813021 }, |
| 2580 | { 0x0d, 0x01014010 }, |
| 2581 | { 0x0e, 0x40000100 }, |
| 2582 | { 0x0f, 0x40000100 }, |
| 2583 | { 0x10, 0x40000100 }, |
| 2584 | { 0x11, 0x40000100 }, |
| 2585 | { 0x15, 0x02a19120 }, |
| 2586 | { 0x1b, 0x40000100 }, |
| 2587 | {} |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 2588 | }; |
| 2589 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2590 | static const struct hda_pintbl d945gtp5_pin_configs[] = { |
| 2591 | { 0x0a, 0x0221401f }, |
| 2592 | { 0x0b, 0x01011012 }, |
| 2593 | { 0x0c, 0x01813024 }, |
| 2594 | { 0x0d, 0x01014010 }, |
| 2595 | { 0x0e, 0x01a19021 }, |
| 2596 | { 0x0f, 0x01016011 }, |
| 2597 | { 0x10, 0x01452130 }, |
| 2598 | { 0x11, 0x40000100 }, |
| 2599 | { 0x15, 0x02a19320 }, |
| 2600 | { 0x1b, 0x40000100 }, |
| 2601 | {} |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 2602 | }; |
| 2603 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2604 | static const struct hda_pintbl intel_mac_v1_pin_configs[] = { |
| 2605 | { 0x0a, 0x0121e21f }, |
| 2606 | { 0x0b, 0x400000ff }, |
| 2607 | { 0x0c, 0x9017e110 }, |
| 2608 | { 0x0d, 0x400000fd }, |
| 2609 | { 0x0e, 0x400000fe }, |
| 2610 | { 0x0f, 0x0181e020 }, |
| 2611 | { 0x10, 0x1145e030 }, |
| 2612 | { 0x11, 0x11c5e240 }, |
| 2613 | { 0x15, 0x400000fc }, |
| 2614 | { 0x1b, 0x400000fb }, |
| 2615 | {} |
Takashi Iwai | 3fc24d8 | 2007-02-16 13:27:18 +0100 | [diff] [blame] | 2616 | }; |
| 2617 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2618 | static const struct hda_pintbl intel_mac_v2_pin_configs[] = { |
| 2619 | { 0x0a, 0x0121e21f }, |
| 2620 | { 0x0b, 0x90a7012e }, |
| 2621 | { 0x0c, 0x9017e110 }, |
| 2622 | { 0x0d, 0x400000fd }, |
| 2623 | { 0x0e, 0x400000fe }, |
| 2624 | { 0x0f, 0x0181e020 }, |
| 2625 | { 0x10, 0x1145e230 }, |
| 2626 | { 0x11, 0x500000fa }, |
| 2627 | { 0x15, 0x400000fc }, |
| 2628 | { 0x1b, 0x400000fb }, |
| 2629 | {} |
Sylvain FORET | f16928f | 2007-04-27 14:22:36 +0200 | [diff] [blame] | 2630 | }; |
| 2631 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2632 | static const struct hda_pintbl intel_mac_v3_pin_configs[] = { |
| 2633 | { 0x0a, 0x0121e21f }, |
| 2634 | { 0x0b, 0x90a7012e }, |
| 2635 | { 0x0c, 0x9017e110 }, |
| 2636 | { 0x0d, 0x400000fd }, |
| 2637 | { 0x0e, 0x400000fe }, |
| 2638 | { 0x0f, 0x0181e020 }, |
| 2639 | { 0x10, 0x1145e230 }, |
| 2640 | { 0x11, 0x11c5e240 }, |
| 2641 | { 0x15, 0x400000fc }, |
| 2642 | { 0x1b, 0x400000fb }, |
| 2643 | {} |
Ivan N. Zlatev | 5d5d3bc | 2007-05-29 16:03:00 +0200 | [diff] [blame] | 2644 | }; |
| 2645 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2646 | static const struct hda_pintbl intel_mac_v4_pin_configs[] = { |
| 2647 | { 0x0a, 0x0321e21f }, |
| 2648 | { 0x0b, 0x03a1e02e }, |
| 2649 | { 0x0c, 0x9017e110 }, |
| 2650 | { 0x0d, 0x9017e11f }, |
| 2651 | { 0x0e, 0x400000fe }, |
| 2652 | { 0x0f, 0x0381e020 }, |
| 2653 | { 0x10, 0x1345e230 }, |
| 2654 | { 0x11, 0x13c5e240 }, |
| 2655 | { 0x15, 0x400000fc }, |
| 2656 | { 0x1b, 0x400000fb }, |
| 2657 | {} |
Ivan N. Zlatev | 5d5d3bc | 2007-05-29 16:03:00 +0200 | [diff] [blame] | 2658 | }; |
| 2659 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2660 | static const struct hda_pintbl intel_mac_v5_pin_configs[] = { |
| 2661 | { 0x0a, 0x0321e21f }, |
| 2662 | { 0x0b, 0x03a1e02e }, |
| 2663 | { 0x0c, 0x9017e110 }, |
| 2664 | { 0x0d, 0x9017e11f }, |
| 2665 | { 0x0e, 0x400000fe }, |
| 2666 | { 0x0f, 0x0381e020 }, |
| 2667 | { 0x10, 0x1345e230 }, |
| 2668 | { 0x11, 0x13c5e240 }, |
| 2669 | { 0x15, 0x400000fc }, |
| 2670 | { 0x1b, 0x400000fb }, |
| 2671 | {} |
Takashi Iwai | 0dae0f8 | 2007-05-21 12:41:29 +0200 | [diff] [blame] | 2672 | }; |
| 2673 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2674 | static const struct hda_pintbl ecs202_pin_configs[] = { |
| 2675 | { 0x0a, 0x0221401f }, |
| 2676 | { 0x0b, 0x02a19020 }, |
| 2677 | { 0x0c, 0x01a19020 }, |
| 2678 | { 0x0d, 0x01114010 }, |
| 2679 | { 0x0e, 0x408000f0 }, |
| 2680 | { 0x0f, 0x01813022 }, |
| 2681 | { 0x10, 0x074510a0 }, |
| 2682 | { 0x11, 0x40c400f1 }, |
| 2683 | { 0x15, 0x9037012e }, |
| 2684 | { 0x1b, 0x40e000f2 }, |
| 2685 | {} |
Mauro Carvalho Chehab | 8c65008 | 2008-08-04 10:39:59 -0300 | [diff] [blame] | 2686 | }; |
Takashi Iwai | 76c0882 | 2007-06-19 12:17:42 +0200 | [diff] [blame] | 2687 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2688 | /* codec SSIDs for Intel Mac sharing the same PCI SSID 8384:7680 */ |
| 2689 | static const struct snd_pci_quirk stac922x_intel_mac_fixup_tbl[] = { |
| 2690 | SND_PCI_QUIRK(0x106b, 0x0800, "Mac", STAC_INTEL_MAC_V1), |
| 2691 | SND_PCI_QUIRK(0x106b, 0x0600, "Mac", STAC_INTEL_MAC_V2), |
| 2692 | SND_PCI_QUIRK(0x106b, 0x0700, "Mac", STAC_INTEL_MAC_V2), |
| 2693 | SND_PCI_QUIRK(0x106b, 0x0e00, "Mac", STAC_INTEL_MAC_V3), |
| 2694 | SND_PCI_QUIRK(0x106b, 0x0f00, "Mac", STAC_INTEL_MAC_V3), |
| 2695 | SND_PCI_QUIRK(0x106b, 0x1600, "Mac", STAC_INTEL_MAC_V3), |
| 2696 | SND_PCI_QUIRK(0x106b, 0x1700, "Mac", STAC_INTEL_MAC_V3), |
| 2697 | SND_PCI_QUIRK(0x106b, 0x0200, "Mac", STAC_INTEL_MAC_V3), |
| 2698 | SND_PCI_QUIRK(0x106b, 0x1e00, "Mac", STAC_INTEL_MAC_V3), |
| 2699 | SND_PCI_QUIRK(0x106b, 0x1a00, "Mac", STAC_INTEL_MAC_V4), |
| 2700 | SND_PCI_QUIRK(0x106b, 0x0a00, "Mac", STAC_INTEL_MAC_V5), |
| 2701 | SND_PCI_QUIRK(0x106b, 0x2200, "Mac", STAC_INTEL_MAC_V5), |
| 2702 | {} |
| 2703 | }; |
| 2704 | |
| 2705 | static const struct hda_fixup stac922x_fixups[]; |
| 2706 | |
| 2707 | /* remap the fixup from codec SSID and apply it */ |
| 2708 | static void stac922x_fixup_intel_mac_auto(struct hda_codec *codec, |
| 2709 | const struct hda_fixup *fix, |
| 2710 | int action) |
| 2711 | { |
| 2712 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2713 | return; |
| 2714 | snd_hda_pick_fixup(codec, NULL, stac922x_intel_mac_fixup_tbl, |
| 2715 | stac922x_fixups); |
| 2716 | if (codec->fixup_id != STAC_INTEL_MAC_AUTO) |
| 2717 | snd_hda_apply_fixup(codec, action); |
| 2718 | } |
| 2719 | |
| 2720 | static void stac922x_fixup_intel_mac_gpio(struct hda_codec *codec, |
| 2721 | const struct hda_fixup *fix, |
| 2722 | int action) |
| 2723 | { |
| 2724 | struct sigmatel_spec *spec = codec->spec; |
| 2725 | |
| 2726 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 2727 | spec->gpio_mask = spec->gpio_dir = 0x03; |
| 2728 | spec->gpio_data = 0x03; |
| 2729 | } |
| 2730 | } |
| 2731 | |
| 2732 | static const struct hda_fixup stac922x_fixups[] = { |
| 2733 | [STAC_D945_REF] = { |
| 2734 | .type = HDA_FIXUP_PINS, |
| 2735 | .v.pins = ref922x_pin_configs, |
| 2736 | }, |
| 2737 | [STAC_D945GTP3] = { |
| 2738 | .type = HDA_FIXUP_PINS, |
| 2739 | .v.pins = d945gtp3_pin_configs, |
| 2740 | }, |
| 2741 | [STAC_D945GTP5] = { |
| 2742 | .type = HDA_FIXUP_PINS, |
| 2743 | .v.pins = d945gtp5_pin_configs, |
| 2744 | }, |
| 2745 | [STAC_INTEL_MAC_AUTO] = { |
| 2746 | .type = HDA_FIXUP_FUNC, |
| 2747 | .v.func = stac922x_fixup_intel_mac_auto, |
| 2748 | }, |
| 2749 | [STAC_INTEL_MAC_V1] = { |
| 2750 | .type = HDA_FIXUP_PINS, |
| 2751 | .v.pins = intel_mac_v1_pin_configs, |
| 2752 | .chained = true, |
| 2753 | .chain_id = STAC_922X_INTEL_MAC_GPIO, |
| 2754 | }, |
| 2755 | [STAC_INTEL_MAC_V2] = { |
| 2756 | .type = HDA_FIXUP_PINS, |
| 2757 | .v.pins = intel_mac_v2_pin_configs, |
| 2758 | .chained = true, |
| 2759 | .chain_id = STAC_922X_INTEL_MAC_GPIO, |
| 2760 | }, |
| 2761 | [STAC_INTEL_MAC_V3] = { |
| 2762 | .type = HDA_FIXUP_PINS, |
| 2763 | .v.pins = intel_mac_v3_pin_configs, |
| 2764 | .chained = true, |
| 2765 | .chain_id = STAC_922X_INTEL_MAC_GPIO, |
| 2766 | }, |
| 2767 | [STAC_INTEL_MAC_V4] = { |
| 2768 | .type = HDA_FIXUP_PINS, |
| 2769 | .v.pins = intel_mac_v4_pin_configs, |
| 2770 | .chained = true, |
| 2771 | .chain_id = STAC_922X_INTEL_MAC_GPIO, |
| 2772 | }, |
| 2773 | [STAC_INTEL_MAC_V5] = { |
| 2774 | .type = HDA_FIXUP_PINS, |
| 2775 | .v.pins = intel_mac_v5_pin_configs, |
| 2776 | .chained = true, |
| 2777 | .chain_id = STAC_922X_INTEL_MAC_GPIO, |
| 2778 | }, |
| 2779 | [STAC_922X_INTEL_MAC_GPIO] = { |
| 2780 | .type = HDA_FIXUP_FUNC, |
| 2781 | .v.func = stac922x_fixup_intel_mac_gpio, |
| 2782 | }, |
| 2783 | [STAC_ECS_202] = { |
| 2784 | .type = HDA_FIXUP_PINS, |
| 2785 | .v.pins = ecs202_pin_configs, |
| 2786 | }, |
| 2787 | [STAC_922X_DELL_D81] = { |
| 2788 | .type = HDA_FIXUP_PINS, |
| 2789 | .v.pins = dell_922x_d81_pin_configs, |
| 2790 | }, |
| 2791 | [STAC_922X_DELL_D82] = { |
| 2792 | .type = HDA_FIXUP_PINS, |
| 2793 | .v.pins = dell_922x_d82_pin_configs, |
| 2794 | }, |
| 2795 | [STAC_922X_DELL_M81] = { |
| 2796 | .type = HDA_FIXUP_PINS, |
| 2797 | .v.pins = dell_922x_m81_pin_configs, |
| 2798 | }, |
| 2799 | [STAC_922X_DELL_M82] = { |
| 2800 | .type = HDA_FIXUP_PINS, |
| 2801 | .v.pins = dell_922x_m82_pin_configs, |
| 2802 | }, |
| 2803 | }; |
| 2804 | |
| 2805 | static const struct hda_model_fixup stac922x_models[] = { |
| 2806 | { .id = STAC_D945_REF, .name = "ref" }, |
| 2807 | { .id = STAC_D945GTP5, .name = "5stack" }, |
| 2808 | { .id = STAC_D945GTP3, .name = "3stack" }, |
| 2809 | { .id = STAC_INTEL_MAC_V1, .name = "intel-mac-v1" }, |
| 2810 | { .id = STAC_INTEL_MAC_V2, .name = "intel-mac-v2" }, |
| 2811 | { .id = STAC_INTEL_MAC_V3, .name = "intel-mac-v3" }, |
| 2812 | { .id = STAC_INTEL_MAC_V4, .name = "intel-mac-v4" }, |
| 2813 | { .id = STAC_INTEL_MAC_V5, .name = "intel-mac-v5" }, |
| 2814 | { .id = STAC_INTEL_MAC_AUTO, .name = "intel-mac-auto" }, |
| 2815 | { .id = STAC_ECS_202, .name = "ecs202" }, |
| 2816 | { .id = STAC_922X_DELL_D81, .name = "dell-d81" }, |
| 2817 | { .id = STAC_922X_DELL_D82, .name = "dell-d82" }, |
| 2818 | { .id = STAC_922X_DELL_M81, .name = "dell-m81" }, |
| 2819 | { .id = STAC_922X_DELL_M82, .name = "dell-m82" }, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 2820 | /* for backward compatibility */ |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2821 | { .id = STAC_INTEL_MAC_V3, .name = "macmini" }, |
| 2822 | { .id = STAC_INTEL_MAC_V5, .name = "macbook" }, |
| 2823 | { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro-v1" }, |
| 2824 | { .id = STAC_INTEL_MAC_V3, .name = "macbook-pro" }, |
| 2825 | { .id = STAC_INTEL_MAC_V2, .name = "imac-intel" }, |
| 2826 | { .id = STAC_INTEL_MAC_V3, .name = "imac-intel-20" }, |
| 2827 | {} |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 2828 | }; |
| 2829 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2830 | static const struct snd_pci_quirk stac922x_fixup_tbl[] = { |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 2831 | /* SigmaTel reference board */ |
| 2832 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
| 2833 | "DFI LanParty", STAC_D945_REF), |
Matthew Ranostay | 577aa2c | 2009-01-22 22:55:44 -0500 | [diff] [blame] | 2834 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
| 2835 | "DFI LanParty", STAC_D945_REF), |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 2836 | /* Intel 945G based systems */ |
| 2837 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0101, |
| 2838 | "Intel D945G", STAC_D945GTP3), |
| 2839 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0202, |
| 2840 | "Intel D945G", STAC_D945GTP3), |
| 2841 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0606, |
| 2842 | "Intel D945G", STAC_D945GTP3), |
| 2843 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0601, |
| 2844 | "Intel D945G", STAC_D945GTP3), |
| 2845 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0111, |
| 2846 | "Intel D945G", STAC_D945GTP3), |
| 2847 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1115, |
| 2848 | "Intel D945G", STAC_D945GTP3), |
| 2849 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1116, |
| 2850 | "Intel D945G", STAC_D945GTP3), |
| 2851 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1117, |
| 2852 | "Intel D945G", STAC_D945GTP3), |
| 2853 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1118, |
| 2854 | "Intel D945G", STAC_D945GTP3), |
| 2855 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1119, |
| 2856 | "Intel D945G", STAC_D945GTP3), |
| 2857 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x8826, |
| 2858 | "Intel D945G", STAC_D945GTP3), |
| 2859 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5049, |
| 2860 | "Intel D945G", STAC_D945GTP3), |
| 2861 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5055, |
| 2862 | "Intel D945G", STAC_D945GTP3), |
| 2863 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5048, |
| 2864 | "Intel D945G", STAC_D945GTP3), |
| 2865 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0110, |
| 2866 | "Intel D945G", STAC_D945GTP3), |
| 2867 | /* Intel D945G 5-stack systems */ |
| 2868 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0404, |
| 2869 | "Intel D945G", STAC_D945GTP5), |
| 2870 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0303, |
| 2871 | "Intel D945G", STAC_D945GTP5), |
| 2872 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0013, |
| 2873 | "Intel D945G", STAC_D945GTP5), |
| 2874 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0417, |
| 2875 | "Intel D945G", STAC_D945GTP5), |
| 2876 | /* Intel 945P based systems */ |
| 2877 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0b0b, |
| 2878 | "Intel D945P", STAC_D945GTP3), |
| 2879 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0112, |
| 2880 | "Intel D945P", STAC_D945GTP3), |
| 2881 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0d0d, |
| 2882 | "Intel D945P", STAC_D945GTP3), |
| 2883 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0909, |
| 2884 | "Intel D945P", STAC_D945GTP3), |
| 2885 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0505, |
| 2886 | "Intel D945P", STAC_D945GTP3), |
| 2887 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707, |
| 2888 | "Intel D945P", STAC_D945GTP5), |
Takashi Iwai | 8056d47 | 2009-01-23 09:09:43 +0100 | [diff] [blame] | 2889 | /* other intel */ |
| 2890 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0204, |
| 2891 | "Intel D945", STAC_D945_REF), |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 2892 | /* other systems */ |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2893 | |
Nicolas Boichat | 536319a | 2008-07-21 22:18:01 +0800 | [diff] [blame] | 2894 | /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */ |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 2895 | SND_PCI_QUIRK(0x8384, 0x7680, "Mac", STAC_INTEL_MAC_AUTO), |
| 2896 | |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 2897 | /* Dell systems */ |
| 2898 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7, |
| 2899 | "unknown Dell", STAC_922X_DELL_D81), |
| 2900 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a9, |
| 2901 | "unknown Dell", STAC_922X_DELL_D81), |
| 2902 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ab, |
| 2903 | "unknown Dell", STAC_922X_DELL_D81), |
| 2904 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ac, |
| 2905 | "unknown Dell", STAC_922X_DELL_D82), |
| 2906 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01bf, |
| 2907 | "unknown Dell", STAC_922X_DELL_M81), |
| 2908 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d0, |
| 2909 | "unknown Dell", STAC_922X_DELL_D82), |
| 2910 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d1, |
| 2911 | "unknown Dell", STAC_922X_DELL_D81), |
| 2912 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d2, |
| 2913 | "unknown Dell", STAC_922X_DELL_D81), |
| 2914 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d7, |
| 2915 | "Dell XPS M1210", STAC_922X_DELL_M82), |
Mauro Carvalho Chehab | 8c65008 | 2008-08-04 10:39:59 -0300 | [diff] [blame] | 2916 | /* ECS/PC Chips boards */ |
Takashi Iwai | dea0a50 | 2009-02-09 17:14:52 +0100 | [diff] [blame] | 2917 | SND_PCI_QUIRK_MASK(0x1019, 0xf000, 0x2000, |
Herton Ronaldo Krzesinski | 8663ae5 | 2009-02-08 19:50:34 -0200 | [diff] [blame] | 2918 | "ECS/PC chips", STAC_ECS_202), |
Matt Porter | 403d194 | 2005-11-29 15:00:51 +0100 | [diff] [blame] | 2919 | {} /* terminator */ |
| 2920 | }; |
| 2921 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 2922 | static const struct hda_pintbl ref927x_pin_configs[] = { |
| 2923 | { 0x0a, 0x02214020 }, |
| 2924 | { 0x0b, 0x02a19080 }, |
| 2925 | { 0x0c, 0x0181304e }, |
| 2926 | { 0x0d, 0x01014010 }, |
| 2927 | { 0x0e, 0x01a19040 }, |
| 2928 | { 0x0f, 0x01011012 }, |
| 2929 | { 0x10, 0x01016011 }, |
| 2930 | { 0x11, 0x0101201f }, |
| 2931 | { 0x12, 0x183301f0 }, |
| 2932 | { 0x13, 0x18a001f0 }, |
| 2933 | { 0x14, 0x18a001f0 }, |
| 2934 | { 0x21, 0x01442070 }, |
| 2935 | { 0x22, 0x01c42190 }, |
| 2936 | { 0x23, 0x40000100 }, |
| 2937 | {} |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 2938 | }; |
| 2939 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 2940 | static const struct hda_pintbl d965_3st_pin_configs[] = { |
| 2941 | { 0x0a, 0x0221401f }, |
| 2942 | { 0x0b, 0x02a19120 }, |
| 2943 | { 0x0c, 0x40000100 }, |
| 2944 | { 0x0d, 0x01014011 }, |
| 2945 | { 0x0e, 0x01a19021 }, |
| 2946 | { 0x0f, 0x01813024 }, |
| 2947 | { 0x10, 0x40000100 }, |
| 2948 | { 0x11, 0x40000100 }, |
| 2949 | { 0x12, 0x40000100 }, |
| 2950 | { 0x13, 0x40000100 }, |
| 2951 | { 0x14, 0x40000100 }, |
| 2952 | { 0x21, 0x40000100 }, |
| 2953 | { 0x22, 0x40000100 }, |
| 2954 | { 0x23, 0x40000100 }, |
| 2955 | {} |
Tobin Davis | 81d3dbd | 2006-08-22 19:44:45 +0200 | [diff] [blame] | 2956 | }; |
| 2957 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 2958 | static const struct hda_pintbl d965_5st_pin_configs[] = { |
| 2959 | { 0x0a, 0x02214020 }, |
| 2960 | { 0x0b, 0x02a19080 }, |
| 2961 | { 0x0c, 0x0181304e }, |
| 2962 | { 0x0d, 0x01014010 }, |
| 2963 | { 0x0e, 0x01a19040 }, |
| 2964 | { 0x0f, 0x01011012 }, |
| 2965 | { 0x10, 0x01016011 }, |
| 2966 | { 0x11, 0x40000100 }, |
| 2967 | { 0x12, 0x40000100 }, |
| 2968 | { 0x13, 0x40000100 }, |
| 2969 | { 0x14, 0x40000100 }, |
| 2970 | { 0x21, 0x01442070 }, |
| 2971 | { 0x22, 0x40000100 }, |
| 2972 | { 0x23, 0x40000100 }, |
| 2973 | {} |
Tobin Davis | 93ed150 | 2006-09-01 21:03:12 +0200 | [diff] [blame] | 2974 | }; |
| 2975 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 2976 | static const struct hda_pintbl d965_5st_no_fp_pin_configs[] = { |
| 2977 | { 0x0a, 0x40000100 }, |
| 2978 | { 0x0b, 0x40000100 }, |
| 2979 | { 0x0c, 0x0181304e }, |
| 2980 | { 0x0d, 0x01014010 }, |
| 2981 | { 0x0e, 0x01a19040 }, |
| 2982 | { 0x0f, 0x01011012 }, |
| 2983 | { 0x10, 0x01016011 }, |
| 2984 | { 0x11, 0x40000100 }, |
| 2985 | { 0x12, 0x40000100 }, |
| 2986 | { 0x13, 0x40000100 }, |
| 2987 | { 0x14, 0x40000100 }, |
| 2988 | { 0x21, 0x01442070 }, |
| 2989 | { 0x22, 0x40000100 }, |
| 2990 | { 0x23, 0x40000100 }, |
| 2991 | {} |
Takashi Iwai | 679d92e | 2009-05-24 19:00:08 +0200 | [diff] [blame] | 2992 | }; |
| 2993 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 2994 | static const struct hda_pintbl dell_3st_pin_configs[] = { |
| 2995 | { 0x0a, 0x02211230 }, |
| 2996 | { 0x0b, 0x02a11220 }, |
| 2997 | { 0x0c, 0x01a19040 }, |
| 2998 | { 0x0d, 0x01114210 }, |
| 2999 | { 0x0e, 0x01111212 }, |
| 3000 | { 0x0f, 0x01116211 }, |
| 3001 | { 0x10, 0x01813050 }, |
| 3002 | { 0x11, 0x01112214 }, |
| 3003 | { 0x12, 0x403003fa }, |
| 3004 | { 0x13, 0x90a60040 }, |
| 3005 | { 0x14, 0x90a60040 }, |
| 3006 | { 0x21, 0x404003fb }, |
| 3007 | { 0x22, 0x40c003fc }, |
| 3008 | { 0x23, 0x40000100 }, |
| 3009 | {} |
Tobin Davis | 4ff076e | 2007-08-07 11:48:12 +0200 | [diff] [blame] | 3010 | }; |
| 3011 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3012 | static void stac927x_fixup_ref_no_jd(struct hda_codec *codec, |
| 3013 | const struct hda_fixup *fix, int action) |
| 3014 | { |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3015 | /* no jack detecion for ref-no-jd model */ |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3016 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3017 | codec->no_jack_detect = 1; |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3018 | } |
| 3019 | |
| 3020 | static void stac927x_fixup_ref(struct hda_codec *codec, |
| 3021 | const struct hda_fixup *fix, int action) |
| 3022 | { |
| 3023 | struct sigmatel_spec *spec = codec->spec; |
| 3024 | |
| 3025 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3026 | snd_hda_apply_pincfgs(codec, ref927x_pin_configs); |
| 3027 | spec->eapd_mask = spec->gpio_mask = 0; |
| 3028 | spec->gpio_dir = spec->gpio_data = 0; |
| 3029 | } |
| 3030 | } |
| 3031 | |
| 3032 | static void stac927x_fixup_dell_dmic(struct hda_codec *codec, |
| 3033 | const struct hda_fixup *fix, int action) |
| 3034 | { |
| 3035 | struct sigmatel_spec *spec = codec->spec; |
| 3036 | |
| 3037 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3038 | return; |
| 3039 | |
| 3040 | if (codec->subsystem_id != 0x1028022f) { |
| 3041 | /* GPIO2 High = Enable EAPD */ |
| 3042 | spec->eapd_mask = spec->gpio_mask = 0x04; |
| 3043 | spec->gpio_dir = spec->gpio_data = 0x04; |
| 3044 | } |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3045 | |
| 3046 | snd_hda_add_verbs(codec, dell_3st_core_init); |
| 3047 | spec->volknob_init = 1; |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3048 | } |
| 3049 | |
| 3050 | static void stac927x_fixup_volknob(struct hda_codec *codec, |
| 3051 | const struct hda_fixup *fix, int action) |
| 3052 | { |
| 3053 | struct sigmatel_spec *spec = codec->spec; |
| 3054 | |
| 3055 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3056 | snd_hda_add_verbs(codec, stac927x_volknob_core_init); |
| 3057 | spec->volknob_init = 1; |
| 3058 | } |
| 3059 | } |
| 3060 | |
| 3061 | static const struct hda_fixup stac927x_fixups[] = { |
| 3062 | [STAC_D965_REF_NO_JD] = { |
| 3063 | .type = HDA_FIXUP_FUNC, |
| 3064 | .v.func = stac927x_fixup_ref_no_jd, |
| 3065 | .chained = true, |
| 3066 | .chain_id = STAC_D965_REF, |
| 3067 | }, |
| 3068 | [STAC_D965_REF] = { |
| 3069 | .type = HDA_FIXUP_FUNC, |
| 3070 | .v.func = stac927x_fixup_ref, |
| 3071 | }, |
| 3072 | [STAC_D965_3ST] = { |
| 3073 | .type = HDA_FIXUP_PINS, |
| 3074 | .v.pins = d965_3st_pin_configs, |
| 3075 | .chained = true, |
| 3076 | .chain_id = STAC_D965_VERBS, |
| 3077 | }, |
| 3078 | [STAC_D965_5ST] = { |
| 3079 | .type = HDA_FIXUP_PINS, |
| 3080 | .v.pins = d965_5st_pin_configs, |
| 3081 | .chained = true, |
| 3082 | .chain_id = STAC_D965_VERBS, |
| 3083 | }, |
| 3084 | [STAC_D965_VERBS] = { |
| 3085 | .type = HDA_FIXUP_VERBS, |
| 3086 | .v.verbs = d965_core_init, |
| 3087 | }, |
| 3088 | [STAC_D965_5ST_NO_FP] = { |
| 3089 | .type = HDA_FIXUP_PINS, |
| 3090 | .v.pins = d965_5st_no_fp_pin_configs, |
| 3091 | }, |
| 3092 | [STAC_DELL_3ST] = { |
| 3093 | .type = HDA_FIXUP_PINS, |
| 3094 | .v.pins = dell_3st_pin_configs, |
| 3095 | .chained = true, |
| 3096 | .chain_id = STAC_927X_DELL_DMIC, |
| 3097 | }, |
| 3098 | [STAC_DELL_BIOS] = { |
| 3099 | .type = HDA_FIXUP_PINS, |
| 3100 | .v.pins = (const struct hda_pintbl[]) { |
| 3101 | /* configure the analog microphone on some laptops */ |
| 3102 | { 0x0c, 0x90a79130 }, |
| 3103 | /* correct the front output jack as a hp out */ |
| 3104 | { 0x0f, 0x0227011f }, |
| 3105 | /* correct the front input jack as a mic */ |
| 3106 | { 0x0e, 0x02a79130 }, |
| 3107 | {} |
| 3108 | }, |
| 3109 | .chained = true, |
| 3110 | .chain_id = STAC_927X_DELL_DMIC, |
| 3111 | }, |
| 3112 | [STAC_DELL_BIOS_SPDIF] = { |
| 3113 | .type = HDA_FIXUP_PINS, |
| 3114 | .v.pins = (const struct hda_pintbl[]) { |
| 3115 | /* correct the device field to SPDIF out */ |
| 3116 | { 0x21, 0x01442070 }, |
| 3117 | {} |
| 3118 | }, |
| 3119 | .chained = true, |
| 3120 | .chain_id = STAC_DELL_BIOS, |
| 3121 | }, |
| 3122 | [STAC_927X_DELL_DMIC] = { |
| 3123 | .type = HDA_FIXUP_FUNC, |
| 3124 | .v.func = stac927x_fixup_dell_dmic, |
| 3125 | }, |
| 3126 | [STAC_927X_VOLKNOB] = { |
| 3127 | .type = HDA_FIXUP_FUNC, |
| 3128 | .v.func = stac927x_fixup_volknob, |
| 3129 | }, |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 3130 | }; |
| 3131 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3132 | static const struct hda_model_fixup stac927x_models[] = { |
| 3133 | { .id = STAC_D965_REF_NO_JD, .name = "ref-no-jd" }, |
| 3134 | { .id = STAC_D965_REF, .name = "ref" }, |
| 3135 | { .id = STAC_D965_3ST, .name = "3stack" }, |
| 3136 | { .id = STAC_D965_5ST, .name = "5stack" }, |
| 3137 | { .id = STAC_D965_5ST_NO_FP, .name = "5stack-no-fp" }, |
| 3138 | { .id = STAC_DELL_3ST, .name = "dell-3stack" }, |
| 3139 | { .id = STAC_DELL_BIOS, .name = "dell-bios" }, |
| 3140 | { .id = STAC_927X_VOLKNOB, .name = "volknob" }, |
| 3141 | {} |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 3142 | }; |
| 3143 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3144 | static const struct snd_pci_quirk stac927x_fixup_tbl[] = { |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 3145 | /* SigmaTel reference board */ |
| 3146 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
| 3147 | "DFI LanParty", STAC_D965_REF), |
Matthew Ranostay | 577aa2c | 2009-01-22 22:55:44 -0500 | [diff] [blame] | 3148 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
| 3149 | "DFI LanParty", STAC_D965_REF), |
Tobin Davis | 81d3dbd | 2006-08-22 19:44:45 +0200 | [diff] [blame] | 3150 | /* Intel 946 based systems */ |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 3151 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST), |
| 3152 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST), |
Tobin Davis | 93ed150 | 2006-09-01 21:03:12 +0200 | [diff] [blame] | 3153 | /* 965 based 3 stack systems */ |
Takashi Iwai | dea0a50 | 2009-02-09 17:14:52 +0100 | [diff] [blame] | 3154 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2100, |
| 3155 | "Intel D965", STAC_D965_3ST), |
| 3156 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2000, |
| 3157 | "Intel D965", STAC_D965_3ST), |
Tobin Davis | 4ff076e | 2007-08-07 11:48:12 +0200 | [diff] [blame] | 3158 | /* Dell 3 stack systems */ |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3159 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST), |
Tobin Davis | 4ff076e | 2007-08-07 11:48:12 +0200 | [diff] [blame] | 3160 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ed, "Dell ", STAC_DELL_3ST), |
| 3161 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f4, "Dell ", STAC_DELL_3ST), |
Matthew Ranostay | 8e9068b | 2007-12-17 11:58:13 +0100 | [diff] [blame] | 3162 | /* Dell 3 stack systems with verb table in BIOS */ |
Matthew Ranostay | 2f32d90 | 2008-01-10 13:06:26 +0100 | [diff] [blame] | 3163 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS), |
Daniel T Chen | 66668b6 | 2010-05-23 20:47:45 -0400 | [diff] [blame] | 3164 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f7, "Dell XPS M1730", STAC_DELL_BIOS), |
Matthew Ranostay | 2f32d90 | 2008-01-10 13:06:26 +0100 | [diff] [blame] | 3165 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS), |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3166 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS_SPDIF), |
Chengu Wang | 84d3dc2 | 2009-07-30 19:43:55 +0800 | [diff] [blame] | 3167 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS), |
Matthew Ranostay | 8e9068b | 2007-12-17 11:58:13 +0100 | [diff] [blame] | 3168 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), |
| 3169 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), |
| 3170 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3171 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0209, "Dell XPS 1330", STAC_DELL_BIOS_SPDIF), |
Tobin Davis | 93ed150 | 2006-09-01 21:03:12 +0200 | [diff] [blame] | 3172 | /* 965 based 5 stack systems */ |
Takashi Iwai | dea0a50 | 2009-02-09 17:14:52 +0100 | [diff] [blame] | 3173 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2300, |
| 3174 | "Intel D965", STAC_D965_5ST), |
| 3175 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2500, |
| 3176 | "Intel D965", STAC_D965_5ST), |
Takashi Iwai | 5493053 | 2009-10-11 17:38:29 +0200 | [diff] [blame] | 3177 | /* volume-knob fixes */ |
| 3178 | SND_PCI_QUIRK_VENDOR(0x10cf, "FSC", STAC_927X_VOLKNOB), |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 3179 | {} /* terminator */ |
| 3180 | }; |
| 3181 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3182 | static const struct hda_pintbl ref9205_pin_configs[] = { |
| 3183 | { 0x0a, 0x40000100 }, |
| 3184 | { 0x0b, 0x40000100 }, |
| 3185 | { 0x0c, 0x01016011 }, |
| 3186 | { 0x0d, 0x01014010 }, |
| 3187 | { 0x0e, 0x01813122 }, |
| 3188 | { 0x0f, 0x01a19021 }, |
| 3189 | { 0x14, 0x01019020 }, |
| 3190 | { 0x16, 0x40000100 }, |
| 3191 | { 0x17, 0x90a000f0 }, |
| 3192 | { 0x18, 0x90a000f0 }, |
| 3193 | { 0x21, 0x01441030 }, |
| 3194 | { 0x22, 0x01c41030 }, |
| 3195 | {} |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 3196 | }; |
| 3197 | |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3198 | /* |
| 3199 | STAC 9205 pin configs for |
| 3200 | 102801F1 |
| 3201 | 102801F2 |
| 3202 | 102801FC |
| 3203 | 102801FD |
| 3204 | 10280204 |
| 3205 | 1028021F |
Matthew Ranostay | 3fa2ef7 | 2008-01-11 11:39:06 +0100 | [diff] [blame] | 3206 | 10280228 (Dell Vostro 1500) |
Anisse Astier | 95e70e8 | 2009-12-23 17:28:45 +0100 | [diff] [blame] | 3207 | 10280229 (Dell Vostro 1700) |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3208 | */ |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3209 | static const struct hda_pintbl dell_9205_m42_pin_configs[] = { |
| 3210 | { 0x0a, 0x0321101F }, |
| 3211 | { 0x0b, 0x03A11020 }, |
| 3212 | { 0x0c, 0x400003FA }, |
| 3213 | { 0x0d, 0x90170310 }, |
| 3214 | { 0x0e, 0x400003FB }, |
| 3215 | { 0x0f, 0x400003FC }, |
| 3216 | { 0x14, 0x400003FD }, |
| 3217 | { 0x16, 0x40F000F9 }, |
| 3218 | { 0x17, 0x90A60330 }, |
| 3219 | { 0x18, 0x400003FF }, |
| 3220 | { 0x21, 0x0144131F }, |
| 3221 | { 0x22, 0x40C003FE }, |
| 3222 | {} |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3223 | }; |
| 3224 | |
| 3225 | /* |
| 3226 | STAC 9205 pin configs for |
| 3227 | 102801F9 |
| 3228 | 102801FA |
| 3229 | 102801FE |
| 3230 | 102801FF (Dell Precision M4300) |
| 3231 | 10280206 |
| 3232 | 10280200 |
| 3233 | 10280201 |
| 3234 | */ |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3235 | static const struct hda_pintbl dell_9205_m43_pin_configs[] = { |
| 3236 | { 0x0a, 0x0321101f }, |
| 3237 | { 0x0b, 0x03a11020 }, |
| 3238 | { 0x0c, 0x90a70330 }, |
| 3239 | { 0x0d, 0x90170310 }, |
| 3240 | { 0x0e, 0x400000fe }, |
| 3241 | { 0x0f, 0x400000ff }, |
| 3242 | { 0x14, 0x400000fd }, |
| 3243 | { 0x16, 0x40f000f9 }, |
| 3244 | { 0x17, 0x400000fa }, |
| 3245 | { 0x18, 0x400000fc }, |
| 3246 | { 0x21, 0x0144131f }, |
| 3247 | { 0x22, 0x40c003f8 }, |
| 3248 | /* Enable SPDIF in/out */ |
| 3249 | { 0x1f, 0x01441030 }, |
| 3250 | { 0x20, 0x1c410030 }, |
| 3251 | {} |
Tobin Davis | ae0a8ed | 2007-08-13 15:50:29 +0200 | [diff] [blame] | 3252 | }; |
| 3253 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3254 | static const struct hda_pintbl dell_9205_m44_pin_configs[] = { |
| 3255 | { 0x0a, 0x0421101f }, |
| 3256 | { 0x0b, 0x04a11020 }, |
| 3257 | { 0x0c, 0x400003fa }, |
| 3258 | { 0x0d, 0x90170310 }, |
| 3259 | { 0x0e, 0x400003fb }, |
| 3260 | { 0x0f, 0x400003fc }, |
| 3261 | { 0x14, 0x400003fd }, |
| 3262 | { 0x16, 0x400003f9 }, |
| 3263 | { 0x17, 0x90a60330 }, |
| 3264 | { 0x18, 0x400003ff }, |
| 3265 | { 0x21, 0x01441340 }, |
| 3266 | { 0x22, 0x40c003fe }, |
| 3267 | {} |
Tobin Davis | ae0a8ed | 2007-08-13 15:50:29 +0200 | [diff] [blame] | 3268 | }; |
| 3269 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3270 | static void stac9205_fixup_ref(struct hda_codec *codec, |
| 3271 | const struct hda_fixup *fix, int action) |
| 3272 | { |
| 3273 | struct sigmatel_spec *spec = codec->spec; |
| 3274 | |
| 3275 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3276 | snd_hda_apply_pincfgs(codec, ref9205_pin_configs); |
| 3277 | /* SPDIF-In enabled */ |
| 3278 | spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0; |
| 3279 | } |
| 3280 | } |
| 3281 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3282 | static void stac9205_fixup_dell_m43(struct hda_codec *codec, |
| 3283 | const struct hda_fixup *fix, int action) |
| 3284 | { |
| 3285 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3286 | struct hda_jack_tbl *jack; |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3287 | |
| 3288 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3289 | snd_hda_apply_pincfgs(codec, dell_9205_m43_pin_configs); |
| 3290 | |
| 3291 | /* Enable unsol response for GPIO4/Dock HP connection */ |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3292 | snd_hda_codec_write_cache(codec, codec->afg, 0, |
| 3293 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10); |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3294 | snd_hda_jack_detect_enable_callback(codec, codec->afg, |
| 3295 | STAC_VREF_EVENT, |
| 3296 | stac_vref_event); |
| 3297 | jack = snd_hda_jack_tbl_get(codec, codec->afg); |
| 3298 | if (jack) |
| 3299 | jack->private_data = 0x01; |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3300 | |
| 3301 | spec->gpio_dir = 0x0b; |
| 3302 | spec->eapd_mask = 0x01; |
| 3303 | spec->gpio_mask = 0x1b; |
| 3304 | spec->gpio_mute = 0x10; |
| 3305 | /* GPIO0 High = EAPD, GPIO1 Low = Headphone Mute, |
| 3306 | * GPIO3 Low = DRM |
| 3307 | */ |
| 3308 | spec->gpio_data = 0x01; |
| 3309 | } |
| 3310 | } |
| 3311 | |
| 3312 | static void stac9205_fixup_eapd(struct hda_codec *codec, |
| 3313 | const struct hda_fixup *fix, int action) |
| 3314 | { |
| 3315 | struct sigmatel_spec *spec = codec->spec; |
| 3316 | |
| 3317 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3318 | spec->eapd_switch = 0; |
| 3319 | } |
| 3320 | |
| 3321 | static const struct hda_fixup stac9205_fixups[] = { |
| 3322 | [STAC_9205_REF] = { |
| 3323 | .type = HDA_FIXUP_FUNC, |
| 3324 | .v.func = stac9205_fixup_ref, |
| 3325 | }, |
| 3326 | [STAC_9205_DELL_M42] = { |
| 3327 | .type = HDA_FIXUP_PINS, |
| 3328 | .v.pins = dell_9205_m42_pin_configs, |
| 3329 | }, |
| 3330 | [STAC_9205_DELL_M43] = { |
| 3331 | .type = HDA_FIXUP_FUNC, |
| 3332 | .v.func = stac9205_fixup_dell_m43, |
| 3333 | }, |
| 3334 | [STAC_9205_DELL_M44] = { |
| 3335 | .type = HDA_FIXUP_PINS, |
| 3336 | .v.pins = dell_9205_m44_pin_configs, |
| 3337 | }, |
| 3338 | [STAC_9205_EAPD] = { |
| 3339 | .type = HDA_FIXUP_FUNC, |
| 3340 | .v.func = stac9205_fixup_eapd, |
| 3341 | }, |
| 3342 | {} |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 3343 | }; |
| 3344 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3345 | static const struct hda_model_fixup stac9205_models[] = { |
| 3346 | { .id = STAC_9205_REF, .name = "ref" }, |
| 3347 | { .id = STAC_9205_DELL_M42, .name = "dell-m42" }, |
| 3348 | { .id = STAC_9205_DELL_M43, .name = "dell-m43" }, |
| 3349 | { .id = STAC_9205_DELL_M44, .name = "dell-m44" }, |
| 3350 | { .id = STAC_9205_EAPD, .name = "eapd" }, |
| 3351 | {} |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 3352 | }; |
| 3353 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 3354 | static const struct snd_pci_quirk stac9205_fixup_tbl[] = { |
Takashi Iwai | f5fcc13 | 2006-11-24 17:07:44 +0100 | [diff] [blame] | 3355 | /* SigmaTel reference board */ |
| 3356 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
| 3357 | "DFI LanParty", STAC_9205_REF), |
Herton Ronaldo Krzesinski | 02358fc | 2009-07-04 01:44:59 -0300 | [diff] [blame] | 3358 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xfb30, |
| 3359 | "SigmaTel", STAC_9205_REF), |
Matthew Ranostay | 577aa2c | 2009-01-22 22:55:44 -0500 | [diff] [blame] | 3360 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
| 3361 | "DFI LanParty", STAC_9205_REF), |
Takashi Iwai | d9a4268 | 2009-01-22 17:40:18 +0100 | [diff] [blame] | 3362 | /* Dell */ |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3363 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f1, |
| 3364 | "unknown Dell", STAC_9205_DELL_M42), |
| 3365 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f2, |
| 3366 | "unknown Dell", STAC_9205_DELL_M42), |
Tobin Davis | ae0a8ed | 2007-08-13 15:50:29 +0200 | [diff] [blame] | 3367 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f8, |
Matthew Ranostay | b44ef2f | 2007-09-18 00:52:38 +0200 | [diff] [blame] | 3368 | "Dell Precision", STAC_9205_DELL_M43), |
Tobin Davis | ae0a8ed | 2007-08-13 15:50:29 +0200 | [diff] [blame] | 3369 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f9, |
| 3370 | "Dell Precision", STAC_9205_DELL_M43), |
| 3371 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fa, |
| 3372 | "Dell Precision", STAC_9205_DELL_M43), |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3373 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fc, |
| 3374 | "unknown Dell", STAC_9205_DELL_M42), |
| 3375 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fd, |
| 3376 | "unknown Dell", STAC_9205_DELL_M42), |
Tobin Davis | ae0a8ed | 2007-08-13 15:50:29 +0200 | [diff] [blame] | 3377 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01fe, |
| 3378 | "Dell Precision", STAC_9205_DELL_M43), |
| 3379 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ff, |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3380 | "Dell Precision M4300", STAC_9205_DELL_M43), |
Takashi Iwai | dfe495d | 2007-08-23 19:04:28 +0200 | [diff] [blame] | 3381 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0204, |
| 3382 | "unknown Dell", STAC_9205_DELL_M42), |
Takashi Iwai | 4549915 | 2008-06-12 16:27:24 +0200 | [diff] [blame] | 3383 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0206, |
| 3384 | "Dell Precision", STAC_9205_DELL_M43), |
| 3385 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021b, |
| 3386 | "Dell Precision", STAC_9205_DELL_M43), |
| 3387 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021c, |
| 3388 | "Dell Precision", STAC_9205_DELL_M43), |
Tobin Davis | ae0a8ed | 2007-08-13 15:50:29 +0200 | [diff] [blame] | 3389 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x021f, |
| 3390 | "Dell Inspiron", STAC_9205_DELL_M44), |
Matthew Ranostay | 3fa2ef7 | 2008-01-11 11:39:06 +0100 | [diff] [blame] | 3391 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228, |
| 3392 | "Dell Vostro 1500", STAC_9205_DELL_M42), |
Anisse Astier | 95e70e8 | 2009-12-23 17:28:45 +0100 | [diff] [blame] | 3393 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0229, |
| 3394 | "Dell Vostro 1700", STAC_9205_DELL_M42), |
Takashi Iwai | d9a4268 | 2009-01-22 17:40:18 +0100 | [diff] [blame] | 3395 | /* Gateway */ |
Hao Song | 42b95f0 | 2009-07-20 15:01:16 +0800 | [diff] [blame] | 3396 | SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD), |
Takashi Iwai | d9a4268 | 2009-01-22 17:40:18 +0100 | [diff] [blame] | 3397 | SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD), |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 3398 | {} /* terminator */ |
| 3399 | }; |
| 3400 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3401 | static int stac_parse_auto_config(struct hda_codec *codec) |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3402 | { |
| 3403 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | dc04d1b | 2009-03-06 10:00:05 +0100 | [diff] [blame] | 3404 | int err; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3405 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3406 | err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); |
Takashi Iwai | dc04d1b | 2009-03-06 10:00:05 +0100 | [diff] [blame] | 3407 | if (err < 0) |
| 3408 | return err; |
| 3409 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3410 | /* add hooks */ |
| 3411 | spec->gen.pcm_playback_hook = stac_playback_pcm_hook; |
| 3412 | spec->gen.pcm_capture_hook = stac_capture_pcm_hook; |
| 3413 | |
| 3414 | spec->gen.automute_hook = stac_update_outputs; |
| 3415 | spec->gen.hp_automute_hook = stac_hp_automute; |
| 3416 | spec->gen.line_automute_hook = stac_line_automute; |
| 3417 | |
| 3418 | err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); |
Takashi Iwai | dc04d1b | 2009-03-06 10:00:05 +0100 | [diff] [blame] | 3419 | if (err < 0) |
| 3420 | return err; |
| 3421 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3422 | /* minimum value is actually mute */ |
| 3423 | spec->gen.vmaster_tlv[3] |= TLV_DB_SCALE_MUTE; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3424 | |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3425 | /* setup analog beep controls */ |
| 3426 | if (spec->anabeep_nid > 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3427 | err = stac_auto_create_beep_ctls(codec, |
| 3428 | spec->anabeep_nid); |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3429 | if (err < 0) |
| 3430 | return err; |
| 3431 | } |
| 3432 | |
| 3433 | /* setup digital beep controls and input device */ |
| 3434 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
| 3435 | if (spec->digbeep_nid > 0) { |
| 3436 | hda_nid_t nid = spec->digbeep_nid; |
Takashi Iwai | 4d4e9bb | 2008-11-12 16:45:04 +0100 | [diff] [blame] | 3437 | unsigned int caps; |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3438 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3439 | err = stac_auto_create_beep_ctls(codec, nid); |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3440 | if (err < 0) |
| 3441 | return err; |
| 3442 | err = snd_hda_attach_beep_device(codec, nid); |
| 3443 | if (err < 0) |
| 3444 | return err; |
Takashi Iwai | d8d881d | 2009-12-22 07:52:49 +0100 | [diff] [blame] | 3445 | if (codec->beep) { |
| 3446 | /* IDT/STAC codecs have linear beep tone parameter */ |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 3447 | codec->beep->linear_tone = spec->linear_tone_beep; |
Takashi Iwai | d8d881d | 2009-12-22 07:52:49 +0100 | [diff] [blame] | 3448 | /* if no beep switch is available, make its own one */ |
| 3449 | caps = query_amp_caps(codec, nid, HDA_OUTPUT); |
| 3450 | if (!(caps & AC_AMPCAP_MUTE)) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3451 | err = stac_beep_switch_ctl(codec); |
Takashi Iwai | d8d881d | 2009-12-22 07:52:49 +0100 | [diff] [blame] | 3452 | if (err < 0) |
| 3453 | return err; |
| 3454 | } |
Takashi Iwai | 4d4e9bb | 2008-11-12 16:45:04 +0100 | [diff] [blame] | 3455 | } |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3456 | } |
| 3457 | #endif |
| 3458 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3459 | if (spec->gpio_led) |
| 3460 | spec->gen.vmaster_mute.hook = stac_vmaster_hook; |
Maxim Levitsky | 0fb87bb | 2007-09-03 15:29:04 +0200 | [diff] [blame] | 3461 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3462 | if (spec->aloopback_ctl && |
| 3463 | snd_hda_get_bool_hint(codec, "loopback") == 1) { |
| 3464 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, spec->aloopback_ctl)) |
| 3465 | return -ENOMEM; |
Takashi Iwai | dc04d1b | 2009-03-06 10:00:05 +0100 | [diff] [blame] | 3466 | } |
Maxim Levitsky | 0fb87bb | 2007-09-03 15:29:04 +0200 | [diff] [blame] | 3467 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3468 | stac_init_power_map(codec); |
Takashi Iwai | 82bc955 | 2006-03-21 11:24:42 +0100 | [diff] [blame] | 3469 | |
| 3470 | return 0; |
| 3471 | } |
| 3472 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3473 | |
| 3474 | static int stac_init(struct hda_codec *codec) |
Richard Fish | 160ea0d | 2006-09-06 13:58:25 +0200 | [diff] [blame] | 3475 | { |
| 3476 | struct sigmatel_spec *spec = codec->spec; |
Takashi Iwai | f73d358 | 2008-11-25 08:21:51 +0100 | [diff] [blame] | 3477 | unsigned int gpio; |
Takashi Iwai | e4973e1 | 2008-11-18 09:32:42 +0100 | [diff] [blame] | 3478 | int i; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3479 | |
Takashi Iwai | 6565e4f | 2009-03-02 14:38:35 +0100 | [diff] [blame] | 3480 | /* override some hints */ |
| 3481 | stac_store_hints(codec); |
| 3482 | |
Takashi Iwai | f73d358 | 2008-11-25 08:21:51 +0100 | [diff] [blame] | 3483 | /* set up GPIO */ |
| 3484 | gpio = spec->gpio_data; |
| 3485 | /* turn on EAPD statically when spec->eapd_switch isn't set. |
| 3486 | * otherwise, unsol event will turn it on/off dynamically |
| 3487 | */ |
| 3488 | if (!spec->eapd_switch) |
| 3489 | gpio |= spec->eapd_mask; |
| 3490 | stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, gpio); |
| 3491 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3492 | snd_hda_gen_init(codec); |
Takashi Iwai | c882246 | 2012-05-15 09:11:36 +0200 | [diff] [blame] | 3493 | |
| 3494 | /* sync the power-map */ |
| 3495 | if (spec->num_pwrs) |
| 3496 | snd_hda_codec_write(codec, codec->afg, 0, |
| 3497 | AC_VERB_IDT_SET_POWER_MAP, |
| 3498 | spec->power_map_bits); |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3499 | |
| 3500 | /* power down inactive ADCs */ |
| 3501 | if (spec->powerdown_adcs) { |
| 3502 | for (i = 0; i < spec->gen.num_all_adcs; i++) { |
| 3503 | if (spec->active_adcs & (1 << i)) |
| 3504 | continue; |
| 3505 | snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0, |
| 3506 | AC_VERB_SET_POWER_STATE, |
| 3507 | AC_PWRST_D3); |
| 3508 | } |
| 3509 | } |
| 3510 | |
| 3511 | /* power down unused DACs */ |
| 3512 | for (i = 0; i < spec->gen.num_all_dacs; i++) { |
| 3513 | if (!snd_hda_get_nid_path(codec, spec->gen.all_dacs[i], 0)) |
| 3514 | snd_hda_codec_write(codec, spec->gen.all_dacs[i], 0, |
| 3515 | AC_VERB_SET_POWER_STATE, |
| 3516 | AC_PWRST_D3); |
| 3517 | } |
| 3518 | |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3519 | return 0; |
| 3520 | } |
| 3521 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3522 | static void stac_shutup(struct hda_codec *codec) |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 3523 | { |
| 3524 | struct sigmatel_spec *spec = codec->spec; |
| 3525 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3526 | snd_hda_shutup_pins(codec); |
Takashi Iwai | 167eae5 | 2009-11-06 15:47:50 +0100 | [diff] [blame] | 3527 | |
| 3528 | if (spec->eapd_mask) |
| 3529 | stac_gpio_set(codec, spec->gpio_mask, |
| 3530 | spec->gpio_dir, spec->gpio_data & |
| 3531 | ~spec->eapd_mask); |
| 3532 | } |
| 3533 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3534 | static void stac_free(struct hda_codec *codec) |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3535 | { |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3536 | struct sigmatel_spec *spec = codec->spec; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3537 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3538 | if (!spec) |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3539 | return; |
| 3540 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3541 | snd_hda_gen_spec_free(&spec->gen); |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3542 | kfree(spec); |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3543 | snd_hda_detach_beep_device(codec); |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3544 | } |
| 3545 | |
Takashi Iwai | 2d34e1b | 2008-11-28 14:35:16 +0100 | [diff] [blame] | 3546 | #ifdef CONFIG_PROC_FS |
| 3547 | static void stac92hd_proc_hook(struct snd_info_buffer *buffer, |
| 3548 | struct hda_codec *codec, hda_nid_t nid) |
| 3549 | { |
| 3550 | if (nid == codec->afg) |
| 3551 | snd_iprintf(buffer, "Power-Map: 0x%02x\n", |
Takashi Iwai | c882246 | 2012-05-15 09:11:36 +0200 | [diff] [blame] | 3552 | snd_hda_codec_read(codec, nid, 0, |
| 3553 | AC_VERB_IDT_GET_POWER_MAP, 0)); |
Takashi Iwai | 2d34e1b | 2008-11-28 14:35:16 +0100 | [diff] [blame] | 3554 | } |
| 3555 | |
| 3556 | static void analog_loop_proc_hook(struct snd_info_buffer *buffer, |
| 3557 | struct hda_codec *codec, |
| 3558 | unsigned int verb) |
| 3559 | { |
| 3560 | snd_iprintf(buffer, "Analog Loopback: 0x%02x\n", |
| 3561 | snd_hda_codec_read(codec, codec->afg, 0, verb, 0)); |
| 3562 | } |
| 3563 | |
| 3564 | /* stac92hd71bxx, stac92hd73xx */ |
| 3565 | static void stac92hd7x_proc_hook(struct snd_info_buffer *buffer, |
| 3566 | struct hda_codec *codec, hda_nid_t nid) |
| 3567 | { |
| 3568 | stac92hd_proc_hook(buffer, codec, nid); |
| 3569 | if (nid == codec->afg) |
| 3570 | analog_loop_proc_hook(buffer, codec, 0xfa0); |
| 3571 | } |
| 3572 | |
| 3573 | static void stac9205_proc_hook(struct snd_info_buffer *buffer, |
| 3574 | struct hda_codec *codec, hda_nid_t nid) |
| 3575 | { |
| 3576 | if (nid == codec->afg) |
| 3577 | analog_loop_proc_hook(buffer, codec, 0xfe0); |
| 3578 | } |
| 3579 | |
| 3580 | static void stac927x_proc_hook(struct snd_info_buffer *buffer, |
| 3581 | struct hda_codec *codec, hda_nid_t nid) |
| 3582 | { |
| 3583 | if (nid == codec->afg) |
| 3584 | analog_loop_proc_hook(buffer, codec, 0xfeb); |
| 3585 | } |
| 3586 | #else |
| 3587 | #define stac92hd_proc_hook NULL |
| 3588 | #define stac92hd7x_proc_hook NULL |
| 3589 | #define stac9205_proc_hook NULL |
| 3590 | #define stac927x_proc_hook NULL |
| 3591 | #endif |
| 3592 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3593 | #ifdef CONFIG_PM |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3594 | static int stac_resume(struct hda_codec *codec) |
Matt | ff6fdc3 | 2005-06-27 15:06:52 +0200 | [diff] [blame] | 3595 | { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3596 | codec->patch_ops.init(codec); |
Takashi Iwai | 82beb8f | 2007-08-10 17:09:26 +0200 | [diff] [blame] | 3597 | snd_hda_codec_resume_amp(codec); |
| 3598 | snd_hda_codec_resume_cache(codec); |
Matt | ff6fdc3 | 2005-06-27 15:06:52 +0200 | [diff] [blame] | 3599 | return 0; |
| 3600 | } |
Matthew Ranostay | c6798d2 | 2008-11-18 20:54:17 -0500 | [diff] [blame] | 3601 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3602 | static int stac_suspend(struct hda_codec *codec) |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 3603 | { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3604 | stac_shutup(codec); |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 3605 | return 0; |
| 3606 | } |
| 3607 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3608 | static void stac_set_power_state(struct hda_codec *codec, hda_nid_t fg, |
| 3609 | unsigned int power_state) |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 3610 | { |
| 3611 | unsigned int afg_power_state = power_state; |
| 3612 | struct sigmatel_spec *spec = codec->spec; |
| 3613 | |
| 3614 | if (power_state == AC_PWRST_D3) { |
Takashi Iwai | f1a7374 | 2011-12-04 13:44:06 +0100 | [diff] [blame] | 3615 | if (spec->vref_mute_led_nid) { |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 3616 | /* with vref-out pin used for mute led control |
| 3617 | * codec AFG is prevented from D3 state |
| 3618 | */ |
| 3619 | afg_power_state = AC_PWRST_D1; |
| 3620 | } |
| 3621 | /* this delay seems necessary to avoid click noise at power-down */ |
| 3622 | msleep(100); |
| 3623 | } |
| 3624 | snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, |
| 3625 | afg_power_state); |
| 3626 | snd_hda_codec_set_power_to_all(codec, fg, power_state, true); |
| 3627 | } |
Takashi Iwai | 350eba43 | 2012-03-16 16:09:03 +0100 | [diff] [blame] | 3628 | #else |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3629 | #define stac_suspend NULL |
| 3630 | #define stac_resume NULL |
| 3631 | #define stac_set_power_state NULL |
Takashi Iwai | 2faa3bf | 2012-03-12 12:30:22 +0100 | [diff] [blame] | 3632 | #endif /* CONFIG_PM */ |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 3633 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3634 | static const struct hda_codec_ops stac_patch_ops = { |
| 3635 | .build_controls = snd_hda_gen_build_controls, |
| 3636 | .build_pcms = snd_hda_gen_build_pcms, |
| 3637 | .init = stac_init, |
| 3638 | .free = stac_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 3639 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3640 | #ifdef CONFIG_PM |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3641 | .suspend = stac_suspend, |
| 3642 | .resume = stac_resume, |
Matt | ff6fdc3 | 2005-06-27 15:06:52 +0200 | [diff] [blame] | 3643 | #endif |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3644 | .reboot_notify = stac_shutup, |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3645 | }; |
| 3646 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3647 | static int alloc_stac_spec(struct hda_codec *codec) |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3648 | { |
| 3649 | struct sigmatel_spec *spec; |
| 3650 | |
| 3651 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 3652 | if (!spec) |
| 3653 | return -ENOMEM; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3654 | snd_hda_gen_spec_init(&spec->gen); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3655 | codec->spec = spec; |
| 3656 | codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */ |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3657 | return 0; |
| 3658 | } |
| 3659 | |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3660 | static int patch_stac9200(struct hda_codec *codec) |
| 3661 | { |
| 3662 | struct sigmatel_spec *spec; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3663 | int err; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3664 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3665 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3666 | if (err < 0) |
| 3667 | return err; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3668 | |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3669 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 3670 | spec->linear_tone_beep = 1; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3671 | spec->gen.own_eapd_ctl = 1; |
| 3672 | |
| 3673 | codec->patch_ops = stac_patch_ops; |
| 3674 | |
| 3675 | snd_hda_add_verbs(codec, stac9200_eapd_init); |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 3676 | |
| 3677 | snd_hda_pick_fixup(codec, stac9200_models, stac9200_fixup_tbl, |
| 3678 | stac9200_fixups); |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 3679 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 117f257 | 2008-03-18 09:53:23 +0100 | [diff] [blame] | 3680 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3681 | err = stac_parse_auto_config(codec); |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3682 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3683 | stac_free(codec); |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3684 | return err; |
| 3685 | } |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3686 | |
Takashi Iwai | d39a3ae | 2013-01-14 14:06:26 +0100 | [diff] [blame] | 3687 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 3688 | |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3689 | return 0; |
| 3690 | } |
| 3691 | |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 3692 | static int patch_stac925x(struct hda_codec *codec) |
| 3693 | { |
| 3694 | struct sigmatel_spec *spec; |
| 3695 | int err; |
| 3696 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3697 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3698 | if (err < 0) |
| 3699 | return err; |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 3700 | |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3701 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 3702 | spec->linear_tone_beep = 1; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3703 | spec->gen.own_eapd_ctl = 1; |
| 3704 | |
| 3705 | codec->patch_ops = stac_patch_ops; |
| 3706 | |
| 3707 | snd_hda_add_verbs(codec, stac925x_core_init); |
Mauro Carvalho Chehab | 9cb36c2 | 2008-08-11 10:18:39 +0200 | [diff] [blame] | 3708 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 3709 | snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl, |
| 3710 | stac925x_fixups); |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 3711 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 3712 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3713 | err = stac_parse_auto_config(codec); |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 3714 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3715 | stac_free(codec); |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 3716 | return err; |
| 3717 | } |
| 3718 | |
Takashi Iwai | d2077d4 | 2013-01-14 14:20:16 +0100 | [diff] [blame] | 3719 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 3720 | |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 3721 | return 0; |
| 3722 | } |
| 3723 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3724 | static int patch_stac92hd73xx(struct hda_codec *codec) |
| 3725 | { |
| 3726 | struct sigmatel_spec *spec; |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3727 | int err; |
Takashi Iwai | c21ca4a | 2008-12-19 09:26:08 +0100 | [diff] [blame] | 3728 | int num_dacs; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3729 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3730 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3731 | if (err < 0) |
| 3732 | return err; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3733 | |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3734 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 3735 | spec->linear_tone_beep = 0; |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 3736 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3737 | num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; |
Takashi Iwai | c21ca4a | 2008-12-19 09:26:08 +0100 | [diff] [blame] | 3738 | if (num_dacs < 3 || num_dacs > 5) { |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3739 | printk(KERN_WARNING "hda_codec: Could not determine " |
| 3740 | "number of channels defaulting to DAC count\n"); |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3741 | num_dacs = 5; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3742 | } |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 3743 | |
Takashi Iwai | c21ca4a | 2008-12-19 09:26:08 +0100 | [diff] [blame] | 3744 | switch (num_dacs) { |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3745 | case 0x3: /* 6 Channel */ |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3746 | spec->aloopback_ctl = &stac92hd73xx_6ch_loopback; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3747 | break; |
| 3748 | case 0x4: /* 8 Channel */ |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3749 | spec->aloopback_ctl = &stac92hd73xx_8ch_loopback; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3750 | break; |
| 3751 | case 0x5: /* 10 Channel */ |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3752 | spec->aloopback_ctl = &stac92hd73xx_10ch_loopback; |
Takashi Iwai | d78d7a9 | 2009-03-02 14:26:25 +0100 | [diff] [blame] | 3753 | break; |
Takashi Iwai | c21ca4a | 2008-12-19 09:26:08 +0100 | [diff] [blame] | 3754 | } |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3755 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3756 | spec->aloopback_mask = 0x01; |
| 3757 | spec->aloopback_shift = 8; |
| 3758 | |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3759 | spec->digbeep_nid = 0x1c; |
Takashi Iwai | 6479c63 | 2009-07-28 18:20:25 +0200 | [diff] [blame] | 3760 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 3761 | /* GPIO0 High = Enable EAPD */ |
| 3762 | spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; |
| 3763 | spec->gpio_data = 0x01; |
Matthew Ranostay | 6b3ab21 | 2008-11-03 08:12:43 -0500 | [diff] [blame] | 3764 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 3765 | spec->eapd_switch = 1; |
Matthew Ranostay | a766264 | 2008-02-21 07:51:14 +0100 | [diff] [blame] | 3766 | |
Matthew Ranostay | a64135a | 2008-01-10 16:55:06 +0100 | [diff] [blame] | 3767 | spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids); |
| 3768 | spec->pwr_nids = stac92hd73xx_pwr_nids; |
| 3769 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3770 | spec->gen.own_eapd_ctl = 1; |
| 3771 | |
| 3772 | codec->patch_ops = stac_patch_ops; |
| 3773 | |
| 3774 | snd_hda_pick_fixup(codec, stac92hd73xx_models, stac92hd73xx_fixup_tbl, |
| 3775 | stac92hd73xx_fixups); |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 3776 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 3777 | |
| 3778 | if (!spec->volknob_init) |
| 3779 | snd_hda_add_verbs(codec, stac92hd73xx_core_init); |
| 3780 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3781 | err = stac_parse_auto_config(codec); |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3782 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3783 | stac_free(codec); |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3784 | return err; |
| 3785 | } |
| 3786 | |
Takashi Iwai | 2d34e1b | 2008-11-28 14:35:16 +0100 | [diff] [blame] | 3787 | codec->proc_widget_hook = stac92hd7x_proc_hook; |
| 3788 | |
Takashi Iwai | 55e3014 | 2013-01-14 17:30:04 +0100 | [diff] [blame] | 3789 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 3790 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3791 | return 0; |
| 3792 | } |
| 3793 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3794 | static void stac_setup_gpio(struct hda_codec *codec) |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 3795 | { |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3796 | struct sigmatel_spec *spec = codec->spec; |
Vitaliy Kulikov | e108c7b | 2010-01-28 19:21:07 +0100 | [diff] [blame] | 3797 | |
Takashi Iwai | b4e8187 | 2009-11-18 17:20:24 +0100 | [diff] [blame] | 3798 | if (spec->gpio_led) { |
Takashi Iwai | f1a7374 | 2011-12-04 13:44:06 +0100 | [diff] [blame] | 3799 | if (!spec->vref_mute_led_nid) { |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 3800 | spec->gpio_mask |= spec->gpio_led; |
| 3801 | spec->gpio_dir |= spec->gpio_led; |
| 3802 | spec->gpio_data |= spec->gpio_led; |
| 3803 | } else { |
| 3804 | codec->patch_ops.set_power_state = |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3805 | stac_set_power_state; |
Vitaliy Kulikov | 45eebda | 2011-07-26 16:56:20 -0500 | [diff] [blame] | 3806 | } |
Takashi Iwai | b4e8187 | 2009-11-18 17:20:24 +0100 | [diff] [blame] | 3807 | } |
Takashi Iwai | b4e8187 | 2009-11-18 17:20:24 +0100 | [diff] [blame] | 3808 | |
Takashi Iwai | 62cbde1 | 2012-09-14 11:58:54 +0200 | [diff] [blame] | 3809 | if (spec->mic_mute_led_gpio) { |
| 3810 | spec->gpio_mask |= spec->mic_mute_led_gpio; |
| 3811 | spec->gpio_dir |= spec->mic_mute_led_gpio; |
| 3812 | spec->mic_mute_led_on = true; |
| 3813 | spec->gpio_data |= spec->mic_mute_led_gpio; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3814 | |
Takashi Iwai | a90229e | 2013-01-18 14:10:00 +0100 | [diff] [blame^] | 3815 | spec->gen.cap_sync_hook = stac_capture_led_hook; |
Takashi Iwai | 62cbde1 | 2012-09-14 11:58:54 +0200 | [diff] [blame] | 3816 | } |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3817 | } |
| 3818 | |
| 3819 | static int patch_stac92hd83xxx(struct hda_codec *codec) |
| 3820 | { |
| 3821 | struct sigmatel_spec *spec; |
| 3822 | int err; |
| 3823 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3824 | err = alloc_stac_spec(codec); |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3825 | if (err < 0) |
| 3826 | return err; |
| 3827 | |
| 3828 | codec->epss = 0; /* longer delay needed for D3 */ |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3829 | |
| 3830 | spec = codec->spec; |
| 3831 | spec->linear_tone_beep = 0; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3832 | spec->gen.own_eapd_ctl = 1; |
| 3833 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3834 | spec->digbeep_nid = 0x21; |
| 3835 | spec->pwr_nids = stac92hd83xxx_pwr_nids; |
| 3836 | spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3837 | spec->default_polarity = -1; /* no default cfg */ |
| 3838 | |
| 3839 | codec->patch_ops = stac_patch_ops; |
| 3840 | |
| 3841 | snd_hda_add_verbs(codec, stac92hd83xxx_core_init); |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3842 | |
| 3843 | snd_hda_pick_fixup(codec, stac92hd83xxx_models, stac92hd83xxx_fixup_tbl, |
| 3844 | stac92hd83xxx_fixups); |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3845 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 3846 | |
| 3847 | stac_setup_gpio(codec); |
Takashi Iwai | 62cbde1 | 2012-09-14 11:58:54 +0200 | [diff] [blame] | 3848 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3849 | err = stac_parse_auto_config(codec); |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 3850 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3851 | stac_free(codec); |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 3852 | return err; |
| 3853 | } |
| 3854 | |
Takashi Iwai | 2d34e1b | 2008-11-28 14:35:16 +0100 | [diff] [blame] | 3855 | codec->proc_widget_hook = stac92hd_proc_hook; |
| 3856 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3857 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 3858 | |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 3859 | return 0; |
| 3860 | } |
| 3861 | |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3862 | static int patch_stac92hd71bxx(struct hda_codec *codec) |
| 3863 | { |
| 3864 | struct sigmatel_spec *spec; |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 3865 | const struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init; |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3866 | int err; |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3867 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3868 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3869 | if (err < 0) |
| 3870 | return err; |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3871 | |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3872 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 3873 | spec->linear_tone_beep = 0; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3874 | spec->gen.own_eapd_ctl = 1; |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3875 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3876 | codec->patch_ops = stac_patch_ops; |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 3877 | |
| 3878 | /* GPIO0 = EAPD */ |
| 3879 | spec->gpio_mask = 0x01; |
| 3880 | spec->gpio_dir = 0x01; |
| 3881 | spec->gpio_data = 0x01; |
Takashi Iwai | 41c3b64 | 2008-11-18 10:45:15 +0100 | [diff] [blame] | 3882 | |
Matthew Ranostay | 541eee8 | 2007-12-14 12:08:04 +0100 | [diff] [blame] | 3883 | switch (codec->vendor_id) { |
| 3884 | case 0x111d76b6: /* 4 Port without Analog Mixer */ |
| 3885 | case 0x111d76b7: |
Herton Ronaldo Krzesinski | 23c7b52 | 2009-02-08 19:51:28 -0200 | [diff] [blame] | 3886 | unmute_init++; |
Matthew Ranostay | 541eee8 | 2007-12-14 12:08:04 +0100 | [diff] [blame] | 3887 | break; |
Matthew Ranostay | aafc441 | 2008-06-13 18:04:33 +0200 | [diff] [blame] | 3888 | case 0x111d7608: /* 5 Port with Analog Mixer */ |
Matthew Ranostay | 8daaaa9 | 2008-08-15 07:45:52 +0200 | [diff] [blame] | 3889 | if ((codec->revision_id & 0xf) == 0 || |
Takashi Iwai | 8c2f767 | 2008-12-01 11:54:35 +0100 | [diff] [blame] | 3890 | (codec->revision_id & 0xf) == 1) |
Matthew Ranostay | 8daaaa9 | 2008-08-15 07:45:52 +0200 | [diff] [blame] | 3891 | spec->stream_delay = 40; /* 40 milliseconds */ |
Matthew Ranostay | 8daaaa9 | 2008-08-15 07:45:52 +0200 | [diff] [blame] | 3892 | |
Matthew Ranostay | aafc441 | 2008-06-13 18:04:33 +0200 | [diff] [blame] | 3893 | /* disable VSW */ |
Matthew Ranostay | ca8d33f | 2009-01-26 09:33:52 -0500 | [diff] [blame] | 3894 | unmute_init++; |
Takashi Iwai | 330ee99 | 2009-02-20 14:33:36 +0100 | [diff] [blame] | 3895 | snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); |
| 3896 | snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); |
Matthew Ranostay | aafc441 | 2008-06-13 18:04:33 +0200 | [diff] [blame] | 3897 | break; |
| 3898 | case 0x111d7603: /* 6 Port with Analog Mixer */ |
Takashi Iwai | 8c2f767 | 2008-12-01 11:54:35 +0100 | [diff] [blame] | 3899 | if ((codec->revision_id & 0xf) == 1) |
Matthew Ranostay | 8daaaa9 | 2008-08-15 07:45:52 +0200 | [diff] [blame] | 3900 | spec->stream_delay = 40; /* 40 milliseconds */ |
Matthew Ranostay | 8daaaa9 | 2008-08-15 07:45:52 +0200 | [diff] [blame] | 3901 | |
Takashi Iwai | 5207e10 | 2009-07-30 13:09:08 +0200 | [diff] [blame] | 3902 | break; |
Matthew Ranostay | 541eee8 | 2007-12-14 12:08:04 +0100 | [diff] [blame] | 3903 | } |
| 3904 | |
David Henningsson | 5e68fb3 | 2012-08-16 14:11:09 +0200 | [diff] [blame] | 3905 | if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB) |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 3906 | snd_hda_add_verbs(codec, stac92hd71bxx_core_init); |
David Henningsson | 5e68fb3 | 2012-08-16 14:11:09 +0200 | [diff] [blame] | 3907 | |
Matthew Ranostay | ca8d33f | 2009-01-26 09:33:52 -0500 | [diff] [blame] | 3908 | if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) |
| 3909 | snd_hda_sequence_write_cache(codec, unmute_init); |
| 3910 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3911 | spec->aloopback_ctl = &stac92hd71bxx_loopback; |
Matthew Ranostay | 4b33c76 | 2008-10-10 09:07:23 -0400 | [diff] [blame] | 3912 | spec->aloopback_mask = 0x50; |
Matthew Ranostay | 541eee8 | 2007-12-14 12:08:04 +0100 | [diff] [blame] | 3913 | spec->aloopback_shift = 0; |
| 3914 | |
Matthew Ranostay | 8daaaa9 | 2008-08-15 07:45:52 +0200 | [diff] [blame] | 3915 | spec->powerdown_adcs = 1; |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3916 | spec->digbeep_nid = 0x26; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3917 | spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids); |
Matthew Ranostay | aafc441 | 2008-06-13 18:04:33 +0200 | [diff] [blame] | 3918 | spec->pwr_nids = stac92hd71bxx_pwr_nids; |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3919 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3920 | snd_hda_pick_fixup(codec, stac92hd71bxx_models, stac92hd71bxx_fixup_tbl, |
| 3921 | stac92hd71bxx_fixups); |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 3922 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Vitaliy Kulikov | 5bdaaad | 2009-11-04 07:57:45 +0100 | [diff] [blame] | 3923 | |
Takashi Iwai | 372f8c7 | 2013-01-14 18:06:34 +0100 | [diff] [blame] | 3924 | stac_setup_gpio(codec); |
Matthew Ranostay | 6a14f58 | 2008-09-12 12:02:30 -0400 | [diff] [blame] | 3925 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3926 | err = stac_parse_auto_config(codec); |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3927 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3928 | stac_free(codec); |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3929 | return err; |
| 3930 | } |
| 3931 | |
Takashi Iwai | 2d34e1b | 2008-11-28 14:35:16 +0100 | [diff] [blame] | 3932 | codec->proc_widget_hook = stac92hd7x_proc_hook; |
| 3933 | |
Takashi Iwai | 0f6fcb7 | 2013-01-14 17:05:25 +0100 | [diff] [blame] | 3934 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 3935 | |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3936 | return 0; |
Takashi Iwai | 86d190e | 2009-05-26 15:18:58 +0200 | [diff] [blame] | 3937 | } |
Matthew Ranostay | e035b84 | 2007-11-06 11:53:55 +0100 | [diff] [blame] | 3938 | |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3939 | static int patch_stac922x(struct hda_codec *codec) |
| 3940 | { |
| 3941 | struct sigmatel_spec *spec; |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 3942 | int err; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3943 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3944 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3945 | if (err < 0) |
| 3946 | return err; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3947 | |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3948 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 3949 | spec->linear_tone_beep = 1; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3950 | spec->gen.own_eapd_ctl = 1; |
Ivan N. Zlatev | 5d5d3bc | 2007-05-29 16:03:00 +0200 | [diff] [blame] | 3951 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3952 | codec->patch_ops = stac_patch_ops; |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 3953 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 3954 | snd_hda_add_verbs(codec, stac922x_core_init); |
| 3955 | |
Takashi Iwai | 807a4636 | 2007-05-29 19:01:37 +0200 | [diff] [blame] | 3956 | /* Fix Mux capture level; max to 2 */ |
| 3957 | snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, |
| 3958 | (0 << AC_AMPCAP_OFFSET_SHIFT) | |
| 3959 | (2 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 3960 | (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 3961 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 3962 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3963 | snd_hda_pick_fixup(codec, stac922x_models, stac922x_fixup_tbl, |
| 3964 | stac922x_fixups); |
| 3965 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 3966 | |
| 3967 | err = stac_parse_auto_config(codec); |
| 3968 | if (err < 0) { |
| 3969 | stac_free(codec); |
| 3970 | return err; |
| 3971 | } |
| 3972 | |
Takashi Iwai | 0a42784 | 2013-01-14 15:20:13 +0100 | [diff] [blame] | 3973 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 3974 | |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 3975 | return 0; |
| 3976 | } |
| 3977 | |
| 3978 | static int patch_stac927x(struct hda_codec *codec) |
| 3979 | { |
| 3980 | struct sigmatel_spec *spec; |
| 3981 | int err; |
| 3982 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3983 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3984 | if (err < 0) |
| 3985 | return err; |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 3986 | |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 3987 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 3988 | spec->linear_tone_beep = 1; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3989 | spec->gen.own_eapd_ctl = 1; |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 3990 | |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 3991 | spec->digbeep_nid = 0x23; |
Matthew Ranostay | 8e9068b | 2007-12-17 11:58:13 +0100 | [diff] [blame] | 3992 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 3993 | /* GPIO0 High = Enable EAPD */ |
| 3994 | spec->eapd_mask = spec->gpio_mask = 0x01; |
| 3995 | spec->gpio_dir = spec->gpio_data = 0x01; |
Takashi Iwai | af6ee30 | 2009-09-14 15:03:12 +0200 | [diff] [blame] | 3996 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 3997 | spec->aloopback_ctl = &stac927x_loopback; |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 3998 | spec->aloopback_mask = 0x40; |
| 3999 | spec->aloopback_shift = 0; |
Matthew Ranostay | c0cea0d | 2008-11-16 11:42:34 -0500 | [diff] [blame] | 4000 | spec->eapd_switch = 1; |
Matthew Ranostay | 8e9068b | 2007-12-17 11:58:13 +0100 | [diff] [blame] | 4001 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4002 | codec->patch_ops = stac_patch_ops; |
| 4003 | |
| 4004 | snd_hda_pick_fixup(codec, stac927x_models, stac927x_fixup_tbl, |
| 4005 | stac927x_fixups); |
Takashi Iwai | f6655d5 | 2013-01-17 08:49:01 +0100 | [diff] [blame] | 4006 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 4007 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 4008 | if (!spec->volknob_init) |
| 4009 | snd_hda_add_verbs(codec, stac927x_core_init); |
| 4010 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4011 | err = stac_parse_auto_config(codec); |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 4012 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4013 | stac_free(codec); |
Matt | c7d4b2f | 2005-06-27 14:59:41 +0200 | [diff] [blame] | 4014 | return err; |
| 4015 | } |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 4016 | |
Takashi Iwai | 2d34e1b | 2008-11-28 14:35:16 +0100 | [diff] [blame] | 4017 | codec->proc_widget_hook = stac927x_proc_hook; |
| 4018 | |
Takashi Iwai | 5298765 | 2008-01-16 16:09:47 +0100 | [diff] [blame] | 4019 | /* |
| 4020 | * !!FIXME!! |
| 4021 | * The STAC927x seem to require fairly long delays for certain |
| 4022 | * command sequences. With too short delays (even if the answer |
| 4023 | * is set to RIRB properly), it results in the silence output |
| 4024 | * on some hardwares like Dell. |
| 4025 | * |
| 4026 | * The below flag enables the longer delay (see get_response |
| 4027 | * in hda_intel.c). |
| 4028 | */ |
| 4029 | codec->bus->needs_damn_long_delay = 1; |
| 4030 | |
Takashi Iwai | 29ac836 | 2013-01-14 16:03:38 +0100 | [diff] [blame] | 4031 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | e28d832 | 2008-12-17 13:48:29 +0100 | [diff] [blame] | 4032 | |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 4033 | return 0; |
| 4034 | } |
| 4035 | |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4036 | static int patch_stac9205(struct hda_codec *codec) |
| 4037 | { |
| 4038 | struct sigmatel_spec *spec; |
Takashi Iwai | 8259980 | 2007-07-31 15:56:24 +0200 | [diff] [blame] | 4039 | int err; |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4040 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4041 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 4042 | if (err < 0) |
| 4043 | return err; |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4044 | |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 4045 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 4046 | spec->linear_tone_beep = 1; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4047 | spec->gen.own_eapd_ctl = 1; |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4048 | |
Matthew Ranostay | 1cd2224 | 2008-07-18 18:20:52 +0200 | [diff] [blame] | 4049 | spec->digbeep_nid = 0x23; |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4050 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 4051 | snd_hda_add_verbs(codec, stac9205_core_init); |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4052 | spec->aloopback_ctl = &stac9205_loopback; |
Takashi Iwai | 6479c63 | 2009-07-28 18:20:25 +0200 | [diff] [blame] | 4053 | |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 4054 | spec->aloopback_mask = 0x40; |
| 4055 | spec->aloopback_shift = 0; |
Matthew Ranostay | 87d4836 | 2007-07-17 11:52:24 +0200 | [diff] [blame] | 4056 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 4057 | /* GPIO0 High = EAPD */ |
| 4058 | spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; |
| 4059 | spec->gpio_data = 0x01; |
Matt Porter | 3338240 | 2006-12-18 13:17:28 +0100 | [diff] [blame] | 4060 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 4061 | /* Turn on/off EAPD per HP plugging */ |
| 4062 | spec->eapd_switch = 1; |
Matthew Ranostay | 4fe5195c | 2008-01-29 15:28:44 +0100 | [diff] [blame] | 4063 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4064 | codec->patch_ops = stac_patch_ops; |
| 4065 | |
| 4066 | snd_hda_pick_fixup(codec, stac9205_models, stac9205_fixup_tbl, |
| 4067 | stac9205_fixups); |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 4068 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Matthew Ranostay | 87d4836 | 2007-07-17 11:52:24 +0200 | [diff] [blame] | 4069 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4070 | err = stac_parse_auto_config(codec); |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4071 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4072 | stac_free(codec); |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4073 | return err; |
| 4074 | } |
| 4075 | |
Takashi Iwai | 2d34e1b | 2008-11-28 14:35:16 +0100 | [diff] [blame] | 4076 | codec->proc_widget_hook = stac9205_proc_hook; |
| 4077 | |
Takashi Iwai | fe6322c | 2013-01-14 14:46:51 +0100 | [diff] [blame] | 4078 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 4079 | |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4080 | return 0; |
| 4081 | } |
| 4082 | |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 4083 | /* |
Guillaume Munch | 6d85906 | 2006-08-22 17:15:47 +0200 | [diff] [blame] | 4084 | * STAC9872 hack |
Takashi Iwai | db064e5 | 2006-03-16 16:04:58 +0100 | [diff] [blame] | 4085 | */ |
| 4086 | |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 4087 | static const struct hda_verb stac9872_core_init[] = { |
Takashi Iwai | 1624cb9 | 2007-07-05 13:10:51 +0200 | [diff] [blame] | 4088 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mic-sel: 0a,0d,14,02 */ |
Takashi Iwai | db064e5 | 2006-03-16 16:04:58 +0100 | [diff] [blame] | 4089 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Mic-in -> 0x9 */ |
| 4090 | {} |
| 4091 | }; |
| 4092 | |
Takashi Iwai | fc268c1 | 2013-01-14 14:29:36 +0100 | [diff] [blame] | 4093 | static const struct hda_pintbl stac9872_vaio_pin_configs[] = { |
| 4094 | { 0x0a, 0x03211020 }, |
| 4095 | { 0x0b, 0x411111f0 }, |
| 4096 | { 0x0c, 0x411111f0 }, |
| 4097 | { 0x0d, 0x03a15030 }, |
| 4098 | { 0x0e, 0x411111f0 }, |
| 4099 | { 0x0f, 0x90170110 }, |
| 4100 | { 0x11, 0x411111f0 }, |
| 4101 | { 0x13, 0x411111f0 }, |
| 4102 | { 0x14, 0x90a7013e }, |
| 4103 | {} |
Takashi Iwai | 307282c | 2009-03-12 18:17:58 +0100 | [diff] [blame] | 4104 | }; |
| 4105 | |
Takashi Iwai | fc268c1 | 2013-01-14 14:29:36 +0100 | [diff] [blame] | 4106 | static const struct hda_model_fixup stac9872_models[] = { |
| 4107 | { .id = STAC_9872_VAIO, .name = "vaio" }, |
| 4108 | {} |
Takashi Iwai | 307282c | 2009-03-12 18:17:58 +0100 | [diff] [blame] | 4109 | }; |
| 4110 | |
Takashi Iwai | fc268c1 | 2013-01-14 14:29:36 +0100 | [diff] [blame] | 4111 | static const struct hda_fixup stac9872_fixups[] = { |
| 4112 | [STAC_9872_VAIO] = { |
| 4113 | .type = HDA_FIXUP_PINS, |
| 4114 | .v.pins = stac9872_vaio_pin_configs, |
| 4115 | }, |
Takashi Iwai | 307282c | 2009-03-12 18:17:58 +0100 | [diff] [blame] | 4116 | }; |
| 4117 | |
Takashi Iwai | fc268c1 | 2013-01-14 14:29:36 +0100 | [diff] [blame] | 4118 | static const struct snd_pci_quirk stac9872_fixup_tbl[] = { |
Takashi Iwai | b04add9 | 2009-07-20 08:01:36 +0200 | [diff] [blame] | 4119 | SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0, |
| 4120 | "Sony VAIO F/S", STAC_9872_VAIO), |
Takashi Iwai | 307282c | 2009-03-12 18:17:58 +0100 | [diff] [blame] | 4121 | {} /* terminator */ |
| 4122 | }; |
| 4123 | |
Guillaume Munch | 6d85906 | 2006-08-22 17:15:47 +0200 | [diff] [blame] | 4124 | static int patch_stac9872(struct hda_codec *codec) |
Takashi Iwai | db064e5 | 2006-03-16 16:04:58 +0100 | [diff] [blame] | 4125 | { |
| 4126 | struct sigmatel_spec *spec; |
Takashi Iwai | 1e137f9 | 2009-01-21 07:41:22 +0100 | [diff] [blame] | 4127 | int err; |
Takashi Iwai | db064e5 | 2006-03-16 16:04:58 +0100 | [diff] [blame] | 4128 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4129 | err = alloc_stac_spec(codec); |
Takashi Iwai | 361dab3 | 2012-05-09 14:35:27 +0200 | [diff] [blame] | 4130 | if (err < 0) |
| 4131 | return err; |
| 4132 | |
| 4133 | spec = codec->spec; |
Daniel J Blueman | 1b0e372 | 2010-08-03 11:09:13 +0100 | [diff] [blame] | 4134 | spec->linear_tone_beep = 1; |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4135 | spec->gen.own_eapd_ctl = 1; |
| 4136 | |
| 4137 | codec->patch_ops = stac_patch_ops; |
| 4138 | |
| 4139 | snd_hda_add_verbs(codec, stac9872_core_init); |
Takashi Iwai | caa10b6 | 2009-01-20 17:19:01 +0100 | [diff] [blame] | 4140 | |
Takashi Iwai | fc268c1 | 2013-01-14 14:29:36 +0100 | [diff] [blame] | 4141 | snd_hda_pick_fixup(codec, stac9872_models, stac9872_fixup_tbl, |
| 4142 | stac9872_fixups); |
Takashi Iwai | fc268c1 | 2013-01-14 14:29:36 +0100 | [diff] [blame] | 4143 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | caa10b6 | 2009-01-20 17:19:01 +0100 | [diff] [blame] | 4144 | |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4145 | err = stac_parse_auto_config(codec); |
Takashi Iwai | 1e137f9 | 2009-01-21 07:41:22 +0100 | [diff] [blame] | 4146 | if (err < 0) { |
Takashi Iwai | 36c9db7 | 2013-01-17 17:07:59 +0100 | [diff] [blame] | 4147 | stac_free(codec); |
Takashi Iwai | 1e137f9 | 2009-01-21 07:41:22 +0100 | [diff] [blame] | 4148 | return -EINVAL; |
Takashi Iwai | caa10b6 | 2009-01-20 17:19:01 +0100 | [diff] [blame] | 4149 | } |
Takashi Iwai | fc268c1 | 2013-01-14 14:29:36 +0100 | [diff] [blame] | 4150 | |
| 4151 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
| 4152 | |
Takashi Iwai | db064e5 | 2006-03-16 16:04:58 +0100 | [diff] [blame] | 4153 | return 0; |
| 4154 | } |
| 4155 | |
| 4156 | |
| 4157 | /* |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 4158 | * patch entries |
| 4159 | */ |
Takashi Iwai | 2b63536 | 2011-05-02 12:33:43 +0200 | [diff] [blame] | 4160 | static const struct hda_codec_preset snd_hda_preset_sigmatel[] = { |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 4161 | { .id = 0x83847690, .name = "STAC9200", .patch = patch_stac9200 }, |
| 4162 | { .id = 0x83847882, .name = "STAC9220 A1", .patch = patch_stac922x }, |
| 4163 | { .id = 0x83847680, .name = "STAC9221 A1", .patch = patch_stac922x }, |
| 4164 | { .id = 0x83847880, .name = "STAC9220 A2", .patch = patch_stac922x }, |
| 4165 | { .id = 0x83847681, .name = "STAC9220D/9223D A2", .patch = patch_stac922x }, |
| 4166 | { .id = 0x83847682, .name = "STAC9221 A2", .patch = patch_stac922x }, |
| 4167 | { .id = 0x83847683, .name = "STAC9221D A2", .patch = patch_stac922x }, |
Matt Porter | 22a27c7 | 2006-07-06 18:49:10 +0200 | [diff] [blame] | 4168 | { .id = 0x83847618, .name = "STAC9227", .patch = patch_stac927x }, |
| 4169 | { .id = 0x83847619, .name = "STAC9227", .patch = patch_stac927x }, |
| 4170 | { .id = 0x83847616, .name = "STAC9228", .patch = patch_stac927x }, |
| 4171 | { .id = 0x83847617, .name = "STAC9228", .patch = patch_stac927x }, |
| 4172 | { .id = 0x83847614, .name = "STAC9229", .patch = patch_stac927x }, |
| 4173 | { .id = 0x83847615, .name = "STAC9229", .patch = patch_stac927x }, |
Matt Porter | 3cc08dc | 2006-01-23 15:27:49 +0100 | [diff] [blame] | 4174 | { .id = 0x83847620, .name = "STAC9274", .patch = patch_stac927x }, |
| 4175 | { .id = 0x83847621, .name = "STAC9274D", .patch = patch_stac927x }, |
| 4176 | { .id = 0x83847622, .name = "STAC9273X", .patch = patch_stac927x }, |
| 4177 | { .id = 0x83847623, .name = "STAC9273D", .patch = patch_stac927x }, |
| 4178 | { .id = 0x83847624, .name = "STAC9272X", .patch = patch_stac927x }, |
| 4179 | { .id = 0x83847625, .name = "STAC9272D", .patch = patch_stac927x }, |
| 4180 | { .id = 0x83847626, .name = "STAC9271X", .patch = patch_stac927x }, |
| 4181 | { .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x }, |
| 4182 | { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x }, |
| 4183 | { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x }, |
Tobin Davis | 8e21c34 | 2007-01-08 11:04:17 +0100 | [diff] [blame] | 4184 | { .id = 0x83847632, .name = "STAC9202", .patch = patch_stac925x }, |
| 4185 | { .id = 0x83847633, .name = "STAC9202D", .patch = patch_stac925x }, |
| 4186 | { .id = 0x83847634, .name = "STAC9250", .patch = patch_stac925x }, |
| 4187 | { .id = 0x83847635, .name = "STAC9250D", .patch = patch_stac925x }, |
| 4188 | { .id = 0x83847636, .name = "STAC9251", .patch = patch_stac925x }, |
| 4189 | { .id = 0x83847637, .name = "STAC9250D", .patch = patch_stac925x }, |
Takashi Iwai | 7bd3c0f | 2008-05-02 12:28:02 +0200 | [diff] [blame] | 4190 | { .id = 0x83847645, .name = "92HD206X", .patch = patch_stac927x }, |
| 4191 | { .id = 0x83847646, .name = "92HD206D", .patch = patch_stac927x }, |
Guillaume Munch | 6d85906 | 2006-08-22 17:15:47 +0200 | [diff] [blame] | 4192 | /* The following does not take into account .id=0x83847661 when subsys = |
| 4193 | * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are |
| 4194 | * currently not fully supported. |
| 4195 | */ |
| 4196 | { .id = 0x83847661, .name = "CXD9872RD/K", .patch = patch_stac9872 }, |
| 4197 | { .id = 0x83847662, .name = "STAC9872AK", .patch = patch_stac9872 }, |
| 4198 | { .id = 0x83847664, .name = "CXD9872AKD", .patch = patch_stac9872 }, |
Simos Xenitellis | a5c0f88 | 2009-06-10 16:33:31 +0100 | [diff] [blame] | 4199 | { .id = 0x83847698, .name = "STAC9205", .patch = patch_stac9205 }, |
Matt Porter | f3302a5 | 2006-07-31 12:49:34 +0200 | [diff] [blame] | 4200 | { .id = 0x838476a0, .name = "STAC9205", .patch = patch_stac9205 }, |
| 4201 | { .id = 0x838476a1, .name = "STAC9205D", .patch = patch_stac9205 }, |
| 4202 | { .id = 0x838476a2, .name = "STAC9204", .patch = patch_stac9205 }, |
| 4203 | { .id = 0x838476a3, .name = "STAC9204D", .patch = patch_stac9205 }, |
| 4204 | { .id = 0x838476a4, .name = "STAC9255", .patch = patch_stac9205 }, |
| 4205 | { .id = 0x838476a5, .name = "STAC9255D", .patch = patch_stac9205 }, |
| 4206 | { .id = 0x838476a6, .name = "STAC9254", .patch = patch_stac9205 }, |
| 4207 | { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 }, |
Matthew Ranostay | aafc441 | 2008-06-13 18:04:33 +0200 | [diff] [blame] | 4208 | { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx}, |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 4209 | { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx}, |
Vitaliy Kulikov | a9694fa | 2010-02-04 08:58:23 +0100 | [diff] [blame] | 4210 | { .id = 0x111d76d4, .name = "92HD83C1C5", .patch = patch_stac92hd83xxx}, |
Matthew Ranostay | d0513fc | 2008-07-27 10:30:30 +0200 | [diff] [blame] | 4211 | { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx}, |
Matthew Ranostay | ff2e733 | 2009-04-01 14:49:48 -0400 | [diff] [blame] | 4212 | { .id = 0x111d76d5, .name = "92HD81B1C5", .patch = patch_stac92hd83xxx}, |
Charles Chin | 8a345a0 | 2010-08-10 11:43:25 +0200 | [diff] [blame] | 4213 | { .id = 0x111d76d1, .name = "92HD87B1/3", .patch = patch_stac92hd83xxx}, |
| 4214 | { .id = 0x111d76d9, .name = "92HD87B2/4", .patch = patch_stac92hd83xxx}, |
Charles Chin | 3670600 | 2010-01-29 12:05:51 +0100 | [diff] [blame] | 4215 | { .id = 0x111d7666, .name = "92HD88B3", .patch = patch_stac92hd83xxx}, |
| 4216 | { .id = 0x111d7667, .name = "92HD88B1", .patch = patch_stac92hd83xxx}, |
| 4217 | { .id = 0x111d7668, .name = "92HD88B2", .patch = patch_stac92hd83xxx}, |
| 4218 | { .id = 0x111d7669, .name = "92HD88B4", .patch = patch_stac92hd83xxx}, |
Matthew Ranostay | aafc441 | 2008-06-13 18:04:33 +0200 | [diff] [blame] | 4219 | { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx}, |
Matthew Ranostay | 541eee8 | 2007-12-14 12:08:04 +0100 | [diff] [blame] | 4220 | { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx }, |
| 4221 | { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx }, |
Matthew Ranostay | e1f0d66 | 2007-12-13 17:47:21 +0100 | [diff] [blame] | 4222 | { .id = 0x111d7676, .name = "92HD73E1X5", .patch = patch_stac92hd73xx }, |
Matthew Ranostay | 541eee8 | 2007-12-14 12:08:04 +0100 | [diff] [blame] | 4223 | { .id = 0x111d76b0, .name = "92HD71B8X", .patch = patch_stac92hd71bxx }, |
| 4224 | { .id = 0x111d76b1, .name = "92HD71B8X", .patch = patch_stac92hd71bxx }, |
| 4225 | { .id = 0x111d76b2, .name = "92HD71B7X", .patch = patch_stac92hd71bxx }, |
| 4226 | { .id = 0x111d76b3, .name = "92HD71B7X", .patch = patch_stac92hd71bxx }, |
| 4227 | { .id = 0x111d76b4, .name = "92HD71B6X", .patch = patch_stac92hd71bxx }, |
| 4228 | { .id = 0x111d76b5, .name = "92HD71B6X", .patch = patch_stac92hd71bxx }, |
| 4229 | { .id = 0x111d76b6, .name = "92HD71B5X", .patch = patch_stac92hd71bxx }, |
| 4230 | { .id = 0x111d76b7, .name = "92HD71B5X", .patch = patch_stac92hd71bxx }, |
Charles Chin | 4d8ec5f | 2010-08-19 08:06:16 +0200 | [diff] [blame] | 4231 | { .id = 0x111d76c0, .name = "92HD89C3", .patch = patch_stac92hd73xx }, |
| 4232 | { .id = 0x111d76c1, .name = "92HD89C2", .patch = patch_stac92hd73xx }, |
| 4233 | { .id = 0x111d76c2, .name = "92HD89C1", .patch = patch_stac92hd73xx }, |
| 4234 | { .id = 0x111d76c3, .name = "92HD89B3", .patch = patch_stac92hd73xx }, |
| 4235 | { .id = 0x111d76c4, .name = "92HD89B2", .patch = patch_stac92hd73xx }, |
| 4236 | { .id = 0x111d76c5, .name = "92HD89B1", .patch = patch_stac92hd73xx }, |
| 4237 | { .id = 0x111d76c6, .name = "92HD89E3", .patch = patch_stac92hd73xx }, |
| 4238 | { .id = 0x111d76c7, .name = "92HD89E2", .patch = patch_stac92hd73xx }, |
| 4239 | { .id = 0x111d76c8, .name = "92HD89E1", .patch = patch_stac92hd73xx }, |
| 4240 | { .id = 0x111d76c9, .name = "92HD89D3", .patch = patch_stac92hd73xx }, |
| 4241 | { .id = 0x111d76ca, .name = "92HD89D2", .patch = patch_stac92hd73xx }, |
| 4242 | { .id = 0x111d76cb, .name = "92HD89D1", .patch = patch_stac92hd73xx }, |
| 4243 | { .id = 0x111d76cc, .name = "92HD89F3", .patch = patch_stac92hd73xx }, |
| 4244 | { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx }, |
| 4245 | { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx }, |
David Henningsson | 46724c2 | 2011-09-20 09:02:22 +0200 | [diff] [blame] | 4246 | { .id = 0x111d76df, .name = "92HD93BXX", .patch = patch_stac92hd83xxx}, |
Vitaliy Kulikov | ab5a6eb | 2010-09-08 09:00:17 +0200 | [diff] [blame] | 4247 | { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx}, |
Vitaliy Kulikov | 4dfb8a4 | 2011-02-22 17:32:19 -0600 | [diff] [blame] | 4248 | { .id = 0x111d76e3, .name = "92HD98BXX", .patch = patch_stac92hd83xxx}, |
| 4249 | { .id = 0x111d76e5, .name = "92HD99BXX", .patch = patch_stac92hd83xxx}, |
Vitaliy Kulikov | ab5a6eb | 2010-09-08 09:00:17 +0200 | [diff] [blame] | 4250 | { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx}, |
Charles Chin | ad5d875 | 2011-11-02 07:56:58 +0100 | [diff] [blame] | 4251 | { .id = 0x111d76e8, .name = "92HD66B1X5", .patch = patch_stac92hd83xxx}, |
| 4252 | { .id = 0x111d76e9, .name = "92HD66B2X5", .patch = patch_stac92hd83xxx}, |
| 4253 | { .id = 0x111d76ea, .name = "92HD66B3X5", .patch = patch_stac92hd83xxx}, |
| 4254 | { .id = 0x111d76eb, .name = "92HD66C1X5", .patch = patch_stac92hd83xxx}, |
| 4255 | { .id = 0x111d76ec, .name = "92HD66C2X5", .patch = patch_stac92hd83xxx}, |
| 4256 | { .id = 0x111d76ed, .name = "92HD66C3X5", .patch = patch_stac92hd83xxx}, |
| 4257 | { .id = 0x111d76ee, .name = "92HD66B1X3", .patch = patch_stac92hd83xxx}, |
| 4258 | { .id = 0x111d76ef, .name = "92HD66B2X3", .patch = patch_stac92hd83xxx}, |
| 4259 | { .id = 0x111d76f0, .name = "92HD66B3X3", .patch = patch_stac92hd83xxx}, |
| 4260 | { .id = 0x111d76f1, .name = "92HD66C1X3", .patch = patch_stac92hd83xxx}, |
| 4261 | { .id = 0x111d76f2, .name = "92HD66C2X3", .patch = patch_stac92hd83xxx}, |
| 4262 | { .id = 0x111d76f3, .name = "92HD66C3/65", .patch = patch_stac92hd83xxx}, |
Matt | 2f2f425 | 2005-04-13 14:45:30 +0200 | [diff] [blame] | 4263 | {} /* terminator */ |
| 4264 | }; |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 4265 | |
| 4266 | MODULE_ALIAS("snd-hda-codec-id:8384*"); |
| 4267 | MODULE_ALIAS("snd-hda-codec-id:111d*"); |
| 4268 | |
| 4269 | MODULE_LICENSE("GPL"); |
| 4270 | MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec"); |
| 4271 | |
| 4272 | static struct hda_codec_preset_list sigmatel_list = { |
| 4273 | .preset = snd_hda_preset_sigmatel, |
| 4274 | .owner = THIS_MODULE, |
| 4275 | }; |
| 4276 | |
| 4277 | static int __init patch_sigmatel_init(void) |
| 4278 | { |
| 4279 | return snd_hda_add_codec_preset(&sigmatel_list); |
| 4280 | } |
| 4281 | |
| 4282 | static void __exit patch_sigmatel_exit(void) |
| 4283 | { |
| 4284 | snd_hda_delete_codec_preset(&sigmatel_list); |
| 4285 | } |
| 4286 | |
| 4287 | module_init(patch_sigmatel_init) |
| 4288 | module_exit(patch_sigmatel_exit) |