• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef __LINUX_UAPI_SND_ASOC_H
8 #define __LINUX_UAPI_SND_ASOC_H
9 #include <linux/types.h>
10 #include <sound/asound.h>
11 #define SND_SOC_TPLG_MAX_CHAN 8
12 #define SND_SOC_TPLG_MAX_FORMATS 16
13 #define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
14 #define SND_SOC_TPLG_HW_CONFIG_MAX 8
15 #define SND_SOC_TPLG_CTL_VOLSW 1
16 #define SND_SOC_TPLG_CTL_VOLSW_SX 2
17 #define SND_SOC_TPLG_CTL_VOLSW_XR_SX 3
18 #define SND_SOC_TPLG_CTL_ENUM 4
19 #define SND_SOC_TPLG_CTL_BYTES 5
20 #define SND_SOC_TPLG_CTL_ENUM_VALUE 6
21 #define SND_SOC_TPLG_CTL_RANGE 7
22 #define SND_SOC_TPLG_CTL_STROBE 8
23 #define SND_SOC_TPLG_DAPM_CTL_VOLSW 64
24 #define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE 65
25 #define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT 66
26 #define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE 67
27 #define SND_SOC_TPLG_DAPM_CTL_PIN 68
28 #define SND_SOC_TPLG_DAPM_INPUT 0
29 #define SND_SOC_TPLG_DAPM_OUTPUT 1
30 #define SND_SOC_TPLG_DAPM_MUX 2
31 #define SND_SOC_TPLG_DAPM_MIXER 3
32 #define SND_SOC_TPLG_DAPM_PGA 4
33 #define SND_SOC_TPLG_DAPM_OUT_DRV 5
34 #define SND_SOC_TPLG_DAPM_ADC 6
35 #define SND_SOC_TPLG_DAPM_DAC 7
36 #define SND_SOC_TPLG_DAPM_SWITCH 8
37 #define SND_SOC_TPLG_DAPM_PRE 9
38 #define SND_SOC_TPLG_DAPM_POST 10
39 #define SND_SOC_TPLG_DAPM_AIF_IN 11
40 #define SND_SOC_TPLG_DAPM_AIF_OUT 12
41 #define SND_SOC_TPLG_DAPM_DAI_IN 13
42 #define SND_SOC_TPLG_DAPM_DAI_OUT 14
43 #define SND_SOC_TPLG_DAPM_DAI_LINK 15
44 #define SND_SOC_TPLG_DAPM_BUFFER 16
45 #define SND_SOC_TPLG_DAPM_SCHEDULER 17
46 #define SND_SOC_TPLG_DAPM_EFFECT 18
47 #define SND_SOC_TPLG_DAPM_SIGGEN 19
48 #define SND_SOC_TPLG_DAPM_SRC 20
49 #define SND_SOC_TPLG_DAPM_ASRC 21
50 #define SND_SOC_TPLG_DAPM_ENCODER 22
51 #define SND_SOC_TPLG_DAPM_DECODER 23
52 #define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DECODER
53 #define SND_SOC_TPLG_MAGIC 0x41536F43
54 #define SND_SOC_TPLG_NUM_TEXTS 16
55 #define SND_SOC_TPLG_ABI_VERSION 0x5
56 #define SND_SOC_TPLG_ABI_VERSION_MIN 0x4
57 #define SND_SOC_TPLG_TLV_SIZE 32
58 #define SND_SOC_TPLG_TYPE_MIXER 1
59 #define SND_SOC_TPLG_TYPE_BYTES 2
60 #define SND_SOC_TPLG_TYPE_ENUM 3
61 #define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4
62 #define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5
63 #define SND_SOC_TPLG_TYPE_DAI_LINK 6
64 #define SND_SOC_TPLG_TYPE_PCM 7
65 #define SND_SOC_TPLG_TYPE_MANIFEST 8
66 #define SND_SOC_TPLG_TYPE_CODEC_LINK 9
67 #define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
68 #define SND_SOC_TPLG_TYPE_PDATA 11
69 #define SND_SOC_TPLG_TYPE_DAI 12
70 #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI
71 #define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
72 #define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001
73 #define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002
74 #define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003
75 #define SND_SOC_TPLG_STREAM_PLAYBACK 0
76 #define SND_SOC_TPLG_STREAM_CAPTURE 1
77 #define SND_SOC_TPLG_TUPLE_TYPE_UUID 0
78 #define SND_SOC_TPLG_TUPLE_TYPE_STRING 1
79 #define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2
80 #define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3
81 #define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
82 #define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
83 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
84 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
85 #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
86 #define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0
87 #define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1
88 #define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2
89 #define SND_SOC_TPLG_MCLK_CO 0
90 #define SND_SOC_TPLG_MCLK_CI 1
91 #define SND_SOC_DAI_FORMAT_I2S 1
92 #define SND_SOC_DAI_FORMAT_RIGHT_J 2
93 #define SND_SOC_DAI_FORMAT_LEFT_J 3
94 #define SND_SOC_DAI_FORMAT_DSP_A 4
95 #define SND_SOC_DAI_FORMAT_DSP_B 5
96 #define SND_SOC_DAI_FORMAT_AC97 6
97 #define SND_SOC_DAI_FORMAT_PDM 7
98 #define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J
99 #define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J
100 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0)
101 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
102 #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
103 #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
104 #define SND_SOC_TPLG_BCLK_CP 0
105 #define SND_SOC_TPLG_BCLK_CC 1
106 #define SND_SOC_TPLG_BCLK_CM SND_SOC_TPLG_BCLK_CP
107 #define SND_SOC_TPLG_BCLK_CS SND_SOC_TPLG_BCLK_CC
108 #define SND_SOC_TPLG_FSYNC_CP 0
109 #define SND_SOC_TPLG_FSYNC_CC 1
110 #define SND_SOC_TPLG_FSYNC_CM SND_SOC_TPLG_FSYNC_CP
111 #define SND_SOC_TPLG_FSYNC_CS SND_SOC_TPLG_FSYNC_CC
112 struct snd_soc_tplg_hdr {
113   __le32 magic;
114   __le32 abi;
115   __le32 version;
116   __le32 type;
117   __le32 size;
118   __le32 vendor_type;
119   __le32 payload_size;
120   __le32 index;
121   __le32 count;
122 } __attribute__((packed));
123 struct snd_soc_tplg_vendor_uuid_elem {
124   __le32 token;
125   char uuid[16];
126 } __attribute__((packed));
127 struct snd_soc_tplg_vendor_value_elem {
128   __le32 token;
129   __le32 value;
130 } __attribute__((packed));
131 struct snd_soc_tplg_vendor_string_elem {
132   __le32 token;
133   char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
134 } __attribute__((packed));
135 struct snd_soc_tplg_vendor_array {
136   __le32 size;
137   __le32 type;
138   __le32 num_elems;
139   union {
140     __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_uuid_elem, uuid);
141     __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_value_elem, value);
142     __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_string_elem, string);
143   };
144 } __attribute__((packed));
145 struct snd_soc_tplg_private {
146   __le32 size;
147   union {
148     __DECLARE_FLEX_ARRAY(char, data);
149     __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_array, array);
150   };
151 } __attribute__((packed));
152 struct snd_soc_tplg_tlv_dbscale {
153   __le32 min;
154   __le32 step;
155   __le32 mute;
156 } __attribute__((packed));
157 struct snd_soc_tplg_ctl_tlv {
158   __le32 size;
159   __le32 type;
160   union {
161     __le32 data[SND_SOC_TPLG_TLV_SIZE];
162     struct snd_soc_tplg_tlv_dbscale scale;
163   };
164 } __attribute__((packed));
165 struct snd_soc_tplg_channel {
166   __le32 size;
167   __le32 reg;
168   __le32 shift;
169   __le32 id;
170 } __attribute__((packed));
171 struct snd_soc_tplg_io_ops {
172   __le32 get;
173   __le32 put;
174   __le32 info;
175 } __attribute__((packed));
176 struct snd_soc_tplg_ctl_hdr {
177   __le32 size;
178   __le32 type;
179   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
180   __le32 access;
181   struct snd_soc_tplg_io_ops ops;
182   struct snd_soc_tplg_ctl_tlv tlv;
183 } __attribute__((packed));
184 struct snd_soc_tplg_stream_caps {
185   __le32 size;
186   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
187   __le64 formats;
188   __le32 rates;
189   __le32 rate_min;
190   __le32 rate_max;
191   __le32 channels_min;
192   __le32 channels_max;
193   __le32 periods_min;
194   __le32 periods_max;
195   __le32 period_size_min;
196   __le32 period_size_max;
197   __le32 buffer_size_min;
198   __le32 buffer_size_max;
199   __le32 sig_bits;
200 } __attribute__((packed));
201 struct snd_soc_tplg_stream {
202   __le32 size;
203   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
204   __le64 format;
205   __le32 rate;
206   __le32 period_bytes;
207   __le32 buffer_bytes;
208   __le32 channels;
209 } __attribute__((packed));
210 struct snd_soc_tplg_hw_config {
211   __le32 size;
212   __le32 id;
213   __le32 fmt;
214   __u8 clock_gated;
215   __u8 invert_bclk;
216   __u8 invert_fsync;
217   __u8 bclk_provider;
218   __u8 fsync_provider;
219   __u8 mclk_direction;
220   __le16 reserved;
221   __le32 mclk_rate;
222   __le32 bclk_rate;
223   __le32 fsync_rate;
224   __le32 tdm_slots;
225   __le32 tdm_slot_width;
226   __le32 tx_slots;
227   __le32 rx_slots;
228   __le32 tx_channels;
229   __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN];
230   __le32 rx_channels;
231   __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN];
232 } __attribute__((packed));
233 struct snd_soc_tplg_manifest {
234   __le32 size;
235   __le32 control_elems;
236   __le32 widget_elems;
237   __le32 graph_elems;
238   __le32 pcm_elems;
239   __le32 dai_link_elems;
240   __le32 dai_elems;
241   __le32 reserved[20];
242   struct snd_soc_tplg_private priv;
243 } __attribute__((packed));
244 struct snd_soc_tplg_mixer_control {
245   struct snd_soc_tplg_ctl_hdr hdr;
246   __le32 size;
247   __le32 min;
248   __le32 max;
249   __le32 platform_max;
250   __le32 invert;
251   __le32 num_channels;
252   struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
253   struct snd_soc_tplg_private priv;
254 } __attribute__((packed));
255 struct snd_soc_tplg_enum_control {
256   struct snd_soc_tplg_ctl_hdr hdr;
257   __le32 size;
258   __le32 num_channels;
259   struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
260   __le32 items;
261   __le32 mask;
262   __le32 count;
263   char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
264   __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
265   struct snd_soc_tplg_private priv;
266 } __attribute__((packed));
267 struct snd_soc_tplg_bytes_control {
268   struct snd_soc_tplg_ctl_hdr hdr;
269   __le32 size;
270   __le32 max;
271   __le32 mask;
272   __le32 base;
273   __le32 num_regs;
274   struct snd_soc_tplg_io_ops ext_ops;
275   struct snd_soc_tplg_private priv;
276 } __attribute__((packed));
277 struct snd_soc_tplg_dapm_graph_elem {
278   char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
279   char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
280   char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
281 } __attribute__((packed));
282 struct snd_soc_tplg_dapm_widget {
283   __le32 size;
284   __le32 id;
285   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
286   char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
287   __le32 reg;
288   __le32 shift;
289   __le32 mask;
290   __le32 subseq;
291   __le32 invert;
292   __le32 ignore_suspend;
293   __le16 event_flags;
294   __le16 event_type;
295   __le32 num_kcontrols;
296   struct snd_soc_tplg_private priv;
297 } __attribute__((packed));
298 struct snd_soc_tplg_pcm {
299   __le32 size;
300   char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
301   char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
302   __le32 pcm_id;
303   __le32 dai_id;
304   __le32 playback;
305   __le32 capture;
306   __le32 compress;
307   struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
308   __le32 num_streams;
309   struct snd_soc_tplg_stream_caps caps[2];
310   __le32 flag_mask;
311   __le32 flags;
312   struct snd_soc_tplg_private priv;
313 } __attribute__((packed));
314 struct snd_soc_tplg_link_config {
315   __le32 size;
316   __le32 id;
317   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
318   char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
319   struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
320   __le32 num_streams;
321   struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX];
322   __le32 num_hw_configs;
323   __le32 default_hw_config_id;
324   __le32 flag_mask;
325   __le32 flags;
326   struct snd_soc_tplg_private priv;
327 } __attribute__((packed));
328 struct snd_soc_tplg_dai {
329   __le32 size;
330   char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
331   __le32 dai_id;
332   __le32 playback;
333   __le32 capture;
334   struct snd_soc_tplg_stream_caps caps[2];
335   __le32 flag_mask;
336   __le32 flags;
337   struct snd_soc_tplg_private priv;
338 } __attribute__((packed));
339 struct snd_soc_tplg_manifest_v4 {
340   __le32 size;
341   __le32 control_elems;
342   __le32 widget_elems;
343   __le32 graph_elems;
344   __le32 pcm_elems;
345   __le32 dai_link_elems;
346   struct snd_soc_tplg_private priv;
347 } __attribute__((__packed__));
348 struct snd_soc_tplg_stream_caps_v4 {
349   __le32 size;
350   char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
351   __le64 formats;
352   __le32 rates;
353   __le32 rate_min;
354   __le32 rate_max;
355   __le32 channels_min;
356   __le32 channels_max;
357   __le32 periods_min;
358   __le32 periods_max;
359   __le32 period_size_min;
360   __le32 period_size_max;
361   __le32 buffer_size_min;
362   __le32 buffer_size_max;
363 } __attribute__((__packed__));
364 struct snd_soc_tplg_pcm_v4 {
365   __le32 size;
366   char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
367   char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
368   __le32 pcm_id;
369   __le32 dai_id;
370   __le32 playback;
371   __le32 capture;
372   __le32 compress;
373   struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
374   __le32 num_streams;
375   struct snd_soc_tplg_stream_caps_v4 caps[2];
376 } __attribute__((__packed__));
377 struct snd_soc_tplg_link_config_v4 {
378   __le32 size;
379   __le32 id;
380   struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
381   __le32 num_streams;
382 } __attribute__((__packed__));
383 #endif
384