26 #include <linux/time.h>
27 #include <linux/module.h>
32 #define SNDRV_LEGACY_FIND_FREE_IRQ
33 #define SNDRV_LEGACY_FIND_FREE_DMA
68 MODULE_PARM_DESC(joystick_dac,
"Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for GUS MAX driver.");
83 #define PFX "gusmax: "
123 }
while (loop && --max > 0);
135 if (gus->
gf1.dma1 > 3)
137 if (gus->
gf1.dma2 > 3)
154 strcpy(
id2.name,
"Synth Playback Switch");
158 strcpy(
id2.name,
"Synth Playback Volume");
172 if (snd_mixer_group_rename(mixer,
173 SNDRV_MIXER_IN_MONO, 0,
174 SNDRV_MIXER_IN_MIC, 0) < 0)
176 if (snd_mixer_elem_rename(mixer,
177 SNDRV_MIXER_IN_MONO, 0, SNDRV_MIXER_ETYPE_INPUT,
178 SNDRV_MIXER_IN_MIC, 0) < 0)
180 if (snd_mixer_elem_rename(mixer,
181 "Mono Capture Volume", 0, SNDRV_MIXER_ETYPE_VOLUME1,
182 "Mic Capture Volume", 0) < 0)
184 if (snd_mixer_elem_rename(mixer,
185 "Mono Capture Switch", 0, SNDRV_MIXER_ETYPE_SWITCH1,
186 "Mic Capture Switch", 0) < 0)
192 static void snd_gusmax_free(
struct snd_card *card)
198 if (maxcard->
irq >= 0)
202 static int __devinit snd_gusmax_match(
struct device *pdev,
unsigned int dev)
207 static int __devinit snd_gusmax_probe(
struct device *pdev,
unsigned int dev)
209 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};
210 static int possible_dmas[] = {5, 6, 7, 1, 3, -1};
211 int xirq, xdma1, xdma2,
err;
228 if ((xirq = snd_legacy_find_free_irq(possible_irqs)) < 0) {
236 if ((xdma1 = snd_legacy_find_free_dma(possible_dmas)) < 0) {
244 if ((xdma2 = snd_legacy_find_free_dma(possible_dmas)) < 0) {
259 static unsigned long possible_ports[] = {
260 0x220, 0x230, 0x240, 0x250, 0x260
263 for (i = 0; i <
ARRAY_SIZE(possible_ports); i++) {
279 if ((err = snd_gusmax_detect(gus)) < 0)
284 snd_gusmax_init(dev, card, gus);
294 if (
request_irq(xirq, snd_gusmax_interrupt, 0,
"GUS MAX", (
void *)maxcard)) {
302 gus->
gf1.port + 0x10c, -1, xirq,
303 xdma2 < 0 ? xdma1 : xdma2, xdma1,
324 if (pcm_channels[dev] > 0) {
328 err = snd_gusmax_mixer(wss);
357 static int __devexit snd_gusmax_remove(
struct device *devptr,
unsigned int dev)
364 #define DEV_NAME "gusmax"
366 static struct isa_driver snd_gusmax_driver = {
367 .match = snd_gusmax_match,
368 .probe = snd_gusmax_probe,
376 static int __init alsa_card_gusmax_init(
void)
381 static void __exit alsa_card_gusmax_exit(
void)