// SPDX-License-Identifier: GPL-2.0-only // // Copyright(c) 2019-2022 Intel Corporation // // Author: Jyri Sarha <[email protected]> // #include <sound/soc.h> #include <sound/sof/ipc4/header.h> #include <uapi/sound/sof/header.h> #include "sof-priv.h" #include "ipc4-priv.h" #include "sof-client.h" #include "sof-client-probes.h" enum sof_ipc4_dma_type { … }; enum sof_ipc4_probe_runtime_param { … }; struct sof_ipc4_probe_gtw_cfg { … } __packed __aligned(…); #define SOF_IPC4_PROBE_NODE_ID_INDEX(x) … #define SOF_IPC4_PROBE_NODE_ID_TYPE(x) … struct sof_ipc4_probe_cfg { … } __packed __aligned(…); enum sof_ipc4_probe_type { … }; struct sof_ipc4_probe_point { … } __packed __aligned(…); #define INVALID_PIPELINE_ID … /** * 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) { … } /** * ipc4_probes_init - initialize data probing * @cdev: SOF client device * @stream_tag: Extractor stream tag * @buffer_size: DMA buffer size to set for extractor * @return: 0 on success, negative error code on error * * Host chooses whether extraction is supported or not by providing * valid stream tag to DSP. Once specified, stream described by that * tag will be tied to DSP for extraction for the entire lifetime of * probe. * * Probing is initialized only once and each INIT request must be * matched by DEINIT call. */ static int ipc4_probes_init(struct sof_client_dev *cdev, u32 stream_tag, size_t buffer_size) { … } /** * ipc4_probes_deinit - cleanup after data probing * @cdev: SOF client device * @return: 0 on success, negative error code on error * * Host sends DEINIT request to free previously initialized probe * on DSP side once it is no longer needed. DEINIT only when there * are no probes connected and with all injectors detached. */ static int ipc4_probes_deinit(struct sof_client_dev *cdev) { … } /** * ipc4_probes_points_info - retrieve list of active probe points * @cdev: SOF client device * @desc: Returned list of active probes * @num_desc: Returned count of active probes * @return: 0 on success, negative error code on error * * Dummy implementation returning empty list of probes. */ static int ipc4_probes_points_info(struct sof_client_dev *cdev, struct sof_probe_point_desc **desc, size_t *num_desc) { … } /** * ipc4_probes_points_add - connect specified probes * @cdev: SOF client device * @desc: List of probe points to connect * @num_desc: Number of elements in @desc * @return: 0 on success, negative error code on error * * Translates the generic probe point presentation to an IPC4 * message to dynamically connect the provided set of endpoints. */ static int ipc4_probes_points_add(struct sof_client_dev *cdev, struct sof_probe_point_desc *desc, size_t num_desc) { … } /** * ipc4_probes_points_remove - disconnect specified probes * @cdev: SOF client device * @buffer_id: List of probe points to disconnect * @num_buffer_id: Number of elements in @desc * @return: 0 on success, negative error code on error * * Converts the generic buffer_id to IPC4 probe_point_id and remove * the probe points with an IPC4 for message. */ static int ipc4_probes_points_remove(struct sof_client_dev *cdev, unsigned int *buffer_id, size_t num_buffer_id) { … } const struct sof_probes_ipc_ops ipc4_probe_ops = …;