Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ALSA] emu10k1: Add support for Audigy4 (not Pro)

Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>

authored by

James Courtier-Dutton and committed by
Jaroslav Kysela
21fdddea 6129daaa

+107 -21
+2
include/sound/emu10k1.h
··· 245 245 #define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ 246 246 #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ 247 247 #define A_IOCFG_ENABLE_DIGITAL 0x0004 248 + #define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080 248 249 #define A_IOCFG_UNKNOWN_20 0x0020 249 250 #define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ 250 251 #define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ ··· 1066 1065 unsigned char emu1212m; /* EMU 1212m card */ 1067 1066 unsigned char spi_dac; /* SPI interface for DAC */ 1068 1067 unsigned char i2c_adc; /* I2C interface for ADC */ 1068 + unsigned char adc_1361t; /* Use Philips 1361T ADC */ 1069 1069 const char *driver; 1070 1070 const char *name; 1071 1071 const char *id; /* for backward compatibility - can be NULL if not needed */
+2 -2
sound/pci/ac97/ac97_codec.c
··· 563 563 }; 564 564 565 565 static 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 569 569 static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line", "Mix", "Mix Mono", "Phone"}; ··· 605 605 AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0), 606 606 AC97_SINGLE("Loudness (bass boost)", AC97_GENERAL_PURPOSE, 12, 1, 0), 607 607 AC97_ENUM("Mono Output Select", std_enum[2]), 608 - AC97_ENUM("Mic Select", std_enum[3]), 608 + AC97_ENUM("Mic Select Capture Switch", std_enum[3]), 609 609 AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0) 610 610 }; 611 611
+2 -2
sound/pci/ac97/ac97_patch.c
··· 563 563 AC97_SINGLE("Mic 2 to Phone Switch", AC97_MIC, 13, 1, 1), 564 564 AC97_ENUM("Mic Select Source", wm9711_enum[7]), 565 565 AC97_SINGLE("Mic 1 Volume", AC97_MIC, 8, 32, 1), 566 - AC97_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 7, 1, 0), 566 + AC97_SINGLE("Mic 20dB Boost Capture Switch", AC97_MIC, 7, 1, 0), 567 567 568 568 AC97_SINGLE("Master ZC Switch", AC97_MASTER, 7, 1, 0), 569 569 AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0), ··· 653 653 AC97_SINGLE("Mic 2 Volume", AC97_MIC, 0, 31, 1), 654 654 AC97_SINGLE("Mic 1 to Mono Switch", AC97_LINE, 7, 1, 1), 655 655 AC97_SINGLE("Mic 2 to Mono Switch", AC97_LINE, 6, 1, 1), 656 - AC97_SINGLE("Mic Boost (+20dB) Switch", AC97_LINE, 5, 1, 0), 656 + AC97_SINGLE("Mic Boost (+20dB) Capture Switch", AC97_LINE, 5, 1, 0), 657 657 AC97_ENUM("Mic to Headphone Mux", wm9713_enum[0]), 658 658 AC97_SINGLE("Mic Headphone Mixer Volume", AC97_LINE, 0, 7, 1), 659 659
+47 -9
sound/pci/emu10k1/emu10k1_main.c
··· 777 777 778 778 static struct snd_emu_chip_details emu_chip_details[] = { 779 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 780 /* Tested by James@superbug.co.uk 3rd July 2005 */ 789 781 /* DSP: CA0108-IAT 790 782 * DAC: CS4382-KQ ··· 791 799 .ca0108_chip = 1, 792 800 .spk71 = 1, 793 801 .ac97_chip = 1} , 802 + /* Audigy4 (Not PRO) SB0610 */ 803 + /* Tested by James@superbug.co.uk 4th April 2006 */ 804 + /* A_IOCFG bits 805 + * Output 806 + * 0: ? 807 + * 1: ? 808 + * 2: ? 809 + * 3: 0 - Digital Out, 1 - Line in 810 + * 4: ? 811 + * 5: ? 812 + * 6: ? 813 + * 7: ? 814 + * Input 815 + * 8: ? 816 + * 9: ? 817 + * A: Green jack sense (Front) 818 + * B: ? 819 + * C: Black jack sense (Rear/Side Right) 820 + * D: Yellow jack sense (Center/LFE/Side Left) 821 + * E: ? 822 + * F: ? 823 + * 824 + * Digital Out/Line in switch using A_IOCFG bit 3 (0x08) 825 + * 0 - Digital Out 826 + * 1 - Line in 827 + */ 828 + /* Mic input not tested. 829 + * Analog CD input not tested 830 + * Digital Out not tested. 831 + * Line in working. 832 + * Audio output 5.1 working. Side outputs not working. 833 + */ 834 + /* DSP: CA10300-IAT LF 835 + * DAC: Cirrus Logic CS4382-KQZ 836 + * ADC: Philips 1361T 837 + * AC97: Sigmatel STAC9750 838 + * CA0151: None 839 + */ 840 + {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102, 841 + .driver = "Audigy2", .name = "Audigy 4 [SB0610]", 842 + .id = "Audigy2", 843 + .emu10k2_chip = 1, 844 + .ca0108_chip = 1, 845 + .spk71 = 1, 846 + .adc_1361t = 1, /* 24 bit capture instead of 16bit */ 847 + .ac97_chip = 1} , 794 848 /* Audigy 2 ZS Notebook Cardbus card.*/ 795 849 /* Tested by James@superbug.co.uk 22th December 2005 */ 796 850 /* Audio output 7.1/Headphones working. 797 851 * Digital output working. (AC3 not checked, only PCM) 798 852 * Audio inputs not tested. 799 853 */ 800 - /* DSP: Tiny2 854 + /* DSP: Tina2 801 855 * DAC: Wolfson WM8768/WM8568 802 856 * ADC: Wolfson WM8775 803 857 * AC97: None
+52 -2
sound/pci/emu10k1/emumixer.c
··· 777 777 }; 778 778 static char *audigy_remove_ctls[] = { 779 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 782 "PCM Playback Switch", 781 783 "PCM Playback Volume", 782 784 "Master Mono Playback Switch", ··· 804 802 /* "Wave Capture Volume", "PCM Capture Volume", */ 805 803 "Wave Master Playback Volume", "Master Playback Volume", 806 804 "AMic Playback Volume", "Mic Playback Volume", 805 + NULL 806 + }; 807 + static char *audigy_remove_ctls_1361t_adc[] = { 808 + /* On the Audigy2 the AC97 playback is piped into 809 + * the Philips ADC for 24bit capture */ 810 + "PCM Playback Switch", 811 + "PCM Playback Volume", 812 + "Master Mono Playback Switch", 813 + "Master Mono Playback Volume", 814 + "Capture Source", 815 + "Capture Switch", 816 + "Capture Volume", 817 + "Mic Capture Volume", 818 + "Headphone Playback Switch", 819 + "Headphone Playback Volume", 820 + "3D Control - Center", 821 + "3D Control - Depth", 822 + "3D Control - Switch", 823 + "Line2 Playback Volume", 824 + "Line2 Capture Volume", 825 + NULL 826 + }; 827 + static char *audigy_rename_ctls_1361t_adc[] = { 828 + "Master Playback Switch", "Master Capture Switch", 829 + "Master Playback Volume", "Master Capture Volume", 830 + "Wave Master Playback Volume", "Master Playback Volume", 831 + "PC Speaker Playback Switch", "PC Speaker Capture Switch", 832 + "PC Speaker Playback Volume", "PC Speaker Capture Volume", 833 + "Phone Playback Switch", "Phone Capture Switch", 834 + "Phone Playback Volume", "Phone Capture Volume", 835 + "Mic Playback Switch", "Mic Capture Switch", 836 + "Mic Playback Volume", "Mic Capture Volume", 837 + "Line Playback Switch", "Line Capture Switch", 838 + "Line Playback Volume", "Line Capture Volume", 839 + "CD Playback Switch", "CD Capture Switch", 840 + "CD Playback Volume", "CD Capture Volume", 841 + "Aux Playback Switch", "Aux Capture Switch", 842 + "Aux Playback Volume", "Aux Capture Volume", 843 + "Video Playback Switch", "Video Capture Switch", 844 + "Video Playback Volume", "Video Capture Volume", 845 + 807 846 NULL 808 847 }; 809 848 ··· 877 834 snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000); 878 835 /* set capture source to mic */ 879 836 snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000); 880 - c = audigy_remove_ctls; 837 + if (emu->card_capabilities->adc_1361t) 838 + c = audigy_remove_ctls_1361t_adc; 839 + else 840 + c = audigy_remove_ctls; 881 841 } else { 882 842 /* 883 843 * Credits for cards based on STAC9758: ··· 909 863 } 910 864 911 865 if (emu->audigy) 912 - c = audigy_rename_ctls; 866 + if (emu->card_capabilities->adc_1361t) 867 + c = audigy_rename_ctls_1361t_adc; 868 + else 869 + c = audigy_rename_ctls; 913 870 else 914 871 c = emu10k1_rename_ctls; 915 872 for (; *c; c += 2) 916 873 rename_ctl(card, c[0], c[1]); 874 + 917 875 if (emu->card_capabilities->subsystem == 0x20071102) { /* Audigy 4 Pro */ 918 876 rename_ctl(card, "Line2 Capture Volume", "Line1/Mic Capture Volume"); 919 877 rename_ctl(card, "Analog Mix Capture Volume", "Line2 Capture Volume");
+2 -6
sound/pci/emu10k1/tina2.h
··· 1 1 /* 2 2 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk> 3 - * Driver p16v chips 4 - * Version: 0.21 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> 3 + * Driver tina2 chips 4 + * Version: 0.1 9 5 * 10 6 * This program is free software; you can redistribute it and/or modify 11 7 * it under the terms of the GNU General Public License as published by