• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __SOUND_ASOUND_H
20 #define __SOUND_ASOUND_H
21 #ifdef __linux__
22 #include <linux/types.h>
23 #else
24 #include <sys/ioctl.h>
25 #endif
26 #include <stdlib.h>
27 #define SNDRV_PROTOCOL_VERSION(major,minor,subminor) (((major) << 16) | ((minor) << 8) | (subminor))
28 #define SNDRV_PROTOCOL_MAJOR(version) (((version) >> 16) & 0xffff)
29 #define SNDRV_PROTOCOL_MINOR(version) (((version) >> 8) & 0xff)
30 #define SNDRV_PROTOCOL_MICRO(version) ((version) & 0xff)
31 #define SNDRV_PROTOCOL_INCOMPATIBLE(kversion,uversion) (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
32 struct snd_aes_iec958 {
33   unsigned char status[24];
34   unsigned char subcode[147];
35   unsigned char pad;
36   unsigned char dig_subframe[4];
37 };
38 struct snd_cea_861_aud_if {
39   unsigned char db1_ct_cc;
40   unsigned char db2_sf_ss;
41   unsigned char db3;
42   unsigned char db4_ca;
43   unsigned char db5_dminh_lsv;
44 };
45 #define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
46 enum {
47   SNDRV_HWDEP_IFACE_OPL2 = 0,
48   SNDRV_HWDEP_IFACE_OPL3,
49   SNDRV_HWDEP_IFACE_OPL4,
50   SNDRV_HWDEP_IFACE_SB16CSP,
51   SNDRV_HWDEP_IFACE_EMU10K1,
52   SNDRV_HWDEP_IFACE_YSS225,
53   SNDRV_HWDEP_IFACE_ICS2115,
54   SNDRV_HWDEP_IFACE_SSCAPE,
55   SNDRV_HWDEP_IFACE_VX,
56   SNDRV_HWDEP_IFACE_MIXART,
57   SNDRV_HWDEP_IFACE_USX2Y,
58   SNDRV_HWDEP_IFACE_EMUX_WAVETABLE,
59   SNDRV_HWDEP_IFACE_BLUETOOTH,
60   SNDRV_HWDEP_IFACE_USX2Y_PCM,
61   SNDRV_HWDEP_IFACE_PCXHR,
62   SNDRV_HWDEP_IFACE_SB_RC,
63   SNDRV_HWDEP_IFACE_HDA,
64   SNDRV_HWDEP_IFACE_USB_STREAM,
65   SNDRV_HWDEP_IFACE_FW_DICE,
66   SNDRV_HWDEP_IFACE_FW_FIREWORKS,
67   SNDRV_HWDEP_IFACE_FW_BEBOB,
68   SNDRV_HWDEP_IFACE_FW_OXFW,
69   SNDRV_HWDEP_IFACE_FW_DIGI00X,
70   SNDRV_HWDEP_IFACE_FW_TASCAM,
71   SNDRV_HWDEP_IFACE_LINE6,
72   SNDRV_HWDEP_IFACE_FW_MOTU,
73   SNDRV_HWDEP_IFACE_FW_FIREFACE,
74   SNDRV_HWDEP_IFACE_AUDIO_BE,
75   SNDRV_HWDEP_IFACE_AUDIO_CODEC,
76   SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_AUDIO_CODEC
77 };
78 #define SNDRV_HWDEP_IFACE_AUDIO_BE SNDRV_HWDEP_IFACE_AUDIO_BE
79 #define SNDRV_HWDEP_IFACE_AUDIO_CODEC SNDRV_HWDEP_IFACE_AUDIO_CODEC
80 struct snd_hwdep_info {
81   unsigned int device;
82   int card;
83   unsigned char id[64];
84   unsigned char name[80];
85   int iface;
86   unsigned char reserved[64];
87 };
88 struct snd_hwdep_dsp_status {
89   unsigned int version;
90   unsigned char id[32];
91   unsigned int num_dsps;
92   unsigned int dsp_loaded;
93   unsigned int chip_ready;
94   unsigned char reserved[16];
95 };
96 struct snd_hwdep_dsp_image {
97   unsigned int index;
98   unsigned char name[64];
99   unsigned char * image;
100   size_t length;
101   unsigned long driver_data;
102 };
103 #define SNDRV_HWDEP_IOCTL_PVERSION _IOR('H', 0x00, int)
104 #define SNDRV_HWDEP_IOCTL_INFO _IOR('H', 0x01, struct snd_hwdep_info)
105 #define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
106 #define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
107 #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 14)
108 typedef unsigned long snd_pcm_uframes_t;
109 typedef signed long snd_pcm_sframes_t;
110 enum {
111   SNDRV_PCM_CLASS_GENERIC = 0,
112   SNDRV_PCM_CLASS_MULTI,
113   SNDRV_PCM_CLASS_MODEM,
114   SNDRV_PCM_CLASS_DIGITIZER,
115   SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
116 };
117 enum {
118   SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0,
119   SNDRV_PCM_SUBCLASS_MULTI_MIX,
120   SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
121 };
122 enum {
123   SNDRV_PCM_STREAM_PLAYBACK = 0,
124   SNDRV_PCM_STREAM_CAPTURE,
125   SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
126 };
127 typedef int __bitwise snd_pcm_access_t;
128 #define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((snd_pcm_access_t) 0)
129 #define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((snd_pcm_access_t) 1)
130 #define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((snd_pcm_access_t) 2)
131 #define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((snd_pcm_access_t) 3)
132 #define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((snd_pcm_access_t) 4)
133 #define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
134 typedef int __bitwise snd_pcm_format_t;
135 #define SNDRV_PCM_FORMAT_S8 ((snd_pcm_format_t) 0)
136 #define SNDRV_PCM_FORMAT_U8 ((snd_pcm_format_t) 1)
137 #define SNDRV_PCM_FORMAT_S16_LE ((snd_pcm_format_t) 2)
138 #define SNDRV_PCM_FORMAT_S16_BE ((snd_pcm_format_t) 3)
139 #define SNDRV_PCM_FORMAT_U16_LE ((snd_pcm_format_t) 4)
140 #define SNDRV_PCM_FORMAT_U16_BE ((snd_pcm_format_t) 5)
141 #define SNDRV_PCM_FORMAT_S24_LE ((snd_pcm_format_t) 6)
142 #define SNDRV_PCM_FORMAT_S24_BE ((snd_pcm_format_t) 7)
143 #define SNDRV_PCM_FORMAT_U24_LE ((snd_pcm_format_t) 8)
144 #define SNDRV_PCM_FORMAT_U24_BE ((snd_pcm_format_t) 9)
145 #define SNDRV_PCM_FORMAT_S32_LE ((snd_pcm_format_t) 10)
146 #define SNDRV_PCM_FORMAT_S32_BE ((snd_pcm_format_t) 11)
147 #define SNDRV_PCM_FORMAT_U32_LE ((snd_pcm_format_t) 12)
148 #define SNDRV_PCM_FORMAT_U32_BE ((snd_pcm_format_t) 13)
149 #define SNDRV_PCM_FORMAT_FLOAT_LE ((snd_pcm_format_t) 14)
150 #define SNDRV_PCM_FORMAT_FLOAT_BE ((snd_pcm_format_t) 15)
151 #define SNDRV_PCM_FORMAT_FLOAT64_LE ((snd_pcm_format_t) 16)
152 #define SNDRV_PCM_FORMAT_FLOAT64_BE ((snd_pcm_format_t) 17)
153 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((snd_pcm_format_t) 18)
154 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((snd_pcm_format_t) 19)
155 #define SNDRV_PCM_FORMAT_MU_LAW ((snd_pcm_format_t) 20)
156 #define SNDRV_PCM_FORMAT_A_LAW ((snd_pcm_format_t) 21)
157 #define SNDRV_PCM_FORMAT_IMA_ADPCM ((snd_pcm_format_t) 22)
158 #define SNDRV_PCM_FORMAT_MPEG ((snd_pcm_format_t) 23)
159 #define SNDRV_PCM_FORMAT_GSM ((snd_pcm_format_t) 24)
160 #define SNDRV_PCM_FORMAT_S20_LE ((snd_pcm_format_t) 25)
161 #define SNDRV_PCM_FORMAT_S20_BE ((snd_pcm_format_t) 26)
162 #define SNDRV_PCM_FORMAT_U20_LE ((snd_pcm_format_t) 27)
163 #define SNDRV_PCM_FORMAT_U20_BE ((snd_pcm_format_t) 28)
164 #define SNDRV_PCM_FORMAT_SPECIAL ((snd_pcm_format_t) 31)
165 #define SNDRV_PCM_FORMAT_S24_3LE ((snd_pcm_format_t) 32)
166 #define SNDRV_PCM_FORMAT_S24_3BE ((snd_pcm_format_t) 33)
167 #define SNDRV_PCM_FORMAT_U24_3LE ((snd_pcm_format_t) 34)
168 #define SNDRV_PCM_FORMAT_U24_3BE ((snd_pcm_format_t) 35)
169 #define SNDRV_PCM_FORMAT_S20_3LE ((snd_pcm_format_t) 36)
170 #define SNDRV_PCM_FORMAT_S20_3BE ((snd_pcm_format_t) 37)
171 #define SNDRV_PCM_FORMAT_U20_3LE ((snd_pcm_format_t) 38)
172 #define SNDRV_PCM_FORMAT_U20_3BE ((snd_pcm_format_t) 39)
173 #define SNDRV_PCM_FORMAT_S18_3LE ((snd_pcm_format_t) 40)
174 #define SNDRV_PCM_FORMAT_S18_3BE ((snd_pcm_format_t) 41)
175 #define SNDRV_PCM_FORMAT_U18_3LE ((snd_pcm_format_t) 42)
176 #define SNDRV_PCM_FORMAT_U18_3BE ((snd_pcm_format_t) 43)
177 #define SNDRV_PCM_FORMAT_G723_24 ((snd_pcm_format_t) 44)
178 #define SNDRV_PCM_FORMAT_G723_24_1B ((snd_pcm_format_t) 45)
179 #define SNDRV_PCM_FORMAT_G723_40 ((snd_pcm_format_t) 46)
180 #define SNDRV_PCM_FORMAT_G723_40_1B ((snd_pcm_format_t) 47)
181 #define SNDRV_PCM_FORMAT_DSD_U8 ((snd_pcm_format_t) 48)
182 #define SNDRV_PCM_FORMAT_DSD_U16_LE ((snd_pcm_format_t) 49)
183 #define SNDRV_PCM_FORMAT_DSD_U32_LE ((snd_pcm_format_t) 50)
184 #define SNDRV_PCM_FORMAT_DSD_U16_BE ((snd_pcm_format_t) 51)
185 #define SNDRV_PCM_FORMAT_DSD_U32_BE ((snd_pcm_format_t) 52)
186 #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE
187 #define SNDRV_PCM_FORMAT_FIRST SNDRV_PCM_FORMAT_S8
188 #ifdef SNDRV_LITTLE_ENDIAN
189 #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
190 #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
191 #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
192 #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
193 #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
194 #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
195 #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
196 #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
197 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
198 #define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_LE
199 #define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_LE
200 #endif
201 #ifdef SNDRV_BIG_ENDIAN
202 #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
203 #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
204 #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
205 #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
206 #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
207 #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
208 #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
209 #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
210 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
211 #define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_BE
212 #define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_BE
213 #endif
214 typedef int __bitwise snd_pcm_subformat_t;
215 #define SNDRV_PCM_SUBFORMAT_STD ((snd_pcm_subformat_t) 0)
216 #define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
217 #define SNDRV_PCM_INFO_MMAP 0x00000001
218 #define SNDRV_PCM_INFO_MMAP_VALID 0x00000002
219 #define SNDRV_PCM_INFO_DOUBLE 0x00000004
220 #define SNDRV_PCM_INFO_BATCH 0x00000010
221 #define SNDRV_PCM_INFO_SYNC_APPLPTR 0x00000020
222 #define SNDRV_PCM_INFO_INTERLEAVED 0x00000100
223 #define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200
224 #define SNDRV_PCM_INFO_COMPLEX 0x00000400
225 #define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000
226 #define SNDRV_PCM_INFO_OVERRANGE 0x00020000
227 #define SNDRV_PCM_INFO_RESUME 0x00040000
228 #define SNDRV_PCM_INFO_PAUSE 0x00080000
229 #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000
230 #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000
231 #define SNDRV_PCM_INFO_SYNC_START 0x00400000
232 #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000
233 #define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000
234 #define SNDRV_PCM_INFO_HAS_LINK_ATIME 0x01000000
235 #define SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME 0x02000000
236 #define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000
237 #define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000
238 #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000
239 #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000
240 typedef int __bitwise snd_pcm_state_t;
241 #define SNDRV_PCM_STATE_OPEN ((snd_pcm_state_t) 0)
242 #define SNDRV_PCM_STATE_SETUP ((snd_pcm_state_t) 1)
243 #define SNDRV_PCM_STATE_PREPARED ((snd_pcm_state_t) 2)
244 #define SNDRV_PCM_STATE_RUNNING ((snd_pcm_state_t) 3)
245 #define SNDRV_PCM_STATE_XRUN ((snd_pcm_state_t) 4)
246 #define SNDRV_PCM_STATE_DRAINING ((snd_pcm_state_t) 5)
247 #define SNDRV_PCM_STATE_PAUSED ((snd_pcm_state_t) 6)
248 #define SNDRV_PCM_STATE_SUSPENDED ((snd_pcm_state_t) 7)
249 #define SNDRV_PCM_STATE_DISCONNECTED ((snd_pcm_state_t) 8)
250 #define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
251 enum {
252   SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
253   SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
254   SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
255 };
256 union snd_pcm_sync_id {
257   unsigned char id[16];
258   unsigned short id16[8];
259   unsigned int id32[4];
260 };
261 struct snd_pcm_info {
262   unsigned int device;
263   unsigned int subdevice;
264   int stream;
265   int card;
266   unsigned char id[64];
267   unsigned char name[80];
268   unsigned char subname[32];
269   int dev_class;
270   int dev_subclass;
271   unsigned int subdevices_count;
272   unsigned int subdevices_avail;
273   union snd_pcm_sync_id sync;
274   unsigned char reserved[64];
275 };
276 typedef int snd_pcm_hw_param_t;
277 #define SNDRV_PCM_HW_PARAM_ACCESS 0
278 #define SNDRV_PCM_HW_PARAM_FORMAT 1
279 #define SNDRV_PCM_HW_PARAM_SUBFORMAT 2
280 #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
281 #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
282 #define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8
283 #define SNDRV_PCM_HW_PARAM_FRAME_BITS 9
284 #define SNDRV_PCM_HW_PARAM_CHANNELS 10
285 #define SNDRV_PCM_HW_PARAM_RATE 11
286 #define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12
287 #define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13
288 #define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14
289 #define SNDRV_PCM_HW_PARAM_PERIODS 15
290 #define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16
291 #define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17
292 #define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18
293 #define SNDRV_PCM_HW_PARAM_TICK_TIME 19
294 #define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
295 #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
296 #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1 << 0)
297 #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1 << 1)
298 #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1 << 2)
299 struct snd_interval {
300   unsigned int min, max;
301   unsigned int openmin : 1, openmax : 1, integer : 1, empty : 1;
302 };
303 #define SNDRV_MASK_MAX 256
304 struct snd_mask {
305   __u32 bits[(SNDRV_MASK_MAX + 31) / 32];
306 };
307 struct snd_pcm_hw_params {
308   unsigned int flags;
309   struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
310   struct snd_mask mres[5];
311   struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
312   struct snd_interval ires[9];
313   unsigned int rmask;
314   unsigned int cmask;
315   unsigned int info;
316   unsigned int msbits;
317   unsigned int rate_num;
318   unsigned int rate_den;
319   snd_pcm_uframes_t fifo_size;
320   unsigned char reserved[64];
321 };
322 enum {
323   SNDRV_PCM_TSTAMP_NONE = 0,
324   SNDRV_PCM_TSTAMP_ENABLE,
325   SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
326 };
327 struct snd_pcm_sw_params {
328   int tstamp_mode;
329   unsigned int period_step;
330   unsigned int sleep_min;
331   snd_pcm_uframes_t avail_min;
332   snd_pcm_uframes_t xfer_align;
333   snd_pcm_uframes_t start_threshold;
334   snd_pcm_uframes_t stop_threshold;
335   snd_pcm_uframes_t silence_threshold;
336   snd_pcm_uframes_t silence_size;
337   snd_pcm_uframes_t boundary;
338   unsigned int proto;
339   unsigned int tstamp_type;
340   unsigned char reserved[56];
341 };
342 struct snd_pcm_channel_info {
343   unsigned int channel;
344   __kernel_off_t offset;
345   unsigned int first;
346   unsigned int step;
347 };
348 enum {
349   SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT = 0,
350   SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT = 1,
351   SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK = 2,
352   SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE = 3,
353   SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED = 4,
354   SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED = 5,
355   SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED
356 };
357 struct snd_pcm_status {
358   snd_pcm_state_t state;
359   struct timespec trigger_tstamp;
360   struct timespec tstamp;
361   snd_pcm_uframes_t appl_ptr;
362   snd_pcm_uframes_t hw_ptr;
363   snd_pcm_sframes_t delay;
364   snd_pcm_uframes_t avail;
365   snd_pcm_uframes_t avail_max;
366   snd_pcm_uframes_t overrange;
367   snd_pcm_state_t suspended_state;
368   __u32 audio_tstamp_data;
369   struct timespec audio_tstamp;
370   struct timespec driver_tstamp;
371   __u32 audio_tstamp_accuracy;
372   unsigned char reserved[52 - 2 * sizeof(struct timespec)];
373 };
374 struct snd_pcm_mmap_status {
375   snd_pcm_state_t state;
376   int pad1;
377   snd_pcm_uframes_t hw_ptr;
378   struct timespec tstamp;
379   snd_pcm_state_t suspended_state;
380   struct timespec audio_tstamp;
381 };
382 struct snd_pcm_mmap_control {
383   snd_pcm_uframes_t appl_ptr;
384   snd_pcm_uframes_t avail_min;
385 };
386 #define SNDRV_PCM_SYNC_PTR_HWSYNC (1 << 0)
387 #define SNDRV_PCM_SYNC_PTR_APPL (1 << 1)
388 #define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1 << 2)
389 struct snd_pcm_sync_ptr {
390   unsigned int flags;
391   union {
392     struct snd_pcm_mmap_status status;
393     unsigned char reserved[64];
394   } s;
395   union {
396     struct snd_pcm_mmap_control control;
397     unsigned char reserved[64];
398   } c;
399 };
400 struct snd_xferi {
401   snd_pcm_sframes_t result;
402   void * buf;
403   snd_pcm_uframes_t frames;
404 };
405 struct snd_xfern {
406   snd_pcm_sframes_t result;
407   void * * bufs;
408   snd_pcm_uframes_t frames;
409 };
410 enum {
411   SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
412   SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
413   SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
414   SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
415 };
416 enum {
417   SNDRV_CHMAP_UNKNOWN = 0,
418   SNDRV_CHMAP_NA,
419   SNDRV_CHMAP_MONO,
420   SNDRV_CHMAP_FL,
421   SNDRV_CHMAP_FR,
422   SNDRV_CHMAP_RL,
423   SNDRV_CHMAP_RR,
424   SNDRV_CHMAP_FC,
425   SNDRV_CHMAP_LFE,
426   SNDRV_CHMAP_SL,
427   SNDRV_CHMAP_SR,
428   SNDRV_CHMAP_RC,
429   SNDRV_CHMAP_FLC,
430   SNDRV_CHMAP_FRC,
431   SNDRV_CHMAP_RLC,
432   SNDRV_CHMAP_RRC,
433   SNDRV_CHMAP_FLW,
434   SNDRV_CHMAP_FRW,
435   SNDRV_CHMAP_FLH,
436   SNDRV_CHMAP_FCH,
437   SNDRV_CHMAP_FRH,
438   SNDRV_CHMAP_TC,
439   SNDRV_CHMAP_TFL,
440   SNDRV_CHMAP_TFR,
441   SNDRV_CHMAP_TFC,
442   SNDRV_CHMAP_TRL,
443   SNDRV_CHMAP_TRR,
444   SNDRV_CHMAP_TRC,
445   SNDRV_CHMAP_TFLC,
446   SNDRV_CHMAP_TFRC,
447   SNDRV_CHMAP_TSL,
448   SNDRV_CHMAP_TSR,
449   SNDRV_CHMAP_LLFE,
450   SNDRV_CHMAP_RLFE,
451   SNDRV_CHMAP_BC,
452   SNDRV_CHMAP_BLC,
453   SNDRV_CHMAP_BRC,
454   SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
455 };
456 #define SNDRV_CHMAP_POSITION_MASK 0xffff
457 #define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
458 #define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
459 #define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
460 #define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
461 #define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
462 #define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
463 #define SNDRV_PCM_IOCTL_USER_PVERSION _IOW('A', 0x04, int)
464 #define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
465 #define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
466 #define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
467 #define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
468 #define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
469 #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
470 #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
471 #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
472 #define SNDRV_PCM_IOCTL_STATUS_EXT _IOWR('A', 0x24, struct snd_pcm_status)
473 #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
474 #define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
475 #define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
476 #define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
477 #define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
478 #define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
479 #define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
480 #define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
481 #define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
482 #define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
483 #define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
484 #define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
485 #define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
486 #define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
487 #define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
488 #define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
489 #define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
490 #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
491 enum {
492   SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
493   SNDRV_RAWMIDI_STREAM_INPUT,
494   SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
495 };
496 #define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
497 #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
498 #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
499 struct snd_rawmidi_info {
500   unsigned int device;
501   unsigned int subdevice;
502   int stream;
503   int card;
504   unsigned int flags;
505   unsigned char id[64];
506   unsigned char name[80];
507   unsigned char subname[32];
508   unsigned int subdevices_count;
509   unsigned int subdevices_avail;
510   unsigned char reserved[64];
511 };
512 struct snd_rawmidi_params {
513   int stream;
514   size_t buffer_size;
515   size_t avail_min;
516   unsigned int no_active_sensing : 1;
517   unsigned char reserved[16];
518 };
519 struct snd_rawmidi_status {
520   int stream;
521   struct timespec tstamp;
522   size_t avail;
523   size_t xruns;
524   unsigned char reserved[16];
525 };
526 #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
527 #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
528 #define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
529 #define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
530 #define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
531 #define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
532 #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
533 enum {
534   SNDRV_TIMER_CLASS_NONE = - 1,
535   SNDRV_TIMER_CLASS_SLAVE = 0,
536   SNDRV_TIMER_CLASS_GLOBAL,
537   SNDRV_TIMER_CLASS_CARD,
538   SNDRV_TIMER_CLASS_PCM,
539   SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
540 };
541 enum {
542   SNDRV_TIMER_SCLASS_NONE = 0,
543   SNDRV_TIMER_SCLASS_APPLICATION,
544   SNDRV_TIMER_SCLASS_SEQUENCER,
545   SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
546   SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
547 };
548 #define SNDRV_TIMER_GLOBAL_SYSTEM 0
549 #define SNDRV_TIMER_GLOBAL_RTC 1
550 #define SNDRV_TIMER_GLOBAL_HPET 2
551 #define SNDRV_TIMER_GLOBAL_HRTIMER 3
552 #define SNDRV_TIMER_FLG_SLAVE (1 << 0)
553 struct snd_timer_id {
554   int dev_class;
555   int dev_sclass;
556   int card;
557   int device;
558   int subdevice;
559 };
560 struct snd_timer_ginfo {
561   struct snd_timer_id tid;
562   unsigned int flags;
563   int card;
564   unsigned char id[64];
565   unsigned char name[80];
566   unsigned long reserved0;
567   unsigned long resolution;
568   unsigned long resolution_min;
569   unsigned long resolution_max;
570   unsigned int clients;
571   unsigned char reserved[32];
572 };
573 struct snd_timer_gparams {
574   struct snd_timer_id tid;
575   unsigned long period_num;
576   unsigned long period_den;
577   unsigned char reserved[32];
578 };
579 struct snd_timer_gstatus {
580   struct snd_timer_id tid;
581   unsigned long resolution;
582   unsigned long resolution_num;
583   unsigned long resolution_den;
584   unsigned char reserved[32];
585 };
586 struct snd_timer_select {
587   struct snd_timer_id id;
588   unsigned char reserved[32];
589 };
590 struct snd_timer_info {
591   unsigned int flags;
592   int card;
593   unsigned char id[64];
594   unsigned char name[80];
595   unsigned long reserved0;
596   unsigned long resolution;
597   unsigned char reserved[64];
598 };
599 #define SNDRV_TIMER_PSFLG_AUTO (1 << 0)
600 #define SNDRV_TIMER_PSFLG_EXCLUSIVE (1 << 1)
601 #define SNDRV_TIMER_PSFLG_EARLY_EVENT (1 << 2)
602 struct snd_timer_params {
603   unsigned int flags;
604   unsigned int ticks;
605   unsigned int queue_size;
606   unsigned int reserved0;
607   unsigned int filter;
608   unsigned char reserved[60];
609 };
610 struct snd_timer_status {
611   struct timespec tstamp;
612   unsigned int resolution;
613   unsigned int lost;
614   unsigned int overrun;
615   unsigned int queue;
616   unsigned char reserved[64];
617 };
618 #define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
619 #define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
620 #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
621 #define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
622 #define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
623 #define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
624 #define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
625 #define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
626 #define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
627 #define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
628 #define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
629 #define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
630 #define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
631 #define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
632 struct snd_timer_read {
633   unsigned int resolution;
634   unsigned int ticks;
635 };
636 enum {
637   SNDRV_TIMER_EVENT_RESOLUTION = 0,
638   SNDRV_TIMER_EVENT_TICK,
639   SNDRV_TIMER_EVENT_START,
640   SNDRV_TIMER_EVENT_STOP,
641   SNDRV_TIMER_EVENT_CONTINUE,
642   SNDRV_TIMER_EVENT_PAUSE,
643   SNDRV_TIMER_EVENT_EARLY,
644   SNDRV_TIMER_EVENT_SUSPEND,
645   SNDRV_TIMER_EVENT_RESUME,
646   SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
647   SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
648   SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
649   SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
650   SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
651   SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
652 };
653 struct snd_timer_tread {
654   int event;
655   struct timespec tstamp;
656   unsigned int val;
657 };
658 #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
659 struct snd_ctl_card_info {
660   int card;
661   int pad;
662   unsigned char id[16];
663   unsigned char driver[16];
664   unsigned char name[32];
665   unsigned char longname[80];
666   unsigned char reserved_[16];
667   unsigned char mixername[80];
668   unsigned char components[128];
669 };
670 typedef int __bitwise snd_ctl_elem_type_t;
671 #define SNDRV_CTL_ELEM_TYPE_NONE ((snd_ctl_elem_type_t) 0)
672 #define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((snd_ctl_elem_type_t) 1)
673 #define SNDRV_CTL_ELEM_TYPE_INTEGER ((snd_ctl_elem_type_t) 2)
674 #define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((snd_ctl_elem_type_t) 3)
675 #define SNDRV_CTL_ELEM_TYPE_BYTES ((snd_ctl_elem_type_t) 4)
676 #define SNDRV_CTL_ELEM_TYPE_IEC958 ((snd_ctl_elem_type_t) 5)
677 #define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((snd_ctl_elem_type_t) 6)
678 #define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
679 typedef int __bitwise snd_ctl_elem_iface_t;
680 #define SNDRV_CTL_ELEM_IFACE_CARD ((snd_ctl_elem_iface_t) 0)
681 #define SNDRV_CTL_ELEM_IFACE_HWDEP ((snd_ctl_elem_iface_t) 1)
682 #define SNDRV_CTL_ELEM_IFACE_MIXER ((snd_ctl_elem_iface_t) 2)
683 #define SNDRV_CTL_ELEM_IFACE_PCM ((snd_ctl_elem_iface_t) 3)
684 #define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((snd_ctl_elem_iface_t) 4)
685 #define SNDRV_CTL_ELEM_IFACE_TIMER ((snd_ctl_elem_iface_t) 5)
686 #define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((snd_ctl_elem_iface_t) 6)
687 #define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
688 #define SNDRV_CTL_ELEM_ACCESS_READ (1 << 0)
689 #define SNDRV_CTL_ELEM_ACCESS_WRITE (1 << 1)
690 #define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE)
691 #define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1 << 2)
692 #define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1 << 3)
693 #define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1 << 4)
694 #define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1 << 5)
695 #define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
696 #define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1 << 6)
697 #define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1 << 8)
698 #define SNDRV_CTL_ELEM_ACCESS_LOCK (1 << 9)
699 #define SNDRV_CTL_ELEM_ACCESS_OWNER (1 << 10)
700 #define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1 << 28)
701 #define SNDRV_CTL_ELEM_ACCESS_USER (1 << 29)
702 #define SNDRV_CTL_POWER_D0 0x0000
703 #define SNDRV_CTL_POWER_D1 0x0100
704 #define SNDRV_CTL_POWER_D2 0x0200
705 #define SNDRV_CTL_POWER_D3 0x0300
706 #define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3 | 0x0000)
707 #define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3 | 0x0001)
708 #define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
709 struct snd_ctl_elem_id {
710   unsigned int numid;
711   snd_ctl_elem_iface_t iface;
712   unsigned int device;
713   unsigned int subdevice;
714   unsigned char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
715   unsigned int index;
716 };
717 struct snd_ctl_elem_list {
718   unsigned int offset;
719   unsigned int space;
720   unsigned int used;
721   unsigned int count;
722   struct snd_ctl_elem_id * pids;
723   unsigned char reserved[50];
724 };
725 struct snd_ctl_elem_info {
726   struct snd_ctl_elem_id id;
727   snd_ctl_elem_type_t type;
728   unsigned int access;
729   unsigned int count;
730   __kernel_pid_t owner;
731   union {
732     struct {
733       long min;
734       long max;
735       long step;
736     } integer;
737     struct {
738       long long min;
739       long long max;
740       long long step;
741     } integer64;
742     struct {
743       unsigned int items;
744       unsigned int item;
745       char name[64];
746       __u64 names_ptr;
747       unsigned int names_length;
748     } enumerated;
749     unsigned char reserved[128];
750   } value;
751   union {
752     unsigned short d[4];
753     unsigned short * d_ptr;
754   } dimen;
755   unsigned char reserved[64 - 4 * sizeof(unsigned short)];
756 };
757 struct snd_ctl_elem_value {
758   struct snd_ctl_elem_id id;
759   unsigned int indirect : 1;
760   union {
761     union {
762       long value[128];
763       long * value_ptr;
764     } integer;
765     union {
766       long long value[64];
767       long long * value_ptr;
768     } integer64;
769     union {
770       unsigned int item[128];
771       unsigned int * item_ptr;
772     } enumerated;
773     union {
774       unsigned char data[512];
775       unsigned char * data_ptr;
776     } bytes;
777     struct snd_aes_iec958 iec958;
778   } value;
779   struct timespec tstamp;
780   unsigned char reserved[128 - sizeof(struct timespec)];
781 };
782 struct snd_ctl_tlv {
783   unsigned int numid;
784   unsigned int length;
785   unsigned int tlv[0];
786 };
787 #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
788 #define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
789 #define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
790 #define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
791 #define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
792 #define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
793 #define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
794 #define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
795 #define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
796 #define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
797 #define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
798 #define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
799 #define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
800 #define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
801 #define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
802 #define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
803 #define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
804 #define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
805 #define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
806 #define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
807 #define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
808 #define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
809 #define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
810 #define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
811 #define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
812 enum sndrv_ctl_event_type {
813   SNDRV_CTL_EVENT_ELEM = 0,
814   SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
815 };
816 #define SNDRV_CTL_EVENT_MASK_VALUE (1 << 0)
817 #define SNDRV_CTL_EVENT_MASK_INFO (1 << 1)
818 #define SNDRV_CTL_EVENT_MASK_ADD (1 << 2)
819 #define SNDRV_CTL_EVENT_MASK_TLV (1 << 3)
820 #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U)
821 struct snd_ctl_event {
822   int type;
823   union {
824     struct {
825       unsigned int mask;
826       struct snd_ctl_elem_id id;
827     } elem;
828     unsigned char data8[60];
829   } data;
830 };
831 #define SNDRV_CTL_NAME_NONE ""
832 #define SNDRV_CTL_NAME_PLAYBACK "Playback "
833 #define SNDRV_CTL_NAME_CAPTURE "Capture "
834 #define SNDRV_CTL_NAME_IEC958_NONE ""
835 #define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
836 #define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
837 #define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
838 #define SNDRV_CTL_NAME_IEC958_MASK "Mask"
839 #define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
840 #define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
841 #define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
842 #define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_ ##direction SNDRV_CTL_NAME_IEC958_ ##what
843 #endif
844