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