From 6aadf41d6b9f8da68db5962929c07f816db15893 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 20 Jun 2011 14:09:02 +0200
Subject: [PATCH] ALSA: hda - Name the primary out as Speaker when needed for VIA codecs
Git-commit: 6aadf41d6b9f8da68db5962929c07f816db15893
Patch-mainline: 3.1-rc2
References: FATE#314310

When the primary output is the speaker output, rather name it as
"Speaker".  This will be more intuitive.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/patch_via.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -1771,7 +1771,11 @@ static int via_auto_create_multi_out_ctl
 			if (err < 0)
 				return err;
 		} else {
-			err = create_ch_ctls(codec, chname[i], pin, dac, 3);
+			const char *pfx = chname[i];
+			if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT &&
+			    cfg->line_outs == 1)
+				pfx = "Speaker";
+			err = create_ch_ctls(codec, pfx, pin, dac, 3);
 			if (err < 0)
 				return err;
 		}
