Lines Matching refs:gus

98 	struct snd_gus_card *gus;  member
190 struct snd_gus_card *gus, int dev, in snd_interwave_detect_stb() argument
203 if (gus->gf1.port == 0x250) { in snd_interwave_detect_stb()
237 struct snd_gus_card *gus, in snd_interwave_detect() argument
248 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ in snd_interwave_detect()
249 d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); in snd_interwave_detect()
251 snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
255 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 1); /* release reset */ in snd_interwave_detect()
257 d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); in snd_interwave_detect()
259 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
262 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_detect()
263 rev1 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER); in snd_interwave_detect()
264 snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, ~rev1); in snd_interwave_detect()
265 rev2 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER); in snd_interwave_detect()
266 snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, rev1); in snd_interwave_detect()
267 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_detect()
268 snd_printdd("[0x%lx] InterWave check - rev1=0x%x, rev2=0x%x\n", gus->gf1.port, rev1, rev2); in snd_interwave_detect()
271 snd_printdd("[0x%lx] InterWave check - passed\n", gus->gf1.port); in snd_interwave_detect()
272 gus->interwave = 1; in snd_interwave_detect()
273 strcpy(gus->card->shortname, "AMD InterWave"); in snd_interwave_detect()
274 gus->revision = rev1 >> 4; in snd_interwave_detect()
278 return snd_interwave_detect_stb(iwcard, gus, dev, rbus); in snd_interwave_detect()
281 snd_printdd("[0x%lx] InterWave check - failed\n", gus->gf1.port); in snd_interwave_detect()
295 snd_gus_interrupt(irq, iwcard->gus); in snd_interwave_interrupt()
307 static void snd_interwave_reset(struct snd_gus_card *gus) in snd_interwave_reset() argument
309 snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x00); in snd_interwave_reset()
311 snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x01); in snd_interwave_reset()
315 static void snd_interwave_bank_sizes(struct snd_gus_card *gus, int *sizes) in snd_interwave_bank_sizes() argument
327 snd_gf1_poke(gus, local, d); in snd_interwave_bank_sizes()
328 snd_gf1_poke(gus, local + 1, d + 1); in snd_interwave_bank_sizes()
333 snd_gf1_peek(gus, local), in snd_interwave_bank_sizes()
334 snd_gf1_peek(gus, local + 1), in snd_interwave_bank_sizes()
335 snd_gf1_peek(gus, idx << 22)); in snd_interwave_bank_sizes()
337 if (snd_gf1_peek(gus, local) != d || in snd_interwave_bank_sizes()
338 snd_gf1_peek(gus, local + 1) != d + 1 || in snd_interwave_bank_sizes()
339 snd_gf1_peek(gus, idx << 22) != 0x55) in snd_interwave_bank_sizes()
366 static void snd_interwave_detect_memory(struct snd_gus_card *gus) in snd_interwave_detect_memory() argument
382 snd_interwave_reset(gus); in snd_interwave_detect_memory()
383 …snd_gf1_write8(gus, SNDRV_GF1_GB_GLOBAL_MODE, snd_gf1_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE) | 0x01)… in snd_interwave_detect_memory()
384 snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x01); /* DRAM I/O cycles selected */ in snd_interwave_detect_memory()
385 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
388 snd_gf1_poke(gus, 0, 0x55); in snd_interwave_detect_memory()
389 snd_gf1_poke(gus, 1, 0xaa); in snd_interwave_detect_memory()
391 if (snd_gf1_peek(gus, 0) == 0x55 && snd_gf1_peek(gus, 1) == 0xaa) in snd_interwave_detect_memory()
396 snd_interwave_bank_sizes(gus, psizes); in snd_interwave_detect_memory()
407 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
408 snd_interwave_bank_sizes(gus, psizes); in snd_interwave_detect_memory()
411 if (i >= ARRAY_SIZE(lmc) && !gus->gf1.enh_mode) in snd_interwave_detect_memory()
412 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
414 gus->gf1.mem_alloc.banks_8[i].address = in snd_interwave_detect_memory()
415 gus->gf1.mem_alloc.banks_16[i].address = i << 22; in snd_interwave_detect_memory()
416 gus->gf1.mem_alloc.banks_8[i].size = in snd_interwave_detect_memory()
417 gus->gf1.mem_alloc.banks_16[i].size = psizes[i] << 18; in snd_interwave_detect_memory()
422 gus->gf1.memory = pages; in snd_interwave_detect_memory()
424 snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x03); /* select ROM */ in snd_interwave_detect_memory()
425 …snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) … in snd_interwave_detect_memory()
426 gus->gf1.rom_banks = 0; in snd_interwave_detect_memory()
427 gus->gf1.rom_memory = 0; in snd_interwave_detect_memory()
430 iwave[i] = snd_gf1_peek(gus, bank_pos + i); in snd_interwave_detect_memory()
435 csum += snd_gf1_peek(gus, bank_pos + i); in snd_interwave_detect_memory()
438 gus->gf1.rom_banks++; in snd_interwave_detect_memory()
439 gus->gf1.rom_present |= 1 << (bank_pos >> 22); in snd_interwave_detect_memory()
440 gus->gf1.rom_memory = snd_gf1_peek(gus, bank_pos + 40) | in snd_interwave_detect_memory()
441 (snd_gf1_peek(gus, bank_pos + 41) << 8) | in snd_interwave_detect_memory()
442 (snd_gf1_peek(gus, bank_pos + 42) << 16) | in snd_interwave_detect_memory()
443 (snd_gf1_peek(gus, bank_pos + 43) << 24); in snd_interwave_detect_memory()
446 if (gus->gf1.rom_memory > 0) { in snd_interwave_detect_memory()
447 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_detect_memory()
448 gus->card->type = SNDRV_CARD_TYPE_IW_DYNASONIC; in snd_interwave_detect_memory()
451 snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x00); /* select RAM */ in snd_interwave_detect_memory()
453 if (!gus->gf1.enh_mode) in snd_interwave_detect_memory()
454 snd_interwave_reset(gus); in snd_interwave_detect_memory()
457 static void snd_interwave_init(int dev, struct snd_gus_card *gus) in snd_interwave_init() argument
462 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_init()
463 snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, 0x00); in snd_interwave_init()
464 snd_gf1_write8(gus, SNDRV_GF1_GB_COMPATIBILITY, 0x1f); in snd_interwave_init()
465 snd_gf1_write8(gus, SNDRV_GF1_GB_DECODE_CONTROL, 0x49); in snd_interwave_init()
466 snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, 0x11); in snd_interwave_init()
467 snd_gf1_write8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A, 0x00); in snd_interwave_init()
468 snd_gf1_write8(gus, SNDRV_GF1_GB_MPU401_CONTROL_B, 0x30); in snd_interwave_init()
469 snd_gf1_write8(gus, SNDRV_GF1_GB_EMULATION_IRQ, 0x00); in snd_interwave_init()
470 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_init()
471 gus->equal_irq = 1; in snd_interwave_init()
472 gus->codec_flag = 1; in snd_interwave_init()
473 gus->interwave = 1; in snd_interwave_init()
474 gus->max_flag = 1; in snd_interwave_init()
475 gus->joystick_dac = joystick_dac[dev]; in snd_interwave_init()
629 struct snd_gus_card *gus) in snd_interwave_probe() argument
644 err = snd_interwave_detect(iwcard, gus, dev in snd_interwave_probe()
652 iwcard->gus_status_reg = gus->gf1.reg_irqstat; in snd_interwave_probe()
653 iwcard->pcm_status_reg = gus->gf1.port + 0x10c + 2; in snd_interwave_probe()
655 snd_interwave_init(dev, gus); in snd_interwave_probe()
656 snd_interwave_detect_memory(gus); in snd_interwave_probe()
657 err = snd_gus_initialize(gus); in snd_interwave_probe()
670 gus->gf1.port + 0x10c, -1, xirq, in snd_interwave_probe()
685 gus->revision + 'A'); in snd_interwave_probe()
697 err = snd_gf1_pcm_new(gus, 1, 1); in snd_interwave_probe()
728 gus->uart_enable = midi[dev]; in snd_interwave_probe()
729 err = snd_gf1_rawmidi_new(gus, 0); in snd_interwave_probe()
735 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_probe()
744 gus->gf1.port, in snd_interwave_probe()
755 iwcard->gus = gus; in snd_interwave_probe()
775 struct snd_gus_card *gus; in snd_interwave_isa_probe() local
807 err = snd_interwave_probe_gus(card, dev, &gus); in snd_interwave_isa_probe()
813 err = snd_interwave_probe_gus(card, dev, &gus); in snd_interwave_isa_probe()
821 err = snd_interwave_probe(card, dev, gus); in snd_interwave_isa_probe()
844 struct snd_gus_card *gus; in snd_interwave_pnp_detect() local
861 res = snd_interwave_probe_gus(card, dev, &gus); in snd_interwave_pnp_detect()
864 res = snd_interwave_probe(card, dev, gus); in snd_interwave_pnp_detect()