xref: /openbmc/linux/include/uapi/sound/asoc.h (revision e2c75e76)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * uapi/sound/asoc.h -- ALSA SoC Firmware Controls and DAPM
4  *
5  * Copyright (C) 2012 Texas Instruments Inc.
6  * Copyright (C) 2015 Intel Corporation.
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 version 2 as
10  * published by the Free Software Foundation.
11  *
12  * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
13  * algorithms, equalisers, DAIs, widgets etc.
14 */
15 
16 #ifndef __LINUX_UAPI_SND_ASOC_H
17 #define __LINUX_UAPI_SND_ASOC_H
18 
19 #include <linux/types.h>
20 #include <sound/asound.h>
21 
22 /*
23  * Maximum number of channels topology kcontrol can represent.
24  */
25 #define SND_SOC_TPLG_MAX_CHAN		8
26 
27 /*
28  * Maximum number of PCM formats capability
29  */
30 #define SND_SOC_TPLG_MAX_FORMATS	16
31 
32 /*
33  * Maximum number of PCM stream configs
34  */
35 #define SND_SOC_TPLG_STREAM_CONFIG_MAX  8
36 
37 /*
38  * Maximum number of physical link's hardware configs
39  */
40 #define SND_SOC_TPLG_HW_CONFIG_MAX	8
41 
42 /* individual kcontrol info types - can be mixed with other types */
43 #define SND_SOC_TPLG_CTL_VOLSW		1
44 #define SND_SOC_TPLG_CTL_VOLSW_SX	2
45 #define SND_SOC_TPLG_CTL_VOLSW_XR_SX	3
46 #define SND_SOC_TPLG_CTL_ENUM		4
47 #define SND_SOC_TPLG_CTL_BYTES		5
48 #define SND_SOC_TPLG_CTL_ENUM_VALUE	6
49 #define SND_SOC_TPLG_CTL_RANGE		7
50 #define SND_SOC_TPLG_CTL_STROBE		8
51 
52 
53 /* individual widget kcontrol info types - can be mixed with other types */
54 #define SND_SOC_TPLG_DAPM_CTL_VOLSW		64
55 #define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE	65
56 #define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT		66
57 #define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE	67
58 #define SND_SOC_TPLG_DAPM_CTL_PIN		68
59 
60 /* DAPM widget types - add new items to the end */
61 #define SND_SOC_TPLG_DAPM_INPUT		0
62 #define SND_SOC_TPLG_DAPM_OUTPUT	1
63 #define SND_SOC_TPLG_DAPM_MUX		2
64 #define SND_SOC_TPLG_DAPM_MIXER		3
65 #define SND_SOC_TPLG_DAPM_PGA		4
66 #define SND_SOC_TPLG_DAPM_OUT_DRV	5
67 #define SND_SOC_TPLG_DAPM_ADC		6
68 #define SND_SOC_TPLG_DAPM_DAC		7
69 #define SND_SOC_TPLG_DAPM_SWITCH	8
70 #define SND_SOC_TPLG_DAPM_PRE		9
71 #define SND_SOC_TPLG_DAPM_POST		10
72 #define SND_SOC_TPLG_DAPM_AIF_IN	11
73 #define SND_SOC_TPLG_DAPM_AIF_OUT	12
74 #define SND_SOC_TPLG_DAPM_DAI_IN	13
75 #define SND_SOC_TPLG_DAPM_DAI_OUT	14
76 #define SND_SOC_TPLG_DAPM_DAI_LINK	15
77 #define SND_SOC_TPLG_DAPM_BUFFER	16
78 #define SND_SOC_TPLG_DAPM_SCHEDULER	17
79 #define SND_SOC_TPLG_DAPM_EFFECT	18
80 #define SND_SOC_TPLG_DAPM_SIGGEN	19
81 #define SND_SOC_TPLG_DAPM_SRC		20
82 #define SND_SOC_TPLG_DAPM_ASRC		21
83 #define SND_SOC_TPLG_DAPM_ENCODER	22
84 #define SND_SOC_TPLG_DAPM_DECODER	23
85 #define SND_SOC_TPLG_DAPM_LAST		SND_SOC_TPLG_DAPM_DECODER
86 
87 /* Header magic number and string sizes */
88 #define SND_SOC_TPLG_MAGIC		0x41536F43 /* ASoC */
89 
90 /* string sizes */
91 #define SND_SOC_TPLG_NUM_TEXTS		16
92 
93 /* ABI version */
94 #define SND_SOC_TPLG_ABI_VERSION	0x5	/* current version */
95 #define SND_SOC_TPLG_ABI_VERSION_MIN	0x4	/* oldest version supported */
96 
97 /* Max size of TLV data */
98 #define SND_SOC_TPLG_TLV_SIZE		32
99 
100 /*
101  * File and Block header data types.
102  * Add new generic and vendor types to end of list.
103  * Generic types are handled by the core whilst vendors types are passed
104  * to the component drivers for handling.
105  */
106 #define SND_SOC_TPLG_TYPE_MIXER		1
107 #define SND_SOC_TPLG_TYPE_BYTES		2
108 #define SND_SOC_TPLG_TYPE_ENUM		3
109 #define SND_SOC_TPLG_TYPE_DAPM_GRAPH	4
110 #define SND_SOC_TPLG_TYPE_DAPM_WIDGET	5
111 #define SND_SOC_TPLG_TYPE_DAI_LINK	6
112 #define SND_SOC_TPLG_TYPE_PCM		7
113 #define SND_SOC_TPLG_TYPE_MANIFEST	8
114 #define SND_SOC_TPLG_TYPE_CODEC_LINK	9
115 #define SND_SOC_TPLG_TYPE_BACKEND_LINK	10
116 #define SND_SOC_TPLG_TYPE_PDATA		11
117 #define SND_SOC_TPLG_TYPE_DAI		12
118 #define SND_SOC_TPLG_TYPE_MAX		SND_SOC_TPLG_TYPE_DAI
119 
120 /* vendor block IDs - please add new vendor types to end */
121 #define SND_SOC_TPLG_TYPE_VENDOR_FW	1000
122 #define SND_SOC_TPLG_TYPE_VENDOR_CONFIG	1001
123 #define SND_SOC_TPLG_TYPE_VENDOR_COEFF	1002
124 #define SND_SOC_TPLG_TYPEVENDOR_CODEC	1003
125 
126 #define SND_SOC_TPLG_STREAM_PLAYBACK	0
127 #define SND_SOC_TPLG_STREAM_CAPTURE	1
128 
129 /* vendor tuple types */
130 #define SND_SOC_TPLG_TUPLE_TYPE_UUID	0
131 #define SND_SOC_TPLG_TUPLE_TYPE_STRING	1
132 #define SND_SOC_TPLG_TUPLE_TYPE_BOOL	2
133 #define SND_SOC_TPLG_TUPLE_TYPE_BYTE	3
134 #define SND_SOC_TPLG_TUPLE_TYPE_WORD	4
135 #define SND_SOC_TPLG_TUPLE_TYPE_SHORT	5
136 
137 /* DAI flags */
138 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES         (1 << 0)
139 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS      (1 << 1)
140 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS    (1 << 2)
141 
142 /* DAI physical PCM data formats.
143  * Add new formats to the end of the list.
144  */
145 #define SND_SOC_DAI_FORMAT_I2S          1 /* I2S mode */
146 #define SND_SOC_DAI_FORMAT_RIGHT_J      2 /* Right Justified mode */
147 #define SND_SOC_DAI_FORMAT_LEFT_J       3 /* Left Justified mode */
148 #define SND_SOC_DAI_FORMAT_DSP_A        4 /* L data MSB after FRM LRC */
149 #define SND_SOC_DAI_FORMAT_DSP_B        5 /* L data MSB during FRM LRC */
150 #define SND_SOC_DAI_FORMAT_AC97         6 /* AC97 */
151 #define SND_SOC_DAI_FORMAT_PDM          7 /* Pulse density modulation */
152 
153 /* left and right justified also known as MSB and LSB respectively */
154 #define SND_SOC_DAI_FORMAT_MSB          SND_SOC_DAI_FORMAT_LEFT_J
155 #define SND_SOC_DAI_FORMAT_LSB          SND_SOC_DAI_FORMAT_RIGHT_J
156 
157 /* DAI link flags */
158 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES         (1 << 0)
159 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS      (1 << 1)
160 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS    (1 << 2)
161 #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP            (1 << 3)
162 
163 /*
164  * Block Header.
165  * This header precedes all object and object arrays below.
166  */
167 struct snd_soc_tplg_hdr {
168 	__le32 magic;		/* magic number */
169 	__le32 abi;		/* ABI version */
170 	__le32 version;		/* optional vendor specific version details */
171 	__le32 type;		/* SND_SOC_TPLG_TYPE_ */
172 	__le32 size;		/* size of this structure */
173 	__le32 vendor_type;	/* optional vendor specific type info */
174 	__le32 payload_size;	/* data bytes, excluding this header */
175 	__le32 index;		/* identifier for block */
176 	__le32 count;		/* number of elements in block */
177 } __attribute__((packed));
178 
179 /* vendor tuple for uuid */
180 struct snd_soc_tplg_vendor_uuid_elem {
181 	__le32 token;
182 	char uuid[16];
183 } __attribute__((packed));
184 
185 /* vendor tuple for a bool/byte/short/word value */
186 struct snd_soc_tplg_vendor_value_elem {
187 	__le32 token;
188 	__le32 value;
189 } __attribute__((packed));
190 
191 /* vendor tuple for string */
192 struct snd_soc_tplg_vendor_string_elem {
193 	__le32 token;
194 	char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
195 } __attribute__((packed));
196 
197 struct snd_soc_tplg_vendor_array {
198 	__le32 size;	/* size in bytes of the array, including all elements */
199 	__le32 type;	/* SND_SOC_TPLG_TUPLE_TYPE_ */
200 	__le32 num_elems;	/* number of elements in array */
201 	union {
202 		struct snd_soc_tplg_vendor_uuid_elem uuid[0];
203 		struct snd_soc_tplg_vendor_value_elem value[0];
204 		struct snd_soc_tplg_vendor_string_elem string[0];
205 	};
206 } __attribute__((packed));
207 
208 /*
209  * Private data.
210  * All topology objects may have private data that can be used by the driver or
211  * firmware. Core will ignore this data.
212  */
213 struct snd_soc_tplg_private {
214 	__le32 size;	/* in bytes of private data */
215 	union {
216 		char data[0];
217 		struct snd_soc_tplg_vendor_array array[0];
218 	};
219 } __attribute__((packed));
220 
221 /*
222  * Kcontrol TLV data.
223  */
224 struct snd_soc_tplg_tlv_dbscale {
225 	__le32 min;
226 	__le32 step;
227 	__le32 mute;
228 } __attribute__((packed));
229 
230 struct snd_soc_tplg_ctl_tlv {
231 	__le32 size;	/* in bytes of this structure */
232 	__le32 type;	/* SNDRV_CTL_TLVT_*, type of TLV */
233 	union {
234 		__le32 data[SND_SOC_TPLG_TLV_SIZE];
235 		struct snd_soc_tplg_tlv_dbscale scale;
236 	};
237 } __attribute__((packed));
238 
239 /*
240  * Kcontrol channel data
241  */
242 struct snd_soc_tplg_channel {
243 	__le32 size;	/* in bytes of this structure */
244 	__le32 reg;
245 	__le32 shift;
246 	__le32 id;	/* ID maps to Left, Right, LFE etc */
247 } __attribute__((packed));
248 
249 /*
250  * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops
251  * Kcontrol ops need get/put/info.
252  * Bytes ext ops need get/put.
253  */
254 struct snd_soc_tplg_io_ops {
255 	__le32 get;
256 	__le32 put;
257 	__le32 info;
258 } __attribute__((packed));
259 
260 /*
261  * kcontrol header
262  */
263 struct snd_soc_tplg_ctl_hdr {
264 	__le32 size;	/* in bytes of this structure */
265 	__le32 type;
266 	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
267 	__le32 access;
268 	struct snd_soc_tplg_io_ops ops;
269 	struct snd_soc_tplg_ctl_tlv tlv;
270 } __attribute__((packed));
271 
272 /*
273  * Stream Capabilities
274  */
275 struct snd_soc_tplg_stream_caps {
276 	__le32 size;		/* in bytes of this structure */
277 	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
278 	__le64 formats;	/* supported formats SNDRV_PCM_FMTBIT_* */
279 	__le32 rates;		/* supported rates SNDRV_PCM_RATE_* */
280 	__le32 rate_min;	/* min rate */
281 	__le32 rate_max;	/* max rate */
282 	__le32 channels_min;	/* min channels */
283 	__le32 channels_max;	/* max channels */
284 	__le32 periods_min;	/* min number of periods */
285 	__le32 periods_max;	/* max number of periods */
286 	__le32 period_size_min;	/* min period size bytes */
287 	__le32 period_size_max;	/* max period size bytes */
288 	__le32 buffer_size_min;	/* min buffer size bytes */
289 	__le32 buffer_size_max;	/* max buffer size bytes */
290 	__le32 sig_bits;        /* number of bits of content */
291 } __attribute__((packed));
292 
293 /*
294  * FE or BE Stream configuration supported by SW/FW
295  */
296 struct snd_soc_tplg_stream {
297 	__le32 size;		/* in bytes of this structure */
298 	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */
299 	__le64 format;		/* SNDRV_PCM_FMTBIT_* */
300 	__le32 rate;		/* SNDRV_PCM_RATE_* */
301 	__le32 period_bytes;	/* size of period in bytes */
302 	__le32 buffer_bytes;	/* size of buffer in bytes */
303 	__le32 channels;	/* channels */
304 } __attribute__((packed));
305 
306 
307 /*
308  * Describes a physical link's runtime supported hardware config,
309  * i.e. hardware audio formats.
310  */
311 struct snd_soc_tplg_hw_config {
312 	__le32 size;            /* in bytes of this structure */
313 	__le32 id;		/* unique ID - - used to match */
314 	__le32 fmt;		/* SND_SOC_DAI_FORMAT_ format value */
315 	__u8 clock_gated;	/* 1 if clock can be gated to save power */
316 	__u8 invert_bclk;	/* 1 for inverted BCLK, 0 for normal */
317 	__u8 invert_fsync;	/* 1 for inverted frame clock, 0 for normal */
318 	__u8 bclk_master;	/* 1 for master of BCLK, 0 for slave */
319 	__u8 fsync_master;	/* 1 for master of FSYNC, 0 for slave */
320 	__u8 mclk_direction;    /* 0 for input, 1 for output */
321 	__le16 reserved;	/* for 32bit alignment */
322 	__le32 mclk_rate;	/* MCLK or SYSCLK freqency in Hz */
323 	__le32 bclk_rate;	/* BCLK freqency in Hz */
324 	__le32 fsync_rate;	/* frame clock in Hz */
325 	__le32 tdm_slots;	/* number of TDM slots in use */
326 	__le32 tdm_slot_width;	/* width in bits for each slot */
327 	__le32 tx_slots;	/* bit mask for active Tx slots */
328 	__le32 rx_slots;	/* bit mask for active Rx slots */
329 	__le32 tx_channels;	/* number of Tx channels */
330 	__le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
331 	__le32 rx_channels;	/* number of Rx channels */
332 	__le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
333 } __attribute__((packed));
334 
335 /*
336  * Manifest. List totals for each payload type. Not used in parsing, but will
337  * be passed to the component driver before any other objects in order for any
338  * global component resource allocations.
339  *
340  * File block representation for manifest :-
341  * +-----------------------------------+----+
342  * | struct snd_soc_tplg_hdr           |  1 |
343  * +-----------------------------------+----+
344  * | struct snd_soc_tplg_manifest      |  1 |
345  * +-----------------------------------+----+
346  */
347 struct snd_soc_tplg_manifest {
348 	__le32 size;		/* in bytes of this structure */
349 	__le32 control_elems;	/* number of control elements */
350 	__le32 widget_elems;	/* number of widget elements */
351 	__le32 graph_elems;	/* number of graph elements */
352 	__le32 pcm_elems;	/* number of PCM elements */
353 	__le32 dai_link_elems;	/* number of DAI link elements */
354 	__le32 dai_elems;	/* number of physical DAI elements */
355 	__le32 reserved[20];	/* reserved for new ABI element types */
356 	struct snd_soc_tplg_private priv;
357 } __attribute__((packed));
358 
359 /*
360  * Mixer kcontrol.
361  *
362  * File block representation for mixer kcontrol :-
363  * +-----------------------------------+----+
364  * | struct snd_soc_tplg_hdr           |  1 |
365  * +-----------------------------------+----+
366  * | struct snd_soc_tplg_mixer_control |  N |
367  * +-----------------------------------+----+
368  */
369 struct snd_soc_tplg_mixer_control {
370 	struct snd_soc_tplg_ctl_hdr hdr;
371 	__le32 size;	/* in bytes of this structure */
372 	__le32 min;
373 	__le32 max;
374 	__le32 platform_max;
375 	__le32 invert;
376 	__le32 num_channels;
377 	struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
378 	struct snd_soc_tplg_private priv;
379 } __attribute__((packed));
380 
381 /*
382  * Enumerated kcontrol
383  *
384  * File block representation for enum kcontrol :-
385  * +-----------------------------------+----+
386  * | struct snd_soc_tplg_hdr           |  1 |
387  * +-----------------------------------+----+
388  * | struct snd_soc_tplg_enum_control  |  N |
389  * +-----------------------------------+----+
390  */
391 struct snd_soc_tplg_enum_control {
392 	struct snd_soc_tplg_ctl_hdr hdr;
393 	__le32 size;	/* in bytes of this structure */
394 	__le32 num_channels;
395 	struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
396 	__le32 items;
397 	__le32 mask;
398 	__le32 count;
399 	char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
400 	__le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
401 	struct snd_soc_tplg_private priv;
402 } __attribute__((packed));
403 
404 /*
405  * Bytes kcontrol
406  *
407  * File block representation for bytes kcontrol :-
408  * +-----------------------------------+----+
409  * | struct snd_soc_tplg_hdr           |  1 |
410  * +-----------------------------------+----+
411  * | struct snd_soc_tplg_bytes_control |  N |
412  * +-----------------------------------+----+
413  */
414 struct snd_soc_tplg_bytes_control {
415 	struct snd_soc_tplg_ctl_hdr hdr;
416 	__le32 size;	/* in bytes of this structure */
417 	__le32 max;
418 	__le32 mask;
419 	__le32 base;
420 	__le32 num_regs;
421 	struct snd_soc_tplg_io_ops ext_ops;
422 	struct snd_soc_tplg_private priv;
423 } __attribute__((packed));
424 
425 /*
426  * DAPM Graph Element
427  *
428  * File block representation for DAPM graph elements :-
429  * +-------------------------------------+----+
430  * | struct snd_soc_tplg_hdr             |  1 |
431  * +-------------------------------------+----+
432  * | struct snd_soc_tplg_dapm_graph_elem |  N |
433  * +-------------------------------------+----+
434  */
435 struct snd_soc_tplg_dapm_graph_elem {
436 	char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
437 	char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
438 	char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
439 } __attribute__((packed));
440 
441 /*
442  * DAPM Widget.
443  *
444  * File block representation for DAPM widget :-
445  * +-------------------------------------+-----+
446  * | struct snd_soc_tplg_hdr             |  1  |
447  * +-------------------------------------+-----+
448  * | struct snd_soc_tplg_dapm_widget     |  N  |
449  * +-------------------------------------+-----+
450  * |   struct snd_soc_tplg_enum_control  | 0|1 |
451  * |   struct snd_soc_tplg_mixer_control | 0|N |
452  * +-------------------------------------+-----+
453  *
454  * Optional enum or mixer control can be appended to the end of each widget
455  * in the block.
456  */
457 struct snd_soc_tplg_dapm_widget {
458 	__le32 size;		/* in bytes of this structure */
459 	__le32 id;		/* SND_SOC_DAPM_CTL */
460 	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
461 	char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
462 
463 	__le32 reg;		/* negative reg = no direct dapm */
464 	__le32 shift;		/* bits to shift */
465 	__le32 mask;		/* non-shifted mask */
466 	__le32 subseq;		/* sort within widget type */
467 	__le32 invert;		/* invert the power bit */
468 	__le32 ignore_suspend;	/* kept enabled over suspend */
469 	__le16 event_flags;
470 	__le16 event_type;
471 	__le32 num_kcontrols;
472 	struct snd_soc_tplg_private priv;
473 	/*
474 	 * kcontrols that relate to this widget
475 	 * follow here after widget private data
476 	 */
477 } __attribute__((packed));
478 
479 
480 /*
481  * Describes SW/FW specific features of PCM (FE DAI & DAI link).
482  *
483  * File block representation for PCM :-
484  * +-----------------------------------+-----+
485  * | struct snd_soc_tplg_hdr           |  1  |
486  * +-----------------------------------+-----+
487  * | struct snd_soc_tplg_pcm           |  N  |
488  * +-----------------------------------+-----+
489  */
490 struct snd_soc_tplg_pcm {
491 	__le32 size;		/* in bytes of this structure */
492 	char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
493 	char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
494 	__le32 pcm_id;		/* unique ID - used to match with DAI link */
495 	__le32 dai_id;		/* unique ID - used to match */
496 	__le32 playback;	/* supports playback mode */
497 	__le32 capture;		/* supports capture mode */
498 	__le32 compress;	/* 1 = compressed; 0 = PCM */
499 	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
500 	__le32 num_streams;	/* number of streams */
501 	struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
502 	__le32 flag_mask;       /* bitmask of flags to configure */
503 	__le32 flags;           /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
504 	struct snd_soc_tplg_private priv;
505 } __attribute__((packed));
506 
507 
508 /*
509  * Describes the physical link runtime supported configs or params
510  *
511  * File block representation for physical link config :-
512  * +-----------------------------------+-----+
513  * | struct snd_soc_tplg_hdr           |  1  |
514  * +-----------------------------------+-----+
515  * | struct snd_soc_tplg_link_config   |  N  |
516  * +-----------------------------------+-----+
517  */
518 struct snd_soc_tplg_link_config {
519 	__le32 size;            /* in bytes of this structure */
520 	__le32 id;              /* unique ID - used to match */
521 	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
522 	char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* stream name - used to match */
523 	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
524 	__le32 num_streams;     /* number of streams */
525 	struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; /* hw configs */
526 	__le32 num_hw_configs;         /* number of hw configs */
527 	__le32 default_hw_config_id;   /* default hw config ID for init */
528 	__le32 flag_mask;       /* bitmask of flags to configure */
529 	__le32 flags;           /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
530 	struct snd_soc_tplg_private priv;
531 } __attribute__((packed));
532 
533 /*
534  * Describes SW/FW specific features of physical DAI.
535  * It can be used to configure backend DAIs for DPCM.
536  *
537  * File block representation for physical DAI :-
538  * +-----------------------------------+-----+
539  * | struct snd_soc_tplg_hdr           |  1  |
540  * +-----------------------------------+-----+
541  * | struct snd_soc_tplg_dai           |  N  |
542  * +-----------------------------------+-----+
543  */
544 struct snd_soc_tplg_dai {
545 	__le32 size;            /* in bytes of this structure */
546 	char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
547 	__le32 dai_id;          /* unique ID - used to match */
548 	__le32 playback;        /* supports playback mode */
549 	__le32 capture;         /* supports capture mode */
550 	struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
551 	__le32 flag_mask;       /* bitmask of flags to configure */
552 	__le32 flags;           /* SND_SOC_TPLG_DAI_FLGBIT_* */
553 	struct snd_soc_tplg_private priv;
554 } __attribute__((packed));
555 #endif
556