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 }
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; }
void attach_vidc(struct address_info *hw_config) { char name[32]; int i; sprintf(name, "VIDC %d-bit sound", hw_config->card_subtype); conf_printf(name, hw_config); for (i = 0; i < 2; i++) { dma_buf[i] = get_free_page(GFP_KERNEL); dma_pbuf[i] = virt_to_phys(dma_buf[i]); } if (sound_alloc_dma(hw_config->dma, "VIDCsound")) { printk(KERN_ERR "VIDCsound: can't allocate virtual DMA channel\n"); return; } if (request_irq(hw_config->irq, vidc_sound_dma_irq, 0, "VIDCsound", &dma_start)) { printk(KERN_ERR "VIDCsound: can't allocate DMA interrupt\n"); return; } // vidc_synth_init(hw_config); vidc_audio_init(hw_config); vidc_mixer_init(hw_config); }
static int __init config_pas_hw(struct address_info *hw_config) { char ok = 1; unsigned int_ptrs; /* scsi/sound interrupt pointers */ pas_irq = hw_config->irq; pas_write(0x00, 0x0B8B); pas_write(0x36, 0x138B); pas_write(0x36, 0x1388); pas_write(0, 0x1388); pas_write(0x74, 0x138B); pas_write(0x74, 0x1389); pas_write(0, 0x1389); pas_write(0x80 | 0x40 | 0x20 | 1, 0x0B8A); pas_write(0x80 | 0x20 | 0x10 | 0x08 | 0x01, 0xF8A); pas_write(0x01 | 0x02 | 0x04 | 0x10 /* * | * 0x80 */ , 0xB88); pas_write(0x80 | (joystick ? 0x40 : 0), 0xF388); if (pas_irq < 0 || pas_irq > 15) { printk(KERN_ERR "PAS16: Invalid IRQ %d", pas_irq); hw_config->irq=-1; ok = 0; } else { int_ptrs = pas_read(0xF38A); int_ptrs = (int_ptrs & 0xf0) | irq_bits[pas_irq]; pas_write(int_ptrs, 0xF38A); if (!irq_bits[pas_irq]) { printk(KERN_ERR "PAS16: Invalid IRQ %d", pas_irq); hw_config->irq=-1; ok = 0; } else { if (request_irq(pas_irq, pasintr, 0, "PAS16",hw_config) < 0) { printk(KERN_ERR "PAS16: Cannot allocate IRQ %d\n",pas_irq); hw_config->irq=-1; ok = 0; } } } if (hw_config->dma < 0 || hw_config->dma > 7) { printk(KERN_ERR "PAS16: Invalid DMA selection %d", hw_config->dma); hw_config->dma=-1; ok = 0; } else { pas_write(dma_bits[hw_config->dma], 0xF389); if (!dma_bits[hw_config->dma]) { printk(KERN_ERR "PAS16: Invalid DMA selection %d", hw_config->dma); hw_config->dma=-1; ok = 0; } else { if (sound_alloc_dma(hw_config->dma, "PAS16")) { printk(KERN_ERR "pas2_card.c: Can't allocate DMA channel\n"); hw_config->dma=-1; ok = 0; } } } /* * This fixes the timing problems of the PAS due to the Symphony chipset * as per Media Vision. Only define this if your PAS doesn't work correctly. */ if(symphony) { outb((0x05), 0xa8); outb((0x60), 0xa9); } if(broken_bus_clock) pas_write(0x01 | 0x10 | 0x20 | 0x04, 0x8388); else /* * pas_write(0x01, 0x8388); */ pas_write(0x01 | 0x10 | 0x20, 0x8388); pas_write(0x18, 0x838A); /* ??? */ pas_write(0x20 | 0x01, 0x0B8A); /* Mute off, filter = 17.897 kHz */ pas_write(8, 0xBF8A); mix_write(0x80 | 5, 0x078B); mix_write(5, 0x078B); { struct address_info *sb_config; sb_config = &cfg2; if (sb_config->io_base) { unsigned char irq_dma; /* * Turn on Sound Blaster compatibility * bit 1 = SB emulation * bit 0 = MPU401 emulation (CDPC only :-( ) */ pas_write(0x02, 0xF788); /* * "Emulation address" */ pas_write((sb_config->io_base >> 4) & 0x0f, 0xF789); pas_sb_base = sb_config->io_base; if (!sb_dma_bits[sb_config->dma]) printk(KERN_ERR "PAS16 Warning: Invalid SB DMA %d\n\n", sb_config->dma); if (!sb_irq_bits[sb_config->irq]) printk(KERN_ERR "PAS16 Warning: Invalid SB IRQ %d\n\n", sb_config->irq); irq_dma = sb_dma_bits[sb_config->dma] | sb_irq_bits[sb_config->irq]; pas_write(irq_dma, 0xFB8A); } else