sound/drivers/vx/vx_hwdep.c
Source file repositories/reference/linux-study-clean/sound/drivers/vx/vx_hwdep.c
File Facts
- System
- Linux kernel
- Corpus path
sound/drivers/vx/vx_hwdep.c- Extension
.c- Size
- 2640 bytes
- Lines
- 113
- Domain
- Driver Families
- Bucket
- sound/drivers
- 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.
- 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/device.hlinux/firmware.hlinux/slab.hlinux/vmalloc.hlinux/module.hsound/core.hsound/hwdep.hsound/vx_core.h
Detected Declarations
function snd_vx_setup_firmwarefunction snd_vx_free_firmwareexport snd_vx_setup_firmwareexport snd_vx_free_firmware
Annotated Snippet
if (request_firmware(&fw, path, chip->card->dev)) {
dev_err(chip->card->dev, "vx: can't load firmware %s\n", path);
return -ENOENT;
}
err = chip->ops->load_dsp(chip, i, fw);
if (err < 0) {
release_firmware(fw);
return err;
}
if (i == 1)
chip->chip_status |= VX_STAT_XILINX_LOADED;
#ifdef CONFIG_PM
chip->firmware[i] = fw;
#else
release_firmware(fw);
#endif
}
/* ok, we reached to the last one */
/* create the devices if not built yet */
err = snd_vx_pcm_new(chip);
if (err < 0)
return err;
err = snd_vx_mixer_new(chip);
if (err < 0)
return err;
if (chip->ops->add_controls) {
err = chip->ops->add_controls(chip);
if (err < 0)
return err;
}
chip->chip_status |= VX_STAT_DEVICE_INIT;
chip->chip_status |= VX_STAT_CHIP_INIT;
return snd_card_register(chip->card);
}
/* exported */
void snd_vx_free_firmware(struct vx_core *chip)
{
#ifdef CONFIG_PM
int i;
for (i = 0; i < 4; i++)
release_firmware(chip->firmware[i]);
#endif
}
EXPORT_SYMBOL(snd_vx_setup_firmware);
EXPORT_SYMBOL(snd_vx_free_firmware);
Annotation
- Immediate include surface: `linux/device.h`, `linux/firmware.h`, `linux/slab.h`, `linux/vmalloc.h`, `linux/module.h`, `sound/core.h`, `sound/hwdep.h`, `sound/vx_core.h`.
- Detected declarations: `function snd_vx_setup_firmware`, `function snd_vx_free_firmware`, `export snd_vx_setup_firmware`, `export snd_vx_free_firmware`.
- Atlas domain: Driver Families / sound/drivers.
- 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.