sound/soc/sof/sof-client-probes-ipc4.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/sof-client-probes-ipc4.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/sof-client-probes-ipc4.c- Extension
.c- Size
- 12070 bytes
- Lines
- 410
- 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.
- 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
sound/soc.hsound/sof/ipc4/header.huapi/sound/sof/header.hsof-audio.hipc4-priv.hsof-client.hsof-client-probes.h
Detected Declarations
struct sof_ipc4_probe_gtw_cfgstruct sof_ipc4_probe_cfgstruct sof_ipc4_probe_pointstruct sof_ipc4_probe_infoenum sof_ipc4_dma_typeenum sof_ipc4_probe_runtime_paramenum sof_ipc4_probe_typefunction ipc4_probes_initfunction ipc4_probes_deinitfunction ipc4_probes_points_infofunction ipc4_probes_point_printfunction ipc4_probes_points_addfunction ipc4_probes_points_remove
Annotated Snippet
struct sof_ipc4_probe_gtw_cfg {
u32 node_id;
u32 dma_buffer_size;
} __packed __aligned(4);
#define SOF_IPC4_PROBE_NODE_ID_INDEX(x) ((x) & GENMASK(7, 0))
#define SOF_IPC4_PROBE_NODE_ID_TYPE(x) (((x) << 8) & GENMASK(12, 8))
struct sof_ipc4_probe_cfg {
struct sof_ipc4_base_module_cfg base;
struct sof_ipc4_probe_gtw_cfg gtw_cfg;
} __packed __aligned(4);
enum sof_ipc4_probe_type {
SOF_IPC4_PROBE_TYPE_INPUT = 0,
SOF_IPC4_PROBE_TYPE_OUTPUT,
SOF_IPC4_PROBE_TYPE_INTERNAL
};
#define SOF_IPC4_PROBE_TYPE_SHIFT 24
#define SOF_IPC4_PROBE_TYPE_MASK GENMASK(25, 24)
#define SOF_IPC4_PROBE_TYPE_GET(x) (((x) & SOF_IPC4_PROBE_TYPE_MASK) \
>> SOF_IPC4_PROBE_TYPE_SHIFT)
#define SOF_IPC4_PROBE_IDX_SHIFT 26
#define SOF_IPC4_PROBE_IDX_MASK GENMASK(31, 26)
#define SOF_IPC4_PROBE_IDX_GET(x) (((x) & SOF_IPC4_PROBE_IDX_MASK) \
>> SOF_IPC4_PROBE_IDX_SHIFT)
struct sof_ipc4_probe_point {
u32 point_id;
u32 purpose;
u32 stream_tag;
} __packed __aligned(4);
struct sof_ipc4_probe_info {
unsigned int num_elems;
DECLARE_FLEX_ARRAY(struct sof_ipc4_probe_point, points);
} __packed;
#define INVALID_PIPELINE_ID 0xFF
static const char *sof_probe_ipc4_type_string(u32 type)
{
switch (type) {
case SOF_IPC4_PROBE_TYPE_INPUT:
return "input";
case SOF_IPC4_PROBE_TYPE_OUTPUT:
return "output";
case SOF_IPC4_PROBE_TYPE_INTERNAL:
return "internal";
default:
return "UNKNOWN";
}
}
/**
* sof_ipc4_probe_get_module_info - Get IPC4 module info for probe module
* @cdev: SOF client device
* @return: Pointer to IPC4 probe module info
*
* Look up the IPC4 probe module info based on the hard coded uuid and
* store the value for the future calls.
*/
static struct sof_man4_module *sof_ipc4_probe_get_module_info(struct sof_client_dev *cdev)
{
struct sof_probes_priv *priv = cdev->data;
struct device *dev = &cdev->auxdev.dev;
static const guid_t probe_uuid =
GUID_INIT(0x7CAD0808, 0xAB10, 0xCD23,
0xEF, 0x45, 0x12, 0xAB, 0x34, 0xCD, 0x56, 0xEF);
if (!priv->ipc_priv) {
struct sof_ipc4_fw_module *fw_module =
sof_client_ipc4_find_module(cdev, &probe_uuid);
if (!fw_module) {
dev_err(dev, "%s: no matching uuid found", __func__);
return NULL;
}
priv->ipc_priv = &fw_module->man4_module_entry;
}
return (struct sof_man4_module *)priv->ipc_priv;
}
/**
* ipc4_probes_init - initialize data probing
* @cdev: SOF client device
* @stream_tag: Extractor stream tag
Annotation
- Immediate include surface: `sound/soc.h`, `sound/sof/ipc4/header.h`, `uapi/sound/sof/header.h`, `sof-audio.h`, `ipc4-priv.h`, `sof-client.h`, `sof-client-probes.h`.
- Detected declarations: `struct sof_ipc4_probe_gtw_cfg`, `struct sof_ipc4_probe_cfg`, `struct sof_ipc4_probe_point`, `struct sof_ipc4_probe_info`, `enum sof_ipc4_dma_type`, `enum sof_ipc4_probe_runtime_param`, `enum sof_ipc4_probe_type`, `function ipc4_probes_init`, `function ipc4_probes_deinit`, `function ipc4_probes_points_info`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source 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.