diff options
-rw-r--r-- | sound/pci/hda/hda_codec.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e9b039cbf10a..1715e8b24ff0 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -4694,6 +4694,27 @@ static void sort_autocfg_input_pins(struct auto_pin_cfg *cfg) | |||
4694 | } | 4694 | } |
4695 | } | 4695 | } |
4696 | 4696 | ||
4697 | /* Reorder the surround channels | ||
4698 | * ALSA sequence is front/surr/clfe/side | ||
4699 | * HDA sequence is: | ||
4700 | * 4-ch: front/surr => OK as it is | ||
4701 | * 6-ch: front/clfe/surr | ||
4702 | * 8-ch: front/clfe/rear/side|fc | ||
4703 | */ | ||
4704 | static void reorder_outputs(unsigned int nums, hda_nid_t *pins) | ||
4705 | { | ||
4706 | hda_nid_t nid; | ||
4707 | |||
4708 | switch (nums) { | ||
4709 | case 3: | ||
4710 | case 4: | ||
4711 | nid = pins[1]; | ||
4712 | pins[1] = pins[2]; | ||
4713 | pins[2] = nid; | ||
4714 | break; | ||
4715 | } | ||
4716 | } | ||
4717 | |||
4697 | /* | 4718 | /* |
4698 | * Parse all pin widgets and store the useful pin nids to cfg | 4719 | * Parse all pin widgets and store the useful pin nids to cfg |
4699 | * | 4720 | * |
@@ -4889,21 +4910,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, | |||
4889 | } | 4910 | } |
4890 | } | 4911 | } |
4891 | 4912 | ||
4892 | /* Reorder the surround channels | 4913 | reorder_outputs(cfg->line_outs, cfg->line_out_pins); |
4893 | * ALSA sequence is front/surr/clfe/side | 4914 | reorder_outputs(cfg->hp_outs, cfg->hp_pins); |
4894 | * HDA sequence is: | 4915 | reorder_outputs(cfg->speaker_outs, cfg->speaker_pins); |
4895 | * 4-ch: front/surr => OK as it is | ||
4896 | * 6-ch: front/clfe/surr | ||
4897 | * 8-ch: front/clfe/rear/side|fc | ||
4898 | */ | ||
4899 | switch (cfg->line_outs) { | ||
4900 | case 3: | ||
4901 | case 4: | ||
4902 | nid = cfg->line_out_pins[1]; | ||
4903 | cfg->line_out_pins[1] = cfg->line_out_pins[2]; | ||
4904 | cfg->line_out_pins[2] = nid; | ||
4905 | break; | ||
4906 | } | ||
4907 | 4916 | ||
4908 | sort_autocfg_input_pins(cfg); | 4917 | sort_autocfg_input_pins(cfg); |
4909 | 4918 | ||