Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux/fpc-iii.git] / sound / soc / sof / probe.h
blob5e159ab239fa9730d8b59ae78948e18fd19c6e48
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
6 * Copyright(c) 2019-2020 Intel Corporation. All rights reserved.
8 * Author: Cezary Rojewski <cezary.rojewski@intel.com>
9 */
11 #ifndef __SOF_PROBE_H
12 #define __SOF_PROBE_H
14 #include <sound/sof/header.h>
16 struct snd_sof_dev;
18 #define SOF_PROBE_INVALID_NODE_ID UINT_MAX
20 struct sof_probe_dma {
21 unsigned int stream_tag;
22 unsigned int dma_buffer_size;
23 } __packed;
25 enum sof_connection_purpose {
26 SOF_CONNECTION_PURPOSE_EXTRACT = 1,
27 SOF_CONNECTION_PURPOSE_INJECT,
30 struct sof_probe_point_desc {
31 unsigned int buffer_id;
32 unsigned int purpose;
33 unsigned int stream_tag;
34 } __packed;
36 struct sof_ipc_probe_dma_add_params {
37 struct sof_ipc_cmd_hdr hdr;
38 unsigned int num_elems;
39 struct sof_probe_dma dma[];
40 } __packed;
42 struct sof_ipc_probe_info_params {
43 struct sof_ipc_reply rhdr;
44 unsigned int num_elems;
45 union {
46 struct sof_probe_dma dma[0];
47 struct sof_probe_point_desc desc[0];
49 } __packed;
51 struct sof_ipc_probe_dma_remove_params {
52 struct sof_ipc_cmd_hdr hdr;
53 unsigned int num_elems;
54 unsigned int stream_tag[];
55 } __packed;
57 struct sof_ipc_probe_point_add_params {
58 struct sof_ipc_cmd_hdr hdr;
59 unsigned int num_elems;
60 struct sof_probe_point_desc desc[];
61 } __packed;
63 struct sof_ipc_probe_point_remove_params {
64 struct sof_ipc_cmd_hdr hdr;
65 unsigned int num_elems;
66 unsigned int buffer_id[];
67 } __packed;
69 int sof_ipc_probe_init(struct snd_sof_dev *sdev,
70 u32 stream_tag, size_t buffer_size);
71 int sof_ipc_probe_deinit(struct snd_sof_dev *sdev);
72 int sof_ipc_probe_dma_info(struct snd_sof_dev *sdev,
73 struct sof_probe_dma **dma, size_t *num_dma);
74 int sof_ipc_probe_dma_add(struct snd_sof_dev *sdev,
75 struct sof_probe_dma *dma, size_t num_dma);
76 int sof_ipc_probe_dma_remove(struct snd_sof_dev *sdev,
77 unsigned int *stream_tag, size_t num_stream_tag);
78 int sof_ipc_probe_points_info(struct snd_sof_dev *sdev,
79 struct sof_probe_point_desc **desc, size_t *num_desc);
80 int sof_ipc_probe_points_add(struct snd_sof_dev *sdev,
81 struct sof_probe_point_desc *desc, size_t num_desc);
82 int sof_ipc_probe_points_remove(struct snd_sof_dev *sdev,
83 unsigned int *buffer_id, size_t num_buffer_id);
85 #endif