From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] ALSA: hda - Fix no independent HP handling for VIA codecs
Patch-mainline: Never
References: bnc#813922

The current VIA codec parser clears the HP output DAC at init by a
wrong assumption that the independent HP is always available.
This resulted in the missing DAC handling for HP and speaker on IBM POS
systems.

The patch is only for 3.8 and older, so no upstreaming.

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

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

--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -820,6 +820,9 @@ static void setup_playback_multi_pcm(str
 {
 	const struct auto_pin_cfg *cfg = &spec->autocfg;
 	spec->multiout.num_dacs = cfg->line_outs + spec->smart51_nums;
+	if (!spec->hp_dac_nid)
+		return;
+
 	spec->multiout.hp_nid = 0;
 	if (!spec->hp_independent_mode) {
 		if (!spec->hp_indep_shared)
@@ -2080,6 +2083,10 @@ static int via_auto_create_hp_ctls(struc
 		copy_path_mixer_ctls(&spec->hp_path, path);
 	if (spec->hp_indep_path.depth)
 		copy_path_mixer_ctls(&spec->hp_indep_path, path);
+
+	if (!spec->hp_dac_nid && spec->multiout.dac_nids[0] != path->path[0])
+		spec->multiout.hp_nid = path->path[0];
+
 	return 0;
 }
 
