sound/isa/gus/gus_irq.c
Source file repositories/reference/linux-study-clean/sound/isa/gus/gus_irq.c
File Facts
- System
- Linux kernel
- Corpus path
sound/isa/gus/gus_irq.c- Extension
.c- Size
- 3926 bytes
- Lines
- 131
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/core.hsound/info.hsound/gus.h
Detected Declarations
function Copyrightfunction snd_gus_interruptfunction snd_gus_irq_info_readfunction snd_gus_irq_profile_init
Annotated Snippet
while (((voice_status = snd_gf1_i_read8(gus, SNDRV_GF1_GB_VOICES_IRQ)) & 0xc0) != 0xc0) {
voice = voice_status & 0x1f;
_current_ = 1 << voice;
if (already & _current_)
continue; /* multi request */
already |= _current_; /* mark request */
#if 0
dev_dbg(gus->card->dev,
"voice = %i, voice_status = 0x%x, voice_verify = %i\n",
voice, voice_status, inb(GUSP(gus, GF1PAGE)));
#endif
pvoice = &gus->gf1.voices[voice];
if (pvoice->use) {
if (!(voice_status & 0x80)) { /* voice position IRQ */
STAT_ADD(pvoice->interrupt_stat_wave);
pvoice->handler_wave(gus, pvoice);
}
if (!(voice_status & 0x40)) { /* volume ramp IRQ */
STAT_ADD(pvoice->interrupt_stat_volume);
pvoice->handler_volume(gus, pvoice);
}
} else {
STAT_ADD(gus->gf1.interrupt_stat_voice_lost);
snd_gf1_i_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL);
snd_gf1_i_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
}
}
}
if (status & 0x04) {
STAT_ADD(gus->gf1.interrupt_stat_timer1);
if (gus->gf1.interrupt_handler_timer1)
gus->gf1.interrupt_handler_timer1(gus);
}
if (status & 0x08) {
STAT_ADD(gus->gf1.interrupt_stat_timer2);
if (gus->gf1.interrupt_handler_timer2)
gus->gf1.interrupt_handler_timer2(gus);
}
if (status & 0x80) {
if (snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_CONTROL) & 0x40) {
STAT_ADD(gus->gf1.interrupt_stat_dma_write);
if (gus->gf1.interrupt_handler_dma_write)
gus->gf1.interrupt_handler_dma_write(gus);
}
if (snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL) & 0x40) {
STAT_ADD(gus->gf1.interrupt_stat_dma_read);
if (gus->gf1.interrupt_handler_dma_read)
gus->gf1.interrupt_handler_dma_read(gus);
}
}
if (--loop > 0)
goto __again;
return IRQ_NONE;
}
#ifdef CONFIG_SND_DEBUG
static void snd_gus_irq_info_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_gus_card *gus;
struct snd_gus_voice *pvoice;
int idx;
gus = entry->private_data;
snd_iprintf(buffer, "midi out = %u\n", gus->gf1.interrupt_stat_midi_out);
snd_iprintf(buffer, "midi in = %u\n", gus->gf1.interrupt_stat_midi_in);
snd_iprintf(buffer, "timer1 = %u\n", gus->gf1.interrupt_stat_timer1);
snd_iprintf(buffer, "timer2 = %u\n", gus->gf1.interrupt_stat_timer2);
snd_iprintf(buffer, "dma write = %u\n", gus->gf1.interrupt_stat_dma_write);
snd_iprintf(buffer, "dma read = %u\n", gus->gf1.interrupt_stat_dma_read);
snd_iprintf(buffer, "voice lost = %u\n", gus->gf1.interrupt_stat_voice_lost);
for (idx = 0; idx < 32; idx++) {
pvoice = &gus->gf1.voices[idx];
snd_iprintf(buffer, "voice %i: wave = %u, volume = %u\n",
idx,
pvoice->interrupt_stat_wave,
pvoice->interrupt_stat_volume);
}
}
void snd_gus_irq_profile_init(struct snd_gus_card *gus)
{
snd_card_ro_proc_new(gus->card, "gusirq", gus, snd_gus_irq_info_read);
}
#endif
Annotation
- Immediate include surface: `sound/core.h`, `sound/info.h`, `sound/gus.h`.
- Detected declarations: `function Copyright`, `function snd_gus_interrupt`, `function snd_gus_irq_info_read`, `function snd_gus_irq_profile_init`.
- Atlas domain: Driver Families / sound/isa.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.