diff options
author | Lydia Wang <lydiawang@viatech.com.cn> | 2009-10-10 07:07:29 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-10-11 11:54:15 -0400 |
commit | 518bf3ba753ad93644e7c6cf95c043c918d9429b (patch) | |
tree | 0d488b998c2e5479f6704caef56a2639ac9797d6 /sound/pci/hda/patch_via.c | |
parent | 744ff5f487925223beb6e21460c8cec468b54ab4 (diff) |
ALSA: HDA VIA: Add VT1708B-CE codec support.
Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Logan Li <loganli@viatech.com.cn>
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 | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index e7d739f12247..4d9ffd6f190b 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -84,6 +84,7 @@ enum VIA_HDA_CODEC { | |||
84 | VT1708B_8CH, | 84 | VT1708B_8CH, |
85 | VT1708B_4CH, | 85 | VT1708B_4CH, |
86 | VT1708S, | 86 | VT1708S, |
87 | VT1708BCE, | ||
87 | VT1702, | 88 | VT1702, |
88 | CODEC_TYPES, | 89 | CODEC_TYPES, |
89 | }; | 90 | }; |
@@ -104,9 +105,11 @@ static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec) | |||
104 | codec_type = VT1709_10CH; | 105 | codec_type = VT1709_10CH; |
105 | else if (dev_id >= 0xe714 && dev_id <= 0xe717) | 106 | else if (dev_id >= 0xe714 && dev_id <= 0xe717) |
106 | codec_type = VT1709_6CH; | 107 | codec_type = VT1709_6CH; |
107 | else if (dev_id >= 0xe720 && dev_id <= 0xe723) | 108 | else if (dev_id >= 0xe720 && dev_id <= 0xe723) { |
108 | codec_type = VT1708B_8CH; | 109 | codec_type = VT1708B_8CH; |
109 | else if (dev_id >= 0xe724 && dev_id <= 0xe727) | 110 | if (snd_hda_param_read(codec, 0x16, AC_PAR_CONNLIST_LEN) == 0x7) |
111 | codec_type = VT1708BCE; | ||
112 | } else if (dev_id >= 0xe724 && dev_id <= 0xe727) | ||
110 | codec_type = VT1708B_4CH; | 113 | codec_type = VT1708B_4CH; |
111 | else if ((dev_id & 0xfff) == 0x397 | 114 | else if ((dev_id & 0xfff) == 0x397 |
112 | && (dev_id >> 12) < 8) | 115 | && (dev_id >> 12) < 8) |
@@ -224,6 +227,8 @@ struct via_spec { | |||
224 | const struct hda_input_mux *hp_mux; | 227 | const struct hda_input_mux *hp_mux; |
225 | unsigned int hp_independent_mode; | 228 | unsigned int hp_independent_mode; |
226 | 229 | ||
230 | enum VIA_HDA_CODEC codec_type; | ||
231 | |||
227 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 232 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
228 | struct hda_loopback_check loopback; | 233 | struct hda_loopback_check loopback; |
229 | #endif | 234 | #endif |
@@ -979,6 +984,10 @@ static int via_init(struct hda_codec *codec) | |||
979 | for (i = 0; i < spec->num_iverbs; i++) | 984 | for (i = 0; i < spec->num_iverbs; i++) |
980 | snd_hda_sequence_write(codec, spec->init_verbs[i]); | 985 | snd_hda_sequence_write(codec, spec->init_verbs[i]); |
981 | 986 | ||
987 | spec->codec_type = get_codec_type(codec); | ||
988 | if (spec->codec_type == VT1708BCE) | ||
989 | spec->codec_type = VT1708S; /* VT1708BCE & VT1708S are almost | ||
990 | same */ | ||
982 | /* Lydia Add for EAPD enable */ | 991 | /* Lydia Add for EAPD enable */ |
983 | if (!spec->dig_in_nid) { /* No Digital In connection */ | 992 | if (!spec->dig_in_nid) { /* No Digital In connection */ |
984 | if (spec->dig_in_pin) { | 993 | if (spec->dig_in_pin) { |
@@ -2369,12 +2378,14 @@ static struct hda_amp_list vt1708B_loopbacks[] = { | |||
2369 | { } /* end */ | 2378 | { } /* end */ |
2370 | }; | 2379 | }; |
2371 | #endif | 2380 | #endif |
2372 | 2381 | static int patch_vt1708S(struct hda_codec *codec); | |
2373 | static int patch_vt1708B_8ch(struct hda_codec *codec) | 2382 | static int patch_vt1708B_8ch(struct hda_codec *codec) |
2374 | { | 2383 | { |
2375 | struct via_spec *spec; | 2384 | struct via_spec *spec; |
2376 | int err; | 2385 | int err; |
2377 | 2386 | ||
2387 | if (get_codec_type(codec) == VT1708BCE) | ||
2388 | return patch_vt1708S(codec); | ||
2378 | /* create a codec specific record */ | 2389 | /* create a codec specific record */ |
2379 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | 2390 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
2380 | if (spec == NULL) | 2391 | if (spec == NULL) |
@@ -2906,6 +2917,16 @@ static int patch_vt1708S(struct hda_codec *codec) | |||
2906 | spec->loopback.amplist = vt1708S_loopbacks; | 2917 | spec->loopback.amplist = vt1708S_loopbacks; |
2907 | #endif | 2918 | #endif |
2908 | 2919 | ||
2920 | /* correct names for VT1708BCE */ | ||
2921 | if (get_codec_type(codec) == VT1708BCE) { | ||
2922 | kfree(codec->chip_name); | ||
2923 | codec->chip_name = kstrdup("VT1708BCE", GFP_KERNEL); | ||
2924 | snprintf(codec->bus->card->mixername, | ||
2925 | sizeof(codec->bus->card->mixername), | ||
2926 | "%s %s", codec->vendor_name, codec->chip_name); | ||
2927 | spec->stream_name_analog = "VT1708BCE Analog"; | ||
2928 | spec->stream_name_digital = "VT1708BCE Digital"; | ||
2929 | } | ||
2909 | return 0; | 2930 | return 0; |
2910 | } | 2931 | } |
2911 | 2932 | ||