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
40 SOF_COMP_FILEREAD = 10000,
41 SOF_COMP_FILEWRITE = 10001,
42};
43
44
45#define SOF_XRUN_STOP 1
46#define SOF_XRUN_UNDER_ZERO 2
47#define SOF_XRUN_OVER_NULL 4
48
49
50struct sof_ipc_comp {
51 struct sof_ipc_cmd_hdr hdr;
52 uint32_t id;
53 enum sof_comp_type type;
54 uint32_t pipeline_id;
55
56
57 uint32_t reserved[2];
58} __packed;
59
60
61
62
63
64
65
66
67#define SOF_MEM_CAPS_RAM (1 << 0)
68#define SOF_MEM_CAPS_ROM (1 << 1)
69#define SOF_MEM_CAPS_EXT (1 << 2)
70#define SOF_MEM_CAPS_LP (1 << 3)
71#define SOF_MEM_CAPS_HP (1 << 4)
72#define SOF_MEM_CAPS_DMA (1 << 5)
73#define SOF_MEM_CAPS_CACHE (1 << 6)
74#define SOF_MEM_CAPS_EXEC (1 << 7)
75
76
77struct sof_ipc_buffer {
78 struct sof_ipc_comp comp;
79 uint32_t size;
80 uint32_t caps;
81} __packed;
82
83
84struct sof_ipc_comp_config {
85 struct sof_ipc_cmd_hdr hdr;
86 uint32_t periods_sink;
87 uint32_t periods_source;
88 uint32_t reserved1;
89 uint32_t frame_fmt;
90 uint32_t xrun_action;
91
92
93 uint32_t reserved[2];
94} __packed;
95
96
97struct sof_ipc_comp_host {
98 struct sof_ipc_comp comp;
99 struct sof_ipc_comp_config config;
100 uint32_t direction;
101 uint32_t no_irq;
102 uint32_t dmac_config;
103} __packed;
104
105
106struct sof_ipc_comp_dai {
107 struct sof_ipc_comp comp;
108 struct sof_ipc_comp_config config;
109 uint32_t direction;
110 uint32_t dai_index;
111 uint32_t type;
112 uint32_t reserved;
113} __packed;
114
115
116struct sof_ipc_comp_mixer {
117 struct sof_ipc_comp comp;
118 struct sof_ipc_comp_config config;
119} __packed;
120
121
122enum sof_volume_ramp {
123 SOF_VOLUME_LINEAR = 0,
124 SOF_VOLUME_LOG,
125 SOF_VOLUME_LINEAR_ZC,
126 SOF_VOLUME_LOG_ZC,
127};
128
129
130struct sof_ipc_comp_volume {
131 struct sof_ipc_comp comp;
132 struct sof_ipc_comp_config config;
133 uint32_t channels;
134 uint32_t min_value;
135 uint32_t max_value;
136 uint32_t ramp;
137 uint32_t initial_ramp;
138} __packed;
139
140
141struct sof_ipc_comp_src {
142 struct sof_ipc_comp comp;
143 struct sof_ipc_comp_config config;
144
145 uint32_t source_rate;
146 uint32_t sink_rate;
147 uint32_t rate_mask;
148} __packed;
149
150
151struct sof_ipc_comp_mux {
152 struct sof_ipc_comp comp;
153 struct sof_ipc_comp_config config;
154} __packed;
155
156
157struct sof_ipc_comp_tone {
158 struct sof_ipc_comp comp;
159 struct sof_ipc_comp_config config;
160 int32_t sample_rate;
161 int32_t frequency;
162 int32_t amplitude;
163 int32_t freq_mult;
164 int32_t ampl_mult;
165 int32_t length;
166 int32_t period;
167 int32_t repeats;
168 int32_t ramp_step;
169} __packed;
170
171
172enum sof_ipc_process_type {
173 SOF_PROCESS_NONE = 0,
174 SOF_PROCESS_EQFIR,
175 SOF_PROCESS_EQIIR,
176 SOF_PROCESS_KEYWORD_DETECT,
177 SOF_PROCESS_KPB,
178 SOF_PROCESS_CHAN_SELECTOR,
179 SOF_PROCESS_MUX,
180 SOF_PROCESS_DEMUX,
181};
182
183
184struct sof_ipc_comp_process {
185 struct sof_ipc_comp comp;
186 struct sof_ipc_comp_config config;
187 uint32_t size;
188 uint32_t type;
189
190
191 uint32_t reserved[7];
192
193 unsigned char data[0];
194} __packed;
195
196
197
198
199struct sof_ipc_free {
200 struct sof_ipc_cmd_hdr hdr;
201 uint32_t id;
202} __packed;
203
204struct sof_ipc_comp_reply {
205 struct sof_ipc_reply rhdr;
206 uint32_t id;
207 uint32_t offset;
208} __packed;
209
210
211
212
213
214
215enum sof_ipc_pipe_sched_time_domain {
216 SOF_TIME_DOMAIN_DMA = 0,
217 SOF_TIME_DOMAIN_TIMER,
218};
219
220
221struct sof_ipc_pipe_new {
222 struct sof_ipc_cmd_hdr hdr;
223 uint32_t comp_id;
224 uint32_t pipeline_id;
225 uint32_t sched_id;
226 uint32_t core;
227 uint32_t period;
228 uint32_t priority;
229 uint32_t period_mips;
230 uint32_t frames_per_sched;
231 uint32_t xrun_limit_usecs;
232 uint32_t time_domain;
233} __packed;
234
235
236struct sof_ipc_pipe_ready {
237 struct sof_ipc_cmd_hdr hdr;
238 uint32_t comp_id;
239} __packed;
240
241struct sof_ipc_pipe_free {
242 struct sof_ipc_cmd_hdr hdr;
243 uint32_t comp_id;
244} __packed;
245
246
247struct sof_ipc_pipe_comp_connect {
248 struct sof_ipc_cmd_hdr hdr;
249 uint32_t source_id;
250 uint32_t sink_id;
251} __packed;
252
253
254enum sof_event_types {
255 SOF_EVENT_NONE = 0,
256 SOF_KEYWORD_DETECT_DAPM_EVENT,
257};
258
259#endif
260