aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1_main.c
diff options
context:
space:
mode:
authorLee Revell <rlrevell@joe-job.com>2005-03-30 06:51:18 -0500
committerJaroslav Kysela <perex@suse.cz>2005-05-29 03:00:41 -0400
commit2b637da5a1bb3c128ecdadea6aee693f6ff3b786 (patch)
tree636819c212a13118758a8c19db9905a55b20ef9e /sound/pci/emu10k1/emu10k1_main.c
parent51f633dada113ef724a145bb5b33ec77d1b092f6 (diff)
[ALSA] clean up card features
EMU10K1/EMU10K2 driver This patch converts the emu10k1 driver to use the card capabilities structure for some more things. Not extensively tested but seems to work. Signed-off-by: Lee Revell <rlrevell@joe-job.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_main.c')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index ff220fc31421..38be0f1b0e72 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -170,7 +170,7 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
170 SPCS_GENERATIONSTATUS | 0x00001200 | 170 SPCS_GENERATIONSTATUS | 0x00001200 |
171 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT); 171 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
172 172
173 if (emu->audigy && emu->revision == 4) { /* audigy2 */ 173 if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
174 /* Hacks for Alice3 to work independent of haP16V driver */ 174 /* Hacks for Alice3 to work independent of haP16V driver */
175 u32 tmp; 175 u32 tmp;
176 176
@@ -600,7 +600,7 @@ static int snd_emu10k1_free(emu10k1_t *emu)
600 if (emu->port) 600 if (emu->port)
601 pci_release_regions(emu->pci); 601 pci_release_regions(emu->pci);
602 pci_disable_device(emu->pci); 602 pci_disable_device(emu->pci);
603 if (emu->audigy && emu->revision == 4) /* P16V */ 603 if (emu->card_capabilities->ca0151_chip) /* P16V */
604 snd_p16v_free(emu); 604 snd_p16v_free(emu);
605 kfree(emu); 605 kfree(emu);
606 return 0; 606 return 0;
@@ -612,8 +612,6 @@ static int snd_emu10k1_dev_free(snd_device_t *device)
612 return snd_emu10k1_free(emu); 612 return snd_emu10k1_free(emu);
613} 613}
614 614
615/* vendor, device, subsystem, emu10k1_chip, emu10k2_chip, ca0102_chip, ca0108_chip, ca0151_chip, spk71, spdif_bug, ac97_chip, ecard, driver, name */
616
617static emu_chip_details_t emu_chip_details[] = { 615static emu_chip_details_t emu_chip_details[] = {
618 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/ 616 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/
619 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102, 617 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102,
@@ -688,15 +686,22 @@ static emu_chip_details_t emu_chip_details[] = {
688 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80641102, 686 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80641102,
689 .driver = "EMU10K1", .name = "SB Live 5.1", 687 .driver = "EMU10K1", .name = "SB Live 5.1",
690 .emu10k1_chip = 1, 688 .emu10k1_chip = 1,
691 .ac97_chip = 1} , 689 .ac97_chip = 1,
690 .sblive51 = 1} ,
692 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80401102, 691 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80401102,
693 .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]", 692 .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]",
694 .emu10k1_chip = 1, 693 .emu10k1_chip = 1,
695 .ac97_chip = 1} , 694 .ac97_chip = 1} ,
695 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80271102,
696 .driver = "EMU10K1", .name = "SBLive! Value [CT4832]",
697 .emu10k1_chip = 1,
698 .ac97_chip = 1,
699 .sblive51 = 1} ,
696 {.vendor = 0x1102, .device = 0x0002, 700 {.vendor = 0x1102, .device = 0x0002,
697 .driver = "EMU10K1", .name = "SB Live [Unknown]", 701 .driver = "EMU10K1", .name = "SB Live [Unknown]",
698 .emu10k1_chip = 1, 702 .emu10k1_chip = 1,
699 .ac97_chip = 1} , 703 .ac97_chip = 1,
704 .sblive51 = 1} ,
700 { } /* terminator */ 705 { } /* terminator */
701}; 706};
702 707
@@ -747,7 +752,6 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
747 emu->revision = revision; 752 emu->revision = revision;
748 pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &emu->serial); 753 pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &emu->serial);
749 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &emu->model); 754 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &emu->model);
750 emu->card_type = EMU10K1_CARD_CREATIVE;
751 snd_printdd("vendor=0x%x, device=0x%x, subsystem_vendor_id=0x%x, subsystem_id=0x%x\n",pci->vendor, pci->device, emu->serial, emu->model); 755 snd_printdd("vendor=0x%x, device=0x%x, subsystem_vendor_id=0x%x, subsystem_id=0x%x\n",pci->vendor, pci->device, emu->serial, emu->model);
752 756
753 for (c = emu_chip_details; c->vendor; c++) { 757 for (c = emu_chip_details; c->vendor; c++) {
@@ -825,15 +829,6 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
825 829
826 pci_set_master(pci); 830 pci_set_master(pci);
827 831
828 if (c->ecard) {
829 emu->card_type = EMU10K1_CARD_EMUAPS;
830 emu->APS = 1;
831 }
832 if (! c->ac97_chip)
833 emu->no_ac97 = 1;
834
835 emu->spk71 = c->spk71;
836
837 emu->fx8010.fxbus_mask = 0x303f; 832 emu->fx8010.fxbus_mask = 0x303f;
838 if (extin_mask == 0) 833 if (extin_mask == 0)
839 extin_mask = 0x3fcf; 834 extin_mask = 0x3fcf;
@@ -842,7 +837,7 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
842 emu->fx8010.extin_mask = extin_mask; 837 emu->fx8010.extin_mask = extin_mask;
843 emu->fx8010.extout_mask = extout_mask; 838 emu->fx8010.extout_mask = extout_mask;
844 839
845 if (emu->APS) { 840 if (emu->card_capabilities->ecard) {
846 if ((err = snd_emu10k1_ecard_init(emu)) < 0) { 841 if ((err = snd_emu10k1_ecard_init(emu)) < 0) {
847 snd_emu10k1_free(emu); 842 snd_emu10k1_free(emu);
848 return err; 843 return err;