diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-02-11 05:35:15 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-02-11 18:04:19 -0500 |
commit | 0852d7a654f75d22a3c09fd7da4a3551bbb37740 (patch) | |
tree | 36cb4ec6ddd8a5b2ffa06e4d951282b3435b371b /sound/pci | |
parent | 32d2c7fa1344ddf51886eddf31e228d139501dc6 (diff) |
ALSA: hda - Detect multiple digital-out pins
Detect multiple digital-out pins in snd_hda_parse_pin_defconfig().
The dig_out_pin and dig_out_type fields become arrays.
The codec parser still doesn't use this multiple pins detection, though.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 17 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 5 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 20 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 10 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 10 |
6 files changed, 34 insertions, 30 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 95f10aec7a06..29eeb748561d 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3423,11 +3423,13 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
3423 | break; | 3423 | break; |
3424 | case AC_JACK_SPDIF_OUT: | 3424 | case AC_JACK_SPDIF_OUT: |
3425 | case AC_JACK_DIG_OTHER_OUT: | 3425 | case AC_JACK_DIG_OTHER_OUT: |
3426 | cfg->dig_out_pin = nid; | 3426 | if (cfg->dig_outs >= ARRAY_SIZE(cfg->dig_out_pins)) |
3427 | if (loc == AC_JACK_LOC_HDMI) | 3427 | continue; |
3428 | cfg->dig_out_type = HDA_PCM_TYPE_HDMI; | 3428 | cfg->dig_out_pins[cfg->dig_outs] = nid; |
3429 | else | 3429 | cfg->dig_out_type[cfg->dig_outs] = |
3430 | cfg->dig_out_type = HDA_PCM_TYPE_SPDIF; | 3430 | (loc == AC_JACK_LOC_HDMI) ? |
3431 | HDA_PCM_TYPE_HDMI : HDA_PCM_TYPE_SPDIF; | ||
3432 | cfg->dig_outs++; | ||
3431 | break; | 3433 | break; |
3432 | case AC_JACK_SPDIF_IN: | 3434 | case AC_JACK_SPDIF_IN: |
3433 | case AC_JACK_DIG_OTHER_IN: | 3435 | case AC_JACK_DIG_OTHER_IN: |
@@ -3541,8 +3543,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
3541 | cfg->hp_pins[1], cfg->hp_pins[2], | 3543 | cfg->hp_pins[1], cfg->hp_pins[2], |
3542 | cfg->hp_pins[3], cfg->hp_pins[4]); | 3544 | cfg->hp_pins[3], cfg->hp_pins[4]); |
3543 | snd_printd(" mono: mono_out=0x%x\n", cfg->mono_out_pin); | 3545 | snd_printd(" mono: mono_out=0x%x\n", cfg->mono_out_pin); |
3544 | if (cfg->dig_out_pin) | 3546 | if (cfg->dig_outs) |
3545 | snd_printd(" dig-out=0x%x\n", cfg->dig_out_pin); | 3547 | snd_printd(" dig-out=0x%x/0x%x\n", |
3548 | cfg->dig_out_pins[0], cfg->dig_out_pins[1]); | ||
3546 | snd_printd(" inputs: mic=0x%x, fmic=0x%x, line=0x%x, fline=0x%x," | 3549 | snd_printd(" inputs: mic=0x%x, fmic=0x%x, line=0x%x, fline=0x%x," |
3547 | " cd=0x%x, aux=0x%x\n", | 3550 | " cd=0x%x, aux=0x%x\n", |
3548 | cfg->input_pins[AUTO_PIN_MIC], | 3551 | cfg->input_pins[AUTO_PIN_MIC], |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 4086491ed33a..2ae6b53a4628 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -355,10 +355,11 @@ struct auto_pin_cfg { | |||
355 | int line_out_type; /* AUTO_PIN_XXX_OUT */ | 355 | int line_out_type; /* AUTO_PIN_XXX_OUT */ |
356 | hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; | 356 | hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; |
357 | hda_nid_t input_pins[AUTO_PIN_LAST]; | 357 | hda_nid_t input_pins[AUTO_PIN_LAST]; |
358 | hda_nid_t dig_out_pin; | 358 | int dig_outs; |
359 | hda_nid_t dig_out_pins[2]; | ||
359 | hda_nid_t dig_in_pin; | 360 | hda_nid_t dig_in_pin; |
360 | hda_nid_t mono_out_pin; | 361 | hda_nid_t mono_out_pin; |
361 | int dig_out_type; /* HDA_PCM_TYPE_XXX */ | 362 | int dig_out_type[2]; /* HDA_PCM_TYPE_XXX */ |
362 | int dig_in_type; /* HDA_PCM_TYPE_XXX */ | 363 | int dig_in_type; /* HDA_PCM_TYPE_XXX */ |
363 | }; | 364 | }; |
364 | 365 | ||
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 6106dfe8ec04..d58c32b5b433 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -2898,7 +2898,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec) | |||
2898 | 2898 | ||
2899 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 2899 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
2900 | 2900 | ||
2901 | if (spec->autocfg.dig_out_pin) | 2901 | if (spec->autocfg.dig_outs) |
2902 | spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; | 2902 | spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; |
2903 | if (spec->autocfg.dig_in_pin) | 2903 | if (spec->autocfg.dig_in_pin) |
2904 | spec->dig_in_nid = AD1988_SPDIF_IN; | 2904 | spec->dig_in_nid = AD1988_SPDIF_IN; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 1db99df79502..e46251bceb9d 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4291,7 +4291,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec) | |||
4291 | 4291 | ||
4292 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 4292 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
4293 | 4293 | ||
4294 | if (spec->autocfg.dig_out_pin) | 4294 | if (spec->autocfg.dig_outs) |
4295 | spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; | 4295 | spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; |
4296 | if (spec->autocfg.dig_in_pin) | 4296 | if (spec->autocfg.dig_in_pin) |
4297 | spec->dig_in_nid = ALC880_DIGIN_NID; | 4297 | spec->dig_in_nid = ALC880_DIGIN_NID; |
@@ -5658,7 +5658,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec) | |||
5658 | 5658 | ||
5659 | spec->multiout.max_channels = 2; | 5659 | spec->multiout.max_channels = 2; |
5660 | 5660 | ||
5661 | if (spec->autocfg.dig_out_pin) | 5661 | if (spec->autocfg.dig_outs) |
5662 | spec->multiout.dig_out_nid = ALC260_DIGOUT_NID; | 5662 | spec->multiout.dig_out_nid = ALC260_DIGOUT_NID; |
5663 | if (spec->kctls.list) | 5663 | if (spec->kctls.list) |
5664 | add_mixer(spec, spec->kctls.list); | 5664 | add_mixer(spec, spec->kctls.list); |
@@ -10626,7 +10626,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec) | |||
10626 | if (err < 0) | 10626 | if (err < 0) |
10627 | return err; | 10627 | return err; |
10628 | if (!spec->autocfg.line_outs) { | 10628 | if (!spec->autocfg.line_outs) { |
10629 | if (spec->autocfg.dig_out_pin || spec->autocfg.dig_in_pin) { | 10629 | if (spec->autocfg.dig_outs || spec->autocfg.dig_in_pin) { |
10630 | spec->multiout.max_channels = 2; | 10630 | spec->multiout.max_channels = 2; |
10631 | spec->no_analog = 1; | 10631 | spec->no_analog = 1; |
10632 | goto dig_only; | 10632 | goto dig_only; |
@@ -10643,9 +10643,9 @@ static int alc262_parse_auto_config(struct hda_codec *codec) | |||
10643 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 10643 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
10644 | 10644 | ||
10645 | dig_only: | 10645 | dig_only: |
10646 | if (spec->autocfg.dig_out_pin) { | 10646 | if (spec->autocfg.dig_outs) { |
10647 | spec->multiout.dig_out_nid = ALC262_DIGOUT_NID; | 10647 | spec->multiout.dig_out_nid = ALC262_DIGOUT_NID; |
10648 | spec->dig_out_type = spec->autocfg.dig_out_type; | 10648 | spec->dig_out_type = spec->autocfg.dig_out_type[0]; |
10649 | } | 10649 | } |
10650 | if (spec->autocfg.dig_in_pin) | 10650 | if (spec->autocfg.dig_in_pin) |
10651 | spec->dig_in_nid = ALC262_DIGIN_NID; | 10651 | spec->dig_in_nid = ALC262_DIGIN_NID; |
@@ -11807,7 +11807,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec) | |||
11807 | spec->multiout.max_channels = 2; | 11807 | spec->multiout.max_channels = 2; |
11808 | 11808 | ||
11809 | /* digital only support output */ | 11809 | /* digital only support output */ |
11810 | if (spec->autocfg.dig_out_pin) | 11810 | if (spec->autocfg.dig_outs) |
11811 | spec->multiout.dig_out_nid = ALC268_DIGOUT_NID; | 11811 | spec->multiout.dig_out_nid = ALC268_DIGOUT_NID; |
11812 | 11812 | ||
11813 | if (spec->kctls.list) | 11813 | if (spec->kctls.list) |
@@ -12722,7 +12722,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | |||
12722 | 12722 | ||
12723 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 12723 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
12724 | 12724 | ||
12725 | if (spec->autocfg.dig_out_pin) | 12725 | if (spec->autocfg.dig_outs) |
12726 | spec->multiout.dig_out_nid = ALC269_DIGOUT_NID; | 12726 | spec->multiout.dig_out_nid = ALC269_DIGOUT_NID; |
12727 | 12727 | ||
12728 | if (spec->kctls.list) | 12728 | if (spec->kctls.list) |
@@ -13779,7 +13779,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec) | |||
13779 | 13779 | ||
13780 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 13780 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
13781 | 13781 | ||
13782 | if (spec->autocfg.dig_out_pin) | 13782 | if (spec->autocfg.dig_outs) |
13783 | spec->multiout.dig_out_nid = ALC861_DIGOUT_NID; | 13783 | spec->multiout.dig_out_nid = ALC861_DIGOUT_NID; |
13784 | 13784 | ||
13785 | if (spec->kctls.list) | 13785 | if (spec->kctls.list) |
@@ -14881,7 +14881,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec) | |||
14881 | 14881 | ||
14882 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 14882 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
14883 | 14883 | ||
14884 | if (spec->autocfg.dig_out_pin) | 14884 | if (spec->autocfg.dig_outs) |
14885 | spec->multiout.dig_out_nid = ALC861VD_DIGOUT_NID; | 14885 | spec->multiout.dig_out_nid = ALC861VD_DIGOUT_NID; |
14886 | 14886 | ||
14887 | if (spec->kctls.list) | 14887 | if (spec->kctls.list) |
@@ -16689,7 +16689,7 @@ static int alc662_parse_auto_config(struct hda_codec *codec) | |||
16689 | 16689 | ||
16690 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 16690 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
16691 | 16691 | ||
16692 | if (spec->autocfg.dig_out_pin) | 16692 | if (spec->autocfg.dig_outs) |
16693 | spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; | 16693 | spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; |
16694 | 16694 | ||
16695 | if (spec->kctls.list) | 16695 | if (spec->kctls.list) |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 12b30884843b..1882c5735879 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -2546,7 +2546,7 @@ static int stac92xx_build_pcms(struct hda_codec *codec) | |||
2546 | codec->num_pcms++; | 2546 | codec->num_pcms++; |
2547 | info++; | 2547 | info++; |
2548 | info->name = "STAC92xx Digital"; | 2548 | info->name = "STAC92xx Digital"; |
2549 | info->pcm_type = spec->autocfg.dig_out_type; | 2549 | info->pcm_type = spec->autocfg.dig_out_type[0]; |
2550 | if (spec->multiout.dig_out_nid) { | 2550 | if (spec->multiout.dig_out_nid) { |
2551 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_digital_playback; | 2551 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_digital_playback; |
2552 | info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid; | 2552 | info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid; |
@@ -3706,7 +3706,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out | |||
3706 | if (spec->multiout.max_channels > 2) | 3706 | if (spec->multiout.max_channels > 2) |
3707 | spec->surr_switch = 1; | 3707 | spec->surr_switch = 1; |
3708 | 3708 | ||
3709 | if (spec->autocfg.dig_out_pin) | 3709 | if (spec->autocfg.dig_outs) |
3710 | spec->multiout.dig_out_nid = dig_out; | 3710 | spec->multiout.dig_out_nid = dig_out; |
3711 | if (dig_in && spec->autocfg.dig_in_pin) | 3711 | if (dig_in && spec->autocfg.dig_in_pin) |
3712 | spec->dig_in_nid = dig_in; | 3712 | spec->dig_in_nid = dig_in; |
@@ -3819,7 +3819,7 @@ static int stac9200_parse_auto_config(struct hda_codec *codec) | |||
3819 | if (err < 0) | 3819 | if (err < 0) |
3820 | return err; | 3820 | return err; |
3821 | 3821 | ||
3822 | if (spec->autocfg.dig_out_pin) | 3822 | if (spec->autocfg.dig_outs) |
3823 | spec->multiout.dig_out_nid = 0x05; | 3823 | spec->multiout.dig_out_nid = 0x05; |
3824 | if (spec->autocfg.dig_in_pin) | 3824 | if (spec->autocfg.dig_in_pin) |
3825 | spec->dig_in_nid = 0x04; | 3825 | spec->dig_in_nid = 0x04; |
@@ -4069,8 +4069,8 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4069 | for (i = 0; i < spec->num_dmics; i++) | 4069 | for (i = 0; i < spec->num_dmics; i++) |
4070 | stac92xx_auto_set_pinctl(codec, spec->dmic_nids[i], | 4070 | stac92xx_auto_set_pinctl(codec, spec->dmic_nids[i], |
4071 | AC_PINCTL_IN_EN); | 4071 | AC_PINCTL_IN_EN); |
4072 | if (cfg->dig_out_pin) | 4072 | if (cfg->dig_out_pins[0]) |
4073 | stac92xx_auto_set_pinctl(codec, cfg->dig_out_pin, | 4073 | stac92xx_auto_set_pinctl(codec, cfg->dig_out_pins[0], |
4074 | AC_PINCTL_OUT_EN); | 4074 | AC_PINCTL_OUT_EN); |
4075 | if (cfg->dig_in_pin) | 4075 | if (cfg->dig_in_pin) |
4076 | stac92xx_auto_set_pinctl(codec, cfg->dig_in_pin, | 4076 | stac92xx_auto_set_pinctl(codec, cfg->dig_in_pin, |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index c761394cbe84..639b2ff510a6 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -1354,7 +1354,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec) | |||
1354 | 1354 | ||
1355 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 1355 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
1356 | 1356 | ||
1357 | if (spec->autocfg.dig_out_pin) | 1357 | if (spec->autocfg.dig_outs) |
1358 | spec->multiout.dig_out_nid = VT1708_DIGOUT_NID; | 1358 | spec->multiout.dig_out_nid = VT1708_DIGOUT_NID; |
1359 | if (spec->autocfg.dig_in_pin) | 1359 | if (spec->autocfg.dig_in_pin) |
1360 | spec->dig_in_nid = VT1708_DIGIN_NID; | 1360 | spec->dig_in_nid = VT1708_DIGIN_NID; |
@@ -1827,7 +1827,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec) | |||
1827 | 1827 | ||
1828 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 1828 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
1829 | 1829 | ||
1830 | if (spec->autocfg.dig_out_pin) | 1830 | if (spec->autocfg.dig_outs) |
1831 | spec->multiout.dig_out_nid = VT1709_DIGOUT_NID; | 1831 | spec->multiout.dig_out_nid = VT1709_DIGOUT_NID; |
1832 | if (spec->autocfg.dig_in_pin) | 1832 | if (spec->autocfg.dig_in_pin) |
1833 | spec->dig_in_nid = VT1709_DIGIN_NID; | 1833 | spec->dig_in_nid = VT1709_DIGIN_NID; |
@@ -2371,7 +2371,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec) | |||
2371 | 2371 | ||
2372 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 2372 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
2373 | 2373 | ||
2374 | if (spec->autocfg.dig_out_pin) | 2374 | if (spec->autocfg.dig_outs) |
2375 | spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID; | 2375 | spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID; |
2376 | if (spec->autocfg.dig_in_pin) | 2376 | if (spec->autocfg.dig_in_pin) |
2377 | spec->dig_in_nid = VT1708B_DIGIN_NID; | 2377 | spec->dig_in_nid = VT1708B_DIGIN_NID; |
@@ -2836,7 +2836,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec) | |||
2836 | 2836 | ||
2837 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 2837 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
2838 | 2838 | ||
2839 | if (spec->autocfg.dig_out_pin) | 2839 | if (spec->autocfg.dig_outs) |
2840 | spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID; | 2840 | spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID; |
2841 | 2841 | ||
2842 | spec->extra_dig_out_nid = 0x15; | 2842 | spec->extra_dig_out_nid = 0x15; |
@@ -3155,7 +3155,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec) | |||
3155 | 3155 | ||
3156 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 3156 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
3157 | 3157 | ||
3158 | if (spec->autocfg.dig_out_pin) | 3158 | if (spec->autocfg.dig_outs) |
3159 | spec->multiout.dig_out_nid = VT1702_DIGOUT_NID; | 3159 | spec->multiout.dig_out_nid = VT1702_DIGOUT_NID; |
3160 | 3160 | ||
3161 | spec->extra_dig_out_nid = 0x1B; | 3161 | spec->extra_dig_out_nid = 0x1B; |