aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-04-15 12:46:42 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:36 -0400
commit3adb8abc70aaf5c071f27576069c8b01783cca83 (patch)
treeacfc0ad65345bb55762b9198f03bf5fdac1de04d
parentad5fada51d33b408ad3d2d0848ef6744b5daf06f (diff)
[ALSA] hda - Add support of AD1989A/AD1989B
Added the support of AD1989A and AD1989B codecs. These codecs can have multiple SPDIF devices, but currently we handle only one SPDIF. If any real devices with two SPDIF interfaces (likely one for SPDIF and one for HDMI), we'll fix this rightly. Otherwise, these codecs are pretty similar with AD1988. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt2
-rw-r--r--sound/pci/hda/patch_analog.c28
2 files changed, 26 insertions, 4 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 3413644dff1e..fd4c32a031c9 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -956,7 +956,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
956 laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100) 956 laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
957 ultra 2-channel with EAPD (Samsung Ultra tablet PC) 957 ultra 2-channel with EAPD (Samsung Ultra tablet PC)
958 958
959 AD1988 959 AD1988/AD1988B/AD1989A/AD1989B
960 6stack 6-jack 960 6stack 6-jack
961 6stack-dig ditto with SPDIF 961 6stack-dig ditto with SPDIF
962 3stack 3-jack 962 3stack 3-jack
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 2befeebd909e..f486eb16a386 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -2142,6 +2142,10 @@ static struct snd_kcontrol_new ad1988_spdif_in_mixers[] = {
2142 { } /* end */ 2142 { } /* end */
2143}; 2143};
2144 2144
2145static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = {
2146 HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT),
2147 { } /* end */
2148};
2145 2149
2146/* 2150/*
2147 * initialization verbs 2151 * initialization verbs
@@ -2242,6 +2246,13 @@ static struct hda_verb ad1988_spdif_init_verbs[] = {
2242 { } 2246 { }
2243}; 2247};
2244 2248
2249/* AD1989 has no ADC -> SPDIF route */
2250static struct hda_verb ad1989_spdif_init_verbs[] = {
2251 /* SPDIF out pin */
2252 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */
2253 { }
2254};
2255
2245/* 2256/*
2246 * verbs for 3stack (+dig) 2257 * verbs for 3stack (+dig)
2247 */ 2258 */
@@ -2949,10 +2960,19 @@ static int patch_ad1988(struct hda_codec *codec)
2949 spec->mixers[spec->num_mixers++] = ad1988_capture_mixers; 2960 spec->mixers[spec->num_mixers++] = ad1988_capture_mixers;
2950 spec->init_verbs[spec->num_init_verbs++] = ad1988_capture_init_verbs; 2961 spec->init_verbs[spec->num_init_verbs++] = ad1988_capture_init_verbs;
2951 if (spec->multiout.dig_out_nid) { 2962 if (spec->multiout.dig_out_nid) {
2952 spec->mixers[spec->num_mixers++] = ad1988_spdif_out_mixers; 2963 if (codec->vendor_id >= 0x11d4989a) {
2953 spec->init_verbs[spec->num_init_verbs++] = ad1988_spdif_init_verbs; 2964 spec->mixers[spec->num_mixers++] =
2965 ad1989_spdif_out_mixers;
2966 spec->init_verbs[spec->num_init_verbs++] =
2967 ad1989_spdif_init_verbs;
2968 } else {
2969 spec->mixers[spec->num_mixers++] =
2970 ad1988_spdif_out_mixers;
2971 spec->init_verbs[spec->num_init_verbs++] =
2972 ad1988_spdif_init_verbs;
2973 }
2954 } 2974 }
2955 if (spec->dig_in_nid) 2975 if (spec->dig_in_nid && codec->vendor_id < 0x11d4989a)
2956 spec->mixers[spec->num_mixers++] = ad1988_spdif_in_mixers; 2976 spec->mixers[spec->num_mixers++] = ad1988_spdif_in_mixers;
2957 2977
2958 codec->patch_ops = ad198x_patch_ops; 2978 codec->patch_ops = ad198x_patch_ops;
@@ -4184,5 +4204,7 @@ struct hda_codec_preset snd_hda_preset_analog[] = {
4184 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a }, 4204 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a },
4185 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 }, 4205 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 },
4186 { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 }, 4206 { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 },
4207 { .id = 0x11d4989a, .name = "AD1989A", .patch = patch_ad1988 },
4208 { .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 },
4187 {} /* terminator */ 4209 {} /* terminator */
4188}; 4210};