0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef __INCLUDE_SOUND_SOF_TOPOLOGY_H__
0010 #define __INCLUDE_SOUND_SOF_TOPOLOGY_H__
0011
0012 #include <sound/sof/header.h>
0013
0014
0015
0016
0017
0018
0019 enum sof_comp_type {
0020 SOF_COMP_NONE = 0,
0021 SOF_COMP_HOST,
0022 SOF_COMP_DAI,
0023 SOF_COMP_SG_HOST,
0024 SOF_COMP_SG_DAI,
0025 SOF_COMP_VOLUME,
0026 SOF_COMP_MIXER,
0027 SOF_COMP_MUX,
0028 SOF_COMP_SRC,
0029 SOF_COMP_SPLITTER,
0030 SOF_COMP_TONE,
0031 SOF_COMP_SWITCH,
0032 SOF_COMP_BUFFER,
0033 SOF_COMP_EQ_IIR,
0034 SOF_COMP_EQ_FIR,
0035 SOF_COMP_KEYWORD_DETECT,
0036 SOF_COMP_KPB,
0037 SOF_COMP_SELECTOR,
0038 SOF_COMP_DEMUX,
0039 SOF_COMP_ASRC,
0040 SOF_COMP_DCBLOCK,
0041 SOF_COMP_SMART_AMP,
0042
0043 SOF_COMP_FILEREAD = 10000,
0044 SOF_COMP_FILEWRITE = 10001,
0045 };
0046
0047
0048 #define SOF_XRUN_STOP 1
0049 #define SOF_XRUN_UNDER_ZERO 2
0050 #define SOF_XRUN_OVER_NULL 4
0051
0052
0053 struct sof_ipc_comp {
0054 struct sof_ipc_cmd_hdr hdr;
0055 uint32_t id;
0056 enum sof_comp_type type;
0057 uint32_t pipeline_id;
0058 uint32_t core;
0059
0060
0061 uint32_t ext_data_length;
0062 } __packed;
0063
0064
0065
0066
0067
0068
0069
0070
0071 #define SOF_MEM_CAPS_RAM (1 << 0)
0072 #define SOF_MEM_CAPS_ROM (1 << 1)
0073 #define SOF_MEM_CAPS_EXT (1 << 2)
0074 #define SOF_MEM_CAPS_LP (1 << 3)
0075 #define SOF_MEM_CAPS_HP (1 << 4)
0076 #define SOF_MEM_CAPS_DMA (1 << 5)
0077 #define SOF_MEM_CAPS_CACHE (1 << 6)
0078 #define SOF_MEM_CAPS_EXEC (1 << 7)
0079
0080
0081
0082
0083 #define SOF_BUF_OVERRUN_PERMITTED BIT(0)
0084
0085
0086
0087
0088 #define SOF_BUF_UNDERRUN_PERMITTED BIT(1)
0089
0090
0091 struct sof_ipc_buffer {
0092 struct sof_ipc_comp comp;
0093 uint32_t size;
0094 uint32_t caps;
0095 uint32_t flags;
0096 uint32_t reserved;
0097 } __packed;
0098
0099
0100 struct sof_ipc_comp_config {
0101 struct sof_ipc_cmd_hdr hdr;
0102 uint32_t periods_sink;
0103 uint32_t periods_source;
0104 uint32_t reserved1;
0105 uint32_t frame_fmt;
0106 uint32_t xrun_action;
0107
0108
0109 uint32_t reserved[2];
0110 } __packed;
0111
0112
0113 struct sof_ipc_comp_host {
0114 struct sof_ipc_comp comp;
0115 struct sof_ipc_comp_config config;
0116 uint32_t direction;
0117 uint32_t no_irq;
0118 uint32_t dmac_config;
0119 } __packed;
0120
0121
0122 struct sof_ipc_comp_dai {
0123 struct sof_ipc_comp comp;
0124 struct sof_ipc_comp_config config;
0125 uint32_t direction;
0126 uint32_t dai_index;
0127 uint32_t type;
0128 uint32_t reserved;
0129 } __packed;
0130
0131
0132 struct sof_ipc_comp_mixer {
0133 struct sof_ipc_comp comp;
0134 struct sof_ipc_comp_config config;
0135 } __packed;
0136
0137
0138 enum sof_volume_ramp {
0139 SOF_VOLUME_LINEAR = 0,
0140 SOF_VOLUME_LOG,
0141 SOF_VOLUME_LINEAR_ZC,
0142 SOF_VOLUME_LOG_ZC,
0143 };
0144
0145
0146 struct sof_ipc_comp_volume {
0147 struct sof_ipc_comp comp;
0148 struct sof_ipc_comp_config config;
0149 uint32_t channels;
0150 uint32_t min_value;
0151 uint32_t max_value;
0152 uint32_t ramp;
0153 uint32_t initial_ramp;
0154 } __packed;
0155
0156
0157 struct sof_ipc_comp_src {
0158 struct sof_ipc_comp comp;
0159 struct sof_ipc_comp_config config;
0160
0161 uint32_t source_rate;
0162 uint32_t sink_rate;
0163 uint32_t rate_mask;
0164 } __packed;
0165
0166
0167 struct sof_ipc_comp_asrc {
0168 struct sof_ipc_comp comp;
0169 struct sof_ipc_comp_config config;
0170
0171 uint32_t source_rate;
0172
0173
0174 uint32_t sink_rate;
0175
0176
0177 uint32_t asynchronous_mode;
0178
0179
0180 uint32_t operation_mode;
0181
0182
0183
0184
0185
0186
0187
0188
0189 uint32_t reserved[4];
0190 } __attribute__((packed));
0191
0192
0193 struct sof_ipc_comp_mux {
0194 struct sof_ipc_comp comp;
0195 struct sof_ipc_comp_config config;
0196 } __packed;
0197
0198
0199 struct sof_ipc_comp_tone {
0200 struct sof_ipc_comp comp;
0201 struct sof_ipc_comp_config config;
0202 int32_t sample_rate;
0203 int32_t frequency;
0204 int32_t amplitude;
0205 int32_t freq_mult;
0206 int32_t ampl_mult;
0207 int32_t length;
0208 int32_t period;
0209 int32_t repeats;
0210 int32_t ramp_step;
0211 } __packed;
0212
0213
0214 enum sof_ipc_process_type {
0215 SOF_PROCESS_NONE = 0,
0216 SOF_PROCESS_EQFIR,
0217 SOF_PROCESS_EQIIR,
0218 SOF_PROCESS_KEYWORD_DETECT,
0219 SOF_PROCESS_KPB,
0220 SOF_PROCESS_CHAN_SELECTOR,
0221 SOF_PROCESS_MUX,
0222 SOF_PROCESS_DEMUX,
0223 SOF_PROCESS_DCBLOCK,
0224 SOF_PROCESS_SMART_AMP,
0225 };
0226
0227
0228 struct sof_ipc_comp_process {
0229 struct sof_ipc_comp comp;
0230 struct sof_ipc_comp_config config;
0231 uint32_t size;
0232 uint32_t type;
0233
0234
0235 uint32_t reserved[7];
0236
0237 uint8_t data[];
0238 } __packed;
0239
0240
0241
0242
0243 struct sof_ipc_free {
0244 struct sof_ipc_cmd_hdr hdr;
0245 uint32_t id;
0246 } __packed;
0247
0248 struct sof_ipc_comp_reply {
0249 struct sof_ipc_reply rhdr;
0250 uint32_t id;
0251 uint32_t offset;
0252 } __packed;
0253
0254
0255
0256
0257
0258
0259 enum sof_ipc_pipe_sched_time_domain {
0260 SOF_TIME_DOMAIN_DMA = 0,
0261 SOF_TIME_DOMAIN_TIMER,
0262 };
0263
0264
0265 struct sof_ipc_pipe_new {
0266 struct sof_ipc_cmd_hdr hdr;
0267 uint32_t comp_id;
0268 uint32_t pipeline_id;
0269 uint32_t sched_id;
0270 uint32_t core;
0271 uint32_t period;
0272 uint32_t priority;
0273 uint32_t period_mips;
0274 uint32_t frames_per_sched;
0275 uint32_t xrun_limit_usecs;
0276 uint32_t time_domain;
0277 } __packed;
0278
0279
0280 struct sof_ipc_pipe_ready {
0281 struct sof_ipc_cmd_hdr hdr;
0282 uint32_t comp_id;
0283 } __packed;
0284
0285 struct sof_ipc_pipe_free {
0286 struct sof_ipc_cmd_hdr hdr;
0287 uint32_t comp_id;
0288 } __packed;
0289
0290
0291 struct sof_ipc_pipe_comp_connect {
0292 struct sof_ipc_cmd_hdr hdr;
0293 uint32_t source_id;
0294 uint32_t sink_id;
0295 } __packed;
0296
0297
0298 enum sof_event_types {
0299 SOF_EVENT_NONE = 0,
0300 SOF_KEYWORD_DETECT_DAPM_EVENT,
0301 };
0302
0303 #endif