sound/isa/gus/gus_io.c
Source file repositories/reference/linux-study-clean/sound/isa/gus/gus_io.c
File Facts
- System
- Linux kernel
- Corpus path
sound/isa/gus/gus_io.c- Extension
.c- Size
- 8786 bytes
- Lines
- 341
- Domain
- Driver Families
- Bucket
- sound/isa
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/time.hsound/core.hsound/gus.h
Detected Declarations
function Copyrightfunction UltraClickfunction __snd_gf1_write8function __snd_gf1_look8function __snd_gf1_write16function __snd_gf1_look16function __snd_gf1_adlib_writefunction __snd_gf1_write_addrfunction __snd_gf1_read_addrfunction snd_gf1_ctrl_stopfunction snd_gf1_write8function snd_gf1_look8function snd_gf1_write16function snd_gf1_look16function snd_gf1_adlib_writefunction snd_gf1_write_addrfunction snd_gf1_read_addrfunction snd_gf1_i_ctrl_stopfunction snd_gf1_i_write8function snd_gf1_i_look8function snd_gf1_i_write16function snd_gf1_i_look16function snd_gf1_dram_addrfunction snd_gf1_pokefunction snd_gf1_peekfunction snd_gf1_pokewfunction snd_gf1_peekwfunction snd_gf1_dram_setmemfunction snd_gf1_select_active_voices
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* I/O routines for GF1/InterWave synthesizer chips
*/
#include <linux/delay.h>
#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
void snd_gf1_delay(struct snd_gus_card * gus)
{
int i;
for (i = 0; i < 6; i++) {
mb();
inb(GUSP(gus, DRAM));
}
}
/*
* =======================================================================
*/
/*
* ok.. stop of control registers (wave & ramp) need some special things..
* big UltraClick (tm) elimination...
*/
static inline void __snd_gf1_ctrl_stop(struct snd_gus_card * gus, unsigned char reg)
{
unsigned char value;
outb(reg | 0x80, gus->gf1.reg_regsel);
mb();
value = inb(gus->gf1.reg_data8);
mb();
outb(reg, gus->gf1.reg_regsel);
mb();
outb((value | 0x03) & ~(0x80 | 0x20), gus->gf1.reg_data8);
mb();
}
static inline void __snd_gf1_write8(struct snd_gus_card * gus,
unsigned char reg,
unsigned char data)
{
outb(reg, gus->gf1.reg_regsel);
mb();
outb(data, gus->gf1.reg_data8);
mb();
}
static inline unsigned char __snd_gf1_look8(struct snd_gus_card * gus,
unsigned char reg)
{
outb(reg, gus->gf1.reg_regsel);
mb();
return inb(gus->gf1.reg_data8);
}
static inline void __snd_gf1_write16(struct snd_gus_card * gus,
unsigned char reg, unsigned int data)
{
outb(reg, gus->gf1.reg_regsel);
mb();
outw((unsigned short) data, gus->gf1.reg_data16);
mb();
}
static inline unsigned short __snd_gf1_look16(struct snd_gus_card * gus,
unsigned char reg)
{
outb(reg, gus->gf1.reg_regsel);
mb();
return inw(gus->gf1.reg_data16);
}
static inline void __snd_gf1_adlib_write(struct snd_gus_card * gus,
unsigned char reg, unsigned char data)
{
outb(reg, gus->gf1.reg_timerctrl);
inb(gus->gf1.reg_timerctrl);
inb(gus->gf1.reg_timerctrl);
outb(data, gus->gf1.reg_timerdata);
inb(gus->gf1.reg_timerctrl);
inb(gus->gf1.reg_timerctrl);
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/time.h`, `sound/core.h`, `sound/gus.h`.
- Detected declarations: `function Copyright`, `function UltraClick`, `function __snd_gf1_write8`, `function __snd_gf1_look8`, `function __snd_gf1_write16`, `function __snd_gf1_look16`, `function __snd_gf1_adlib_write`, `function __snd_gf1_write_addr`, `function __snd_gf1_read_addr`, `function snd_gf1_ctrl_stop`.
- Atlas domain: Driver Families / sound/isa.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.