diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 1a83559f4cbd..7a426ed491f2 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); |
@@ -183,7 +185,7 @@ static const struct hda_codec_ops ad198x_auto_patch_ops = { | |||
183 | }; | 185 | }; |
184 | 186 | ||
185 | 187 | ||
186 | static int ad198x_parse_auto_config(struct hda_codec *codec) | 188 | static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) |
187 | { | 189 | { |
188 | struct ad198x_spec *spec = codec->spec; | 190 | struct ad198x_spec *spec = codec->spec; |
189 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | 191 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
@@ -193,7 +195,8 @@ static int ad198x_parse_auto_config(struct hda_codec *codec) | |||
193 | codec->no_trigger_sense = 1; | 195 | codec->no_trigger_sense = 1; |
194 | codec->no_sticky_stream = 1; | 196 | codec->no_sticky_stream = 1; |
195 | 197 | ||
196 | spec->gen.indep_hp = 1; | 198 | spec->gen.indep_hp = indep_hp; |
199 | spec->gen.add_stereo_mix_input = 1; | ||
197 | 200 | ||
198 | err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); | 201 | err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); |
199 | if (err < 0) | 202 | if (err < 0) |
@@ -278,11 +281,11 @@ static const struct hda_fixup ad1986a_fixups[] = { | |||
278 | .v.pins = (const struct hda_pintbl[]) { | 281 | .v.pins = (const struct hda_pintbl[]) { |
279 | { 0x1a, 0x02214021 }, /* headphone */ | 282 | { 0x1a, 0x02214021 }, /* headphone */ |
280 | { 0x1b, 0x01014011 }, /* front */ | 283 | { 0x1b, 0x01014011 }, /* front */ |
281 | { 0x1c, 0x01013012 }, /* surround */ | 284 | { 0x1c, 0x01813030 }, /* line-in */ |
282 | { 0x1d, 0x01019015 }, /* clfe */ | 285 | { 0x1d, 0x01a19020 }, /* rear mic */ |
283 | { 0x1e, 0x411111f0 }, /* N/A */ | 286 | { 0x1e, 0x411111f0 }, /* N/A */ |
284 | { 0x1f, 0x02a190f0 }, /* mic */ | 287 | { 0x1f, 0x02a190f0 }, /* mic */ |
285 | { 0x20, 0x018130f0 }, /* line-in */ | 288 | { 0x20, 0x411111f0 }, /* N/A */ |
286 | {} | 289 | {} |
287 | }, | 290 | }, |
288 | }, | 291 | }, |
@@ -338,6 +341,14 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
338 | { | 341 | { |
339 | int err; | 342 | int err; |
340 | 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 | }; | ||
341 | 352 | ||
342 | err = alloc_ad_spec(codec); | 353 | err = alloc_ad_spec(codec); |
343 | if (err < 0) | 354 | if (err < 0) |
@@ -358,12 +369,17 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
358 | * So, let's disable the shared stream. | 369 | * So, let's disable the shared stream. |
359 | */ | 370 | */ |
360 | 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; | ||
361 | 377 | ||
362 | snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, | 378 | snd_hda_pick_fixup(codec, ad1986a_fixup_models, ad1986a_fixup_tbl, |
363 | ad1986a_fixups); | 379 | ad1986a_fixups); |
364 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | 380 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
365 | 381 | ||
366 | err = ad198x_parse_auto_config(codec); | 382 | err = ad198x_parse_auto_config(codec, false); |
367 | if (err < 0) { | 383 | if (err < 0) { |
368 | snd_hda_gen_free(codec); | 384 | snd_hda_gen_free(codec); |
369 | return err; | 385 | return err; |
@@ -465,7 +481,7 @@ static int patch_ad1983(struct hda_codec *codec) | |||
465 | 481 | ||
466 | spec->gen.beep_nid = 0x10; | 482 | spec->gen.beep_nid = 0x10; |
467 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); | 483 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); |
468 | err = ad198x_parse_auto_config(codec); | 484 | err = ad198x_parse_auto_config(codec, false); |
469 | if (err < 0) | 485 | if (err < 0) |
470 | goto error; | 486 | goto error; |
471 | err = ad1983_add_spdif_mux_ctl(codec); | 487 | err = ad1983_add_spdif_mux_ctl(codec); |
@@ -552,7 +568,7 @@ static int patch_ad1981(struct hda_codec *codec) | |||
552 | snd_hda_pick_fixup(codec, NULL, ad1981_fixup_tbl, ad1981_fixups); | 568 | snd_hda_pick_fixup(codec, NULL, ad1981_fixup_tbl, ad1981_fixups); |
553 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | 569 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
554 | 570 | ||
555 | err = ad198x_parse_auto_config(codec); | 571 | err = ad198x_parse_auto_config(codec, false); |
556 | if (err < 0) | 572 | if (err < 0) |
557 | goto error; | 573 | goto error; |
558 | err = ad1983_add_spdif_mux_ctl(codec); | 574 | err = ad1983_add_spdif_mux_ctl(codec); |
@@ -878,7 +894,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
878 | snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups); | 894 | snd_hda_pick_fixup(codec, ad1988_fixup_models, NULL, ad1988_fixups); |
879 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | 895 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
880 | 896 | ||
881 | err = ad198x_parse_auto_config(codec); | 897 | err = ad198x_parse_auto_config(codec, true); |
882 | if (err < 0) | 898 | if (err < 0) |
883 | goto error; | 899 | goto error; |
884 | err = ad1988_add_spdif_mux_ctl(codec); | 900 | err = ad1988_add_spdif_mux_ctl(codec); |
@@ -962,6 +978,7 @@ static void ad1884_fixup_hp_eapd(struct hda_codec *codec, | |||
962 | switch (action) { | 978 | switch (action) { |
963 | case HDA_FIXUP_ACT_PRE_PROBE: | 979 | case HDA_FIXUP_ACT_PRE_PROBE: |
964 | spec->gen.vmaster_mute.hook = ad1884_vmaster_hp_gpio_hook; | 980 | spec->gen.vmaster_mute.hook = ad1884_vmaster_hp_gpio_hook; |
981 | spec->gen.own_eapd_ctl = 1; | ||
965 | snd_hda_sequence_write_cache(codec, gpio_init_verbs); | 982 | snd_hda_sequence_write_cache(codec, gpio_init_verbs); |
966 | break; | 983 | break; |
967 | case HDA_FIXUP_ACT_PROBE: | 984 | case HDA_FIXUP_ACT_PROBE: |
@@ -1054,7 +1071,7 @@ static int patch_ad1884(struct hda_codec *codec) | |||
1054 | snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups); | 1071 | snd_hda_pick_fixup(codec, NULL, ad1884_fixup_tbl, ad1884_fixups); |
1055 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | 1072 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
1056 | 1073 | ||
1057 | err = ad198x_parse_auto_config(codec); | 1074 | err = ad198x_parse_auto_config(codec, true); |
1058 | if (err < 0) | 1075 | if (err < 0) |
1059 | goto error; | 1076 | goto error; |
1060 | err = ad1983_add_spdif_mux_ctl(codec); | 1077 | err = ad1983_add_spdif_mux_ctl(codec); |
@@ -1096,7 +1113,7 @@ static int patch_ad1882(struct hda_codec *codec) | |||
1096 | spec->gen.mixer_merge_nid = 0x21; | 1113 | spec->gen.mixer_merge_nid = 0x21; |
1097 | spec->gen.beep_nid = 0x10; | 1114 | spec->gen.beep_nid = 0x10; |
1098 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); | 1115 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); |
1099 | err = ad198x_parse_auto_config(codec); | 1116 | err = ad198x_parse_auto_config(codec, true); |
1100 | if (err < 0) | 1117 | if (err < 0) |
1101 | goto error; | 1118 | goto error; |
1102 | err = ad1988_add_spdif_mux_ctl(codec); | 1119 | err = ad1988_add_spdif_mux_ctl(codec); |