sound/soc/intel/catpt/pcm.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/catpt/pcm.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/catpt/pcm.c- Extension
.c- Size
- 29267 bytes
- Lines
- 1091
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/cleanup.hlinux/pm_runtime.hsound/soc.hsound/pcm_params.huapi/sound/tlv.hcore.hmessages.h
Detected Declarations
struct catpt_stream_templatestruct catpt_control_datafunction catpt_get_stream_templatefunction catpt_stream_hw_idfunction catpt_stream_read_positionfunction catpt_arrange_page_tablefunction catpt_get_channel_mapfunction catpt_get_channel_configfunction catpt_dai_startupfunction catpt_dai_shutdownfunction catpt_apply_volumefunction catpt_apply_mutefunction catpt_apply_controlsfunction catpt_dai_hw_paramsfunction catpt_dai_hw_freefunction catpt_dai_preparefunction catpt_dai_triggerfunction catpt_stream_update_positionfunction catpt_component_pcm_newfunction catpt_component_openfunction catpt_component_pointerfunction catpt_dai_pcm_newfunction ctlvol_to_dspvolfunction dspvol_to_ctlvolfunction catpt_set_dspvolfunction catpt_volume_infofunction catpt_volume_getfunction catpt_volume_putfunction catpt_loopback_mute_getfunction catpt_loopback_mute_putfunction catpt_arm_stream_templatesfunction catpt_register_plat_component
Annotated Snippet
struct catpt_stream_template {
enum catpt_path_id path_id;
enum catpt_stream_type type;
u32 persistent_size;
u8 num_entries;
struct catpt_module_entry entries[];
};
static struct catpt_stream_template system_pb = {
.path_id = CATPT_PATH_SSP0_OUT,
.type = CATPT_STRM_TYPE_SYSTEM,
.num_entries = 1,
.entries = {{ CATPT_MODID_PCM_SYSTEM, 0 }},
};
static struct catpt_stream_template system_cp = {
.path_id = CATPT_PATH_SSP0_IN,
.type = CATPT_STRM_TYPE_CAPTURE,
.num_entries = 1,
.entries = {{ CATPT_MODID_PCM_CAPTURE, 0 }},
};
static struct catpt_stream_template offload_pb = {
.path_id = CATPT_PATH_SSP0_OUT,
.type = CATPT_STRM_TYPE_RENDER,
.num_entries = 1,
.entries = {{ CATPT_MODID_PCM, 0 }},
};
static struct catpt_stream_template loopback_cp = {
.path_id = CATPT_PATH_SSP0_OUT,
.type = CATPT_STRM_TYPE_LOOPBACK,
.num_entries = 1,
.entries = {{ CATPT_MODID_PCM_REFERENCE, 0 }},
};
static struct catpt_stream_template bluetooth_pb = {
.path_id = CATPT_PATH_SSP1_OUT,
.type = CATPT_STRM_TYPE_BLUETOOTH_RENDER,
.num_entries = 1,
.entries = {{ CATPT_MODID_BLUETOOTH_RENDER, 0 }},
};
static struct catpt_stream_template bluetooth_cp = {
.path_id = CATPT_PATH_SSP1_IN,
.type = CATPT_STRM_TYPE_BLUETOOTH_CAPTURE,
.num_entries = 1,
.entries = {{ CATPT_MODID_BLUETOOTH_CAPTURE, 0 }},
};
static struct catpt_stream_template *catpt_topology[] = {
[CATPT_STRM_TYPE_RENDER] = &offload_pb,
[CATPT_STRM_TYPE_SYSTEM] = &system_pb,
[CATPT_STRM_TYPE_CAPTURE] = &system_cp,
[CATPT_STRM_TYPE_LOOPBACK] = &loopback_cp,
[CATPT_STRM_TYPE_BLUETOOTH_RENDER] = &bluetooth_pb,
[CATPT_STRM_TYPE_BLUETOOTH_CAPTURE] = &bluetooth_cp,
};
static struct catpt_stream_template *
catpt_get_stream_template(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtm = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtm, 0);
enum catpt_stream_type type;
type = cpu_dai->driver->id;
/* account for capture in bidirectional dais */
switch (type) {
case CATPT_STRM_TYPE_SYSTEM:
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
type = CATPT_STRM_TYPE_CAPTURE;
break;
case CATPT_STRM_TYPE_BLUETOOTH_RENDER:
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
type = CATPT_STRM_TYPE_BLUETOOTH_CAPTURE;
break;
default:
break;
}
return catpt_topology[type];
}
/* Caller responsible for holding ->stream_mutex. */
struct catpt_stream_runtime *catpt_stream_find(struct catpt_dev *cdev, u8 stream_hw_id)
{
struct catpt_stream_runtime *stream;
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/pm_runtime.h`, `sound/soc.h`, `sound/pcm_params.h`, `uapi/sound/tlv.h`, `core.h`, `messages.h`.
- Detected declarations: `struct catpt_stream_template`, `struct catpt_control_data`, `function catpt_get_stream_template`, `function catpt_stream_hw_id`, `function catpt_stream_read_position`, `function catpt_arrange_page_table`, `function catpt_get_channel_map`, `function catpt_get_channel_config`, `function catpt_dai_startup`, `function catpt_dai_shutdown`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source 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.