Lines Matching refs:gus
12 void snd_gf1_delay(struct snd_gus_card * gus) in snd_gf1_delay() argument
18 inb(GUSP(gus, DRAM)); in snd_gf1_delay()
31 static inline void __snd_gf1_ctrl_stop(struct snd_gus_card * gus, unsigned char reg) in __snd_gf1_ctrl_stop() argument
35 outb(reg | 0x80, gus->gf1.reg_regsel); in __snd_gf1_ctrl_stop()
37 value = inb(gus->gf1.reg_data8); in __snd_gf1_ctrl_stop()
39 outb(reg, gus->gf1.reg_regsel); in __snd_gf1_ctrl_stop()
41 outb((value | 0x03) & ~(0x80 | 0x20), gus->gf1.reg_data8); in __snd_gf1_ctrl_stop()
45 static inline void __snd_gf1_write8(struct snd_gus_card * gus, in __snd_gf1_write8() argument
49 outb(reg, gus->gf1.reg_regsel); in __snd_gf1_write8()
51 outb(data, gus->gf1.reg_data8); in __snd_gf1_write8()
55 static inline unsigned char __snd_gf1_look8(struct snd_gus_card * gus, in __snd_gf1_look8() argument
58 outb(reg, gus->gf1.reg_regsel); in __snd_gf1_look8()
60 return inb(gus->gf1.reg_data8); in __snd_gf1_look8()
63 static inline void __snd_gf1_write16(struct snd_gus_card * gus, in __snd_gf1_write16() argument
66 outb(reg, gus->gf1.reg_regsel); in __snd_gf1_write16()
68 outw((unsigned short) data, gus->gf1.reg_data16); in __snd_gf1_write16()
72 static inline unsigned short __snd_gf1_look16(struct snd_gus_card * gus, in __snd_gf1_look16() argument
75 outb(reg, gus->gf1.reg_regsel); in __snd_gf1_look16()
77 return inw(gus->gf1.reg_data16); in __snd_gf1_look16()
80 static inline void __snd_gf1_adlib_write(struct snd_gus_card * gus, in __snd_gf1_adlib_write() argument
83 outb(reg, gus->gf1.reg_timerctrl); in __snd_gf1_adlib_write()
84 inb(gus->gf1.reg_timerctrl); in __snd_gf1_adlib_write()
85 inb(gus->gf1.reg_timerctrl); in __snd_gf1_adlib_write()
86 outb(data, gus->gf1.reg_timerdata); in __snd_gf1_adlib_write()
87 inb(gus->gf1.reg_timerctrl); in __snd_gf1_adlib_write()
88 inb(gus->gf1.reg_timerctrl); in __snd_gf1_adlib_write()
91 static inline void __snd_gf1_write_addr(struct snd_gus_card * gus, unsigned char reg, in __snd_gf1_write_addr() argument
94 if (gus->gf1.enh_mode) { in __snd_gf1_write_addr()
97 __snd_gf1_write8(gus, SNDRV_GF1_VB_UPPER_ADDRESS, (unsigned char) ((addr >> 26) & 0x03)); in __snd_gf1_write_addr()
100 __snd_gf1_write16(gus, reg, (unsigned short) (addr >> 11)); in __snd_gf1_write_addr()
101 __snd_gf1_write16(gus, reg + 1, (unsigned short) (addr << 5)); in __snd_gf1_write_addr()
104 static inline unsigned int __snd_gf1_read_addr(struct snd_gus_card * gus, in __snd_gf1_read_addr() argument
109 res = ((unsigned int) __snd_gf1_look16(gus, reg | 0x80) << 11) & 0xfff800; in __snd_gf1_read_addr()
110 res |= ((unsigned int) __snd_gf1_look16(gus, (reg + 1) | 0x80) >> 5) & 0x0007ff; in __snd_gf1_read_addr()
111 if (gus->gf1.enh_mode) { in __snd_gf1_read_addr()
112 res |= (unsigned int) __snd_gf1_look8(gus, SNDRV_GF1_VB_UPPER_ADDRESS | 0x80) << 26; in __snd_gf1_read_addr()
125 void snd_gf1_ctrl_stop(struct snd_gus_card * gus, unsigned char reg) in snd_gf1_ctrl_stop() argument
127 __snd_gf1_ctrl_stop(gus, reg); in snd_gf1_ctrl_stop()
130 void snd_gf1_write8(struct snd_gus_card * gus, in snd_gf1_write8() argument
134 __snd_gf1_write8(gus, reg, data); in snd_gf1_write8()
137 unsigned char snd_gf1_look8(struct snd_gus_card * gus, unsigned char reg) in snd_gf1_look8() argument
139 return __snd_gf1_look8(gus, reg); in snd_gf1_look8()
142 void snd_gf1_write16(struct snd_gus_card * gus, in snd_gf1_write16() argument
146 __snd_gf1_write16(gus, reg, data); in snd_gf1_write16()
149 unsigned short snd_gf1_look16(struct snd_gus_card * gus, unsigned char reg) in snd_gf1_look16() argument
151 return __snd_gf1_look16(gus, reg); in snd_gf1_look16()
154 void snd_gf1_adlib_write(struct snd_gus_card * gus, in snd_gf1_adlib_write() argument
158 __snd_gf1_adlib_write(gus, reg, data); in snd_gf1_adlib_write()
161 void snd_gf1_write_addr(struct snd_gus_card * gus, unsigned char reg, in snd_gf1_write_addr() argument
164 __snd_gf1_write_addr(gus, reg, addr, w_16bit); in snd_gf1_write_addr()
167 unsigned int snd_gf1_read_addr(struct snd_gus_card * gus, in snd_gf1_read_addr() argument
171 return __snd_gf1_read_addr(gus, reg, w_16bit); in snd_gf1_read_addr()
178 void snd_gf1_i_ctrl_stop(struct snd_gus_card * gus, unsigned char reg) in snd_gf1_i_ctrl_stop() argument
182 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_i_ctrl_stop()
183 __snd_gf1_ctrl_stop(gus, reg); in snd_gf1_i_ctrl_stop()
184 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_i_ctrl_stop()
187 void snd_gf1_i_write8(struct snd_gus_card * gus, in snd_gf1_i_write8() argument
193 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_i_write8()
194 __snd_gf1_write8(gus, reg, data); in snd_gf1_i_write8()
195 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_i_write8()
198 unsigned char snd_gf1_i_look8(struct snd_gus_card * gus, unsigned char reg) in snd_gf1_i_look8() argument
203 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_i_look8()
204 res = __snd_gf1_look8(gus, reg); in snd_gf1_i_look8()
205 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_i_look8()
209 void snd_gf1_i_write16(struct snd_gus_card * gus, in snd_gf1_i_write16() argument
215 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_i_write16()
216 __snd_gf1_write16(gus, reg, data); in snd_gf1_i_write16()
217 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_i_write16()
220 unsigned short snd_gf1_i_look16(struct snd_gus_card * gus, unsigned char reg) in snd_gf1_i_look16() argument
225 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_i_look16()
226 res = __snd_gf1_look16(gus, reg); in snd_gf1_i_look16()
227 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_i_look16()
233 void snd_gf1_i_adlib_write(struct snd_gus_card * gus,
239 spin_lock_irqsave(&gus->reg_lock, flags);
240 __snd_gf1_adlib_write(gus, reg, data);
241 spin_unlock_irqrestore(&gus->reg_lock, flags);
244 void snd_gf1_i_write_addr(struct snd_gus_card * gus, unsigned char reg,
249 spin_lock_irqsave(&gus->reg_lock, flags);
250 __snd_gf1_write_addr(gus, reg, addr, w_16bit);
251 spin_unlock_irqrestore(&gus->reg_lock, flags);
257 static unsigned int snd_gf1_i_read_addr(struct snd_gus_card * gus, in snd_gf1_i_read_addr() argument
263 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_i_read_addr()
264 res = __snd_gf1_read_addr(gus, reg, w_16bit); in snd_gf1_i_read_addr()
265 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_i_read_addr()
274 void snd_gf1_dram_addr(struct snd_gus_card * gus, unsigned int addr) in snd_gf1_dram_addr() argument
276 outb(0x43, gus->gf1.reg_regsel); in snd_gf1_dram_addr()
278 outw((unsigned short) addr, gus->gf1.reg_data16); in snd_gf1_dram_addr()
280 outb(0x44, gus->gf1.reg_regsel); in snd_gf1_dram_addr()
282 outb((unsigned char) (addr >> 16), gus->gf1.reg_data8); in snd_gf1_dram_addr()
286 void snd_gf1_poke(struct snd_gus_card * gus, unsigned int addr, unsigned char data) in snd_gf1_poke() argument
290 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_poke()
291 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel); in snd_gf1_poke()
293 outw((unsigned short) addr, gus->gf1.reg_data16); in snd_gf1_poke()
295 outb(SNDRV_GF1_GB_DRAM_IO_HIGH, gus->gf1.reg_regsel); in snd_gf1_poke()
297 outb((unsigned char) (addr >> 16), gus->gf1.reg_data8); in snd_gf1_poke()
299 outb(data, gus->gf1.reg_dram); in snd_gf1_poke()
300 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_poke()
303 unsigned char snd_gf1_peek(struct snd_gus_card * gus, unsigned int addr) in snd_gf1_peek() argument
308 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_peek()
309 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel); in snd_gf1_peek()
311 outw((unsigned short) addr, gus->gf1.reg_data16); in snd_gf1_peek()
313 outb(SNDRV_GF1_GB_DRAM_IO_HIGH, gus->gf1.reg_regsel); in snd_gf1_peek()
315 outb((unsigned char) (addr >> 16), gus->gf1.reg_data8); in snd_gf1_peek()
317 res = inb(gus->gf1.reg_dram); in snd_gf1_peek()
318 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_peek()
324 void snd_gf1_pokew(struct snd_gus_card * gus, unsigned int addr, unsigned short data)
329 if (!gus->interwave)
332 spin_lock_irqsave(&gus->reg_lock, flags);
333 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel);
335 outw((unsigned short) addr, gus->gf1.reg_data16);
337 outb(SNDRV_GF1_GB_DRAM_IO_HIGH, gus->gf1.reg_regsel);
339 outb((unsigned char) (addr >> 16), gus->gf1.reg_data8);
341 outb(SNDRV_GF1_GW_DRAM_IO16, gus->gf1.reg_regsel);
343 outw(data, gus->gf1.reg_data16);
344 spin_unlock_irqrestore(&gus->reg_lock, flags);
347 unsigned short snd_gf1_peekw(struct snd_gus_card * gus, unsigned int addr)
353 if (!gus->interwave)
356 spin_lock_irqsave(&gus->reg_lock, flags);
357 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel);
359 outw((unsigned short) addr, gus->gf1.reg_data16);
361 outb(SNDRV_GF1_GB_DRAM_IO_HIGH, gus->gf1.reg_regsel);
363 outb((unsigned char) (addr >> 16), gus->gf1.reg_data8);
365 outb(SNDRV_GF1_GW_DRAM_IO16, gus->gf1.reg_regsel);
367 res = inw(gus->gf1.reg_data16);
368 spin_unlock_irqrestore(&gus->reg_lock, flags);
372 void snd_gf1_dram_setmem(struct snd_gus_card * gus, unsigned int addr,
379 if (!gus->interwave)
384 port = GUSP(gus, GF1DATALOW);
385 spin_lock_irqsave(&gus->reg_lock, flags);
386 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel);
388 outw((unsigned short) addr, gus->gf1.reg_data16);
390 outb(SNDRV_GF1_GB_DRAM_IO_HIGH, gus->gf1.reg_regsel);
392 outb((unsigned char) (addr >> 16), gus->gf1.reg_data8);
394 outb(SNDRV_GF1_GW_DRAM_IO16, gus->gf1.reg_regsel);
397 spin_unlock_irqrestore(&gus->reg_lock, flags);
402 void snd_gf1_select_active_voices(struct snd_gus_card * gus) in snd_gf1_select_active_voices() argument
412 voices = gus->gf1.active_voices; in snd_gf1_select_active_voices()
417 if (gus->gf1.enh_mode) in snd_gf1_select_active_voices()
419 gus->gf1.active_voices = voices; in snd_gf1_select_active_voices()
420 gus->gf1.playback_freq = in snd_gf1_select_active_voices()
421 gus->gf1.enh_mode ? 44100 : voices_tbl[voices - 14]; in snd_gf1_select_active_voices()
422 if (!gus->gf1.enh_mode) { in snd_gf1_select_active_voices()
423 snd_gf1_i_write8(gus, SNDRV_GF1_GB_ACTIVE_VOICES, 0xc0 | (voices - 1)); in snd_gf1_select_active_voices()
430 void snd_gf1_print_voice_registers(struct snd_gus_card * gus) in snd_gf1_print_voice_registers() argument
435 voice = gus->gf1.active_voice; in snd_gf1_print_voice_registers()
436 …rl, ramp ctrl = 0x%x, 0x%x\n", voice, ctrl = snd_gf1_i_read8(gus, 0), snd_gf1_i_read8(gus, 0x0d)); in snd_gf1_print_voice_registers()
437 printk(KERN_INFO " -%i- GF1 frequency = 0x%x\n", voice, snd_gf1_i_read16(gus, 1)); in snd_gf1_print_voice_registers()
438 …_i_read_addr(gus, 2, ctrl & 4), snd_gf1_i_read_addr(gus, 2, (ctrl & 4) ^ 4), snd_gf1_i_read_addr(g… in snd_gf1_print_voice_registers()
439 …te = 0x%x, 0x%x, 0x%x\n", voice, snd_gf1_i_read8(gus, 7), snd_gf1_i_read8(gus, 8), snd_gf1_i_read… in snd_gf1_print_voice_registers()
440 printk(KERN_INFO" -%i- GF1 volume = 0x%x\n", voice, snd_gf1_i_read16(gus, 9)); in snd_gf1_print_voice_registers()
441 … = 0x%x (0x%x)\n", voice, snd_gf1_i_read_addr(gus, 0x0a, ctrl & 4), snd_gf1_i_read_addr(gu… in snd_gf1_print_voice_registers()
442 if (gus->interwave && snd_gf1_i_read8(gus, 0x19) & 0x01) { /* enhanced mode */ in snd_gf1_print_voice_registers()
443 mode = snd_gf1_i_read8(gus, 0x15); in snd_gf1_print_voice_registers()
446 …printk(KERN_INFO " -%i- GFA1 effect address = 0x%x\n", voice, snd_gf1_i_read_addr(gus, 0x1… in snd_gf1_print_voice_registers()
447 …printk(KERN_INFO " -%i- GFA1 effect volume = 0x%x\n", voice, snd_gf1_i_read16(gus, 0x16)); in snd_gf1_print_voice_registers()
448 …printk(KERN_INFO " -%i- GFA1 effect volume final = 0x%x\n", voice, snd_gf1_i_read16(gus, 0x1d)); in snd_gf1_print_voice_registers()
449 … printk(KERN_INFO " -%i- GFA1 effect accumulator = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x14)); in snd_gf1_print_voice_registers()
452 …t offset = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x13), snd_gf1_i_read16(gus, 0x13… in snd_gf1_print_voice_registers()
453 …t offset final = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x1c), snd_gf1_i_read16(gus, 0x1c… in snd_gf1_print_voice_registers()
454 …ht offset = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x0c), snd_gf1_i_read16(gus, 0x0c… in snd_gf1_print_voice_registers()
455 …ht offset final = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x1b), snd_gf1_i_read16(gus, 0x1b… in snd_gf1_print_voice_registers()
457 … printk(KERN_INFO " -%i- GF1 pan = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x0c)); in snd_gf1_print_voice_registers()
459 printk(KERN_INFO " -%i- GF1 pan = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x0c)); in snd_gf1_print_voice_registers()
464 void snd_gf1_print_global_registers(struct snd_gus_card * gus)
468 …printk(KERN_INFO " -G- GF1 active voices = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_A…
469 if (gus->interwave) {
470 global_mode = snd_gf1_i_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE);
474 …printk(KERN_INFO " -G- GF1 LFO base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_…
475 …printk(KERN_INFO " -G- GF1 voices IRQ read = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_V…
476 …printk(KERN_INFO " -G- GF1 DRAM DMA control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_D…
477 … high/low = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_HIGH), snd_gf1_i_read1…
478 … high/low = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_IO_HIGH), snd_gf1_i_read1…
479 if (!gus->interwave)
480 …printk(KERN_INFO " -G- GF1 record DMA control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_R…
481 …printk(KERN_INFO " -G- GF1 DRAM IO 16 = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_…
482 if (gus->gf1.enh_mode) {
483 …printk(KERN_INFO " -G- GFA1 memory config = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_…
484 …printk(KERN_INFO " -G- GFA1 memory control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_M…
485 …printk(KERN_INFO " -G- GFA1 FIFO record base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_…
486 …printk(KERN_INFO " -G- GFA1 FIFO playback base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_…
487 …printk(KERN_INFO " -G- GFA1 interleave control = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_…
491 void snd_gf1_print_setup_registers(struct snd_gus_card * gus)
493 printk(KERN_INFO " -S- mix control = 0x%x\n", inb(GUSP(gus, MIXCNTRLREG)));
494 printk(KERN_INFO " -S- IRQ status = 0x%x\n", inb(GUSP(gus, IRQSTAT)));
495 printk(KERN_INFO " -S- timer control = 0x%x\n", inb(GUSP(gus, TIMERCNTRL)));
496 printk(KERN_INFO " -S- timer data = 0x%x\n", inb(GUSP(gus, TIMERDATA)));
497 printk(KERN_INFO " -S- status read = 0x%x\n", inb(GUSP(gus, REGCNTRLS)));
498 …printk(KERN_INFO " -S- Sound Blaster control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_S…
499 … 1/2 = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_1), snd_gf1_i_look…
500 …printk(KERN_INFO " -S- reset = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_R…
501 if (gus->interwave) {
502 …printk(KERN_INFO " -S- compatibility = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_C…
503 …printk(KERN_INFO " -S- decode control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_D…
504 …printk(KERN_INFO " -S- version number = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_V…
505 … control A/B = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A), snd_gf1_i_loo…
506 …printk(KERN_INFO " -S- emulation IRQ = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_E…
510 void snd_gf1_peek_print_block(struct snd_gus_card * gus, unsigned int addr, int count, int w_16bit)
514 printk(count > 0 ? "%02x:" : "%02x", snd_gf1_peek(gus, addr++));
517 …printk(count > 0 ? "%04x:" : "%04x", snd_gf1_peek(gus, addr) | (snd_gf1_peek(gus, addr + 1) << 8));