diff options
author | Lydia Wang <lydiawang@viatech.com.cn> | 2011-03-22 04:25:03 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-03-22 07:54:32 -0400 |
commit | 0341ccd7557fecafe6a79c55158670cf629d269e (patch) | |
tree | 820b83898a768ad99da8e2b8e07ab288324e8aac /sound/pci/hda/patch_via.c | |
parent | 169222813eec8403c76394fb7b35ecab98e3c607 (diff) |
ALSA: hda - VIA: Fix codec type for VT1708BCE at the right timing
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>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r-- | sound/pci/hda/patch_via.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 299a18b735a3..269bb365752b 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -159,6 +159,7 @@ struct via_spec { | |||
159 | #endif | 159 | #endif |
160 | }; | 160 | }; |
161 | 161 | ||
162 | static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec); | ||
162 | static struct via_spec * via_new_spec(struct hda_codec *codec) | 163 | static struct via_spec * via_new_spec(struct hda_codec *codec) |
163 | { | 164 | { |
164 | struct via_spec *spec; | 165 | struct via_spec *spec; |
@@ -169,6 +170,10 @@ static struct via_spec * via_new_spec(struct hda_codec *codec) | |||
169 | 170 | ||
170 | codec->spec = spec; | 171 | codec->spec = spec; |
171 | spec->codec = codec; | 172 | spec->codec = codec; |
173 | spec->codec_type = get_codec_type(codec); | ||
174 | /* VT1708BCE & VT1708S are almost same */ | ||
175 | if (spec->codec_type == VT1708BCE) | ||
176 | spec->codec_type = VT1708S; | ||
172 | return spec; | 177 | return spec; |
173 | } | 178 | } |
174 | 179 | ||
@@ -2203,10 +2208,6 @@ static int via_init(struct hda_codec *codec) | |||
2203 | for (i = 0; i < spec->num_iverbs; i++) | 2208 | for (i = 0; i < spec->num_iverbs; i++) |
2204 | snd_hda_sequence_write(codec, spec->init_verbs[i]); | 2209 | snd_hda_sequence_write(codec, spec->init_verbs[i]); |
2205 | 2210 | ||
2206 | spec->codec_type = get_codec_type(codec); | ||
2207 | if (spec->codec_type == VT1708BCE) | ||
2208 | spec->codec_type = VT1708S; /* VT1708BCE & VT1708S are almost | ||
2209 | same */ | ||
2210 | /* Lydia Add for EAPD enable */ | 2211 | /* Lydia Add for EAPD enable */ |
2211 | if (!spec->dig_in_nid) { /* No Digital In connection */ | 2212 | if (!spec->dig_in_nid) { /* No Digital In connection */ |
2212 | if (spec->dig_in_pin) { | 2213 | if (spec->dig_in_pin) { |