From 05855c6fd7350b203d7d72df3497f4c7f1bf6f51 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 26 Oct 2011 16:06:27 +0200 Subject: [PATCH] --- yaml --- r: 270399 b: refs/heads/master c: 8fa7ab48acb636d24669dab291807b487dfb2804 h: refs/heads/master i: 270397: 30ee8d94fbee5d3d105f4ac70fdb4a8bddcf47d1 270395: 04998a1f1c51f90c23f077b2b7b86b7a8d3acb34 270391: 9fcb80da1a73c059289f2fcf1f5638cad29eace5 270383: 687e79cf45cff67984b1f9941672f806f717733d 270367: 6841ffa2c52c45557b10ce5860980c69e1aefb09 270335: 472def92e9592e05ff1119c884c22b591f8415ba v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_codec.c | 39 ++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index 54d747bad573..4a096a5a3328 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 820bc19df20e1927054860513322742de5ebb6b3 +refs/heads/master: 8fa7ab48acb636d24669dab291807b487dfb2804 diff --git a/trunk/sound/pci/hda/hda_codec.c b/trunk/sound/pci/hda/hda_codec.c index e9b039cbf10a..1715e8b24ff0 100644 --- a/trunk/sound/pci/hda/hda_codec.c +++ b/trunk/sound/pci/hda/hda_codec.c @@ -4694,6 +4694,27 @@ static void sort_autocfg_input_pins(struct auto_pin_cfg *cfg) } } +/* Reorder the surround channels + * ALSA sequence is front/surr/clfe/side + * HDA sequence is: + * 4-ch: front/surr => OK as it is + * 6-ch: front/clfe/surr + * 8-ch: front/clfe/rear/side|fc + */ +static void reorder_outputs(unsigned int nums, hda_nid_t *pins) +{ + hda_nid_t nid; + + switch (nums) { + case 3: + case 4: + nid = pins[1]; + pins[1] = pins[2]; + pins[2] = nid; + break; + } +} + /* * Parse all pin widgets and store the useful pin nids to cfg * @@ -4889,21 +4910,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, } } - /* Reorder the surround channels - * ALSA sequence is front/surr/clfe/side - * HDA sequence is: - * 4-ch: front/surr => OK as it is - * 6-ch: front/clfe/surr - * 8-ch: front/clfe/rear/side|fc - */ - switch (cfg->line_outs) { - case 3: - case 4: - nid = cfg->line_out_pins[1]; - cfg->line_out_pins[1] = cfg->line_out_pins[2]; - cfg->line_out_pins[2] = nid; - break; - } + reorder_outputs(cfg->line_outs, cfg->line_out_pins); + reorder_outputs(cfg->hp_outs, cfg->hp_pins); + reorder_outputs(cfg->speaker_outs, cfg->speaker_pins); sort_autocfg_input_pins(cfg);