aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-18 07:53:07 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-25 03:57:05 -0400
commit9e44c6e40fb383e6b1d0df0c9e375a98e11828d1 (patch)
tree41fa83ecb557d006436d091a301eed5e36ccd968
parent503c10d8a7dd3aa627dc57990c95a8a4dd4fa4b5 (diff)
ALSA: hda - Add AD1882A codec support
Added the basic support of AD1882A codec chip. It's almost compatible with AD1882, but with a digital mic and some differences in connections. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt2
-rw-r--r--sound/pci/hda/patch_analog.c74
2 files changed, 58 insertions, 18 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index b33e030509fb..02a7194a10cb 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -931,7 +931,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
931 allout 5-jack in back, 2-jack in front, SPDIF out 931 allout 5-jack in back, 2-jack in front, SPDIF out
932 auto auto-config reading BIOS (default) 932 auto auto-config reading BIOS (default)
933 933
934 AD1882 934 AD1882 / AD1882A
935 3stack 3-stack mode (default) 935 3stack 3-stack mode (default)
936 6stack 6-stack mode 936 6stack 6-stack mode
937 937
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index b6d64cc0787e..0899b6b38863 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3917,7 +3917,7 @@ static int patch_ad1884a(struct hda_codec *codec)
3917 3917
3918 3918
3919/* 3919/*
3920 * AD1882 3920 * AD1882 / AD1882A
3921 * 3921 *
3922 * port-A - front hp-out 3922 * port-A - front hp-out
3923 * port-B - front mic-in 3923 * port-B - front mic-in
@@ -3954,6 +3954,18 @@ static struct hda_input_mux ad1882_capture_source = {
3954 }, 3954 },
3955}; 3955};
3956 3956
3957/* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */
3958static struct hda_input_mux ad1882a_capture_source = {
3959 .num_items = 5,
3960 .items = {
3961 { "Front Mic", 0x1 },
3962 { "Mic", 0x4},
3963 { "Line", 0x2 },
3964 { "Digital Mic", 0x06 },
3965 { "Mix", 0x7 },
3966 },
3967};
3968
3957static struct snd_kcontrol_new ad1882_base_mixers[] = { 3969static struct snd_kcontrol_new ad1882_base_mixers[] = {
3958 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), 3970 HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
3959 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), 3971 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT),
@@ -3963,16 +3975,7 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = {
3963 HDA_CODEC_MUTE("Front Playback Switch", 0x12, 0x0, HDA_OUTPUT), 3975 HDA_CODEC_MUTE("Front Playback Switch", 0x12, 0x0, HDA_OUTPUT),
3964 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT), 3976 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT),
3965 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT), 3977 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT),
3966 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), 3978
3967 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
3968 HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT),
3969 HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT),
3970 HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x04, HDA_INPUT),
3971 HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x04, HDA_INPUT),
3972 HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT),
3973 HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT),
3974 HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x07, HDA_INPUT),
3975 HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x07, HDA_INPUT),
3976 HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT), 3979 HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT),
3977 HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), 3980 HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT),
3978 HDA_CODEC_VOLUME("Line-In Boost", 0x3a, 0x0, HDA_OUTPUT), 3981 HDA_CODEC_VOLUME("Line-In Boost", 0x3a, 0x0, HDA_OUTPUT),
@@ -4005,6 +4008,35 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = {
4005 { } /* end */ 4008 { } /* end */
4006}; 4009};
4007 4010
4011static struct snd_kcontrol_new ad1882_loopback_mixers[] = {
4012 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT),
4013 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
4014 HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT),
4015 HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT),
4016 HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x04, HDA_INPUT),
4017 HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x04, HDA_INPUT),
4018 HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT),
4019 HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT),
4020 HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x07, HDA_INPUT),
4021 HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x07, HDA_INPUT),
4022 { } /* end */
4023};
4024
4025static struct snd_kcontrol_new ad1882a_loopback_mixers[] = {
4026 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT),
4027 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
4028 HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT),
4029 HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x04, HDA_INPUT),
4030 HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x01, HDA_INPUT),
4031 HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x01, HDA_INPUT),
4032 HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT),
4033 HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT),
4034 HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x07, HDA_INPUT),
4035 HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x07, HDA_INPUT),
4036 HDA_CODEC_VOLUME("Digital Mic Boost", 0x1f, 0x0, HDA_INPUT),
4037 { } /* end */
4038};
4039
4008static struct snd_kcontrol_new ad1882_3stack_mixers[] = { 4040static struct snd_kcontrol_new ad1882_3stack_mixers[] = {
4009 HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), 4041 HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT),
4010 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT), 4042 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT),
@@ -4174,9 +4206,16 @@ static int patch_ad1882(struct hda_codec *codec)
4174 spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids); 4206 spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids);
4175 spec->adc_nids = ad1882_adc_nids; 4207 spec->adc_nids = ad1882_adc_nids;
4176 spec->capsrc_nids = ad1882_capsrc_nids; 4208 spec->capsrc_nids = ad1882_capsrc_nids;
4177 spec->input_mux = &ad1882_capture_source; 4209 if (codec->vendor_id == 0x11d1882)
4178 spec->num_mixers = 1; 4210 spec->input_mux = &ad1882_capture_source;
4211 else
4212 spec->input_mux = &ad1882a_capture_source;
4213 spec->num_mixers = 2;
4179 spec->mixers[0] = ad1882_base_mixers; 4214 spec->mixers[0] = ad1882_base_mixers;
4215 if (codec->vendor_id == 0x11d1882)
4216 spec->mixers[1] = ad1882_loopback_mixers;
4217 else
4218 spec->mixers[1] = ad1882a_loopback_mixers;
4180 spec->num_init_verbs = 1; 4219 spec->num_init_verbs = 1;
4181 spec->init_verbs[0] = ad1882_init_verbs; 4220 spec->init_verbs[0] = ad1882_init_verbs;
4182 spec->spdif_route = 0; 4221 spec->spdif_route = 0;
@@ -4193,8 +4232,8 @@ static int patch_ad1882(struct hda_codec *codec)
4193 switch (board_config) { 4232 switch (board_config) {
4194 default: 4233 default:
4195 case AD1882_3STACK: 4234 case AD1882_3STACK:
4196 spec->num_mixers = 2; 4235 spec->num_mixers = 3;
4197 spec->mixers[1] = ad1882_3stack_mixers; 4236 spec->mixers[2] = ad1882_3stack_mixers;
4198 spec->channel_mode = ad1882_modes; 4237 spec->channel_mode = ad1882_modes;
4199 spec->num_channel_mode = ARRAY_SIZE(ad1882_modes); 4238 spec->num_channel_mode = ARRAY_SIZE(ad1882_modes);
4200 spec->need_dac_fix = 1; 4239 spec->need_dac_fix = 1;
@@ -4202,8 +4241,8 @@ static int patch_ad1882(struct hda_codec *codec)
4202 spec->multiout.num_dacs = 1; 4241 spec->multiout.num_dacs = 1;
4203 break; 4242 break;
4204 case AD1882_6STACK: 4243 case AD1882_6STACK:
4205 spec->num_mixers = 2; 4244 spec->num_mixers = 3;
4206 spec->mixers[1] = ad1882_6stack_mixers; 4245 spec->mixers[2] = ad1882_6stack_mixers;
4207 break; 4246 break;
4208 } 4247 }
4209 return 0; 4248 return 0;
@@ -4226,6 +4265,7 @@ struct hda_codec_preset snd_hda_preset_analog[] = {
4226 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a }, 4265 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a },
4227 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 }, 4266 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 },
4228 { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 }, 4267 { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 },
4268 { .id = 0x11d4882a, .name = "AD1882A", .patch = patch_ad1882 },
4229 { .id = 0x11d4989a, .name = "AD1989A", .patch = patch_ad1988 }, 4269 { .id = 0x11d4989a, .name = "AD1989A", .patch = patch_ad1988 },
4230 { .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 }, 4270 { .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 },
4231 {} /* terminator */ 4271 {} /* terminator */