Lines Matching refs:gus
119 struct snd_gus_card *gus; member
211 struct snd_gus_card * gus, int dev, in snd_interwave_detect_stb() argument
224 if (gus->gf1.port == 0x250) { in snd_interwave_detect_stb()
253 struct snd_gus_card * gus, in snd_interwave_detect() argument
264 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ in snd_interwave_detect()
265 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 0) { in snd_interwave_detect()
266 snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
270 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 1); /* release reset */ in snd_interwave_detect()
272 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 1) { in snd_interwave_detect()
273 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
276 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_detect()
277 rev1 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER); in snd_interwave_detect()
278 snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, ~rev1); in snd_interwave_detect()
279 rev2 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER); in snd_interwave_detect()
280 snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, rev1); in snd_interwave_detect()
281 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_detect()
282 snd_printdd("[0x%lx] InterWave check - rev1=0x%x, rev2=0x%x\n", gus->gf1.port, rev1, rev2); in snd_interwave_detect()
285 snd_printdd("[0x%lx] InterWave check - passed\n", gus->gf1.port); in snd_interwave_detect()
286 gus->interwave = 1; in snd_interwave_detect()
287 strcpy(gus->card->shortname, "AMD InterWave"); in snd_interwave_detect()
288 gus->revision = rev1 >> 4; in snd_interwave_detect()
292 return snd_interwave_detect_stb(iwcard, gus, dev, rbus); in snd_interwave_detect()
295 snd_printdd("[0x%lx] InterWave check - failed\n", gus->gf1.port); in snd_interwave_detect()
309 snd_gus_interrupt(irq, iwcard->gus); in snd_interwave_interrupt()
321 static void __devinit snd_interwave_reset(struct snd_gus_card * gus) in snd_interwave_reset() argument
323 snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x00); in snd_interwave_reset()
325 snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x01); in snd_interwave_reset()
329 static void __devinit snd_interwave_bank_sizes(struct snd_gus_card * gus, int *sizes) in snd_interwave_bank_sizes() argument
341 snd_gf1_poke(gus, local, d); in snd_interwave_bank_sizes()
342 snd_gf1_poke(gus, local + 1, d + 1); in snd_interwave_bank_sizes()
347 snd_gf1_peek(gus, local), in snd_interwave_bank_sizes()
348 snd_gf1_peek(gus, local + 1), in snd_interwave_bank_sizes()
349 snd_gf1_peek(gus, idx << 22)); in snd_interwave_bank_sizes()
351 if (snd_gf1_peek(gus, local) != d || in snd_interwave_bank_sizes()
352 snd_gf1_peek(gus, local + 1) != d + 1 || in snd_interwave_bank_sizes()
353 snd_gf1_peek(gus, idx << 22) != 0x55) in snd_interwave_bank_sizes()
380 static void __devinit snd_interwave_detect_memory(struct snd_gus_card * gus) in snd_interwave_detect_memory() argument
396 snd_interwave_reset(gus); in snd_interwave_detect_memory()
397 …snd_gf1_write8(gus, SNDRV_GF1_GB_GLOBAL_MODE, snd_gf1_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE) | 0x01)… in snd_interwave_detect_memory()
398 snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x01); /* DRAM I/O cycles selected */ in snd_interwave_detect_memory()
399 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
402 snd_gf1_poke(gus, 0, 0x55); in snd_interwave_detect_memory()
403 snd_gf1_poke(gus, 1, 0xaa); in snd_interwave_detect_memory()
405 if (snd_gf1_peek(gus, 0) == 0x55 && snd_gf1_peek(gus, 1) == 0xaa) in snd_interwave_detect_memory()
410 snd_interwave_bank_sizes(gus, psizes); in snd_interwave_detect_memory()
421 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
422 snd_interwave_bank_sizes(gus, psizes); in snd_interwave_detect_memory()
425 if (i >= ARRAY_SIZE(lmc) && !gus->gf1.enh_mode) in snd_interwave_detect_memory()
426 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
428 gus->gf1.mem_alloc.banks_8[i].address = in snd_interwave_detect_memory()
429 gus->gf1.mem_alloc.banks_16[i].address = i << 22; in snd_interwave_detect_memory()
430 gus->gf1.mem_alloc.banks_8[i].size = in snd_interwave_detect_memory()
431 gus->gf1.mem_alloc.banks_16[i].size = psizes[i] << 18; in snd_interwave_detect_memory()
436 gus->gf1.memory = pages; in snd_interwave_detect_memory()
438 snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x03); /* select ROM */ in snd_interwave_detect_memory()
439 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
440 gus->gf1.rom_banks = 0; in snd_interwave_detect_memory()
441 gus->gf1.rom_memory = 0; in snd_interwave_detect_memory()
444 iwave[i] = snd_gf1_peek(gus, bank_pos + i); in snd_interwave_detect_memory()
454 csum += snd_gf1_peek(gus, bank_pos + i); in snd_interwave_detect_memory()
460 gus->gf1.rom_banks++; in snd_interwave_detect_memory()
461 gus->gf1.rom_present |= 1 << (bank_pos >> 22); in snd_interwave_detect_memory()
462 gus->gf1.rom_memory = snd_gf1_peek(gus, bank_pos + 40) | in snd_interwave_detect_memory()
463 (snd_gf1_peek(gus, bank_pos + 41) << 8) | in snd_interwave_detect_memory()
464 (snd_gf1_peek(gus, bank_pos + 42) << 16) | in snd_interwave_detect_memory()
465 (snd_gf1_peek(gus, bank_pos + 43) << 24); in snd_interwave_detect_memory()
468 if (gus->gf1.rom_memory > 0) { in snd_interwave_detect_memory()
469 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_detect_memory()
470 gus->card->type = SNDRV_CARD_TYPE_IW_DYNASONIC; in snd_interwave_detect_memory()
473 snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x00); /* select RAM */ in snd_interwave_detect_memory()
475 if (!gus->gf1.enh_mode) in snd_interwave_detect_memory()
476 snd_interwave_reset(gus); in snd_interwave_detect_memory()
479 static void __devinit snd_interwave_init(int dev, struct snd_gus_card * gus) in snd_interwave_init() argument
484 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_init()
485 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, 0x00); in snd_interwave_init()
486 snd_gf1_write8(gus, SNDRV_GF1_GB_COMPATIBILITY, 0x1f); in snd_interwave_init()
487 snd_gf1_write8(gus, SNDRV_GF1_GB_DECODE_CONTROL, 0x49); in snd_interwave_init()
488 snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, 0x11); in snd_interwave_init()
489 snd_gf1_write8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A, 0x00); in snd_interwave_init()
490 snd_gf1_write8(gus, SNDRV_GF1_GB_MPU401_CONTROL_B, 0x30); in snd_interwave_init()
491 snd_gf1_write8(gus, SNDRV_GF1_GB_EMULATION_IRQ, 0x00); in snd_interwave_init()
492 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_init()
493 gus->equal_irq = 1; in snd_interwave_init()
494 gus->codec_flag = 1; in snd_interwave_init()
495 gus->interwave = 1; in snd_interwave_init()
496 gus->max_flag = 1; in snd_interwave_init()
497 gus->joystick_dac = joystick_dac[dev]; in snd_interwave_init()
653 struct snd_gus_card *gus; in snd_interwave_probe() local
669 pcm_channels[dev], effect[dev], &gus)) < 0) in snd_interwave_probe()
672 if ((err = snd_interwave_detect(iwcard, gus, dev in snd_interwave_probe()
679 iwcard->gus_status_reg = gus->gf1.reg_irqstat; in snd_interwave_probe()
680 iwcard->pcm_status_reg = gus->gf1.port + 0x10c + 2; in snd_interwave_probe()
682 snd_interwave_init(dev, gus); in snd_interwave_probe()
683 snd_interwave_detect_memory(gus); in snd_interwave_probe()
684 if ((err = snd_gus_initialize(gus)) < 0) in snd_interwave_probe()
695 gus->gf1.port + 0x10c, -1, xirq, in snd_interwave_probe()
709 sprintf(pcm->name + strlen(pcm->name), " rev %c", gus->revision + 'A'); in snd_interwave_probe()
721 err = snd_gf1_pcm_new(gus, 1, 1, NULL); in snd_interwave_probe()
749 gus->uart_enable = midi[dev]; in snd_interwave_probe()
750 if ((err = snd_gf1_rawmidi_new(gus, 0, NULL)) < 0) in snd_interwave_probe()
755 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_probe()
764 gus->gf1.port, in snd_interwave_probe()
775 iwcard->gus = gus; in snd_interwave_probe()