aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ca0106
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2006-04-09 15:48:44 -0400
committerJaroslav Kysela <perex@suse.cz>2006-06-22 15:32:39 -0400
commitbe0b7b0113300c324034e94a12244c4ac3f4b354 (patch)
tree95409a8755e9e8e8055da964383d7f35401cfd17 /sound/pci/ca0106
parent3969f6178b86613fd443e70d11b8848451552bdd (diff)
[ALSA] ca0106: Fixes MSI K8N's SB Live 24 bit, no sound from line-in.
Fixed bug#1331 Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Diffstat (limited to 'sound/pci/ca0106')
-rw-r--r--sound/pci/ca0106/ca0106_main.c9
-rw-r--r--sound/pci/ca0106/ca0106_mixer.c29
2 files changed, 35 insertions, 3 deletions
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 3762f58384e0..b605d7045cc0 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -195,9 +195,14 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
195 .i2c_adc = 1, 195 .i2c_adc = 1,
196 .spi_dac = 1 } , 196 .spi_dac = 1 } ,
197 /* MSI K8N Diamond Motherboard with onboard SB Live 24bit without AC97 */ 197 /* MSI K8N Diamond Motherboard with onboard SB Live 24bit without AC97 */
198 /* SB0438
199 * CTRL:CA0106-DAT
200 * ADC: WM8775SEDS
201 * DAC: CS4382-KQZ
202 */
198 { .serial = 0x10091462, 203 { .serial = 0x10091462,
199 .name = "MSI K8N Diamond MB [SB0438]", 204 .name = "MSI K8N Diamond MB [SB0438]",
200 .gpio_type = 1, 205 .gpio_type = 2,
201 .i2c_adc = 1 } , 206 .i2c_adc = 1 } ,
202 /* Shuttle XPC SD31P which has an onboard Creative Labs 207 /* Shuttle XPC SD31P which has an onboard Creative Labs
203 * Sound Blaster Live! 24-bit EAX 208 * Sound Blaster Live! 24-bit EAX
@@ -1380,7 +1385,7 @@ static int __devinit snd_ca0106_create(struct snd_card *card,
1380 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4); /* Select MIC, Line in, TAD in, AUX in */ 1385 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4); /* Select MIC, Line in, TAD in, AUX in */
1381 chip->capture_source = 3; /* Set CAPTURE_SOURCE */ 1386 chip->capture_source = 3; /* Set CAPTURE_SOURCE */
1382 1387
1383 if (chip->details->gpio_type == 2) { /* The SB0410 and SB0413 use GPIO differently. */ 1388 if (chip->details->gpio_type == 2) { /* The SB0438 use GPIO differently. */
1384 /* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */ 1389 /* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
1385 outl(0x0, chip->port+GPIO); 1390 outl(0x0, chip->port+GPIO);
1386 //outl(0x00f0e000, chip->port+GPIO); /* Analog */ 1391 //outl(0x00f0e000, chip->port+GPIO); /* Analog */
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
index 8a5833317b0a..146eed70dce6 100644
--- a/sound/pci/ca0106/ca0106_mixer.c
+++ b/sound/pci/ca0106/ca0106_mixer.c
@@ -227,6 +227,20 @@ static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
227 return change; 227 return change;
228} 228}
229 229
230static int snd_ca0106_capture_line_in_side_out_info(struct snd_kcontrol *kcontrol,
231 struct snd_ctl_elem_info *uinfo)
232{
233 static char *texts[2] = { "Side out", "Line in" };
234
235 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
236 uinfo->count = 1;
237 uinfo->value.enumerated.items = 2;
238 if (uinfo->value.enumerated.item > 1)
239 uinfo->value.enumerated.item = 1;
240 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
241 return 0;
242}
243
230static int snd_ca0106_capture_mic_line_in_info(struct snd_kcontrol *kcontrol, 244static int snd_ca0106_capture_mic_line_in_info(struct snd_kcontrol *kcontrol,
231 struct snd_ctl_elem_info *uinfo) 245 struct snd_ctl_elem_info *uinfo)
232{ 246{
@@ -287,6 +301,16 @@ static struct snd_kcontrol_new snd_ca0106_capture_mic_line_in __devinitdata =
287 .put = snd_ca0106_capture_mic_line_in_put 301 .put = snd_ca0106_capture_mic_line_in_put
288}; 302};
289 303
304static struct snd_kcontrol_new snd_ca0106_capture_line_in_side_out __devinitdata =
305{
306 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
307 .name = "Shared Line in/Side out Capture Switch",
308 .info = snd_ca0106_capture_line_in_side_out_info,
309 .get = snd_ca0106_capture_mic_line_in_get,
310 .put = snd_ca0106_capture_mic_line_in_put
311};
312
313
290static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol, 314static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol,
291 struct snd_ctl_elem_info *uinfo) 315 struct snd_ctl_elem_info *uinfo)
292{ 316{
@@ -611,7 +635,10 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
611 return err; 635 return err;
612 } 636 }
613 if (emu->details->i2c_adc == 1) { 637 if (emu->details->i2c_adc == 1) {
614 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_mic_line_in, emu)); 638 if (emu->details->gpio_type == 1)
639 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_mic_line_in, emu));
640 else /* gpio_type == 2 */
641 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_line_in_side_out, emu));
615 if (err < 0) 642 if (err < 0)
616 return err; 643 return err;
617 } 644 }