sound/soc/fsl/lpc3xxx-pcm.c
Source file repositories/reference/linux-study-clean/sound/soc/fsl/lpc3xxx-pcm.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/fsl/lpc3xxx-pcm.c- Extension
.c- Size
- 2000 bytes
- Lines
- 73
- 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/init.hlinux/platform_device.hlinux/slab.hlinux/dma-mapping.hlinux/amba/pl08x.hsound/core.hsound/pcm.hsound/pcm_params.hsound/dmaengine_pcm.hsound/soc.hlpc3xxx-i2s.h
Detected Declarations
function lpc3xxx_pcm_registerexport lpc3xxx_pcm_register
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
//
// Author: Kevin Wells <kevin.wells@nxp.com>
//
// Copyright (C) 2008 NXP Semiconductors
// Copyright 2023 Timesys Corporation <piotr.wojtaszczyk@timesys.com>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/amba/pl08x.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/dmaengine_pcm.h>
#include <sound/soc.h>
#include "lpc3xxx-i2s.h"
#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_U8 | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_U16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_U24_LE | \
SNDRV_PCM_FMTBIT_S32_LE | \
SNDRV_PCM_FMTBIT_U32_LE | \
SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
static const struct snd_pcm_hardware lpc3xxx_pcm_hardware = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_RESUME),
.formats = STUB_FORMATS,
.period_bytes_min = 128,
.period_bytes_max = 2048,
.periods_min = 2,
.periods_max = 1024,
.buffer_bytes_max = 128 * 1024
};
static const struct snd_dmaengine_pcm_config lpc3xxx_dmaengine_pcm_config = {
.pcm_hardware = &lpc3xxx_pcm_hardware,
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
.compat_filter_fn = pl08x_filter_id,
.prealloc_buffer_size = 128 * 1024,
};
static const struct snd_soc_component_driver lpc3xxx_soc_platform_driver = {
.name = "lpc32xx-pcm",
};
int lpc3xxx_pcm_register(struct platform_device *pdev)
{
int ret;
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, &lpc3xxx_dmaengine_pcm_config, 0);
if (ret) {
dev_err(&pdev->dev, "failed to register dmaengine: %d\n", ret);
return ret;
}
return devm_snd_soc_register_component(&pdev->dev, &lpc3xxx_soc_platform_driver,
NULL, 0);
}
EXPORT_SYMBOL(lpc3xxx_pcm_register);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/platform_device.h`, `linux/slab.h`, `linux/dma-mapping.h`, `linux/amba/pl08x.h`, `sound/core.h`, `sound/pcm.h`.
- Detected declarations: `function lpc3xxx_pcm_register`, `export lpc3xxx_pcm_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.