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 reserved[1];
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
91struct sof_ipc_buffer {
92 struct sof_ipc_comp comp;
93 uint32_t size;
94 uint32_t caps;
95 uint32_t flags;
96 uint32_t reserved;
97} __packed;
98
99
100struct sof_ipc_comp_config {
101 struct sof_ipc_cmd_hdr hdr;
102 uint32_t periods_sink;
103 uint32_t periods_source;
104 uint32_t reserved1;
105 uint32_t frame_fmt;
106 uint32_t xrun_action;
107
108
109 uint32_t reserved[2];
110} __packed;
111
112
113struct sof_ipc_comp_host {
114 struct sof_ipc_comp comp;
115 struct sof_ipc_comp_config config;
116 uint32_t direction;
117 uint32_t no_irq;
118 uint32_t dmac_config;
119} __packed;
120
121
122struct sof_ipc_comp_dai {
123 struct sof_ipc_comp comp;
124 struct sof_ipc_comp_config config;
125 uint32_t direction;
126 uint32_t dai_index;
127 uint32_t type;
128 uint32_t reserved;
129} __packed;
130
131
132struct sof_ipc_comp_mixer {
133 struct sof_ipc_comp comp;
134 struct sof_ipc_comp_config config;
135} __packed;
136
137
138enum sof_volume_ramp {
139 SOF_VOLUME_LINEAR = 0,
140 SOF_VOLUME_LOG,
141 SOF_VOLUME_LINEAR_ZC,
142 SOF_VOLUME_LOG_ZC,
143};
144
145
146struct sof_ipc_comp_volume {
147 struct sof_ipc_comp comp;
148 struct sof_ipc_comp_config config;
149 uint32_t channels;
150 uint32_t min_value;
151 uint32_t max_value;
152 uint32_t ramp;
153 uint32_t initial_ramp;
154} __packed;
155
156
157struct sof_ipc_comp_src {
158 struct sof_ipc_comp comp;
159 struct sof_ipc_comp_config config;
160
161 uint32_t source_rate;
162 uint32_t sink_rate;
163 uint32_t rate_mask;
164} __packed;
165
166
167struct sof_ipc_comp_asrc {
168 struct sof_ipc_comp comp;
169 struct sof_ipc_comp_config config;
170
171 uint32_t source_rate;
172
173
174 uint32_t sink_rate;
175
176
177 uint32_t asynchronous_mode;
178
179
180 uint32_t operation_mode;
181
182
183
184
185
186
187
188
189 uint32_t reserved[4];
190} __attribute__((packed));
191
192
193struct sof_ipc_comp_mux {
194 struct sof_ipc_comp comp;
195 struct sof_ipc_comp_config config;
196} __packed;
197
198
199struct sof_ipc_comp_tone {
200 struct sof_ipc_comp comp;
201 struct sof_ipc_comp_config config;
202 int32_t sample_rate;
203 int32_t frequency;
204 int32_t amplitude;
205 int32_t freq_mult;
206 int32_t ampl_mult;
207 int32_t length;
208 int32_t period;
209 int32_t repeats;
210 int32_t ramp_step;
211} __packed;
212
213
214enum sof_ipc_process_type {
215 SOF_PROCESS_NONE = 0,
216 SOF_PROCESS_EQFIR,
217 SOF_PROCESS_EQIIR,
218 SOF_PROCESS_KEYWORD_DETECT,
219 SOF_PROCESS_KPB,
220 SOF_PROCESS_CHAN_SELECTOR,
221 SOF_PROCESS_MUX,
222 SOF_PROCESS_DEMUX,
223 SOF_PROCESS_DCBLOCK,
224 SOF_PROCESS_SMART_AMP,
225};
226
227
228struct sof_ipc_comp_process {
229 struct sof_ipc_comp comp;
230 struct sof_ipc_comp_config config;
231 uint32_t size;
232 uint32_t type;
233
234
235 uint32_t reserved[7];
236
237 uint8_t data[0];
238} __packed;
239
240
241
242
243struct sof_ipc_free {
244 struct sof_ipc_cmd_hdr hdr;
245 uint32_t id;
246} __packed;
247
248struct sof_ipc_comp_reply {
249 struct sof_ipc_reply rhdr;
250 uint32_t id;
251 uint32_t offset;
252} __packed;
253
254
255
256
257
258
259enum sof_ipc_pipe_sched_time_domain {
260 SOF_TIME_DOMAIN_DMA = 0,
261 SOF_TIME_DOMAIN_TIMER,
262};
263
264
265struct sof_ipc_pipe_new {
266 struct sof_ipc_cmd_hdr hdr;
267 uint32_t comp_id;
268 uint32_t pipeline_id;
269 uint32_t sched_id;
270 uint32_t core;
271 uint32_t period;
272 uint32_t priority;
273 uint32_t period_mips;
274 uint32_t frames_per_sched;
275 uint32_t xrun_limit_usecs;
276 uint32_t time_domain;
277} __packed;
278
279
280struct sof_ipc_pipe_ready {
281 struct sof_ipc_cmd_hdr hdr;
282 uint32_t comp_id;
283} __packed;
284
285struct sof_ipc_pipe_free {
286 struct sof_ipc_cmd_hdr hdr;
287 uint32_t comp_id;
288} __packed;
289
290
291struct sof_ipc_pipe_comp_connect {
292 struct sof_ipc_cmd_hdr hdr;
293 uint32_t source_id;
294 uint32_t sink_id;
295} __packed;
296
297
298enum sof_event_types {
299 SOF_EVENT_NONE = 0,
300 SOF_KEYWORD_DETECT_DAPM_EVENT,
301};
302
303#endif
304