From d49e0432c4907164f429c00a4eb50d25dd6a1879 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 13 Feb 2009 11:19:09 +0100 Subject: [PATCH] --- yaml --- r: 133051 b: refs/heads/master c: 6a05ac4afa90ac9c38fedd3f6940fe8da5d1fcf6 h: refs/heads/master i: 133049: 111c8ba504094ad3be647ff37d23fc76700c359f 133047: 8ff3d5582c54f5181fcae79883ead63dca741ac6 v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/patch_realtek.c | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 20f33981c1f5..66069db4e713 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9b5f12e5a4029c1cd03784754687faef6d9e54fa +refs/heads/master: 6a05ac4afa90ac9c38fedd3f6940fe8da5d1fcf6 diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index ef9b7ee34100..244de597c5be 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -279,6 +279,7 @@ struct alc_spec { * dig_out_nid and hp_nid are optional */ hda_nid_t alt_dac_nid; + hda_nid_t slave_dig_outs[3]; /* optional - for auto-parsing */ int dig_out_type; /* capture */ @@ -4269,7 +4270,7 @@ static void alc880_auto_init_analog_input(struct hda_codec *codec) static int alc880_parse_auto_config(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; - int err; + int i, err; static hda_nid_t alc880_ignore[] = { 0x1d, 0 }; err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, @@ -4300,8 +4301,23 @@ static int alc880_parse_auto_config(struct hda_codec *codec) spec->multiout.max_channels = spec->multiout.num_dacs * 2; - if (spec->autocfg.dig_outs) - spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; + /* check multiple SPDIF-out (for recent codecs) */ + for (i = 0; i < spec->autocfg.dig_outs; i++) { + hda_nid_t dig_nid; + err = snd_hda_get_connections(codec, + spec->autocfg.dig_out_pins[i], + &dig_nid, 1); + if (err < 0) + continue; + if (!i) + spec->multiout.dig_out_nid = dig_nid; + else { + spec->multiout.slave_dig_outs = spec->slave_dig_outs; + spec->slave_dig_outs[i - 1] = dig_nid; + if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1) + break; + } + } if (spec->autocfg.dig_in_pin) spec->dig_in_nid = ALC880_DIGIN_NID;