aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c177
1 files changed, 143 insertions, 34 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 8648917acffb..bcb3310c394f 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -23,6 +23,7 @@
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/module.h>
26 27
27#include <sound/core.h> 28#include <sound/core.h>
28#include "hda_codec.h" 29#include "hda_codec.h"
@@ -48,6 +49,8 @@ struct ad198x_spec {
48 49
49 const hda_nid_t *alt_dac_nid; 50 const hda_nid_t *alt_dac_nid;
50 const struct hda_pcm_stream *stream_analog_alt_playback; 51 const struct hda_pcm_stream *stream_analog_alt_playback;
52 int independent_hp;
53 int num_active_streams;
51 54
52 /* capture */ 55 /* capture */
53 unsigned int num_adc_nids; 56 unsigned int num_adc_nids;
@@ -302,6 +305,72 @@ static int ad198x_check_power_status(struct hda_codec *codec, hda_nid_t nid)
302} 305}
303#endif 306#endif
304 307
308static void activate_ctl(struct hda_codec *codec, const char *name, int active)
309{
310 struct snd_kcontrol *ctl = snd_hda_find_mixer_ctl(codec, name);
311 if (ctl) {
312 ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
313 ctl->vd[0].access |= active ? 0 :
314 SNDRV_CTL_ELEM_ACCESS_INACTIVE;
315 ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_WRITE;
316 ctl->vd[0].access |= active ?
317 SNDRV_CTL_ELEM_ACCESS_WRITE : 0;
318 snd_ctl_notify(codec->bus->card,
319 SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
320 }
321}
322
323static void set_stream_active(struct hda_codec *codec, bool active)
324{
325 struct ad198x_spec *spec = codec->spec;
326 if (active)
327 spec->num_active_streams++;
328 else
329 spec->num_active_streams--;
330 activate_ctl(codec, "Independent HP", spec->num_active_streams == 0);
331}
332
333static int ad1988_independent_hp_info(struct snd_kcontrol *kcontrol,
334 struct snd_ctl_elem_info *uinfo)
335{
336 static const char * const texts[] = { "OFF", "ON", NULL};
337 int index;
338 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
339 uinfo->count = 1;
340 uinfo->value.enumerated.items = 2;
341 index = uinfo->value.enumerated.item;
342 if (index >= 2)
343 index = 1;
344 strcpy(uinfo->value.enumerated.name, texts[index]);
345 return 0;
346}
347
348static int ad1988_independent_hp_get(struct snd_kcontrol *kcontrol,
349 struct snd_ctl_elem_value *ucontrol)
350{
351 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
352 struct ad198x_spec *spec = codec->spec;
353 ucontrol->value.enumerated.item[0] = spec->independent_hp;
354 return 0;
355}
356
357static int ad1988_independent_hp_put(struct snd_kcontrol *kcontrol,
358 struct snd_ctl_elem_value *ucontrol)
359{
360 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
361 struct ad198x_spec *spec = codec->spec;
362 unsigned int select = ucontrol->value.enumerated.item[0];
363 if (spec->independent_hp != select) {
364 spec->independent_hp = select;
365 if (spec->independent_hp)
366 spec->multiout.hp_nid = 0;
367 else
368 spec->multiout.hp_nid = spec->alt_dac_nid[0];
369 return 1;
370 }
371 return 0;
372}
373
305/* 374/*
306 * Analog playback callbacks 375 * Analog playback callbacks
307 */ 376 */
@@ -310,8 +379,15 @@ static int ad198x_playback_pcm_open(struct hda_pcm_stream *hinfo,
310 struct snd_pcm_substream *substream) 379 struct snd_pcm_substream *substream)
311{ 380{
312 struct ad198x_spec *spec = codec->spec; 381 struct ad198x_spec *spec = codec->spec;
313 return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream, 382 int err;
383 set_stream_active(codec, true);
384 err = snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
314 hinfo); 385 hinfo);
386 if (err < 0) {
387 set_stream_active(codec, false);
388 return err;
389 }
390 return 0;
315} 391}
316 392
317static int ad198x_playback_pcm_prepare(struct hda_pcm_stream *hinfo, 393static int ad198x_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
@@ -333,11 +409,41 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
333 return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); 409 return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
334} 410}
335 411
412static int ad198x_playback_pcm_close(struct hda_pcm_stream *hinfo,
413 struct hda_codec *codec,
414 struct snd_pcm_substream *substream)
415{
416 set_stream_active(codec, false);
417 return 0;
418}
419
420static int ad1988_alt_playback_pcm_open(struct hda_pcm_stream *hinfo,
421 struct hda_codec *codec,
422 struct snd_pcm_substream *substream)
423{
424 struct ad198x_spec *spec = codec->spec;
425 if (!spec->independent_hp)
426 return -EBUSY;
427 set_stream_active(codec, true);
428 return 0;
429}
430
431static int ad1988_alt_playback_pcm_close(struct hda_pcm_stream *hinfo,
432 struct hda_codec *codec,
433 struct snd_pcm_substream *substream)
434{
435 set_stream_active(codec, false);
436 return 0;
437}
438
336static const struct hda_pcm_stream ad198x_pcm_analog_alt_playback = { 439static const struct hda_pcm_stream ad198x_pcm_analog_alt_playback = {
337 .substreams = 1, 440 .substreams = 1,
338 .channels_min = 2, 441 .channels_min = 2,
339 .channels_max = 2, 442 .channels_max = 2,
340 /* NID is set in ad198x_build_pcms */ 443 .ops = {
444 .open = ad1988_alt_playback_pcm_open,
445 .close = ad1988_alt_playback_pcm_close
446 },
341}; 447};
342 448
343/* 449/*
@@ -402,7 +508,6 @@ static int ad198x_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
402 return 0; 508 return 0;
403} 509}
404 510
405
406/* 511/*
407 */ 512 */
408static const struct hda_pcm_stream ad198x_pcm_analog_playback = { 513static const struct hda_pcm_stream ad198x_pcm_analog_playback = {
@@ -413,7 +518,8 @@ static const struct hda_pcm_stream ad198x_pcm_analog_playback = {
413 .ops = { 518 .ops = {
414 .open = ad198x_playback_pcm_open, 519 .open = ad198x_playback_pcm_open,
415 .prepare = ad198x_playback_pcm_prepare, 520 .prepare = ad198x_playback_pcm_prepare,
416 .cleanup = ad198x_playback_pcm_cleanup 521 .cleanup = ad198x_playback_pcm_cleanup,
522 .close = ad198x_playback_pcm_close
417 }, 523 },
418}; 524};
419 525
@@ -2058,7 +2164,6 @@ static int patch_ad1981(struct hda_codec *codec)
2058enum { 2164enum {
2059 AD1988_6STACK, 2165 AD1988_6STACK,
2060 AD1988_6STACK_DIG, 2166 AD1988_6STACK_DIG,
2061 AD1988_6STACK_DIG_FP,
2062 AD1988_3STACK, 2167 AD1988_3STACK,
2063 AD1988_3STACK_DIG, 2168 AD1988_3STACK_DIG,
2064 AD1988_LAPTOP, 2169 AD1988_LAPTOP,
@@ -2168,6 +2273,17 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
2168 return err; 2273 return err;
2169} 2274}
2170 2275
2276static const struct snd_kcontrol_new ad1988_hp_mixers[] = {
2277 {
2278 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2279 .name = "Independent HP",
2280 .info = ad1988_independent_hp_info,
2281 .get = ad1988_independent_hp_get,
2282 .put = ad1988_independent_hp_put,
2283 },
2284 { } /* end */
2285};
2286
2171/* 6-stack mode */ 2287/* 6-stack mode */
2172static const struct snd_kcontrol_new ad1988_6stack_mixers1[] = { 2288static const struct snd_kcontrol_new ad1988_6stack_mixers1[] = {
2173 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), 2289 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
@@ -2188,6 +2304,7 @@ static const struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
2188}; 2304};
2189 2305
2190static const struct snd_kcontrol_new ad1988_6stack_mixers2[] = { 2306static const struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
2307 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
2191 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), 2308 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT),
2192 HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT), 2309 HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT),
2193 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT), 2310 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT),
@@ -2210,13 +2327,6 @@ static const struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
2210 2327
2211 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT), 2328 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT),
2212 HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT), 2329 HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT),
2213
2214 { } /* end */
2215};
2216
2217static const struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = {
2218 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
2219
2220 { } /* end */ 2330 { } /* end */
2221}; 2331};
2222 2332
@@ -2238,6 +2348,7 @@ static const struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
2238}; 2348};
2239 2349
2240static const struct snd_kcontrol_new ad1988_3stack_mixers2[] = { 2350static const struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
2351 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
2241 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), 2352 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT),
2242 HDA_BIND_MUTE("Surround Playback Switch", 0x2c, 2, HDA_INPUT), 2353 HDA_BIND_MUTE("Surround Playback Switch", 0x2c, 2, HDA_INPUT),
2243 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x26, 1, 2, HDA_INPUT), 2354 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x26, 1, 2, HDA_INPUT),
@@ -2272,6 +2383,7 @@ static const struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
2272 2383
2273/* laptop mode */ 2384/* laptop mode */
2274static const struct snd_kcontrol_new ad1988_laptop_mixers[] = { 2385static const struct snd_kcontrol_new ad1988_laptop_mixers[] = {
2386 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
2275 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), 2387 HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
2276 HDA_CODEC_MUTE("PCM Playback Switch", 0x29, 0x0, HDA_INPUT), 2388 HDA_CODEC_MUTE("PCM Playback Switch", 0x29, 0x0, HDA_INPUT),
2277 HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT), 2389 HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT),
@@ -2446,7 +2558,7 @@ static const struct hda_verb ad1988_6stack_init_verbs[] = {
2446 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2558 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2447 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2559 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2448 /* Port-A front headphon path */ 2560 /* Port-A front headphon path */
2449 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */ 2561 {0x37, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC0:03h */
2450 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2562 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2451 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2563 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2452 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2564 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -2594,7 +2706,7 @@ static const struct hda_verb ad1988_3stack_init_verbs[] = {
2594 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2706 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2595 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2707 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2596 /* Port-A front headphon path */ 2708 /* Port-A front headphon path */
2597 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */ 2709 {0x37, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC0:03h */
2598 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2710 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2599 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2711 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2600 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2712 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -2669,7 +2781,7 @@ static const struct hda_verb ad1988_laptop_init_verbs[] = {
2669 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2781 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2670 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2782 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2671 /* Port-A front headphon path */ 2783 /* Port-A front headphon path */
2672 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */ 2784 {0x37, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC0:03h */
2673 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2785 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2674 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2786 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2675 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2787 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -2782,11 +2894,11 @@ static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx)
2782{ 2894{
2783 static const hda_nid_t idx_to_dac[8] = { 2895 static const hda_nid_t idx_to_dac[8] = {
2784 /* A B C D E F G H */ 2896 /* A B C D E F G H */
2785 0x04, 0x06, 0x05, 0x04, 0x0a, 0x06, 0x05, 0x0a 2897 0x03, 0x06, 0x05, 0x04, 0x0a, 0x06, 0x05, 0x0a
2786 }; 2898 };
2787 static const hda_nid_t idx_to_dac_rev2[8] = { 2899 static const hda_nid_t idx_to_dac_rev2[8] = {
2788 /* A B C D E F G H */ 2900 /* A B C D E F G H */
2789 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06 2901 0x03, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06
2790 }; 2902 };
2791 if (is_rev2(codec)) 2903 if (is_rev2(codec))
2792 return idx_to_dac_rev2[idx]; 2904 return idx_to_dac_rev2[idx];
@@ -3023,8 +3135,8 @@ static void ad1988_auto_set_output_and_unmute(struct hda_codec *codec,
3023 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, pin_type); 3135 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, pin_type);
3024 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3136 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3025 switch (nid) { 3137 switch (nid) {
3026 case 0x11: /* port-A - DAC 04 */ 3138 case 0x11: /* port-A - DAC 03 */
3027 snd_hda_codec_write(codec, 0x37, 0, AC_VERB_SET_CONNECT_SEL, 0x01); 3139 snd_hda_codec_write(codec, 0x37, 0, AC_VERB_SET_CONNECT_SEL, 0x00);
3028 break; 3140 break;
3029 case 0x14: /* port-B - DAC 06 */ 3141 case 0x14: /* port-B - DAC 06 */
3030 snd_hda_codec_write(codec, 0x30, 0, AC_VERB_SET_CONNECT_SEL, 0x02); 3142 snd_hda_codec_write(codec, 0x30, 0, AC_VERB_SET_CONNECT_SEL, 0x02);
@@ -3150,7 +3262,6 @@ static int ad1988_auto_init(struct hda_codec *codec)
3150static const char * const ad1988_models[AD1988_MODEL_LAST] = { 3262static const char * const ad1988_models[AD1988_MODEL_LAST] = {
3151 [AD1988_6STACK] = "6stack", 3263 [AD1988_6STACK] = "6stack",
3152 [AD1988_6STACK_DIG] = "6stack-dig", 3264 [AD1988_6STACK_DIG] = "6stack-dig",
3153 [AD1988_6STACK_DIG_FP] = "6stack-dig-fp",
3154 [AD1988_3STACK] = "3stack", 3265 [AD1988_3STACK] = "3stack",
3155 [AD1988_3STACK_DIG] = "3stack-dig", 3266 [AD1988_3STACK_DIG] = "3stack-dig",
3156 [AD1988_LAPTOP] = "laptop", 3267 [AD1988_LAPTOP] = "laptop",
@@ -3208,10 +3319,11 @@ static int patch_ad1988(struct hda_codec *codec)
3208 } 3319 }
3209 set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); 3320 set_beep_amp(spec, 0x10, 0, HDA_OUTPUT);
3210 3321
3322 if (!spec->multiout.hp_nid)
3323 spec->multiout.hp_nid = ad1988_alt_dac_nid[0];
3211 switch (board_config) { 3324 switch (board_config) {
3212 case AD1988_6STACK: 3325 case AD1988_6STACK:
3213 case AD1988_6STACK_DIG: 3326 case AD1988_6STACK_DIG:
3214 case AD1988_6STACK_DIG_FP:
3215 spec->multiout.max_channels = 8; 3327 spec->multiout.max_channels = 8;
3216 spec->multiout.num_dacs = 4; 3328 spec->multiout.num_dacs = 4;
3217 if (is_rev2(codec)) 3329 if (is_rev2(codec))
@@ -3227,19 +3339,7 @@ static int patch_ad1988(struct hda_codec *codec)
3227 spec->mixers[1] = ad1988_6stack_mixers2; 3339 spec->mixers[1] = ad1988_6stack_mixers2;
3228 spec->num_init_verbs = 1; 3340 spec->num_init_verbs = 1;
3229 spec->init_verbs[0] = ad1988_6stack_init_verbs; 3341 spec->init_verbs[0] = ad1988_6stack_init_verbs;
3230 if (board_config == AD1988_6STACK_DIG_FP) { 3342 if (board_config == AD1988_6STACK_DIG) {
3231 spec->num_mixers++;
3232 spec->mixers[2] = ad1988_6stack_fp_mixers;
3233 spec->num_init_verbs++;
3234 spec->init_verbs[1] = ad1988_6stack_fp_init_verbs;
3235 spec->slave_vols = ad1988_6stack_fp_slave_vols;
3236 spec->slave_sws = ad1988_6stack_fp_slave_sws;
3237 spec->alt_dac_nid = ad1988_alt_dac_nid;
3238 spec->stream_analog_alt_playback =
3239 &ad198x_pcm_analog_alt_playback;
3240 }
3241 if ((board_config == AD1988_6STACK_DIG) ||
3242 (board_config == AD1988_6STACK_DIG_FP)) {
3243 spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; 3343 spec->multiout.dig_out_nid = AD1988_SPDIF_OUT;
3244 spec->dig_in_nid = AD1988_SPDIF_IN; 3344 spec->dig_in_nid = AD1988_SPDIF_IN;
3245 } 3345 }
@@ -3282,6 +3382,15 @@ static int patch_ad1988(struct hda_codec *codec)
3282 break; 3382 break;
3283 } 3383 }
3284 3384
3385 if (spec->autocfg.hp_pins[0]) {
3386 spec->mixers[spec->num_mixers++] = ad1988_hp_mixers;
3387 spec->slave_vols = ad1988_6stack_fp_slave_vols;
3388 spec->slave_sws = ad1988_6stack_fp_slave_sws;
3389 spec->alt_dac_nid = ad1988_alt_dac_nid;
3390 spec->stream_analog_alt_playback =
3391 &ad198x_pcm_analog_alt_playback;
3392 }
3393
3285 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids); 3394 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids);
3286 spec->adc_nids = ad1988_adc_nids; 3395 spec->adc_nids = ad1988_adc_nids;
3287 spec->capsrc_nids = ad1988_capsrc_nids; 3396 spec->capsrc_nids = ad1988_capsrc_nids;