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