aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2006-04-09 12:36:39 -0400
committerJaroslav Kysela <perex@suse.cz>2006-06-22 15:32:37 -0400
commit21fdddea8e4cc54341d389916d0c17db8c1ca452 (patch)
tree9ab8e7c8e92cfc747d71907a7c9ebaa2151fcd41
parent6129daaa0d2b84c0e376b6b17b3d3740c4d1d1ca (diff)
[ALSA] emu10k1: Add support for Audigy4 (not Pro)
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
-rw-r--r--include/sound/emu10k1.h2
-rw-r--r--sound/pci/ac97/ac97_codec.c4
-rw-r--r--sound/pci/ac97/ac97_patch.c4
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c56
-rw-r--r--sound/pci/emu10k1/emumixer.c54
-rw-r--r--sound/pci/emu10k1/tina2.h8
6 files changed, 107 insertions, 21 deletions
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 186e00ad9e79..884bbf54cd36 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -245,6 +245,7 @@
245#define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ 245#define A_IOCFG_GPOUT0 0x0044 /* analog/digital */
246#define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ 246#define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */
247#define A_IOCFG_ENABLE_DIGITAL 0x0004 247#define A_IOCFG_ENABLE_DIGITAL 0x0004
248#define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080
248#define A_IOCFG_UNKNOWN_20 0x0020 249#define A_IOCFG_UNKNOWN_20 0x0020
249#define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ 250#define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */
250#define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ 251#define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */
@@ -1065,6 +1066,7 @@ struct snd_emu_chip_details {
1065 unsigned char emu1212m; /* EMU 1212m card */ 1066 unsigned char emu1212m; /* EMU 1212m card */
1066 unsigned char spi_dac; /* SPI interface for DAC */ 1067 unsigned char spi_dac; /* SPI interface for DAC */
1067 unsigned char i2c_adc; /* I2C interface for ADC */ 1068 unsigned char i2c_adc; /* I2C interface for ADC */
1069 unsigned char adc_1361t; /* Use Philips 1361T ADC */
1068 const char *driver; 1070 const char *driver;
1069 const char *name; 1071 const char *name;
1070 const char *id; /* for backward compatibility - can be NULL if not needed */ 1072 const char *id; /* for backward compatibility - can be NULL if not needed */
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index d05200741ac3..4544f6aa089d 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -563,7 +563,7 @@ AC97_SINGLE("PC Speaker Playback Volume", AC97_PC_BEEP, 1, 15, 1)
563}; 563};
564 564
565static const struct snd_kcontrol_new snd_ac97_controls_mic_boost = 565static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
566 AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0); 566 AC97_SINGLE("Mic Boost (+20dB) Capture Switch", AC97_MIC, 6, 1, 0);
567 567
568 568
569static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line", "Mix", "Mix Mono", "Phone"}; 569static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line", "Mix", "Mix Mono", "Phone"};
@@ -605,7 +605,7 @@ AC97_SINGLE("Simulated Stereo Enhancement", AC97_GENERAL_PURPOSE, 14, 1, 0),
605AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0), 605AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0),
606AC97_SINGLE("Loudness (bass boost)", AC97_GENERAL_PURPOSE, 12, 1, 0), 606AC97_SINGLE("Loudness (bass boost)", AC97_GENERAL_PURPOSE, 12, 1, 0),
607AC97_ENUM("Mono Output Select", std_enum[2]), 607AC97_ENUM("Mono Output Select", std_enum[2]),
608AC97_ENUM("Mic Select", std_enum[3]), 608AC97_ENUM("Mic Select Capture Switch", std_enum[3]),
609AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0) 609AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0)
610}; 610};
611 611
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 4d9cf37300f7..7ae7bc6524e6 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -563,7 +563,7 @@ AC97_SINGLE("Mic 1 to Phone Switch", AC97_MIC, 14, 1, 1),
563AC97_SINGLE("Mic 2 to Phone Switch", AC97_MIC, 13, 1, 1), 563AC97_SINGLE("Mic 2 to Phone Switch", AC97_MIC, 13, 1, 1),
564AC97_ENUM("Mic Select Source", wm9711_enum[7]), 564AC97_ENUM("Mic Select Source", wm9711_enum[7]),
565AC97_SINGLE("Mic 1 Volume", AC97_MIC, 8, 32, 1), 565AC97_SINGLE("Mic 1 Volume", AC97_MIC, 8, 32, 1),
566AC97_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 7, 1, 0), 566AC97_SINGLE("Mic 20dB Boost Capture Switch", AC97_MIC, 7, 1, 0),
567 567
568AC97_SINGLE("Master ZC Switch", AC97_MASTER, 7, 1, 0), 568AC97_SINGLE("Master ZC Switch", AC97_MASTER, 7, 1, 0),
569AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0), 569AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0),
@@ -653,7 +653,7 @@ AC97_SINGLE("Mic 1 Volume", AC97_MIC, 8, 31, 1),
653AC97_SINGLE("Mic 2 Volume", AC97_MIC, 0, 31, 1), 653AC97_SINGLE("Mic 2 Volume", AC97_MIC, 0, 31, 1),
654AC97_SINGLE("Mic 1 to Mono Switch", AC97_LINE, 7, 1, 1), 654AC97_SINGLE("Mic 1 to Mono Switch", AC97_LINE, 7, 1, 1),
655AC97_SINGLE("Mic 2 to Mono Switch", AC97_LINE, 6, 1, 1), 655AC97_SINGLE("Mic 2 to Mono Switch", AC97_LINE, 6, 1, 1),
656AC97_SINGLE("Mic Boost (+20dB) Switch", AC97_LINE, 5, 1, 0), 656AC97_SINGLE("Mic Boost (+20dB) Capture Switch", AC97_LINE, 5, 1, 0),
657AC97_ENUM("Mic to Headphone Mux", wm9713_enum[0]), 657AC97_ENUM("Mic to Headphone Mux", wm9713_enum[0]),
658AC97_SINGLE("Mic Headphone Mixer Volume", AC97_LINE, 0, 7, 1), 658AC97_SINGLE("Mic Headphone Mixer Volume", AC97_LINE, 0, 7, 1),
659 659
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 6bfa08436efa..e71485c23cc7 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -777,14 +777,6 @@ static int snd_emu10k1_dev_free(struct snd_device *device)
777 777
778static struct snd_emu_chip_details emu_chip_details[] = { 778static struct snd_emu_chip_details emu_chip_details[] = {
779 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/ 779 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/
780 /* Audigy4 SB0400 */
781 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102,
782 .driver = "Audigy2", .name = "Audigy 4 [SB0400]",
783 .id = "Audigy2",
784 .emu10k2_chip = 1,
785 .ca0108_chip = 1,
786 .spk71 = 1,
787 .ac97_chip = 1} ,
788 /* Tested by James@superbug.co.uk 3rd July 2005 */ 780 /* Tested by James@superbug.co.uk 3rd July 2005 */
789 /* DSP: CA0108-IAT 781 /* DSP: CA0108-IAT
790 * DAC: CS4382-KQ 782 * DAC: CS4382-KQ
@@ -799,13 +791,59 @@ static struct snd_emu_chip_details emu_chip_details[] = {
799 .ca0108_chip = 1, 791 .ca0108_chip = 1,
800 .spk71 = 1, 792 .spk71 = 1,
801 .ac97_chip = 1} , 793 .ac97_chip = 1} ,
794 /* Audigy4 (Not PRO) SB0610 */
795 /* Tested by James@superbug.co.uk 4th April 2006 */
796 /* A_IOCFG bits
797 * Output
798 * 0: ?
799 * 1: ?
800 * 2: ?
801 * 3: 0 - Digital Out, 1 - Line in
802 * 4: ?
803 * 5: ?
804 * 6: ?
805 * 7: ?
806 * Input
807 * 8: ?
808 * 9: ?
809 * A: Green jack sense (Front)
810 * B: ?
811 * C: Black jack sense (Rear/Side Right)
812 * D: Yellow jack sense (Center/LFE/Side Left)
813 * E: ?
814 * F: ?
815 *
816 * Digital Out/Line in switch using A_IOCFG bit 3 (0x08)
817 * 0 - Digital Out
818 * 1 - Line in
819 */
820 /* Mic input not tested.
821 * Analog CD input not tested
822 * Digital Out not tested.
823 * Line in working.
824 * Audio output 5.1 working. Side outputs not working.
825 */
826 /* DSP: CA10300-IAT LF
827 * DAC: Cirrus Logic CS4382-KQZ
828 * ADC: Philips 1361T
829 * AC97: Sigmatel STAC9750
830 * CA0151: None
831 */
832 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102,
833 .driver = "Audigy2", .name = "Audigy 4 [SB0610]",
834 .id = "Audigy2",
835 .emu10k2_chip = 1,
836 .ca0108_chip = 1,
837 .spk71 = 1,
838 .adc_1361t = 1, /* 24 bit capture instead of 16bit */
839 .ac97_chip = 1} ,
802 /* Audigy 2 ZS Notebook Cardbus card.*/ 840 /* Audigy 2 ZS Notebook Cardbus card.*/
803 /* Tested by James@superbug.co.uk 22th December 2005 */ 841 /* Tested by James@superbug.co.uk 22th December 2005 */
804 /* Audio output 7.1/Headphones working. 842 /* Audio output 7.1/Headphones working.
805 * Digital output working. (AC3 not checked, only PCM) 843 * Digital output working. (AC3 not checked, only PCM)
806 * Audio inputs not tested. 844 * Audio inputs not tested.
807 */ 845 */
808 /* DSP: Tiny2 846 /* DSP: Tina2
809 * DAC: Wolfson WM8768/WM8568 847 * DAC: Wolfson WM8768/WM8568
810 * ADC: Wolfson WM8775 848 * ADC: Wolfson WM8775
811 * AC97: None 849 * AC97: None
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index 2a9d12d10680..c31f3d0877fa 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -777,6 +777,8 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
777 }; 777 };
778 static char *audigy_remove_ctls[] = { 778 static char *audigy_remove_ctls[] = {
779 /* Master/PCM controls on ac97 of Audigy has no effect */ 779 /* Master/PCM controls on ac97 of Audigy has no effect */
780 /* On the Audigy2 the AC97 playback is piped into
781 * the Philips ADC for 24bit capture */
780 "PCM Playback Switch", 782 "PCM Playback Switch",
781 "PCM Playback Volume", 783 "PCM Playback Volume",
782 "Master Mono Playback Switch", 784 "Master Mono Playback Switch",
@@ -804,6 +806,47 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
804 "AMic Playback Volume", "Mic Playback Volume", 806 "AMic Playback Volume", "Mic Playback Volume",
805 NULL 807 NULL
806 }; 808 };
809 static char *audigy_remove_ctls_1361t_adc[] = {
810 /* On the Audigy2 the AC97 playback is piped into
811 * the Philips ADC for 24bit capture */
812 "PCM Playback Switch",
813 "PCM Playback Volume",
814 "Master Mono Playback Switch",
815 "Master Mono Playback Volume",
816 "Capture Source",
817 "Capture Switch",
818 "Capture Volume",
819 "Mic Capture Volume",
820 "Headphone Playback Switch",
821 "Headphone Playback Volume",
822 "3D Control - Center",
823 "3D Control - Depth",
824 "3D Control - Switch",
825 "Line2 Playback Volume",
826 "Line2 Capture Volume",
827 NULL
828 };
829 static char *audigy_rename_ctls_1361t_adc[] = {
830 "Master Playback Switch", "Master Capture Switch",
831 "Master Playback Volume", "Master Capture Volume",
832 "Wave Master Playback Volume", "Master Playback Volume",
833 "PC Speaker Playback Switch", "PC Speaker Capture Switch",
834 "PC Speaker Playback Volume", "PC Speaker Capture Volume",
835 "Phone Playback Switch", "Phone Capture Switch",
836 "Phone Playback Volume", "Phone Capture Volume",
837 "Mic Playback Switch", "Mic Capture Switch",
838 "Mic Playback Volume", "Mic Capture Volume",
839 "Line Playback Switch", "Line Capture Switch",
840 "Line Playback Volume", "Line Capture Volume",
841 "CD Playback Switch", "CD Capture Switch",
842 "CD Playback Volume", "CD Capture Volume",
843 "Aux Playback Switch", "Aux Capture Switch",
844 "Aux Playback Volume", "Aux Capture Volume",
845 "Video Playback Switch", "Video Capture Switch",
846 "Video Playback Volume", "Video Capture Volume",
847
848 NULL
849 };
807 850
808 if (emu->card_capabilities->ac97_chip) { 851 if (emu->card_capabilities->ac97_chip) {
809 struct snd_ac97_bus *pbus; 852 struct snd_ac97_bus *pbus;
@@ -834,7 +877,10 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
834 snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000); 877 snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000);
835 /* set capture source to mic */ 878 /* set capture source to mic */
836 snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000); 879 snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000);
837 c = audigy_remove_ctls; 880 if (emu->card_capabilities->adc_1361t)
881 c = audigy_remove_ctls_1361t_adc;
882 else
883 c = audigy_remove_ctls;
838 } else { 884 } else {
839 /* 885 /*
840 * Credits for cards based on STAC9758: 886 * Credits for cards based on STAC9758:
@@ -863,11 +909,15 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
863 } 909 }
864 910
865 if (emu->audigy) 911 if (emu->audigy)
866 c = audigy_rename_ctls; 912 if (emu->card_capabilities->adc_1361t)
913 c = audigy_rename_ctls_1361t_adc;
914 else
915 c = audigy_rename_ctls;
867 else 916 else
868 c = emu10k1_rename_ctls; 917 c = emu10k1_rename_ctls;
869 for (; *c; c += 2) 918 for (; *c; c += 2)
870 rename_ctl(card, c[0], c[1]); 919 rename_ctl(card, c[0], c[1]);
920
871 if (emu->card_capabilities->subsystem == 0x20071102) { /* Audigy 4 Pro */ 921 if (emu->card_capabilities->subsystem == 0x20071102) { /* Audigy 4 Pro */
872 rename_ctl(card, "Line2 Capture Volume", "Line1/Mic Capture Volume"); 922 rename_ctl(card, "Line2 Capture Volume", "Line1/Mic Capture Volume");
873 rename_ctl(card, "Analog Mix Capture Volume", "Line2 Capture Volume"); 923 rename_ctl(card, "Analog Mix Capture Volume", "Line2 Capture Volume");
diff --git a/sound/pci/emu10k1/tina2.h b/sound/pci/emu10k1/tina2.h
index 5c43abf03e89..f2d8eb6c89e1 100644
--- a/sound/pci/emu10k1/tina2.h
+++ b/sound/pci/emu10k1/tina2.h
@@ -1,11 +1,7 @@
1/* 1/*
2 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk> 2 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
3 * Driver p16v chips 3 * Driver tina2 chips
4 * Version: 0.21 4 * Version: 0.1
5 *
6 *
7 * This code was initally based on code from ALSA's emu10k1x.c which is:
8 * Copyright (c) by Francisco Moraes <fmoraes@nc.rr.com>
9 * 5 *
10 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by