diff options
author | Lee Revell <rlrevell@joe-job.com> | 2005-03-30 06:51:18 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-05-29 03:00:41 -0400 |
commit | 2b637da5a1bb3c128ecdadea6aee693f6ff3b786 (patch) | |
tree | 636819c212a13118758a8c19db9905a55b20ef9e | |
parent | 51f633dada113ef724a145bb5b33ec77d1b092f6 (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>
-rw-r--r-- | include/sound/emu10k1.h | 9 | ||||
-rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 29 | ||||
-rw-r--r-- | sound/pci/emu10k1/emufx.c | 56 | ||||
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 10 | ||||
-rw-r--r-- | sound/pci/emu10k1/emuproc.c | 2 |
5 files changed, 51 insertions, 55 deletions
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 8221df88053f..b1e8ee8e0fab 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -1046,6 +1046,7 @@ typedef struct { | |||
1046 | unsigned char ca0108_chip; /* Audigy 2 Value */ | 1046 | unsigned char ca0108_chip; /* Audigy 2 Value */ |
1047 | unsigned char ca0151_chip; /* P16V */ | 1047 | unsigned char ca0151_chip; /* P16V */ |
1048 | unsigned char spk71; /* Has 7.1 speakers */ | 1048 | unsigned char spk71; /* Has 7.1 speakers */ |
1049 | unsigned char sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */ | ||
1049 | unsigned char spdif_bug; /* Has Spdif phasing bug */ | 1050 | unsigned char spdif_bug; /* Has Spdif phasing bug */ |
1050 | unsigned char ac97_chip; /* Has an AC97 chip */ | 1051 | unsigned char ac97_chip; /* Has an AC97 chip */ |
1051 | unsigned char ecard; /* APS EEPROM */ | 1052 | unsigned char ecard; /* APS EEPROM */ |
@@ -1057,11 +1058,8 @@ struct _snd_emu10k1 { | |||
1057 | int irq; | 1058 | int irq; |
1058 | 1059 | ||
1059 | unsigned long port; /* I/O port number */ | 1060 | unsigned long port; /* I/O port number */ |
1060 | unsigned int APS: 1, /* APS flag */ | 1061 | unsigned int tos_link: 1, /* tos link detected */ |
1061 | no_ac97: 1, /* no AC'97 */ | 1062 | rear_ac97: 1; /* rear channels are on AC'97 */ |
1062 | tos_link: 1, /* tos link detected */ | ||
1063 | rear_ac97: 1, /* rear channels are on AC'97 */ | ||
1064 | spk71:1; /* 7.1 configuration (Audigy 2 ZS) */ | ||
1065 | const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */ | 1063 | const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */ |
1066 | unsigned int audigy; /* is Audigy? */ | 1064 | unsigned int audigy; /* is Audigy? */ |
1067 | unsigned int revision; /* chip revision */ | 1065 | unsigned int revision; /* chip revision */ |
@@ -1456,7 +1454,6 @@ int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu, | |||
1456 | #endif | 1454 | #endif |
1457 | 1455 | ||
1458 | typedef struct { | 1456 | typedef struct { |
1459 | unsigned int card; /* card type */ | ||
1460 | unsigned int internal_tram_size; /* in samples */ | 1457 | unsigned int internal_tram_size; /* in samples */ |
1461 | unsigned int external_tram_size; /* in samples */ | 1458 | unsigned int external_tram_size; /* in samples */ |
1462 | char fxbus_names[16][32]; /* names of FXBUSes */ | 1459 | char fxbus_names[16][32]; /* names of FXBUSes */ |
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 | |||
617 | static emu_chip_details_t emu_chip_details[] = { | 615 | static 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; |
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index b9fa2e887fee..0529fb281125 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c | |||
@@ -1077,7 +1077,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu) | |||
1077 | gpr += 2; | 1077 | gpr += 2; |
1078 | 1078 | ||
1079 | /* PCM Side Playback (independent from stereo mix) */ | 1079 | /* PCM Side Playback (independent from stereo mix) */ |
1080 | if (emu->spk71) { | 1080 | if (emu->card_capabilities->spk71) { |
1081 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_SIDE)); | 1081 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_SIDE)); |
1082 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+7), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_SIDE)); | 1082 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+7), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_SIDE)); |
1083 | snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Side Playback Volume", gpr, 100); | 1083 | snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Side Playback Volume", gpr, 100); |
@@ -1145,14 +1145,14 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1145 | A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_SPDIF_CD_L); | 1145 | A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_SPDIF_CD_L); |
1146 | A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_SPDIF_CD_R); | 1146 | A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_SPDIF_CD_R); |
1147 | snd_emu10k1_init_stereo_control(&controls[nctl++], | 1147 | snd_emu10k1_init_stereo_control(&controls[nctl++], |
1148 | emu->no_ac97 ? "CD Playback Volume" : "Audigy CD Playback Volume", | 1148 | emu->card_capabilities->ac97_chip ? "Audigy CD Playback Volume" : "CD Playback Volume", |
1149 | gpr, 0); | 1149 | gpr, 0); |
1150 | gpr += 2; | 1150 | gpr += 2; |
1151 | /* Audigy CD Capture Volume */ | 1151 | /* Audigy CD Capture Volume */ |
1152 | A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_SPDIF_CD_L); | 1152 | A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_SPDIF_CD_L); |
1153 | A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_SPDIF_CD_R); | 1153 | A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_SPDIF_CD_R); |
1154 | snd_emu10k1_init_stereo_control(&controls[nctl++], | 1154 | snd_emu10k1_init_stereo_control(&controls[nctl++], |
1155 | emu->no_ac97 ? "CD Capture Volume" : "Audigy CD Capture Volume", | 1155 | emu->card_capabilities->ac97_chip ? "Audigy CD Capture Volume" : "CD Capture Volume", |
1156 | gpr, 0); | 1156 | gpr, 0); |
1157 | gpr += 2; | 1157 | gpr += 2; |
1158 | 1158 | ||
@@ -1171,14 +1171,14 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1171 | A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_LINE2_L); | 1171 | A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_LINE2_L); |
1172 | A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_LINE2_R); | 1172 | A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_LINE2_R); |
1173 | snd_emu10k1_init_stereo_control(&controls[nctl++], | 1173 | snd_emu10k1_init_stereo_control(&controls[nctl++], |
1174 | emu->no_ac97 ? "Line Playback Volume" : "Line2 Playback Volume", | 1174 | emu->card_capabilities->ac97_chip ? "Line2 Playback Volume" : "Line Playback Volume", |
1175 | gpr, 0); | 1175 | gpr, 0); |
1176 | gpr += 2; | 1176 | gpr += 2; |
1177 | /* Line2 Capture Volume */ | 1177 | /* Line2 Capture Volume */ |
1178 | A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_LINE2_L); | 1178 | A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_LINE2_L); |
1179 | A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_LINE2_R); | 1179 | A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_LINE2_R); |
1180 | snd_emu10k1_init_stereo_control(&controls[nctl++], | 1180 | snd_emu10k1_init_stereo_control(&controls[nctl++], |
1181 | emu->no_ac97 ? "Line Capture Volume" : "Line2 Capture Volume", | 1181 | emu->card_capabilities->ac97_chip ? "Line2 Capture Volume" : "Line Capture Volume", |
1182 | gpr, 0); | 1182 | gpr, 0); |
1183 | gpr += 2; | 1183 | gpr += 2; |
1184 | 1184 | ||
@@ -1197,14 +1197,14 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1197 | A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_AUX2_L); | 1197 | A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_AUX2_L); |
1198 | A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_AUX2_R); | 1198 | A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_AUX2_R); |
1199 | snd_emu10k1_init_stereo_control(&controls[nctl++], | 1199 | snd_emu10k1_init_stereo_control(&controls[nctl++], |
1200 | emu->no_ac97 ? "Aux Playback Volume" : "Aux2 Playback Volume", | 1200 | emu->card_capabilities->ac97_chip ? "Aux2 Playback Volume" : "Aux Playback Volume", |
1201 | gpr, 0); | 1201 | gpr, 0); |
1202 | gpr += 2; | 1202 | gpr += 2; |
1203 | /* Aux2 Capture Volume */ | 1203 | /* Aux2 Capture Volume */ |
1204 | A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_AUX2_L); | 1204 | A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_AUX2_L); |
1205 | A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_AUX2_R); | 1205 | A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_AUX2_R); |
1206 | snd_emu10k1_init_stereo_control(&controls[nctl++], | 1206 | snd_emu10k1_init_stereo_control(&controls[nctl++], |
1207 | emu->no_ac97 ? "Aux Capture Volume" : "Aux2 Capture Volume", | 1207 | emu->card_capabilities->ac97_chip ? "Aux2 Capture Volume" : "Aux Capture Volume", |
1208 | gpr, 0); | 1208 | gpr, 0); |
1209 | gpr += 2; | 1209 | gpr += 2; |
1210 | 1210 | ||
@@ -1232,7 +1232,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1232 | snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 0); | 1232 | snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 0); |
1233 | gpr++; | 1233 | gpr++; |
1234 | 1234 | ||
1235 | if (emu->spk71) { | 1235 | if (emu->card_capabilities->spk71) { |
1236 | /* Stereo Mix Side Playback */ | 1236 | /* Stereo Mix Side Playback */ |
1237 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_GPR(playback+6), A_GPR(gpr), A_GPR(stereo_mix)); | 1237 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_GPR(playback+6), A_GPR(gpr), A_GPR(stereo_mix)); |
1238 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+7), A_GPR(playback+7), A_GPR(gpr+1), A_GPR(stereo_mix+1)); | 1238 | A_OP(icode, &ptr, iMAC0, A_GPR(playback+7), A_GPR(playback+7), A_GPR(gpr+1), A_GPR(stereo_mix+1)); |
@@ -1266,7 +1266,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1266 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 3), A_GPR(playback + 3), A_C_00000000, A_C_00000000); /* rear right */ | 1266 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 3), A_GPR(playback + 3), A_C_00000000, A_C_00000000); /* rear right */ |
1267 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), A_GPR(playback + 4), A_C_00000000, A_C_00000000); /* center */ | 1267 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), A_GPR(playback + 4), A_C_00000000, A_C_00000000); /* center */ |
1268 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), A_GPR(playback + 5), A_C_00000000, A_C_00000000); /* LFE */ | 1268 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), A_GPR(playback + 5), A_C_00000000, A_C_00000000); /* LFE */ |
1269 | if (emu->spk71) { | 1269 | if (emu->card_capabilities->spk71) { |
1270 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 6), A_GPR(playback + 6), A_C_00000000, A_C_00000000); /* side left */ | 1270 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 6), A_GPR(playback + 6), A_C_00000000, A_C_00000000); /* side left */ |
1271 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 7), A_GPR(playback + 7), A_C_00000000, A_C_00000000); /* side right */ | 1271 | A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 7), A_GPR(playback + 7), A_C_00000000, A_C_00000000); /* side right */ |
1272 | } | 1272 | } |
@@ -1359,7 +1359,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1359 | A_PUT_STEREO_OUTPUT(A_EXTOUT_AREAR_L, A_EXTOUT_AREAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS); | 1359 | A_PUT_STEREO_OUTPUT(A_EXTOUT_AREAR_L, A_EXTOUT_AREAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS); |
1360 | A_PUT_OUTPUT(A_EXTOUT_ACENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS); | 1360 | A_PUT_OUTPUT(A_EXTOUT_ACENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS); |
1361 | A_PUT_OUTPUT(A_EXTOUT_ALFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS); | 1361 | A_PUT_OUTPUT(A_EXTOUT_ALFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS); |
1362 | if (emu->spk71) | 1362 | if (emu->card_capabilities->spk71) |
1363 | A_PUT_STEREO_OUTPUT(A_EXTOUT_ASIDE_L, A_EXTOUT_ASIDE_R, playback+6 + SND_EMU10K1_PLAYBACK_CHANNELS); | 1363 | A_PUT_STEREO_OUTPUT(A_EXTOUT_ASIDE_L, A_EXTOUT_ASIDE_R, playback+6 + SND_EMU10K1_PLAYBACK_CHANNELS); |
1364 | 1364 | ||
1365 | /* headphone */ | 1365 | /* headphone */ |
@@ -1982,22 +1982,27 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu) | |||
1982 | OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_MIC_CAP), GPR(capture + 2), C_00000000, C_00000000); | 1982 | OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_MIC_CAP), GPR(capture + 2), C_00000000, C_00000000); |
1983 | 1983 | ||
1984 | /* EFX capture - capture the 16 EXTINS */ | 1984 | /* EFX capture - capture the 16 EXTINS */ |
1985 | OP(icode, &ptr, iACC3, FXBUS2(14), C_00000000, C_00000000, EXTIN(0)); | 1985 | if (emu->card_capabilities->sblive51) { |
1986 | OP(icode, &ptr, iACC3, FXBUS2(15), C_00000000, C_00000000, EXTIN(1)); | 1986 | /* On the Live! 5.1, FXBUS2(1) and FXBUS(2) are shared with EXTOUT_ACENTER |
1987 | OP(icode, &ptr, iACC3, FXBUS2(0), C_00000000, C_00000000, EXTIN(2)); | 1987 | * and EXTOUT_ALFE, so we can't connect inputs to them for multitrack recording. |
1988 | OP(icode, &ptr, iACC3, FXBUS2(3), C_00000000, C_00000000, EXTIN(3)); | 1988 | * |
1989 | /* Dont connect anything to FXBUS2 1 and 2. These are shared with | 1989 | * Since only 14 of the 16 EXTINs are used, this is not a big problem. |
1990 | * Center/LFE on the SBLive 5.1. The kX driver only changes the | 1990 | * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture |
1991 | * routing when it detects an SBLive 5.1. | 1991 | * 0 and 3, then the rest of the EXTINs to the corresponding FX capture |
1992 | * | 1992 | * channel. Multitrack recorders will still see the center/lfe output signal |
1993 | * Since only 14 of the 16 EXTINs are used, this is not a big problem. | 1993 | * on the second and third channels. |
1994 | * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture | 1994 | */ |
1995 | * 0 and 3, then the rest of the EXTINs to the corresponding FX capture | 1995 | OP(icode, &ptr, iACC3, FXBUS2(14), C_00000000, C_00000000, EXTIN(0)); |
1996 | * channel. | 1996 | OP(icode, &ptr, iACC3, FXBUS2(15), C_00000000, C_00000000, EXTIN(1)); |
1997 | */ | 1997 | OP(icode, &ptr, iACC3, FXBUS2(0), C_00000000, C_00000000, EXTIN(2)); |
1998 | for (z = 4; z < 14; z++) { | 1998 | OP(icode, &ptr, iACC3, FXBUS2(3), C_00000000, C_00000000, EXTIN(3)); |
1999 | OP(icode, &ptr, iACC3, FXBUS2(z), C_00000000, C_00000000, EXTIN(z)); | 1999 | for (z = 4; z < 14; z++) |
2000 | OP(icode, &ptr, iACC3, FXBUS2(z), C_00000000, C_00000000, EXTIN(z)); | ||
2001 | } else { | ||
2002 | for (z = 0; z < 16; z++) | ||
2003 | OP(icode, &ptr, iACC3, FXBUS2(z), C_00000000, C_00000000, EXTIN(z)); | ||
2000 | } | 2004 | } |
2005 | |||
2001 | 2006 | ||
2002 | if (gpr > tmp) { | 2007 | if (gpr > tmp) { |
2003 | snd_BUG(); | 2008 | snd_BUG(); |
@@ -2128,7 +2133,6 @@ static int snd_emu10k1_fx8010_info(emu10k1_t *emu, emu10k1_fx8010_info_t *info) | |||
2128 | int res; | 2133 | int res; |
2129 | 2134 | ||
2130 | memset(info, 0, sizeof(info)); | 2135 | memset(info, 0, sizeof(info)); |
2131 | info->card = emu->card_type; | ||
2132 | info->internal_tram_size = emu->fx8010.itram_size; | 2136 | info->internal_tram_size = emu->fx8010.itram_size; |
2133 | info->external_tram_size = emu->fx8010.etram_pages.bytes / 2; | 2137 | info->external_tram_size = emu->fx8010.etram_pages.bytes / 2; |
2134 | fxbus = fxbuses; | 2138 | fxbus = fxbuses; |
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 044663d31aa7..d0b296587cc0 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -791,7 +791,7 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu) | |||
791 | NULL | 791 | NULL |
792 | }; | 792 | }; |
793 | 793 | ||
794 | if (!emu->no_ac97) { | 794 | if (emu->card_capabilities->ac97_chip) { |
795 | ac97_bus_t *pbus; | 795 | ac97_bus_t *pbus; |
796 | ac97_template_t ac97; | 796 | ac97_template_t ac97; |
797 | static ac97_bus_ops_t ops = { | 797 | static ac97_bus_ops_t ops = { |
@@ -833,7 +833,7 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu) | |||
833 | for (; *c; c++) | 833 | for (; *c; c++) |
834 | remove_ctl(card, *c); | 834 | remove_ctl(card, *c); |
835 | } else { | 835 | } else { |
836 | if (emu->APS) | 836 | if (emu->card_capabilities->ecard) |
837 | strcpy(emu->card->mixername, "EMU APS"); | 837 | strcpy(emu->card->mixername, "EMU APS"); |
838 | else if (emu->audigy) | 838 | else if (emu->audigy) |
839 | strcpy(emu->card->mixername, "SB Audigy"); | 839 | strcpy(emu->card->mixername, "SB Audigy"); |
@@ -918,7 +918,7 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu) | |||
918 | mix->attn[0] = 0xffff; | 918 | mix->attn[0] = 0xffff; |
919 | } | 919 | } |
920 | 920 | ||
921 | if (! emu->APS) { /* FIXME: APS has these controls? */ | 921 | if (! emu->card_capabilities->ecard) { /* FIXME: APS has these controls? */ |
922 | /* sb live! and audigy */ | 922 | /* sb live! and audigy */ |
923 | if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL) | 923 | if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL) |
924 | return -ENOMEM; | 924 | return -ENOMEM; |
@@ -939,14 +939,14 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu) | |||
939 | return -ENOMEM; | 939 | return -ENOMEM; |
940 | if ((err = snd_ctl_add(card, kctl))) | 940 | if ((err = snd_ctl_add(card, kctl))) |
941 | return err; | 941 | return err; |
942 | } else if (! emu->APS) { | 942 | } else if (! emu->card_capabilities->ecard) { |
943 | /* sb live! */ | 943 | /* sb live! */ |
944 | if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL) | 944 | if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL) |
945 | return -ENOMEM; | 945 | return -ENOMEM; |
946 | if ((err = snd_ctl_add(card, kctl))) | 946 | if ((err = snd_ctl_add(card, kctl))) |
947 | return err; | 947 | return err; |
948 | } | 948 | } |
949 | if (emu->audigy && emu->revision == 4) { /* P16V */ | 949 | if (emu->card_capabilities->ca0151_chip) { /* P16V */ |
950 | if ((err = snd_p16v_mixer(emu))) | 950 | if ((err = snd_p16v_mixer(emu))) |
951 | return err; | 951 | return err; |
952 | } | 952 | } |
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c index d990d5eb45a8..732d17d1307f 100644 --- a/sound/pci/emu10k1/emuproc.c +++ b/sound/pci/emu10k1/emuproc.c | |||
@@ -182,7 +182,7 @@ static void snd_emu10k1_proc_read(snd_info_entry_t *entry, | |||
182 | 182 | ||
183 | snd_iprintf(buffer, "EMU10K1\n\n"); | 183 | snd_iprintf(buffer, "EMU10K1\n\n"); |
184 | snd_iprintf(buffer, "Card : %s\n", | 184 | snd_iprintf(buffer, "Card : %s\n", |
185 | emu->audigy ? "Audigy" : (emu->APS ? "EMU APS" : "Creative")); | 185 | emu->audigy ? "Audigy" : (emu->card_capabilities->ecard ? "EMU APS" : "Creative")); |
186 | snd_iprintf(buffer, "Internal TRAM (words) : 0x%x\n", emu->fx8010.itram_size); | 186 | snd_iprintf(buffer, "Internal TRAM (words) : 0x%x\n", emu->fx8010.itram_size); |
187 | snd_iprintf(buffer, "External TRAM (words) : 0x%x\n", (int)emu->fx8010.etram_pages.bytes / 2); | 187 | snd_iprintf(buffer, "External TRAM (words) : 0x%x\n", (int)emu->fx8010.etram_pages.bytes / 2); |
188 | snd_iprintf(buffer, "\n"); | 188 | snd_iprintf(buffer, "\n"); |