Lines Matching +full:dsp +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for Gallant SC-6000 soundcard. This card is also known as
4 * Audio Excel DSP 16 or Zoltrix AV302.
5 * These cards use CompuMedia ASC-9308 chip + AD1848 codec.
6 * SC-6600 and SC-7000 cards are also supported. They are based on
7 * CompuMedia ASC-9408 chip and CS4231 codec.
30 MODULE_DESCRIPTION("Gallant SC-6000");
33 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
43 static bool joystick[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = false };
46 MODULE_PARM_DESC(index, "Index value for sc-6000 based soundcard.");
48 MODULE_PARM_DESC(id, "ID string for sc-6000 based soundcard.");
50 MODULE_PARM_DESC(enable, "Enable sc-6000 based soundcard.");
52 MODULE_PARM_DESC(port, "Port # for sc-6000 driver.");
54 MODULE_PARM_DESC(mss_port, "MSS Port # for sc-6000 driver.");
56 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for sc-6000 driver.");
58 MODULE_PARM_DESC(irq, "IRQ # for sc-6000 driver.");
60 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for sc-6000 driver.");
62 MODULE_PARM_DESC(dma, "DMA # for sc-6000 driver.");
67 * Commands of SC6000's DSP (SBPRO+special).
81 #define GET_DSP_VERSION 0xe1 /* Get DSP Version */
82 #define GET_DSP_COPYRIGHT 0xe3 /* Get DSP Copyright */
85 * Offsets of SC6000 DSP I/O ports. The offset is added to base I/O port
90 * (w-) == Write
91 * (r-) == Read
93 #define DSP_RESET 0x06 /* offset of DSP RESET (wo) */
94 #define DSP_READ 0x0a /* offset of DSP READ (ro) */
95 #define DSP_WRITE 0x0c /* offset of DSP WRITE (w-) */
96 #define DSP_COMMAND 0x0c /* offset of DSP COMMAND (w-) */
97 #define DSP_STATUS 0x0c /* offset of DSP STATUS (r-) */
98 #define DSP_DATAVAIL 0x0e /* offset of DSP DATA AVAILABLE (ro) */
101 #define DRV_NAME "SC-6000"
106 * sc6000_irq_to_softcfg - Decode irq number into cfg code.
135 * sc6000_dma_to_softcfg - Decode dma number into cfg code.
158 * sc6000_mpu_irq_to_softcfg - Decode MPU-401 irq number into cfg code.
193 } while (loop--); in sc6000_wait_data()
195 return -EAGAIN; in sc6000_wait_data()
201 return -EBUSY; in sc6000_read()
215 * DSP ready to receive data if bit 7 of val == 0 in sc6000_write()
222 } while (loop--); in sc6000_write()
224 dev_err(devptr, "DSP Command (0x%x) timeout.\n", cmd); in sc6000_write()
226 return -EIO; in sc6000_write()
237 return -EIO; in sc6000_dsp_get_answer()
254 return len ? len : -EIO; in sc6000_dsp_get_answer()
265 return -ENODEV; in sc6000_dsp_reset()
274 return -EIO; in sc6000_hw_cfg_write()
278 return -EIO; in sc6000_hw_cfg_write()
282 return -EIO; in sc6000_hw_cfg_write()
286 return -EIO; in sc6000_hw_cfg_write()
290 return -EIO; in sc6000_hw_cfg_write()
302 return -EIO; in sc6000_cfg_write()
306 return -EIO; in sc6000_cfg_write()
320 return -EIO; in sc6000_setup_board()
322 } while ((sc6000_wait_data(vport) < 0) && loop--); in sc6000_setup_board()
327 return -EIO; in sc6000_setup_board()
331 return -ENODEV; in sc6000_setup_board()
343 return -EIO; in sc6000_init_mss()
349 return -EIO; in sc6000_init_mss()
402 return -ENODEV; in sc6000_init_board()
405 * My SC-6000 card return "SC-6000" in DSPCopyright, so in sc6000_init_board()
408 if (strncmp("SC-6000", answer, 7)) in sc6000_init_board()
409 dev_warn(devptr, "Warning: non SC-6000 audio card!\n"); in sc6000_init_board()
413 return -ENODEV; in sc6000_init_board()
415 dev_info(devptr, "Detected model: %s, DSP version %d.%d\n", in sc6000_init_board()
430 return -EIO; in sc6000_init_board()
436 return -ENODEV; in sc6000_init_board()
450 return -ENODEV; in sc6000_init_board()
455 return -ENODEV; in sc6000_init_board()
463 struct snd_card *card = chip->card; in snd_sc6000_mixer()
526 dev_err(devptr, "invalid MPU-401 port %lx\n", in snd_sc6000_match()
533 dev_err(devptr, "invalid MPU-401 IRQ %d\n", mpu_irq[dev]); in snd_sc6000_match()
541 char __iomem *vport = (char __force __iomem *)card->private_data; in snd_sc6000_free()
544 sc6000_setup_board(card->dev, vport, 0); in snd_sc6000_free()
549 static const int possible_irqs[] = { 5, 7, 9, 10, 11, -1 }; in __snd_sc6000_probe()
550 static const int possible_dmas[] = { 1, 3, 0, -1 }; in __snd_sc6000_probe()
569 return -EBUSY; in __snd_sc6000_probe()
577 return -EBUSY; in __snd_sc6000_probe()
583 return -EBUSY; in __snd_sc6000_probe()
588 return -EBUSY; in __snd_sc6000_probe()
590 card->private_data = (void __force *)vport; in __snd_sc6000_probe()
595 "SC-6000 port I/O port region is already in use.\n"); in __snd_sc6000_probe()
596 return -EBUSY; in __snd_sc6000_probe()
601 return -EBUSY; in __snd_sc6000_probe()
611 card->private_free = snd_sc6000_free; in __snd_sc6000_probe()
613 err = snd_wss_create(card, mss_port[dev] + 4, -1, xirq, xdma, -1, in __snd_sc6000_probe()
636 dev_err(devptr, "no OPL device at 0x%x-0x%x ?\n", in __snd_sc6000_probe()
646 mpu_irq[dev] = -1; in __snd_sc6000_probe()
651 dev_err(devptr, "no MPU-401 device at 0x%lx ?\n", in __snd_sc6000_probe()
655 strcpy(card->driver, DRV_NAME); in __snd_sc6000_probe()
656 strcpy(card->shortname, "SC-6000"); in __snd_sc6000_probe()
657 sprintf(card->longname, "Gallant SC-6000 at 0x%lx, irq %d, dma %d", in __snd_sc6000_probe()