static void __exit unload_ss_ms_sound(struct address_info *hw_config)
{
	ad1848_unload(hw_config->io_base,
		      hw_config->irq,
		      devc->dma,
		      devc->dma,
		      0);
	sound_unload_audiodev(hw_config->slots[0]);
}
Beispiel #2
0
void unload_mad16(struct address_info *hw_config)
{
	ad1848_unload(hw_config->io_base + 4,
			hw_config->irq,
			hw_config->dma,
			hw_config->dma2, 0);
	release_region(hw_config->io_base, 4);
	sound_unload_audiodev(hw_config->slots[0]);
}
Beispiel #3
0
int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
            int driver_size, int flags, unsigned int format_mask,
            void *devc, int dma1, int dma2)
{
    struct audio_driver *d;
    struct audio_operations *op;
    int num;

    if (vers != AUDIO_DRIVER_VERSION || driver_size > sizeof(struct audio_driver)) {
        printk(KERN_ERR "Sound: Incompatible audio driver for %s\n", name);
        return -(EINVAL);
    }
    num = sound_alloc_audiodev();

    if (num == -1) {
        printk(KERN_ERR "sound: Too many audio drivers\n");
        return -(EBUSY);
    }
    d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver)));

    if (sound_nblocks < 1024)
        sound_nblocks++;

    op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations)));

    if (sound_nblocks < 1024)
        sound_nblocks++;
    if (d == NULL || op == NULL) {
        printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name);
        sound_unload_audiodev(num);
        return -(ENOMEM);
    }
    memset((char *) op, 0, sizeof(struct audio_operations));
    init_waitqueue_head(&op->in_sleeper);
    init_waitqueue_head(&op->out_sleeper);    
    init_waitqueue_head(&op->poll_sleeper);
    if (driver_size < sizeof(struct audio_driver))
        memset((char *) d, 0, sizeof(struct audio_driver));

    memcpy((char *) d, (char *) driver, driver_size);

    op->d = d;
    strlcpy(op->name, name, sizeof(op->name));
    op->flags = flags;
    op->format_mask = format_mask;
    op->devc = devc;

    /*
     *    Hardcoded defaults
     */
    audio_devs[num] = op;

    DMAbuf_init(num, dma1, dma2);

    audio_init_devices();
    return num;
}
static void __exit unload_gus_db16(struct address_info *hw_config)
{

	ad1848_unload(hw_config->io_base,
		      hw_config->irq,
		      hw_config->dma,
		      hw_config->dma, 0);
	sound_unload_audiodev(hw_config->slots[3]);
}
Beispiel #5
0
static void __exit cleanup_nm256 (void)
{
    if (loaded) {
	struct nm256_info *card;
	struct nm256_info *next_card;

	for (card = nmcard_list; card != NULL; card = next_card) {
	    stopPlay (card);
	    stopRecord (card);
	    if (card->has_irq)
		free_irq (card->irq, card);
	    nm256_release_ports (card);
	    sound_unload_mixerdev (card->mixer_oss_dev);
	    sound_unload_audiodev (card->dev[0]);
	    sound_unload_audiodev (card->dev[1]);
	    next_card = card->next_card;
	    kfree (card);
	}
	nmcard_list = NULL;
    }
    pm_unregister_all (&handle_pm_event);
}
Beispiel #6
0
static void __devinit
nm256_remove(struct pci_dev *pcidev) {
    struct nm256_info *xcard = pci_get_drvdata(pcidev);
    struct nm256_info *card,*next_card = NULL;

    for (card = nmcard_list; card != NULL; card = next_card) {
	next_card = card->next_card;
	if (card == xcard) {
	    stopPlay (card);
	    stopRecord (card);
	    if (card->has_irq)
		free_irq (card->irq, card);
	    nm256_release_ports (card);
	    sound_unload_mixerdev (card->mixer_oss_dev);
	    sound_unload_audiodev (card->dev[0]);
	    sound_unload_audiodev (card->dev[1]);
	    kfree (card);
	    break;
	}
    }
    if (nmcard_list == card)
    	nmcard_list = next_card;
}
Beispiel #7
0
static void __exit unload_trix_wss(struct address_info *hw_config)
{
    int dma2 = hw_config->dma2;

    if (dma2 == -1)
        dma2 = hw_config->dma;

    release_region(0x390, 2);
    release_region(hw_config->io_base, 4);

    ad1848_unload(hw_config->io_base + 4,
              hw_config->irq,
              hw_config->dma,
              dma2,
              0);
    sound_unload_audiodev(hw_config->slots[0]);
}