sound/drivers/opl4/opl4_proc.c
Source file repositories/reference/linux-study-clean/sound/drivers/opl4/opl4_proc.c
File Facts
- System
- Linux kernel
- Corpus path
sound/drivers/opl4/opl4_proc.c- Extension
.c- Size
- 2613 bytes
- Lines
- 109
- Domain
- Driver Families
- Bucket
- sound/drivers
- 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 user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
opl4_local.hlinux/vmalloc.hlinux/export.hsound/info.h
Detected Declarations
function Copyrightfunction snd_opl4_mem_proc_releasefunction snd_opl4_mem_proc_readfunction snd_opl4_mem_proc_writefunction snd_opl4_create_procfunction snd_opl4_free_proc
Annotated Snippet
if (opl4->hardware < OPL3_HW_OPL4_ML) {
/* OPL4 can access 4 MB external ROM/SRAM */
entry->mode |= 0200;
entry->size = 4 * 1024 * 1024;
} else {
/* OPL4-ML has 1 MB internal ROM */
entry->size = 1 * 1024 * 1024;
}
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->c.ops = &snd_opl4_mem_proc_ops;
entry->module = THIS_MODULE;
entry->private_data = opl4;
}
opl4->proc_entry = entry;
return 0;
}
void snd_opl4_free_proc(struct snd_opl4 *opl4)
{
snd_info_free_entry(opl4->proc_entry);
}
Annotation
- Immediate include surface: `opl4_local.h`, `linux/vmalloc.h`, `linux/export.h`, `sound/info.h`.
- Detected declarations: `function Copyright`, `function snd_opl4_mem_proc_release`, `function snd_opl4_mem_proc_read`, `function snd_opl4_mem_proc_write`, `function snd_opl4_create_proc`, `function snd_opl4_free_proc`.
- Atlas domain: Driver Families / sound/drivers.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.