26 #include <linux/time.h>
27 #include <linux/module.h>
34 #define SNDRV_LEGACY_AUTO_PROBE
35 #define SNDRV_LEGACY_FIND_FREE_IRQ
36 #define SNDRV_LEGACY_FIND_FREE_DMA
39 #define CRD_NAME "Gravis UltraSound Extreme"
40 #define DEV_NAME "gusextreme"
100 static long possible_ports[] = {0x220, 0x240, 0x260};
101 static int possible_irqs[] = {5, 9, 10, 7, -1};
102 static int possible_dmas[] = {1, 3, 0, -1};
107 irq[
n] = snd_legacy_find_free_irq(possible_irqs);
109 dev_err(dev,
"unable to find a free IRQ for ES1688\n");
114 dma8[
n] = snd_legacy_find_free_dma(possible_dmas);
116 dev_err(dev,
"unable to find a free DMA for ES1688\n");
127 port[
n] = possible_ports[
i];
130 }
while (error < 0 && ++i <
ARRAY_SIZE(possible_ports));
138 static int possible_irqs[] = {11, 12, 15, 9, 5, 7, 3, -1};
139 static int possible_dmas[] = {5, 6, 7, 3, 1, -1};
142 gf1_irq[
n] = snd_legacy_find_free_irq(possible_irqs);
143 if (gf1_irq[n] < 0) {
144 dev_err(dev,
"unable to find a free IRQ for GF1\n");
149 dma1[
n] = snd_legacy_find_free_dma(possible_dmas);
151 dev_err(dev,
"unable to find a free DMA for GF1\n");
156 0, channels[n], pcm_channels[n], 0, rgus);
181 spin_unlock_irqrestore(&es1688->
mixer_lock, flags);
189 spin_unlock_irqrestore(&es1688->
reg_lock, flags);
220 strcpy(
id2.name,
"Synth Playback Volume");
226 strcpy(
id1.name,
"Master Playback Switch");
227 strcpy(
id2.name,
"Synth Playback Switch");
235 static int __devinit snd_gusextreme_probe(
struct device *dev,
unsigned int n)
256 error = snd_gusextreme_es1688_create(card, es1688, dev, n);
261 gf1_port[
n] = es1688->
port + 0x20;
263 error = snd_gusextreme_gus_card_create(card, dev, n, &gus);
267 error = snd_gusextreme_detect(gus, es1688);
279 dev_err(dev,
"GUS Extreme soundcard was not "
280 "detected at 0x%lx\n", gus->
gf1.port);
295 if (pcm_channels[n] > 0) {
305 error = snd_gusextreme_mixer(card);
311 dev_warn(dev,
"opl3 not detected at 0x%lx\n", es1688->
port);
326 "irq %i&%i, dma %i&%i", es1688->
port,
342 static int __devexit snd_gusextreme_remove(
struct device *dev,
unsigned int n)
349 static struct isa_driver snd_gusextreme_driver = {
350 .match = snd_gusextreme_match,
351 .probe = snd_gusextreme_probe,
354 .suspend = snd_gusextreme_suspend,
355 .resume = snd_gusextreme_resume,
362 static int __init alsa_card_gusextreme_init(
void)
367 static void __exit alsa_card_gusextreme_exit(
void)