aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeeja KP <jeeja.kp@intel.com>2015-08-01 10:10:41 -0400
committerMark Brown <broonie@kernel.org>2015-08-07 09:26:02 -0400
commit23db472bba549dcd1c7592b5af95cc9ba4b9b5c9 (patch)
tree1fa50a2e3a90f3cbf3cf1a028ab8b8b58ac558ec
parentaba3dd5ace59d038a9d69e0f5319b6fec61012c8 (diff)
ASoC: Intel: Skylake: Add helpers for DSP module configuration
This adds helper functions to calculate parameters required for base module format and copier module. A generic module is modelled by base module. Copier module is responsible for getting/sending data to FE (host DMAs) and BE (link HDA DMA, SSP, PDM) This also ads module pin management helpers which help in finding pins to use or freeing them up Signed-off-by: Jeeja KP <jeeja.kp@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/skylake/skl-messages.c386
-rw-r--r--sound/soc/intel/skylake/skl-topology.h251
-rw-r--r--sound/soc/intel/skylake/skl-tplg-interface.h88
3 files changed, 725 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index 7c07b76bf0bf..0ba13f1e8116 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -26,6 +26,8 @@
26#include "skl.h" 26#include "skl.h"
27#include "../common/sst-dsp.h" 27#include "../common/sst-dsp.h"
28#include "../common/sst-dsp-priv.h" 28#include "../common/sst-dsp-priv.h"
29#include "skl-topology.h"
30#include "skl-tplg-interface.h"
29 31
30static int skl_alloc_dma_buf(struct device *dev, 32static int skl_alloc_dma_buf(struct device *dev,
31 struct snd_dma_buffer *dmab, size_t size) 33 struct snd_dma_buffer *dmab, size_t size)
@@ -131,3 +133,387 @@ int skl_resume_dsp(struct skl *skl)
131 133
132 return skl_dsp_wake(ctx->dsp); 134 return skl_dsp_wake(ctx->dsp);
133} 135}
136
137enum skl_bitdepth skl_get_bit_depth(int params)
138{
139 switch (params) {
140 case 8:
141 return SKL_DEPTH_8BIT;
142
143 case 16:
144 return SKL_DEPTH_16BIT;
145
146 case 24:
147 return SKL_DEPTH_24BIT;
148
149 case 32:
150 return SKL_DEPTH_32BIT;
151
152 default:
153 return SKL_DEPTH_INVALID;
154
155 }
156}
157
158static u32 skl_create_channel_map(enum skl_ch_cfg ch_cfg)
159{
160 u32 config;
161
162 switch (ch_cfg) {
163 case SKL_CH_CFG_MONO:
164 config = (0xFFFFFFF0 | SKL_CHANNEL_LEFT);
165 break;
166
167 case SKL_CH_CFG_STEREO:
168 config = (0xFFFFFF00 | SKL_CHANNEL_LEFT
169 | (SKL_CHANNEL_RIGHT << 4));
170 break;
171
172 case SKL_CH_CFG_2_1:
173 config = (0xFFFFF000 | SKL_CHANNEL_LEFT
174 | (SKL_CHANNEL_RIGHT << 4)
175 | (SKL_CHANNEL_LFE << 8));
176 break;
177
178 case SKL_CH_CFG_3_0:
179 config = (0xFFFFF000 | SKL_CHANNEL_LEFT
180 | (SKL_CHANNEL_CENTER << 4)
181 | (SKL_CHANNEL_RIGHT << 8));
182 break;
183
184 case SKL_CH_CFG_3_1:
185 config = (0xFFFF0000 | SKL_CHANNEL_LEFT
186 | (SKL_CHANNEL_CENTER << 4)
187 | (SKL_CHANNEL_RIGHT << 8)
188 | (SKL_CHANNEL_LFE << 12));
189 break;
190
191 case SKL_CH_CFG_QUATRO:
192 config = (0xFFFF0000 | SKL_CHANNEL_LEFT
193 | (SKL_CHANNEL_RIGHT << 4)
194 | (SKL_CHANNEL_LEFT_SURROUND << 8)
195 | (SKL_CHANNEL_RIGHT_SURROUND << 12));
196 break;
197
198 case SKL_CH_CFG_4_0:
199 config = (0xFFFF0000 | SKL_CHANNEL_LEFT
200 | (SKL_CHANNEL_CENTER << 4)
201 | (SKL_CHANNEL_RIGHT << 8)
202 | (SKL_CHANNEL_CENTER_SURROUND << 12));
203 break;
204
205 case SKL_CH_CFG_5_0:
206 config = (0xFFF00000 | SKL_CHANNEL_LEFT
207 | (SKL_CHANNEL_CENTER << 4)
208 | (SKL_CHANNEL_RIGHT << 8)
209 | (SKL_CHANNEL_LEFT_SURROUND << 12)
210 | (SKL_CHANNEL_RIGHT_SURROUND << 16));
211 break;
212
213 case SKL_CH_CFG_5_1:
214 config = (0xFF000000 | SKL_CHANNEL_CENTER
215 | (SKL_CHANNEL_LEFT << 4)
216 | (SKL_CHANNEL_RIGHT << 8)
217 | (SKL_CHANNEL_LEFT_SURROUND << 12)
218 | (SKL_CHANNEL_RIGHT_SURROUND << 16)
219 | (SKL_CHANNEL_LFE << 20));
220 break;
221
222 case SKL_CH_CFG_DUAL_MONO:
223 config = (0xFFFFFF00 | SKL_CHANNEL_LEFT
224 | (SKL_CHANNEL_LEFT << 4));
225 break;
226
227 case SKL_CH_CFG_I2S_DUAL_STEREO_0:
228 config = (0xFFFFFF00 | SKL_CHANNEL_LEFT
229 | (SKL_CHANNEL_RIGHT << 4));
230 break;
231
232 case SKL_CH_CFG_I2S_DUAL_STEREO_1:
233 config = (0xFFFF00FF | (SKL_CHANNEL_LEFT << 8)
234 | (SKL_CHANNEL_RIGHT << 12));
235 break;
236
237 default:
238 config = 0xFFFFFFFF;
239 break;
240
241 }
242
243 return config;
244}
245
246/*
247 * Each module in DSP expects a base module configuration, which consists of
248 * PCM format information, which we calculate in driver and resource values
249 * which are read from widget information passed through topology binary
250 * This is send when we create a module with INIT_INSTANCE IPC msg
251 */
252static void skl_set_base_module_format(struct skl_sst *ctx,
253 struct skl_module_cfg *mconfig,
254 struct skl_base_cfg *base_cfg)
255{
256 struct skl_module_fmt *format = &mconfig->in_fmt;
257
258 base_cfg->audio_fmt.number_of_channels = (u8)format->channels;
259
260 base_cfg->audio_fmt.s_freq = format->s_freq;
261 base_cfg->audio_fmt.bit_depth = format->bit_depth;
262 base_cfg->audio_fmt.valid_bit_depth = format->valid_bit_depth;
263 base_cfg->audio_fmt.ch_cfg = format->ch_cfg;
264
265 dev_dbg(ctx->dev, "bit_depth=%x valid_bd=%x ch_config=%x\n",
266 format->bit_depth, format->valid_bit_depth,
267 format->ch_cfg);
268
269 base_cfg->audio_fmt.channel_map = skl_create_channel_map(
270 base_cfg->audio_fmt.ch_cfg);
271
272 base_cfg->audio_fmt.interleaving = SKL_INTERLEAVING_PER_CHANNEL;
273
274 base_cfg->cps = mconfig->mcps;
275 base_cfg->ibs = mconfig->ibs;
276 base_cfg->obs = mconfig->obs;
277}
278
279/*
280 * Copies copier capabilities into copier module and updates copier module
281 * config size.
282 */
283static void skl_copy_copier_caps(struct skl_module_cfg *mconfig,
284 struct skl_cpr_cfg *cpr_mconfig)
285{
286 if (mconfig->formats_config.caps_size == 0)
287 return;
288
289 memcpy(cpr_mconfig->gtw_cfg.config_data,
290 mconfig->formats_config.caps,
291 mconfig->formats_config.caps_size);
292
293 cpr_mconfig->gtw_cfg.config_length =
294 (mconfig->formats_config.caps_size) / 4;
295}
296
297/*
298 * Calculate the gatewat settings required for copier module, type of
299 * gateway and index of gateway to use
300 */
301static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx,
302 struct skl_module_cfg *mconfig,
303 struct skl_cpr_cfg *cpr_mconfig)
304{
305 union skl_connector_node_id node_id = {0};
306 struct skl_pipe_params *params = mconfig->pipe->p_params;
307
308 switch (mconfig->dev_type) {
309 case SKL_DEVICE_BT:
310 node_id.node.dma_type =
311 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ?
312 SKL_DMA_I2S_LINK_OUTPUT_CLASS :
313 SKL_DMA_I2S_LINK_INPUT_CLASS;
314 node_id.node.vindex = params->host_dma_id +
315 (mconfig->vbus_id << 3);
316 break;
317
318 case SKL_DEVICE_I2S:
319 node_id.node.dma_type =
320 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ?
321 SKL_DMA_I2S_LINK_OUTPUT_CLASS :
322 SKL_DMA_I2S_LINK_INPUT_CLASS;
323 node_id.node.vindex = params->host_dma_id +
324 (mconfig->time_slot << 1) +
325 (mconfig->vbus_id << 3);
326 break;
327
328 case SKL_DEVICE_DMIC:
329 node_id.node.dma_type = SKL_DMA_DMIC_LINK_INPUT_CLASS;
330 node_id.node.vindex = mconfig->vbus_id +
331 (mconfig->time_slot);
332 break;
333
334 case SKL_DEVICE_HDALINK:
335 node_id.node.dma_type =
336 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ?
337 SKL_DMA_HDA_LINK_OUTPUT_CLASS :
338 SKL_DMA_HDA_LINK_INPUT_CLASS;
339 node_id.node.vindex = params->link_dma_id;
340 break;
341
342 default:
343 node_id.node.dma_type =
344 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ?
345 SKL_DMA_HDA_HOST_OUTPUT_CLASS :
346 SKL_DMA_HDA_HOST_INPUT_CLASS;
347 node_id.node.vindex = params->host_dma_id;
348 break;
349 }
350
351 cpr_mconfig->gtw_cfg.node_id = node_id.val;
352
353 if (SKL_CONN_SOURCE == mconfig->hw_conn_type)
354 cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs;
355 else
356 cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->ibs;
357
358 cpr_mconfig->cpr_feature_mask = 0;
359 cpr_mconfig->gtw_cfg.config_length = 0;
360
361 skl_copy_copier_caps(mconfig, cpr_mconfig);
362}
363
364static void skl_setup_out_format(struct skl_sst *ctx,
365 struct skl_module_cfg *mconfig,
366 struct skl_audio_data_format *out_fmt)
367{
368 struct skl_module_fmt *format = &mconfig->out_fmt;
369
370 out_fmt->number_of_channels = (u8)format->channels;
371 out_fmt->s_freq = format->s_freq;
372 out_fmt->bit_depth = format->bit_depth;
373 out_fmt->valid_bit_depth = format->valid_bit_depth;
374 out_fmt->ch_cfg = format->ch_cfg;
375
376 out_fmt->channel_map = skl_create_channel_map(out_fmt->ch_cfg);
377 out_fmt->interleaving = SKL_INTERLEAVING_PER_CHANNEL;
378
379 dev_dbg(ctx->dev, "copier out format chan=%d fre=%d bitdepth=%d\n",
380 out_fmt->number_of_channels, format->s_freq, format->bit_depth);
381}
382
383/*
384 * 'copier' is DSP internal module which copies data from Host DMA (HDA host
385 * dma) or link (hda link, SSP, PDM)
386 * Here we calculate the copier module parameters, like PCM format, output
387 * format, gateway settings
388 * copier_module_config is sent as input buffer with INIT_INSTANCE IPC msg
389 */
390static void skl_set_copier_format(struct skl_sst *ctx,
391 struct skl_module_cfg *mconfig,
392 struct skl_cpr_cfg *cpr_mconfig)
393{
394 struct skl_audio_data_format *out_fmt = &cpr_mconfig->out_fmt;
395 struct skl_base_cfg *base_cfg = (struct skl_base_cfg *)cpr_mconfig;
396
397 skl_set_base_module_format(ctx, mconfig, base_cfg);
398
399 skl_setup_out_format(ctx, mconfig, out_fmt);
400 skl_setup_cpr_gateway_cfg(ctx, mconfig, cpr_mconfig);
401}
402
403static u16 skl_get_module_param_size(struct skl_sst *ctx,
404 struct skl_module_cfg *mconfig)
405{
406 u16 param_size;
407
408 switch (mconfig->m_type) {
409 case SKL_MODULE_TYPE_COPIER:
410 param_size = sizeof(struct skl_cpr_cfg);
411 param_size += mconfig->formats_config.caps_size;
412 return param_size;
413
414 default:
415 /*
416 * return only base cfg when no specific module type is
417 * specified
418 */
419 return sizeof(struct skl_base_cfg);
420 }
421
422 return 0;
423}
424
425/*
426 * DSP firmware supports various modules like copier etc. These modules
427 * required various parameters to be calculated and sent for the module
428 * initialization to DSP. By default a generic module needs only base module
429 * format configuration
430 */
431static int skl_set_module_format(struct skl_sst *ctx,
432 struct skl_module_cfg *module_config,
433 u16 *module_config_size,
434 void **param_data)
435{
436 u16 param_size;
437
438 param_size = skl_get_module_param_size(ctx, module_config);
439
440 *param_data = kzalloc(param_size, GFP_KERNEL);
441 if (NULL == *param_data)
442 return -ENOMEM;
443
444 *module_config_size = param_size;
445
446 switch (module_config->m_type) {
447 case SKL_MODULE_TYPE_COPIER:
448 skl_set_copier_format(ctx, module_config, *param_data);
449 break;
450
451 default:
452 skl_set_base_module_format(ctx, module_config, *param_data);
453 break;
454
455 }
456
457 dev_dbg(ctx->dev, "Module type=%d config size: %d bytes\n",
458 module_config->id.module_id, param_size);
459 print_hex_dump(KERN_DEBUG, "Module params:", DUMP_PREFIX_OFFSET, 8, 4,
460 *param_data, param_size, false);
461 return 0;
462}
463
464static int skl_get_queue_index(struct skl_module_pin *mpin,
465 struct skl_module_inst_id id, int max)
466{
467 int i;
468
469 for (i = 0; i < max; i++) {
470 if (mpin[i].id.module_id == id.module_id &&
471 mpin[i].id.instance_id == id.instance_id)
472 return i;
473 }
474
475 return -EINVAL;
476}
477
478/*
479 * Allocates queue for each module.
480 * if dynamic, the pin_index is allocated 0 to max_pin.
481 * In static, the pin_index is fixed based on module_id and instance id
482 */
483static int skl_alloc_queue(struct skl_module_pin *mpin,
484 struct skl_module_inst_id id, int max)
485{
486 int i;
487
488 /*
489 * if pin in dynamic, find first free pin
490 * otherwise find match module and instance id pin as topology will
491 * ensure a unique pin is assigned to this so no need to
492 * allocate/free
493 */
494 for (i = 0; i < max; i++) {
495 if (mpin[i].is_dynamic) {
496 if (!mpin[i].in_use) {
497 mpin[i].in_use = true;
498 mpin[i].id.module_id = id.module_id;
499 mpin[i].id.instance_id = id.instance_id;
500 return i;
501 }
502 } else {
503 if (mpin[i].id.module_id == id.module_id &&
504 mpin[i].id.instance_id == id.instance_id)
505 return i;
506 }
507 }
508
509 return -EINVAL;
510}
511
512static void skl_free_queue(struct skl_module_pin *mpin, int q_index)
513{
514 if (mpin[q_index].is_dynamic) {
515 mpin[q_index].in_use = false;
516 mpin[q_index].id.module_id = 0;
517 mpin[q_index].id.instance_id = 0;
518 }
519}
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
new file mode 100644
index 000000000000..6ba137a43e68
--- /dev/null
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -0,0 +1,251 @@
1/*
2 * skl_topology.h - Intel HDA Platform topology header file
3 *
4 * Copyright (C) 2014-15 Intel Corp
5 * Author: Jeeja KP <jeeja.kp@intel.com>
6 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 *
19 */
20
21#ifndef __SKL_TOPOLOGY_H__
22#define __SKL_TOPOLOGY_H__
23
24#include <linux/types.h>
25
26#include <sound/hdaudio_ext.h>
27#include <sound/soc.h>
28#include "skl.h"
29#include "skl-tplg-interface.h"
30
31#define BITS_PER_BYTE 8
32#define MAX_TS_GROUPS 8
33#define MAX_DMIC_TS_GROUPS 4
34#define MAX_FIXED_DMIC_PARAMS_SIZE 727
35
36/* Maximum number of coefficients up down mixer module */
37#define UP_DOWN_MIXER_MAX_COEFF 6
38
39enum skl_channel_index {
40 SKL_CHANNEL_LEFT = 0,
41 SKL_CHANNEL_RIGHT = 1,
42 SKL_CHANNEL_CENTER = 2,
43 SKL_CHANNEL_LEFT_SURROUND = 3,
44 SKL_CHANNEL_CENTER_SURROUND = 3,
45 SKL_CHANNEL_RIGHT_SURROUND = 4,
46 SKL_CHANNEL_LFE = 7,
47 SKL_CHANNEL_INVALID = 0xF,
48};
49
50enum skl_bitdepth {
51 SKL_DEPTH_8BIT = 8,
52 SKL_DEPTH_16BIT = 16,
53 SKL_DEPTH_24BIT = 24,
54 SKL_DEPTH_32BIT = 32,
55 SKL_DEPTH_INVALID
56};
57
58enum skl_interleaving {
59 /* [s1_ch1...s1_chN,...,sM_ch1...sM_chN] */
60 SKL_INTERLEAVING_PER_CHANNEL = 0,
61 /* [s1_ch1...sM_ch1,...,s1_chN...sM_chN] */
62 SKL_INTERLEAVING_PER_SAMPLE = 1,
63};
64
65enum skl_s_freq {
66 SKL_FS_8000 = 8000,
67 SKL_FS_11025 = 11025,
68 SKL_FS_12000 = 12000,
69 SKL_FS_16000 = 16000,
70 SKL_FS_22050 = 22050,
71 SKL_FS_24000 = 24000,
72 SKL_FS_32000 = 32000,
73 SKL_FS_44100 = 44100,
74 SKL_FS_48000 = 48000,
75 SKL_FS_64000 = 64000,
76 SKL_FS_88200 = 88200,
77 SKL_FS_96000 = 96000,
78 SKL_FS_128000 = 128000,
79 SKL_FS_176400 = 176400,
80 SKL_FS_192000 = 192000,
81 SKL_FS_INVALID
82};
83
84enum skl_widget_type {
85 SKL_WIDGET_VMIXER = 1,
86 SKL_WIDGET_MIXER = 2,
87 SKL_WIDGET_PGA = 3,
88 SKL_WIDGET_MUX = 4
89};
90
91struct skl_audio_data_format {
92 enum skl_s_freq s_freq;
93 enum skl_bitdepth bit_depth;
94 u32 channel_map;
95 enum skl_ch_cfg ch_cfg;
96 enum skl_interleaving interleaving;
97 u8 number_of_channels;
98 u8 valid_bit_depth;
99 u8 sample_type;
100 u8 reserved[1];
101} __packed;
102
103struct skl_base_cfg {
104 u32 cps;
105 u32 ibs;
106 u32 obs;
107 u32 is_pages;
108 struct skl_audio_data_format audio_fmt;
109};
110
111struct skl_cpr_gtw_cfg {
112 u32 node_id;
113 u32 dma_buffer_size;
114 u32 config_length;
115 /* not mandatory; required only for DMIC/I2S */
116 u32 config_data[1];
117} __packed;
118
119struct skl_cpr_cfg {
120 struct skl_base_cfg base_cfg;
121 struct skl_audio_data_format out_fmt;
122 u32 cpr_feature_mask;
123 struct skl_cpr_gtw_cfg gtw_cfg;
124} __packed;
125
126enum skl_dma_type {
127 SKL_DMA_HDA_HOST_OUTPUT_CLASS = 0,
128 SKL_DMA_HDA_HOST_INPUT_CLASS = 1,
129 SKL_DMA_HDA_HOST_INOUT_CLASS = 2,
130 SKL_DMA_HDA_LINK_OUTPUT_CLASS = 8,
131 SKL_DMA_HDA_LINK_INPUT_CLASS = 9,
132 SKL_DMA_HDA_LINK_INOUT_CLASS = 0xA,
133 SKL_DMA_DMIC_LINK_INPUT_CLASS = 0xB,
134 SKL_DMA_I2S_LINK_OUTPUT_CLASS = 0xC,
135 SKL_DMA_I2S_LINK_INPUT_CLASS = 0xD,
136};
137
138union skl_ssp_dma_node {
139 u8 val;
140 struct {
141 u8 dual_mono:1;
142 u8 time_slot:3;
143 u8 i2s_instance:4;
144 } dma_node;
145};
146
147union skl_connector_node_id {
148 u32 val;
149 struct {
150 u32 vindex:8;
151 u32 dma_type:4;
152 u32 rsvd:20;
153 } node;
154};
155
156struct skl_module_fmt {
157 u32 channels;
158 u32 s_freq;
159 u32 bit_depth;
160 u32 valid_bit_depth;
161 u32 ch_cfg;
162};
163
164struct skl_module_inst_id {
165 u32 module_id;
166 u32 instance_id;
167};
168
169struct skl_module_pin {
170 struct skl_module_inst_id id;
171 u8 pin_index;
172 bool is_dynamic;
173 bool in_use;
174};
175
176struct skl_specific_cfg {
177 u32 caps_size;
178 u32 *caps;
179};
180
181enum skl_pipe_state {
182 SKL_PIPE_INVALID = 0,
183 SKL_PIPE_CREATED = 1,
184 SKL_PIPE_PAUSED = 2,
185 SKL_PIPE_STARTED = 3
186};
187
188struct skl_pipe_module {
189 struct snd_soc_dapm_widget *w;
190 struct list_head node;
191};
192
193struct skl_pipe_params {
194 u8 host_dma_id;
195 u8 link_dma_id;
196 u32 ch;
197 u32 s_freq;
198 u32 s_fmt;
199 u8 linktype;
200 int stream;
201};
202
203struct skl_pipe {
204 u8 ppl_id;
205 u8 pipe_priority;
206 u16 conn_type;
207 u32 memory_pages;
208 struct skl_pipe_params *p_params;
209 enum skl_pipe_state state;
210 struct list_head w_list;
211};
212
213enum skl_module_state {
214 SKL_MODULE_UNINIT = 0,
215 SKL_MODULE_INIT_DONE = 1,
216 SKL_MODULE_LOADED = 2,
217 SKL_MODULE_UNLOADED = 3,
218 SKL_MODULE_BIND_DONE = 4
219};
220
221struct skl_module_cfg {
222 struct skl_module_inst_id id;
223 struct skl_module_fmt in_fmt;
224 struct skl_module_fmt out_fmt;
225 u8 max_in_queue;
226 u8 max_out_queue;
227 u8 in_queue_mask;
228 u8 out_queue_mask;
229 u8 in_queue;
230 u8 out_queue;
231 u32 mcps;
232 u32 ibs;
233 u32 obs;
234 u8 is_loadable;
235 u8 core_id;
236 u8 dev_type;
237 u8 dma_id;
238 u8 time_slot;
239 u32 params_fixup;
240 u32 converter;
241 u32 vbus_id;
242 struct skl_module_pin *m_in_pin;
243 struct skl_module_pin *m_out_pin;
244 enum skl_module_type m_type;
245 enum skl_hw_conn_type hw_conn_type;
246 enum skl_module_state m_state;
247 struct skl_pipe *pipe;
248 struct skl_specific_cfg formats_config;
249};
250enum skl_bitdepth skl_get_bit_depth(int params);
251#endif
diff --git a/sound/soc/intel/skylake/skl-tplg-interface.h b/sound/soc/intel/skylake/skl-tplg-interface.h
new file mode 100644
index 000000000000..a50689825bca
--- /dev/null
+++ b/sound/soc/intel/skylake/skl-tplg-interface.h
@@ -0,0 +1,88 @@
1/*
2 * skl-tplg-interface.h - Intel DSP FW private data interface
3 *
4 * Copyright (C) 2015 Intel Corp
5 * Author: Jeeja KP <jeeja.kp@intel.com>
6 * Nilofer, Samreen <samreen.nilofer@intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#ifndef __HDA_TPLG_INTERFACE_H__
20#define __HDA_TPLG_INTERFACE_H__
21
22/**
23 * enum skl_ch_cfg - channel configuration
24 *
25 * @SKL_CH_CFG_MONO: One channel only
26 * @SKL_CH_CFG_STEREO: L & R
27 * @SKL_CH_CFG_2_1: L, R & LFE
28 * @SKL_CH_CFG_3_0: L, C & R
29 * @SKL_CH_CFG_3_1: L, C, R & LFE
30 * @SKL_CH_CFG_QUATRO: L, R, Ls & Rs
31 * @SKL_CH_CFG_4_0: L, C, R & Cs
32 * @SKL_CH_CFG_5_0: L, C, R, Ls & Rs
33 * @SKL_CH_CFG_5_1: L, C, R, Ls, Rs & LFE
34 * @SKL_CH_CFG_DUAL_MONO: One channel replicated in two
35 * @SKL_CH_CFG_I2S_DUAL_STEREO_0: Stereo(L,R) in 4 slots, 1st stream:[ L, R, -, - ]
36 * @SKL_CH_CFG_I2S_DUAL_STEREO_1: Stereo(L,R) in 4 slots, 2nd stream:[ -, -, L, R ]
37 * @SKL_CH_CFG_INVALID: Invalid
38 */
39enum skl_ch_cfg {
40 SKL_CH_CFG_MONO = 0,
41 SKL_CH_CFG_STEREO = 1,
42 SKL_CH_CFG_2_1 = 2,
43 SKL_CH_CFG_3_0 = 3,
44 SKL_CH_CFG_3_1 = 4,
45 SKL_CH_CFG_QUATRO = 5,
46 SKL_CH_CFG_4_0 = 6,
47 SKL_CH_CFG_5_0 = 7,
48 SKL_CH_CFG_5_1 = 8,
49 SKL_CH_CFG_DUAL_MONO = 9,
50 SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
51 SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,
52 SKL_CH_CFG_INVALID
53};
54
55enum skl_module_type {
56 SKL_MODULE_TYPE_MIXER = 0,
57 SKL_MODULE_TYPE_COPIER,
58 SKL_MODULE_TYPE_UPDWMIX,
59 SKL_MODULE_TYPE_SRCINT
60};
61
62enum skl_core_affinity {
63 SKL_AFFINITY_CORE_0 = 0,
64 SKL_AFFINITY_CORE_1,
65 SKL_AFFINITY_CORE_MAX
66};
67
68enum skl_pipe_conn_type {
69 SKL_PIPE_CONN_TYPE_NONE = 0,
70 SKL_PIPE_CONN_TYPE_FE,
71 SKL_PIPE_CONN_TYPE_BE
72};
73
74enum skl_hw_conn_type {
75 SKL_CONN_NONE = 0,
76 SKL_CONN_SOURCE = 1,
77 SKL_CONN_SINK = 2
78};
79
80enum skl_dev_type {
81 SKL_DEVICE_BT = 0x0,
82 SKL_DEVICE_DMIC = 0x1,
83 SKL_DEVICE_I2S = 0x2,
84 SKL_DEVICE_SLIMBUS = 0x3,
85 SKL_DEVICE_HDALINK = 0x4,
86 SKL_DEVICE_NONE
87};
88#endif