Lines Matching +full:x +full:- +full:max

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for Gravis UltraSound MAX soundcard
22 MODULE_DESCRIPTION("Gravis UltraSound MAX");
25 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
32 static int joystick_dac[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 29};
33 /* 0 to 31, (0.59V-4.52V or 0.389V-2.98V) */
34 static int channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 24};
35 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
38 MODULE_PARM_DESC(index, "Index value for GUS MAX soundcard.");
40 MODULE_PARM_DESC(id, "ID string for GUS MAX soundcard.");
42 MODULE_PARM_DESC(enable, "Enable GUS MAX soundcard.");
44 MODULE_PARM_DESC(port, "Port # for GUS MAX driver.");
46 MODULE_PARM_DESC(irq, "IRQ # for GUS MAX driver.");
48 MODULE_PARM_DESC(dma1, "DMA1 # for GUS MAX driver.");
50 MODULE_PARM_DESC(dma2, "DMA2 # for GUS MAX driver.");
52 MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for GUS MAX driver."…
54 MODULE_PARM_DESC(channels, "Used GF1 channels for GUS MAX driver.");
56 MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS MAX driver.");
74 dev_dbg(gus->card->dev, "[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); in snd_gusmax_detect()
75 return -ENODEV; in snd_gusmax_detect()
82 dev_dbg(gus->card->dev, "[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); in snd_gusmax_detect()
83 return -ENODEV; in snd_gusmax_detect()
92 int loop, max = 5; in snd_gusmax_interrupt() local
97 if (inb(maxcard->gus_status_reg)) { in snd_gusmax_interrupt()
99 snd_gus_interrupt(irq, maxcard->gus); in snd_gusmax_interrupt()
102 if (inb(maxcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ in snd_gusmax_interrupt()
104 snd_wss_interrupt(irq, maxcard->wss); in snd_gusmax_interrupt()
107 } while (loop && --max > 0); in snd_gusmax_interrupt()
114 gus->equal_irq = 1; in snd_gusmax_init()
115 gus->codec_flag = 1; in snd_gusmax_init()
116 gus->joystick_dac = joystick_dac[dev]; in snd_gusmax_init()
118 gus->max_cntrl_val = (gus->gf1.port >> 4) & 0x0f; in snd_gusmax_init()
119 if (gus->gf1.dma1 > 3) in snd_gusmax_init()
120 gus->max_cntrl_val |= 0x10; in snd_gusmax_init()
121 if (gus->gf1.dma2 > 3) in snd_gusmax_init()
122 gus->max_cntrl_val |= 0x20; in snd_gusmax_init()
123 gus->max_cntrl_val |= 0x40; in snd_gusmax_init()
124 outb(gus->max_cntrl_val, GUSP(gus, MAXCNTRLPORT)); in snd_gusmax_init()
129 struct snd_card *card = chip->card; in snd_gusmax_mixer()
187 static const int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; in snd_gusmax_probe()
188 static const int possible_dmas[] = {5, 6, 7, 1, 3, -1}; in snd_gusmax_probe()
199 maxcard = card->private_data; in snd_gusmax_probe()
200 maxcard->card = card; in snd_gusmax_probe()
201 maxcard->irq = -1; in snd_gusmax_probe()
208 return -EBUSY; in snd_gusmax_probe()
216 return -EBUSY; in snd_gusmax_probe()
224 return -EBUSY; in snd_gusmax_probe()
231 -xirq, xdma1, xdma2, in snd_gusmax_probe()
243 -xirq, xdma1, xdma2, in snd_gusmax_probe()
260 maxcard->gus_status_reg = gus->gf1.reg_irqstat; in snd_gusmax_probe()
261 maxcard->pcm_status_reg = gus->gf1.port + 0x10c + 2; in snd_gusmax_probe()
267 if (!gus->max_flag) { in snd_gusmax_probe()
268 dev_err(pdev, "GUS MAX soundcard was not detected at 0x%lx\n", gus->gf1.port); in snd_gusmax_probe()
269 return -ENODEV; in snd_gusmax_probe()
272 if (devm_request_irq(card->dev, xirq, snd_gusmax_interrupt, 0, in snd_gusmax_probe()
273 "GUS MAX", (void *)maxcard)) { in snd_gusmax_probe()
275 return -EBUSY; in snd_gusmax_probe()
277 maxcard->irq = xirq; in snd_gusmax_probe()
278 card->sync_irq = maxcard->irq; in snd_gusmax_probe()
281 gus->gf1.port + 0x10c, -1, xirq, in snd_gusmax_probe()
316 …sprintf(card->longname + strlen(card->longname), " at 0x%lx, irq %i, dma %i", gus->gf1.port, xirq,… in snd_gusmax_probe()
318 sprintf(card->longname + strlen(card->longname), "&%i", xdma2); in snd_gusmax_probe()
324 maxcard->gus = gus; in snd_gusmax_probe()
325 maxcard->wss = wss; in snd_gusmax_probe()