sound/soc/spear/spear_pcm.c
Source file repositories/reference/linux-study-clean/sound/soc/spear/spear_pcm.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/spear/spear_pcm.c- Extension
.c- Size
- 1669 bytes
- Lines
- 53
- Domain
- Driver Families
- Bucket
- sound/soc
- 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/module.hlinux/dmaengine.hlinux/platform_device.hsound/dmaengine_pcm.hsound/pcm.hsound/soc.hsound/spear_dma.hspear_pcm.h
Detected Declarations
function devm_spear_pcm_platform_registerexport devm_spear_pcm_platform_register
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* ALSA PCM interface for ST SPEAr Processors
*
* sound/soc/spear/spear_pcm.c
*
* Copyright (C) 2012 ST Microelectronics
* Rajeev Kumar<rajeevkumar.linux@gmail.com>
*/
#include <linux/module.h>
#include <linux/dmaengine.h>
#include <linux/platform_device.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/spear_dma.h>
#include "spear_pcm.h"
static const struct snd_pcm_hardware spear_pcm_hardware = {
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME),
.buffer_bytes_max = 16 * 1024, /* max buffer size */
.period_bytes_min = 2 * 1024, /* 1 msec data minimum period size */
.period_bytes_max = 2 * 1024, /* maximum period size */
.periods_min = 1, /* min # periods */
.periods_max = 8, /* max # of periods */
.fifo_size = 0, /* fifo size in bytes */
};
static const struct snd_dmaengine_pcm_config spear_dmaengine_pcm_config = {
.pcm_hardware = &spear_pcm_hardware,
.prealloc_buffer_size = 16 * 1024,
};
int devm_spear_pcm_platform_register(struct device *dev,
struct snd_dmaengine_pcm_config *config,
bool (*filter)(struct dma_chan *chan, void *slave))
{
*config = spear_dmaengine_pcm_config;
config->compat_filter_fn = filter;
return devm_snd_dmaengine_pcm_register(dev, config,
SND_DMAENGINE_PCM_FLAG_NO_DT |
SND_DMAENGINE_PCM_FLAG_COMPAT);
}
EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register);
MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
MODULE_DESCRIPTION("SPEAr PCM DMA module");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/module.h`, `linux/dmaengine.h`, `linux/platform_device.h`, `sound/dmaengine_pcm.h`, `sound/pcm.h`, `sound/soc.h`, `sound/spear_dma.h`, `spear_pcm.h`.
- Detected declarations: `function devm_spear_pcm_platform_register`, `export devm_spear_pcm_platform_register`.
- Atlas domain: Driver Families / sound/soc.
- 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.