1
2
3
4
5
6
7
8
9#ifndef __INCLUDE_SOUND_SOF_TOPOLOGY_H__
10#define __INCLUDE_SOUND_SOF_TOPOLOGY_H__
11
12#include <sound/sof/header.h>
13
14
15
16
17
18
19enum sof_comp_type {
20 SOF_COMP_NONE = 0,
21 SOF_COMP_HOST,
22 SOF_COMP_DAI,
23 SOF_COMP_SG_HOST,
24 SOF_COMP_SG_DAI,
25 SOF_COMP_VOLUME,
26 SOF_COMP_MIXER,
27 SOF_COMP_MUX,
28 SOF_COMP_SRC,
29 SOF_COMP_SPLITTER,
30 SOF_COMP_TONE,
31 SOF_COMP_SWITCH,
32 SOF_COMP_BUFFER,
33 SOF_COMP_EQ_IIR,
34 SOF_COMP_EQ_FIR,
35 SOF_COMP_KEYWORD_DETECT,
36 SOF_COMP_KPB,
37 SOF_COMP_SELECTOR,
38 SOF_COMP_DEMUX,
39 SOF_COMP_ASRC,
40 SOF_COMP_DCBLOCK,
41 SOF_COMP_SMART_AMP,
42
43 SOF_COMP_FILEREAD = 10000,
44 SOF_COMP_FILEWRITE = 10001,
45};
46
47
48#define SOF_XRUN_STOP 1
49#define SOF_XRUN_UNDER_ZERO 2
50#define SOF_XRUN_OVER_NULL 4
51
52
53struct sof_ipc_comp {
54 struct sof_ipc_cmd_hdr hdr;
55 uint32_t id;
56 enum sof_comp_type type;
57 uint32_t pipeline_id;
58 uint32_t core;
59
60
61 uint32_t ext_data_length;
62} __packed;
63
64
65
66
67
68
69
70
71#define SOF_MEM_CAPS_RAM (1 << 0)
72#define SOF_MEM_CAPS_ROM (1 << 1)
73#define SOF_MEM_CAPS_EXT (1 << 2)
74#define SOF_MEM_CAPS_LP (1 << 3)
75#define SOF_MEM_CAPS_HP (1 << 4)
76#define SOF_MEM_CAPS_DMA (1 << 5)
77#define SOF_MEM_CAPS_CACHE (1 << 6)
78#define SOF_MEM_CAPS_EXEC (1 << 7)
79
80
81
82
83#define SOF_BUF_OVERRUN_PERMITTED BIT(0)
84
85
86
87
88#define SOF_BUF_UNDERRUN_PERMITTED BIT(1)
89
90
91#define SOF_UUID_SIZE 16
92
93
94struct sof_ipc_buffer {
95 struct sof_ipc_comp comp;
96 uint32_t size;
97 uint32_t caps;
98 uint32_t flags;
99 uint32_t reserved;
100} __packed;
101
102
103struct sof_ipc_comp_config {
104 struct sof_ipc_cmd_hdr hdr;
105 uint32_t periods_sink;
106 uint32_t periods_source;
107 uint32_t reserved1;
108 uint32_t frame_fmt;
109 uint32_t xrun_action;
110
111
112 uint32_t reserved[2];
113} __packed;
114
115
116struct sof_ipc_comp_host {
117 struct sof_ipc_comp comp;
118 struct sof_ipc_comp_config config;
119 uint32_t direction;
120 uint32_t no_irq;
121 uint32_t dmac_config;
122} __packed;
123
124
125struct sof_ipc_comp_dai {
126 struct sof_ipc_comp comp;
127 struct sof_ipc_comp_config config;
128 uint32_t direction;
129 uint32_t dai_index;
130 uint32_t type;
131 uint32_t reserved;
132} __packed;
133
134
135struct sof_ipc_comp_mixer {
136 struct sof_ipc_comp comp;
137 struct sof_ipc_comp_config config;
138} __packed;
139
140
141enum sof_volume_ramp {
142 SOF_VOLUME_LINEAR = 0,
143 SOF_VOLUME_LOG,
144 SOF_VOLUME_LINEAR_ZC,
145 SOF_VOLUME_LOG_ZC,
146};
147
148
149struct sof_ipc_comp_volume {
150 struct sof_ipc_comp comp;
151 struct sof_ipc_comp_config config;
152 uint32_t channels;
153 uint32_t min_value;
154 uint32_t max_value;
155 uint32_t ramp;
156 uint32_t initial_ramp;
157} __packed;
158
159
160struct sof_ipc_comp_src {
161 struct sof_ipc_comp comp;
162 struct sof_ipc_comp_config config;
163
164 uint32_t source_rate;
165 uint32_t sink_rate;
166 uint32_t rate_mask;
167} __packed;
168
169
170struct sof_ipc_comp_asrc {
171 struct sof_ipc_comp comp;
172 struct sof_ipc_comp_config config;
173
174 uint32_t source_rate;
175
176
177 uint32_t sink_rate;
178
179
180 uint32_t asynchronous_mode;
181
182
183 uint32_t operation_mode;
184
185
186
187
188
189
190
191
192 uint32_t reserved[4];
193} __attribute__((packed));
194
195
196struct sof_ipc_comp_mux {
197 struct sof_ipc_comp comp;
198 struct sof_ipc_comp_config config;
199} __packed;
200
201
202struct sof_ipc_comp_tone {
203 struct sof_ipc_comp comp;
204 struct sof_ipc_comp_config config;
205 int32_t sample_rate;
206 int32_t frequency;
207 int32_t amplitude;
208 int32_t freq_mult;
209 int32_t ampl_mult;
210 int32_t length;
211 int32_t period;
212 int32_t repeats;
213 int32_t ramp_step;
214} __packed;
215
216
217enum sof_ipc_process_type {
218 SOF_PROCESS_NONE = 0,
219 SOF_PROCESS_EQFIR,
220 SOF_PROCESS_EQIIR,
221 SOF_PROCESS_KEYWORD_DETECT,
222 SOF_PROCESS_KPB,
223 SOF_PROCESS_CHAN_SELECTOR,
224 SOF_PROCESS_MUX,
225 SOF_PROCESS_DEMUX,
226 SOF_PROCESS_DCBLOCK,
227 SOF_PROCESS_SMART_AMP,
228};
229
230
231struct sof_ipc_comp_process {
232 struct sof_ipc_comp comp;
233 struct sof_ipc_comp_config config;
234 uint32_t size;
235 uint32_t type;
236
237
238 uint32_t reserved[7];
239
240 uint8_t data[0];
241} __packed;
242
243
244
245
246struct sof_ipc_free {
247 struct sof_ipc_cmd_hdr hdr;
248 uint32_t id;
249} __packed;
250
251struct sof_ipc_comp_reply {
252 struct sof_ipc_reply rhdr;
253 uint32_t id;
254 uint32_t offset;
255} __packed;
256
257
258
259
260
261
262enum sof_ipc_pipe_sched_time_domain {
263 SOF_TIME_DOMAIN_DMA = 0,
264 SOF_TIME_DOMAIN_TIMER,
265};
266
267
268struct sof_ipc_pipe_new {
269 struct sof_ipc_cmd_hdr hdr;
270 uint32_t comp_id;
271 uint32_t pipeline_id;
272 uint32_t sched_id;
273 uint32_t core;
274 uint32_t period;
275 uint32_t priority;
276 uint32_t period_mips;
277 uint32_t frames_per_sched;
278 uint32_t xrun_limit_usecs;
279 uint32_t time_domain;
280} __packed;
281
282
283struct sof_ipc_pipe_ready {
284 struct sof_ipc_cmd_hdr hdr;
285 uint32_t comp_id;
286} __packed;
287
288struct sof_ipc_pipe_free {
289 struct sof_ipc_cmd_hdr hdr;
290 uint32_t comp_id;
291} __packed;
292
293
294struct sof_ipc_pipe_comp_connect {
295 struct sof_ipc_cmd_hdr hdr;
296 uint32_t source_id;
297 uint32_t sink_id;
298} __packed;
299
300
301enum sof_event_types {
302 SOF_EVENT_NONE = 0,
303 SOF_KEYWORD_DETECT_DAPM_EVENT,
304};
305
306
307struct sof_ipc_comp_ext {
308 uint8_t uuid[SOF_UUID_SIZE];
309} __packed;
310
311#endif
312