sound/core/isadma.c
Source file repositories/reference/linux-study-clean/sound/core/isadma.c
File Facts
- System
- Linux kernel
- Corpus path
sound/core/isadma.c- Extension
.c- Size
- 3229 bytes
- Lines
- 139
- Domain
- Driver Families
- Bucket
- sound/core
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/isa-dma.hsound/core.h
Detected Declarations
struct snd_dma_datafunction Copyrightfunction snd_dma_disablefunction snd_dma_pointerfunction __snd_release_dmafunction snd_devm_request_dmaexport snd_dma_programexport snd_dma_disableexport snd_dma_pointerexport snd_devm_request_dma
Annotated Snippet
struct snd_dma_data {
int dma;
};
static void __snd_release_dma(struct device *dev, void *data)
{
struct snd_dma_data *p = data;
snd_dma_disable(p->dma);
free_dma(p->dma);
}
/**
* snd_devm_request_dma - the managed version of request_dma()
* @dev: the device pointer
* @dma: the dma number
* @name: the name string of the requester
*
* The requested DMA will be automatically released at unbinding via devres.
*
* Return: zero on success, or a negative error code
*/
int snd_devm_request_dma(struct device *dev, int dma, const char *name)
{
struct snd_dma_data *p;
if (request_dma(dma, name))
return -EBUSY;
p = devres_alloc(__snd_release_dma, sizeof(*p), GFP_KERNEL);
if (!p) {
free_dma(dma);
return -ENOMEM;
}
p->dma = dma;
devres_add(dev, p);
return 0;
}
EXPORT_SYMBOL_GPL(snd_devm_request_dma);
Annotation
- Immediate include surface: `linux/export.h`, `linux/isa-dma.h`, `sound/core.h`.
- Detected declarations: `struct snd_dma_data`, `function Copyright`, `function snd_dma_disable`, `function snd_dma_pointer`, `function __snd_release_dma`, `function snd_devm_request_dma`, `export snd_dma_program`, `export snd_dma_disable`, `export snd_dma_pointer`, `export snd_devm_request_dma`.
- Atlas domain: Driver Families / sound/core.
- Implementation status: integration 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.