aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-12-16 09:53:52 -0500
committerTakashi Iwai <tiwai@suse.de>2013-12-16 09:53:52 -0500
commitd09476018bee39495d6ece7a2e069de29a9c0ed5 (patch)
tree866fff4323f94681e6b423f269f0549df0a34066 /sound/pci/hda
parent337bb336b95bd7884fa3a194eafbdf52a0216b2e (diff)
parentafdcd431cebe3498db9aa963c780fdd5099917ec (diff)
Merge branch 'for-linus' into for-next
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_generic.c47
-rw-r--r--sound/pci/hda/hda_generic.h3
-rw-r--r--sound/pci/hda/hda_intel.c4
-rw-r--r--sound/pci/hda/patch_analog.c15
-rw-r--r--sound/pci/hda/patch_conexant.c1
-rw-r--r--sound/pci/hda/patch_hdmi.c32
-rw-r--r--sound/pci/hda/patch_realtek.c93
7 files changed, 161 insertions, 34 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 44be167d1cad..8cebdcfdcfdc 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -475,6 +475,20 @@ static void invalidate_nid_path(struct hda_codec *codec, int idx)
475 memset(path, 0, sizeof(*path)); 475 memset(path, 0, sizeof(*path));
476} 476}
477 477
478/* return a DAC if paired to the given pin by codec driver */
479static hda_nid_t get_preferred_dac(struct hda_codec *codec, hda_nid_t pin)
480{
481 struct hda_gen_spec *spec = codec->spec;
482 const hda_nid_t *list = spec->preferred_dacs;
483
484 if (!list)
485 return 0;
486 for (; *list; list += 2)
487 if (*list == pin)
488 return list[1];
489 return 0;
490}
491
478/* look for an empty DAC slot */ 492/* look for an empty DAC slot */
479static hda_nid_t look_for_dac(struct hda_codec *codec, hda_nid_t pin, 493static hda_nid_t look_for_dac(struct hda_codec *codec, hda_nid_t pin,
480 bool is_digital) 494 bool is_digital)
@@ -1193,7 +1207,14 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
1193 continue; 1207 continue;
1194 } 1208 }
1195 1209
1196 dacs[i] = look_for_dac(codec, pin, false); 1210 dacs[i] = get_preferred_dac(codec, pin);
1211 if (dacs[i]) {
1212 if (is_dac_already_used(codec, dacs[i]))
1213 badness += bad->shared_primary;
1214 }
1215
1216 if (!dacs[i])
1217 dacs[i] = look_for_dac(codec, pin, false);
1197 if (!dacs[i] && !i) { 1218 if (!dacs[i] && !i) {
1198 /* try to steal the DAC of surrounds for the front */ 1219 /* try to steal the DAC of surrounds for the front */
1199 for (j = 1; j < num_outs; j++) { 1220 for (j = 1; j < num_outs; j++) {
@@ -4302,6 +4323,26 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
4302 return AC_PWRST_D3; 4323 return AC_PWRST_D3;
4303} 4324}
4304 4325
4326/* mute all aamix inputs initially; parse up to the first leaves */
4327static void mute_all_mixer_nid(struct hda_codec *codec, hda_nid_t mix)
4328{
4329 int i, nums;
4330 const hda_nid_t *conn;
4331 bool has_amp;
4332
4333 nums = snd_hda_get_conn_list(codec, mix, &conn);
4334 has_amp = nid_has_mute(codec, mix, HDA_INPUT);
4335 for (i = 0; i < nums; i++) {
4336 if (has_amp)
4337 snd_hda_codec_amp_stereo(codec, mix,
4338 HDA_INPUT, i,
4339 0xff, HDA_AMP_MUTE);
4340 else if (nid_has_volume(codec, conn[i], HDA_OUTPUT))
4341 snd_hda_codec_amp_stereo(codec, conn[i],
4342 HDA_OUTPUT, 0,
4343 0xff, HDA_AMP_MUTE);
4344 }
4345}
4305 4346
4306/* 4347/*
4307 * Parse the given BIOS configuration and set up the hda_gen_spec 4348 * Parse the given BIOS configuration and set up the hda_gen_spec
@@ -4454,6 +4495,10 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
4454 } 4495 }
4455 } 4496 }
4456 4497
4498 /* mute all aamix input initially */
4499 if (spec->mixer_nid)
4500 mute_all_mixer_nid(codec, spec->mixer_nid);
4501
4457 dig_only: 4502 dig_only:
4458 parse_digital(codec); 4503 parse_digital(codec);
4459 4504
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 7e45cb44d151..0929a06df812 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -249,6 +249,9 @@ struct hda_gen_spec {
249 const struct badness_table *main_out_badness; 249 const struct badness_table *main_out_badness;
250 const struct badness_table *extra_out_badness; 250 const struct badness_table *extra_out_badness;
251 251
252 /* preferred pin/DAC pairs; an array of paired NIDs */
253 const hda_nid_t *preferred_dacs;
254
252 /* loopback mixing mode */ 255 /* loopback mixing mode */
253 bool aamix_mode; 256 bool aamix_mode;
254 257
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index af86c71f27bf..440c35546e57 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -3446,6 +3446,10 @@ static void check_probe_mask(struct azx *chip, int dev)
3446 * white/black-list for enable_msi 3446 * white/black-list for enable_msi
3447 */ 3447 */
3448static struct snd_pci_quirk msi_black_list[] = { 3448static struct snd_pci_quirk msi_black_list[] = {
3449 SND_PCI_QUIRK(0x103c, 0x2191, "HP", 0), /* AMD Hudson */
3450 SND_PCI_QUIRK(0x103c, 0x2192, "HP", 0), /* AMD Hudson */
3451 SND_PCI_QUIRK(0x103c, 0x21f7, "HP", 0), /* AMD Hudson */
3452 SND_PCI_QUIRK(0x103c, 0x21fa, "HP", 0), /* AMD Hudson */
3449 SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */ 3453 SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */
3450 SND_PCI_QUIRK(0x1043, 0x81f6, "ASUS", 0), /* nvidia */ 3454 SND_PCI_QUIRK(0x1043, 0x81f6, "ASUS", 0), /* nvidia */
3451 SND_PCI_QUIRK(0x1043, 0x822d, "ASUS", 0), /* Athlon64 X2 + nvidia MCP55 */ 3455 SND_PCI_QUIRK(0x1043, 0x822d, "ASUS", 0), /* Athlon64 X2 + nvidia MCP55 */
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 05280033c302..b174eb1567b8 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -147,6 +147,8 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled)
147 147
148 if (!spec->eapd_nid) 148 if (!spec->eapd_nid)
149 return; 149 return;
150 if (codec->inv_eapd)
151 enabled = !enabled;
150 snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, 152 snd_hda_codec_update_cache(codec, spec->eapd_nid, 0,
151 AC_VERB_SET_EAPD_BTLENABLE, 153 AC_VERB_SET_EAPD_BTLENABLE,
152 enabled ? 0x02 : 0x00); 154 enabled ? 0x02 : 0x00);
@@ -339,6 +341,14 @@ static int patch_ad1986a(struct hda_codec *codec)
339{ 341{
340 int err; 342 int err;
341 struct ad198x_spec *spec; 343 struct ad198x_spec *spec;
344 static hda_nid_t preferred_pairs[] = {
345 0x1a, 0x03,
346 0x1b, 0x03,
347 0x1c, 0x04,
348 0x1d, 0x05,
349 0x1e, 0x03,
350 0
351 };
342 352
343 err = alloc_ad_spec(codec); 353 err = alloc_ad_spec(codec);
344 if (err < 0) 354 if (err < 0)
@@ -359,6 +369,11 @@ static int patch_ad1986a(struct hda_codec *codec)
359 * So, let's disable the shared stream. 369 * So, let's disable the shared stream.
360 */ 370 */
361 spec->gen.multiout.no_share_stream = 1; 371 spec->gen.multiout.no_share_stream = 1;
372 /* give fixed DAC/pin pairs */
373 spec->gen.preferred_dacs = preferred_pairs;
374
375 /* AD1986A can't manage the dynamic pin on/off smoothly */
376 spec->gen.auto_mute_via_amp = 1;
362 377
363 snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, 378 snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl,
364 ad1986a_fixups); 379 ad1986a_fixups);
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 1f2717f817a0..3fbf2883e06e 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -2936,7 +2936,6 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
2936 SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), 2936 SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
2937 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), 2937 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
2938 SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD), 2938 SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD),
2939 SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD),
2940 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), 2939 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
2941 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), 2940 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS),
2942 SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), 2941 SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS),
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 1bd637b1dd0f..f5060fc7c303 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1142,32 +1142,34 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
1142 1142
1143static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll); 1143static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);
1144 1144
1145static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) 1145static void jack_callback(struct hda_codec *codec, struct hda_jack_tbl *jack)
1146{ 1146{
1147 struct hdmi_spec *spec = codec->spec; 1147 struct hdmi_spec *spec = codec->spec;
1148 int pin_idx = pin_nid_to_pin_index(spec, jack->nid);
1149 if (pin_idx < 0)
1150 return;
1151
1152 if (hdmi_present_sense(get_pin(spec, pin_idx), 1))
1153 snd_hda_jack_report_sync(codec);
1154}
1155
1156static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
1157{
1148 int tag = res >> AC_UNSOL_RES_TAG_SHIFT; 1158 int tag = res >> AC_UNSOL_RES_TAG_SHIFT;
1149 int pin_nid;
1150 int pin_idx;
1151 struct hda_jack_tbl *jack; 1159 struct hda_jack_tbl *jack;
1152 int dev_entry = (res & AC_UNSOL_RES_DE) >> AC_UNSOL_RES_DE_SHIFT; 1160 int dev_entry = (res & AC_UNSOL_RES_DE) >> AC_UNSOL_RES_DE_SHIFT;
1153 1161
1154 jack = snd_hda_jack_tbl_get_from_tag(codec, tag); 1162 jack = snd_hda_jack_tbl_get_from_tag(codec, tag);
1155 if (!jack) 1163 if (!jack)
1156 return; 1164 return;
1157 pin_nid = jack->nid;
1158 jack->jack_dirty = 1; 1165 jack->jack_dirty = 1;
1159 1166
1160 _snd_printd(SND_PR_VERBOSE, 1167 _snd_printd(SND_PR_VERBOSE,
1161 "HDMI hot plug event: Codec=%d Pin=%d Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n", 1168 "HDMI hot plug event: Codec=%d Pin=%d Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n",
1162 codec->addr, pin_nid, dev_entry, !!(res & AC_UNSOL_RES_IA), 1169 codec->addr, jack->nid, dev_entry, !!(res & AC_UNSOL_RES_IA),
1163 !!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV)); 1170 !!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV));
1164 1171
1165 pin_idx = pin_nid_to_pin_index(spec, pin_nid); 1172 jack_callback(codec, jack);
1166 if (pin_idx < 0)
1167 return;
1168
1169 if (hdmi_present_sense(get_pin(spec, pin_idx), 1))
1170 snd_hda_jack_report_sync(codec);
1171} 1173}
1172 1174
1173static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) 1175static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
@@ -2080,7 +2082,8 @@ static int generic_hdmi_init(struct hda_codec *codec)
2080 hda_nid_t pin_nid = per_pin->pin_nid; 2082 hda_nid_t pin_nid = per_pin->pin_nid;
2081 2083
2082 hdmi_init_pin(codec, pin_nid); 2084 hdmi_init_pin(codec, pin_nid);
2083 snd_hda_jack_detect_enable(codec, pin_nid, pin_nid); 2085 snd_hda_jack_detect_enable_callback(codec, pin_nid, pin_nid,
2086 codec->jackpoll_interval > 0 ? jack_callback : NULL);
2084 } 2087 }
2085 return 0; 2088 return 0;
2086} 2089}
@@ -2323,8 +2326,9 @@ static int simple_playback_build_controls(struct hda_codec *codec)
2323 int err; 2326 int err;
2324 2327
2325 per_cvt = get_cvt(spec, 0); 2328 per_cvt = get_cvt(spec, 0);
2326 err = snd_hda_create_spdif_out_ctls(codec, per_cvt->cvt_nid, 2329 err = snd_hda_create_dig_out_ctls(codec, per_cvt->cvt_nid,
2327 per_cvt->cvt_nid); 2330 per_cvt->cvt_nid,
2331 HDA_PCM_TYPE_HDMI);
2328 if (err < 0) 2332 if (err < 0)
2329 return err; 2333 return err;
2330 return simple_hdmi_build_jack(codec, 0); 2334 return simple_hdmi_build_jack(codec, 0);
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 518e6ceeed20..3578f11c8e12 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1827,6 +1827,7 @@ enum {
1827 ALC889_FIXUP_DAC_ROUTE, 1827 ALC889_FIXUP_DAC_ROUTE,
1828 ALC889_FIXUP_MBP_VREF, 1828 ALC889_FIXUP_MBP_VREF,
1829 ALC889_FIXUP_IMAC91_VREF, 1829 ALC889_FIXUP_IMAC91_VREF,
1830 ALC889_FIXUP_MBA21_VREF,
1830 ALC882_FIXUP_INV_DMIC, 1831 ALC882_FIXUP_INV_DMIC,
1831 ALC882_FIXUP_NO_PRIMARY_HP, 1832 ALC882_FIXUP_NO_PRIMARY_HP,
1832 ALC887_FIXUP_ASUS_BASS, 1833 ALC887_FIXUP_ASUS_BASS,
@@ -1931,17 +1932,13 @@ static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1931 } 1932 }
1932} 1933}
1933 1934
1934/* Set VREF on speaker pins on imac91 */ 1935static void alc889_fixup_mac_pins(struct hda_codec *codec,
1935static void alc889_fixup_imac91_vref(struct hda_codec *codec, 1936 const hda_nid_t *nids, int num_nids)
1936 const struct hda_fixup *fix, int action)
1937{ 1937{
1938 struct alc_spec *spec = codec->spec; 1938 struct alc_spec *spec = codec->spec;
1939 static hda_nid_t nids[2] = { 0x18, 0x1a };
1940 int i; 1939 int i;
1941 1940
1942 if (action != HDA_FIXUP_ACT_INIT) 1941 for (i = 0; i < num_nids; i++) {
1943 return;
1944 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1945 unsigned int val; 1942 unsigned int val;
1946 val = snd_hda_codec_get_pin_target(codec, nids[i]); 1943 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1947 val |= AC_PINCTL_VREF_50; 1944 val |= AC_PINCTL_VREF_50;
@@ -1950,6 +1947,26 @@ static void alc889_fixup_imac91_vref(struct hda_codec *codec,
1950 spec->gen.keep_vref_in_automute = 1; 1947 spec->gen.keep_vref_in_automute = 1;
1951} 1948}
1952 1949
1950/* Set VREF on speaker pins on imac91 */
1951static void alc889_fixup_imac91_vref(struct hda_codec *codec,
1952 const struct hda_fixup *fix, int action)
1953{
1954 static hda_nid_t nids[2] = { 0x18, 0x1a };
1955
1956 if (action == HDA_FIXUP_ACT_INIT)
1957 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1958}
1959
1960/* Set VREF on speaker pins on mba21 */
1961static void alc889_fixup_mba21_vref(struct hda_codec *codec,
1962 const struct hda_fixup *fix, int action)
1963{
1964 static hda_nid_t nids[2] = { 0x18, 0x19 };
1965
1966 if (action == HDA_FIXUP_ACT_INIT)
1967 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1968}
1969
1953/* Don't take HP output as primary 1970/* Don't take HP output as primary
1954 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio 1971 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
1955 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 1972 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
@@ -2149,6 +2166,12 @@ static const struct hda_fixup alc882_fixups[] = {
2149 .chained = true, 2166 .chained = true,
2150 .chain_id = ALC882_FIXUP_GPIO1, 2167 .chain_id = ALC882_FIXUP_GPIO1,
2151 }, 2168 },
2169 [ALC889_FIXUP_MBA21_VREF] = {
2170 .type = HDA_FIXUP_FUNC,
2171 .v.func = alc889_fixup_mba21_vref,
2172 .chained = true,
2173 .chain_id = ALC889_FIXUP_MBP_VREF,
2174 },
2152 [ALC882_FIXUP_INV_DMIC] = { 2175 [ALC882_FIXUP_INV_DMIC] = {
2153 .type = HDA_FIXUP_FUNC, 2176 .type = HDA_FIXUP_FUNC,
2154 .v.func = alc_fixup_inv_dmic_0x12, 2177 .v.func = alc_fixup_inv_dmic_0x12,
@@ -2219,7 +2242,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2219 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), 2242 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2220 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), 2243 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2221 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF), 2244 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF),
2222 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBP_VREF), 2245 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2223 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), 2246 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2224 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2247 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2225 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), 2248 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
@@ -3340,6 +3363,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
3340 alc_write_coef_idx(codec, 0x18, 0x7388); 3363 alc_write_coef_idx(codec, 0x18, 0x7388);
3341 break; 3364 break;
3342 case 0x10ec0668: 3365 case 0x10ec0668:
3366 alc_write_coef_idx(codec, 0x11, 0x0001);
3343 alc_write_coef_idx(codec, 0x15, 0x0d60); 3367 alc_write_coef_idx(codec, 0x15, 0x0d60);
3344 alc_write_coef_idx(codec, 0xc3, 0x0000); 3368 alc_write_coef_idx(codec, 0xc3, 0x0000);
3345 break; 3369 break;
@@ -3368,6 +3392,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
3368 alc_write_coef_idx(codec, 0x18, 0x7388); 3392 alc_write_coef_idx(codec, 0x18, 0x7388);
3369 break; 3393 break;
3370 case 0x10ec0668: 3394 case 0x10ec0668:
3395 alc_write_coef_idx(codec, 0x11, 0x0001);
3371 alc_write_coef_idx(codec, 0x15, 0x0d50); 3396 alc_write_coef_idx(codec, 0x15, 0x0d50);
3372 alc_write_coef_idx(codec, 0xc3, 0x0000); 3397 alc_write_coef_idx(codec, 0xc3, 0x0000);
3373 break; 3398 break;
@@ -3653,11 +3678,6 @@ static void alc283_hp_automute_hook(struct hda_codec *codec,
3653 vref); 3678 vref);
3654} 3679}
3655 3680
3656static void alc283_chromebook_caps(struct hda_codec *codec)
3657{
3658 snd_hda_override_wcaps(codec, 0x03, 0);
3659}
3660
3661static void alc283_fixup_chromebook(struct hda_codec *codec, 3681static void alc283_fixup_chromebook(struct hda_codec *codec,
3662 const struct hda_fixup *fix, int action) 3682 const struct hda_fixup *fix, int action)
3663{ 3683{
@@ -3666,9 +3686,26 @@ static void alc283_fixup_chromebook(struct hda_codec *codec,
3666 3686
3667 switch (action) { 3687 switch (action) {
3668 case HDA_FIXUP_ACT_PRE_PROBE: 3688 case HDA_FIXUP_ACT_PRE_PROBE:
3669 alc283_chromebook_caps(codec); 3689 snd_hda_override_wcaps(codec, 0x03, 0);
3670 /* Disable AA-loopback as it causes white noise */ 3690 /* Disable AA-loopback as it causes white noise */
3671 spec->gen.mixer_nid = 0; 3691 spec->gen.mixer_nid = 0;
3692 break;
3693 case HDA_FIXUP_ACT_INIT:
3694 /* Enable Line1 input control by verb */
3695 val = alc_read_coef_idx(codec, 0x1a);
3696 alc_write_coef_idx(codec, 0x1a, val | (1 << 4));
3697 break;
3698 }
3699}
3700
3701static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
3702 const struct hda_fixup *fix, int action)
3703{
3704 struct alc_spec *spec = codec->spec;
3705 int val;
3706
3707 switch (action) {
3708 case HDA_FIXUP_ACT_PRE_PROBE:
3672 spec->gen.hp_automute_hook = alc283_hp_automute_hook; 3709 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
3673 break; 3710 break;
3674 case HDA_FIXUP_ACT_INIT: 3711 case HDA_FIXUP_ACT_INIT:
@@ -3676,9 +3713,6 @@ static void alc283_fixup_chromebook(struct hda_codec *codec,
3676 /* Set to manual mode */ 3713 /* Set to manual mode */
3677 val = alc_read_coef_idx(codec, 0x06); 3714 val = alc_read_coef_idx(codec, 0x06);
3678 alc_write_coef_idx(codec, 0x06, val & ~0x000c); 3715 alc_write_coef_idx(codec, 0x06, val & ~0x000c);
3679 /* Enable Line1 input control by verb */
3680 val = alc_read_coef_idx(codec, 0x1a);
3681 alc_write_coef_idx(codec, 0x1a, val | (1 << 4));
3682 break; 3716 break;
3683 } 3717 }
3684} 3718}
@@ -3868,12 +3902,14 @@ enum {
3868 ALC269_FIXUP_ASUS_X101, 3902 ALC269_FIXUP_ASUS_X101,
3869 ALC271_FIXUP_AMIC_MIC2, 3903 ALC271_FIXUP_AMIC_MIC2,
3870 ALC271_FIXUP_HP_GATE_MIC_JACK, 3904 ALC271_FIXUP_HP_GATE_MIC_JACK,
3905 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
3871 ALC269_FIXUP_ACER_AC700, 3906 ALC269_FIXUP_ACER_AC700,
3872 ALC269_FIXUP_LIMIT_INT_MIC_BOOST, 3907 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
3873 ALC269VB_FIXUP_ASUS_ZENBOOK, 3908 ALC269VB_FIXUP_ASUS_ZENBOOK,
3874 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, 3909 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
3875 ALC269VB_FIXUP_ORDISSIMO_EVE2, 3910 ALC269VB_FIXUP_ORDISSIMO_EVE2,
3876 ALC283_FIXUP_CHROME_BOOK, 3911 ALC283_FIXUP_CHROME_BOOK,
3912 ALC283_FIXUP_SENSE_COMBO_JACK,
3877 ALC282_FIXUP_ASUS_TX300, 3913 ALC282_FIXUP_ASUS_TX300,
3878 ALC283_FIXUP_INT_MIC, 3914 ALC283_FIXUP_INT_MIC,
3879 ALC290_FIXUP_MONO_SPEAKERS, 3915 ALC290_FIXUP_MONO_SPEAKERS,
@@ -4129,6 +4165,12 @@ static const struct hda_fixup alc269_fixups[] = {
4129 .chained = true, 4165 .chained = true,
4130 .chain_id = ALC271_FIXUP_AMIC_MIC2, 4166 .chain_id = ALC271_FIXUP_AMIC_MIC2,
4131 }, 4167 },
4168 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
4169 .type = HDA_FIXUP_FUNC,
4170 .v.func = alc269_fixup_limit_int_mic_boost,
4171 .chained = true,
4172 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
4173 },
4132 [ALC269_FIXUP_ACER_AC700] = { 4174 [ALC269_FIXUP_ACER_AC700] = {
4133 .type = HDA_FIXUP_PINS, 4175 .type = HDA_FIXUP_PINS,
4134 .v.pins = (const struct hda_pintbl[]) { 4176 .v.pins = (const struct hda_pintbl[]) {
@@ -4173,6 +4215,12 @@ static const struct hda_fixup alc269_fixups[] = {
4173 .type = HDA_FIXUP_FUNC, 4215 .type = HDA_FIXUP_FUNC,
4174 .v.func = alc283_fixup_chromebook, 4216 .v.func = alc283_fixup_chromebook,
4175 }, 4217 },
4218 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
4219 .type = HDA_FIXUP_FUNC,
4220 .v.func = alc283_fixup_sense_combo_jack,
4221 .chained = true,
4222 .chain_id = ALC283_FIXUP_CHROME_BOOK,
4223 },
4176 [ALC282_FIXUP_ASUS_TX300] = { 4224 [ALC282_FIXUP_ASUS_TX300] = {
4177 .type = HDA_FIXUP_FUNC, 4225 .type = HDA_FIXUP_FUNC,
4178 .v.func = alc282_fixup_asus_tx300, 4226 .v.func = alc282_fixup_asus_tx300,
@@ -4220,6 +4268,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4220 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), 4268 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
4221 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), 4269 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
4222 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), 4270 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
4271 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
4223 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 4272 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
4224 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4273 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4225 SND_PCI_QUIRK(0x1028, 0x05be, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4274 SND_PCI_QUIRK(0x1028, 0x05be, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
@@ -4251,11 +4300,14 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4251 SND_PCI_QUIRK(0x1028, 0x0606, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4300 SND_PCI_QUIRK(0x1028, 0x0606, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4252 SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4301 SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4253 SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4302 SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4303 SND_PCI_QUIRK(0x1028, 0x0610, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4254 SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4304 SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4255 SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4305 SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4256 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS), 4306 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS),
4257 SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4307 SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4308 SND_PCI_QUIRK(0x1028, 0x0629, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4258 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS), 4309 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS),
4310 SND_PCI_QUIRK(0x1028, 0x063e, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4259 SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4311 SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4260 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4312 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4261 SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4313 SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
@@ -4264,7 +4316,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4264 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4316 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4265 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4317 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4266 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), 4318 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
4267 SND_PCI_QUIRK(0x103c, 0x21ed, "HP Falco Chromebook", ALC283_FIXUP_CHROME_BOOK),
4268 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), 4319 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
4269 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 4320 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
4270 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4321 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -4372,6 +4423,8 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
4372 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 4423 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
4373 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 4424 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
4374 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, 4425 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
4426 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-chrome"},
4427 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
4375 {} 4428 {}
4376}; 4429};
4377 4430
@@ -4612,6 +4665,7 @@ static const struct hda_fixup alc861_fixups[] = {
4612 4665
4613static const struct snd_pci_quirk alc861_fixup_tbl[] = { 4666static const struct snd_pci_quirk alc861_fixup_tbl[] = {
4614 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), 4667 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
4668 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
4615 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), 4669 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
4616 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), 4670 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
4617 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), 4671 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
@@ -5044,8 +5098,11 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
5044 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 5098 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
5045 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5099 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5046 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5100 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5101 SND_PCI_QUIRK(0x1028, 0x0623, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5102 SND_PCI_QUIRK(0x1028, 0x0624, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5047 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5103 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5048 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5104 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5105 SND_PCI_QUIRK(0x1028, 0x0628, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5049 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 5106 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
5050 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A_CHMAP), 5107 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A_CHMAP),
5051 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_CHMAP), 5108 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_CHMAP),