alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/7] ALSA: VIA HDA: Get codec's type in via_new_spec() function
@ 2011-03-22  8:25 Lydia Wang
  0 siblings, 0 replies; only message in thread
From: Lydia Wang @ 2011-03-22  8:25 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, HaraldWelte, lydiawang

From: Lydia Wang <lydiawang@viatech.com.cn>
Subject: ALSA: VIA HDA: Get codec's type in via_new_spec() function.

Add get_codec_type() in via_new_spec() function to make sure getting
correct codec type before building mixer controls.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
---
 sound/pci/hda/patch_via.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -159,6 +159,7 @@
 #endif
 };
 
+static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec);
 static struct via_spec * via_new_spec(struct hda_codec *codec)
 {
 	struct via_spec *spec;
@@ -169,6 +170,10 @@
 
 	codec->spec = spec;
 	spec->codec = codec;
+	spec->codec_type = get_codec_type(codec);
+	/* VT1708BCE & VT1708S are almost same */
+	if (spec->codec_type == VT1708BCE)
+		spec->codec_type = VT1708S;
 	return spec;
 }
 
@@ -2203,10 +2208,6 @@
 	for (i = 0; i < spec->num_iverbs; i++)
 		snd_hda_sequence_write(codec, spec->init_verbs[i]);
 
-	spec->codec_type = get_codec_type(codec);
-	if (spec->codec_type == VT1708BCE)
-		spec->codec_type = VT1708S; /* VT1708BCE & VT1708S are almost
-					       same */
 	/* Lydia Add for EAPD enable */
 	if (!spec->dig_in_nid) { /* No Digital In connection */
 		if (spec->dig_in_pin) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-22  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22  8:25 [PATCH 5/7] ALSA: VIA HDA: Get codec's type in via_new_spec() function Lydia Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).