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