drivers/media/pci/cx25821/cx25821-alsa.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/cx25821/cx25821-alsa.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/cx25821/cx25821-alsa.c- Extension
.c- Size
- 20528 bytes
- Lines
- 821
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
linux/module.hlinux/init.hlinux/device.hlinux/interrupt.hlinux/vmalloc.hlinux/dma-mapping.hlinux/pci.hlinux/slab.hlinux/delay.hsound/core.hsound/pcm.hsound/pcm_params.hsound/control.hsound/initval.hsound/tlv.hcx25821.hcx25821-reg.h
Detected Declarations
struct cx25821_audio_bufferstruct cx25821_audio_devfunction cx25821_alsa_dma_initfunction cx25821_alsa_dma_mapfunction cx25821_alsa_dma_unmapfunction cx25821_alsa_dma_freefunction _cx25821_start_audio_dmafunction _cx25821_stop_audio_dmafunction cx25821_aud_irqfunction cx25821_irqfunction dsp_buffer_freefunction snd_cx25821_pcm_openfunction snd_cx25821_closefunction snd_cx25821_hw_paramsfunction snd_cx25821_hw_freefunction snd_cx25821_preparefunction snd_cx25821_card_triggerfunction snd_cx25821_pointerfunction callbackfunction snd_cx25821_pcmfunction cx25821_audio_initdevfunction cx25821_alsa_exit_callbackfunction cx25821_audio_finifunction cx25821_alsa_init_callbackfunction cx25821_alsa_init
Annotated Snippet
struct device_driver *drv = driver_find("cx25821", &pci_bus_type);
int ret;
ret = driver_for_each_device(drv, NULL, NULL, cx25821_alsa_exit_callback);
if (ret)
pr_err("%s failed to find a cx25821 driver.\n", __func__);
}
static int cx25821_alsa_init_callback(struct device *dev, void *data)
{
struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
struct cx25821_dev *cxdev = get_cx25821(v4l2_dev);
cx25821_audio_initdev(cxdev);
return 0;
}
/*
* Module initializer
*
* Loops through present saa7134 cards, and assigns an ALSA device
* to each one
*
*/
static int cx25821_alsa_init(void)
{
struct device_driver *drv = driver_find("cx25821", &pci_bus_type);
return driver_for_each_device(drv, NULL, NULL, cx25821_alsa_init_callback);
}
late_initcall(cx25821_alsa_init);
module_exit(cx25821_audio_fini);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/device.h`, `linux/interrupt.h`, `linux/vmalloc.h`, `linux/dma-mapping.h`, `linux/pci.h`, `linux/slab.h`.
- Detected declarations: `struct cx25821_audio_buffer`, `struct cx25821_audio_dev`, `function cx25821_alsa_dma_init`, `function cx25821_alsa_dma_map`, `function cx25821_alsa_dma_unmap`, `function cx25821_alsa_dma_free`, `function _cx25821_start_audio_dma`, `function _cx25821_stop_audio_dma`, `function cx25821_aud_irq`, `function cx25821_irq`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.