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.

Dependency Surface

Detected Declarations

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

Implementation Notes