void attach_gus_card (struct address_info *hw_config) { int io_addr; gus_osp = hw_config->osp; snd_set_irq_handler (hw_config->irq, gusintr, "Gravis Ultrasound", hw_config->osp); if (gus_wave_detect (hw_config->io_base)) /* * Try first the default */ { gus_wave_init (hw_config); request_region (hw_config->io_base, 16, "GUS"); request_region (hw_config->io_base + 0x100, 12, "GUS"); /* 0x10c-> is MAX */ if (sound_alloc_dma (hw_config->dma, "GUS")) printk ("gus_card.c: Can't allocate DMA channel\n"); if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma) if (sound_alloc_dma (hw_config->dma2, "GUS(2)")) printk ("gus_card.c: Can't allocate DMA channel2\n"); #ifdef CONFIG_MIDI gus_midi_init (); #endif return; } #ifndef EXCLUDE_GUS_IODETECT /* * Look at the possible base addresses (0x2X0, X=1, 2, 3, 4, 5, 6) */ for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10) if (io_addr != hw_config->io_base) /* * Already tested */ if (gus_wave_detect (io_addr)) { hw_config->io_base = io_addr; printk (" WARNING! GUS found at %x, config was %x ", io_addr, hw_config->io_base); gus_wave_init (hw_config); request_region (io_addr, 16, "GUS"); request_region (io_addr + 0x100, 12, "GUS"); /* 0x10c-> is MAX */ if (sound_alloc_dma (hw_config->dma, "GUS")) printk ("gus_card.c: Can't allocate DMA channel\n"); if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma) if (sound_alloc_dma (hw_config->dma2, "GUS")) printk ("gus_card.c: Can't allocate DMA channel2\n"); #ifdef CONFIG_MIDI gus_midi_init (); #endif return; } #endif }
long attach_gus_card (long mem_start, struct address_info *hw_config) { int io_addr; snd_set_irq_handler (hw_config->irq, gusintr); if (gus_wave_detect (hw_config->io_base)) /* Try first the default */ { mem_start = gus_wave_init (mem_start, hw_config->irq, hw_config->dma); #ifndef EXCLUDE_MIDI mem_start = gus_midi_init (mem_start); #endif return mem_start; } #ifndef EXCLUDE_GUS_IODETECT /* * Look at the possible base addresses (0x2X0, X=1, 2, 3, 4, 5, 6) */ for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10) if (io_addr != hw_config->io_base) /* Already tested */ if (gus_wave_detect (io_addr)) { printk (" WARNING! GUS found at %x, config was %x ", io_addr, hw_config->io_base); mem_start = gus_wave_init (mem_start, hw_config->irq, hw_config->dma); #ifndef EXCLUDE_MIDI mem_start = gus_midi_init (mem_start); #endif return mem_start; } #endif return mem_start; /* Not detected */ }
static void __init attach_gus(struct address_info *hw_config) { gus_wave_init(hw_config); if (sound_alloc_dma(hw_config->dma, "GUS")) printk(KERN_ERR "gus_card.c: Can't allocate DMA channel %d\n", hw_config->dma); if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma) if (sound_alloc_dma(hw_config->dma2, "GUS(2)")) printk(KERN_ERR "gus_card.c: Can't allocate DMA channel %d\n", hw_config->dma2); gus_midi_init(hw_config); if(request_irq(hw_config->irq, gusintr, 0, "Gravis Ultrasound", hw_config)<0) printk(KERN_ERR "gus_card.c: Unable to allocate IRQ %d\n", hw_config->irq); return; }