aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-13 05:19:09 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-13 05:59:33 -0500
commit6a05ac4afa90ac9c38fedd3f6940fe8da5d1fcf6 (patch)
tree056f6c1e27b751035af769b83f6def4086df9ef1 /sound/pci/hda/patch_realtek.c
parent9b5f12e5a4029c1cd03784754687faef6d9e54fa (diff)
ALSA: hda - Support multiple digital outs with auto-probing
Added the support of multiple digital outputs via auto-probing for Realtek ALC88x codecs. The multiple outputs are handled as slave streams, so only one PCM stream (and the corresponding IEC958* elements) is provided to control both digital outputs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ef9b7ee34100..244de597c5be 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -279,6 +279,7 @@ struct alc_spec {
279 * dig_out_nid and hp_nid are optional 279 * dig_out_nid and hp_nid are optional
280 */ 280 */
281 hda_nid_t alt_dac_nid; 281 hda_nid_t alt_dac_nid;
282 hda_nid_t slave_dig_outs[3]; /* optional - for auto-parsing */
282 int dig_out_type; 283 int dig_out_type;
283 284
284 /* capture */ 285 /* capture */
@@ -4269,7 +4270,7 @@ static void alc880_auto_init_analog_input(struct hda_codec *codec)
4269static int alc880_parse_auto_config(struct hda_codec *codec) 4270static int alc880_parse_auto_config(struct hda_codec *codec)
4270{ 4271{
4271 struct alc_spec *spec = codec->spec; 4272 struct alc_spec *spec = codec->spec;
4272 int err; 4273 int i, err;
4273 static hda_nid_t alc880_ignore[] = { 0x1d, 0 }; 4274 static hda_nid_t alc880_ignore[] = { 0x1d, 0 };
4274 4275
4275 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, 4276 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
@@ -4300,8 +4301,23 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
4300 4301
4301 spec->multiout.max_channels = spec->multiout.num_dacs * 2; 4302 spec->multiout.max_channels = spec->multiout.num_dacs * 2;
4302 4303
4303 if (spec->autocfg.dig_outs) 4304 /* check multiple SPDIF-out (for recent codecs) */
4304 spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; 4305 for (i = 0; i < spec->autocfg.dig_outs; i++) {
4306 hda_nid_t dig_nid;
4307 err = snd_hda_get_connections(codec,
4308 spec->autocfg.dig_out_pins[i],
4309 &dig_nid, 1);
4310 if (err < 0)
4311 continue;
4312 if (!i)
4313 spec->multiout.dig_out_nid = dig_nid;
4314 else {
4315 spec->multiout.slave_dig_outs = spec->slave_dig_outs;
4316 spec->slave_dig_outs[i - 1] = dig_nid;
4317 if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1)
4318 break;
4319 }
4320 }
4305 if (spec->autocfg.dig_in_pin) 4321 if (spec->autocfg.dig_in_pin)
4306 spec->dig_in_nid = ALC880_DIGIN_NID; 4322 spec->dig_in_nid = ALC880_DIGIN_NID;
4307 4323