sound/soc/sof/sof-client-probes.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/sof-client-probes.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/sof-client-probes.c- Extension
.c- Size
- 16276 bytes
- Lines
- 602
- Domain
- Driver Families
- Bucket
- sound/soc
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/debugfs.hlinux/module.hlinux/pm_runtime.hlinux/string_helpers.hlinux/stddef.hsound/soc.hsound/sof/header.hsound/sof/ipc4/header.hsof-client.hsof-client-probes.hsof-audio.hipc4-priv.h
Detected Declarations
function sof_probes_compr_startupfunction sof_probes_compr_shutdownfunction sof_probes_compr_set_paramsfunction sof_probes_compr_triggerfunction sof_probes_compr_pointerfunction sof_probes_compr_copyfunction sof_probes_dfs_points_readfunction sof_probes_dfs_active_points_readfunction sof_probes_dfs_available_points_readfunction sof_probes_dfs_points_writefunction sof_probes_dfs_points_remove_writefunction sof_probes_client_probefunction sof_probes_client_remove
Annotated Snippet
static const struct file_operations sof_probes_active_points_fops = {
.open = simple_open,
.read = sof_probes_dfs_active_points_read,
.write = sof_probes_dfs_points_write,
.llseek = default_llseek,
.owner = THIS_MODULE,
};
static const struct file_operations sof_probes_available_points_fops = {
.open = simple_open,
.read = sof_probes_dfs_available_points_read,
.llseek = default_llseek,
.owner = THIS_MODULE,
};
static ssize_t
sof_probes_dfs_points_remove_write(struct file *file, const char __user *from,
size_t count, loff_t *ppos)
{
struct sof_client_dev *cdev = file->private_data;
struct sof_probes_priv *priv = cdev->data;
const struct sof_probes_ipc_ops *ipc = priv->ipc_ops;
struct device *dev = &cdev->auxdev.dev;
int ret, err;
u32 *array;
if (priv->extractor_stream_tag == SOF_PROBES_INVALID_NODE_ID) {
dev_warn(dev, "no extractor stream running\n");
return -ENOENT;
}
ret = parse_int_array_user(from, count, (int **)&array);
if (ret < 0)
return ret;
ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err_ratelimited(dev, "debugfs write failed to resume %d\n", ret);
goto exit;
}
ret = sof_client_boot_dsp(cdev);
if (!ret) {
ret = ipc->points_remove(cdev, &array[1], array[0]);
if (!ret)
ret = count;
}
err = pm_runtime_put_autosuspend(dev);
if (err < 0)
dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
exit:
kfree(array);
return ret;
}
static const struct file_operations sof_probes_points_remove_fops = {
.open = simple_open,
.write = sof_probes_dfs_points_remove_write,
.llseek = default_llseek,
.owner = THIS_MODULE,
};
static const struct snd_soc_dai_ops sof_probes_dai_ops = {
.compress_new = snd_soc_new_compress,
};
static struct snd_soc_dai_driver sof_probes_dai_drv[] = {
{
.name = "Probe Extraction CPU DAI",
.ops = &sof_probes_dai_ops,
.cops = &sof_probes_compr_ops,
.capture = {
.stream_name = "Probe Extraction",
.channels_min = 1,
.channels_max = 8,
.rates = SNDRV_PCM_RATE_48000,
.rate_min = 48000,
.rate_max = 48000,
},
},
};
static const struct snd_soc_component_driver sof_probes_component = {
.name = "sof-probes-component",
.compress_ops = &sof_probes_compressed_ops,
.module_get_upon_open = 1,
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/string_helpers.h`, `linux/stddef.h`, `sound/soc.h`, `sound/sof/header.h`, `sound/sof/ipc4/header.h`.
- Detected declarations: `function sof_probes_compr_startup`, `function sof_probes_compr_shutdown`, `function sof_probes_compr_set_params`, `function sof_probes_compr_trigger`, `function sof_probes_compr_pointer`, `function sof_probes_compr_copy`, `function sof_probes_dfs_points_read`, `function sof_probes_dfs_active_points_read`, `function sof_probes_dfs_available_points_read`, `function sof_probes_dfs_points_write`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.