aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/asound.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/asound.h')
-rw-r--r--include/sound/asound.h566
1 files changed, 268 insertions, 298 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 8e552d627fa5..9cc021c7ee11 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -23,12 +23,8 @@
23#ifndef __SOUND_ASOUND_H 23#ifndef __SOUND_ASOUND_H
24#define __SOUND_ASOUND_H 24#define __SOUND_ASOUND_H
25 25
26#if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
27
28#include <linux/ioctl.h>
29
30#ifdef __KERNEL__ 26#ifdef __KERNEL__
31 27#include <linux/ioctl.h>
32#include <linux/types.h> 28#include <linux/types.h>
33#include <linux/time.h> 29#include <linux/time.h>
34#include <asm/byteorder.h> 30#include <asm/byteorder.h>
@@ -43,25 +39,7 @@
43#endif 39#endif
44#endif 40#endif
45 41
46#else /* !__KERNEL__ */ 42#endif /* __KERNEL__ **/
47
48#include <endian.h>
49#if __BYTE_ORDER == __LITTLE_ENDIAN
50#define SNDRV_LITTLE_ENDIAN
51#elif __BYTE_ORDER == __BIG_ENDIAN
52#define SNDRV_BIG_ENDIAN
53#else
54#error "Unsupported endian..."
55#endif
56
57#endif /* __KERNEL **/
58
59#endif /* LINUX */
60
61#ifndef __KERNEL__
62#include <sys/time.h>
63#include <sys/types.h>
64#endif
65 43
66/* 44/*
67 * protocol version 45 * protocol version
@@ -82,7 +60,7 @@
82 * * 60 * *
83 ****************************************************************************/ 61 ****************************************************************************/
84 62
85struct sndrv_aes_iec958 { 63struct snd_aes_iec958 {
86 unsigned char status[24]; /* AES/IEC958 channel status bits */ 64 unsigned char status[24]; /* AES/IEC958 channel status bits */
87 unsigned char subcode[147]; /* AES/IEC958 subcode bits */ 65 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
88 unsigned char pad; /* nothing */ 66 unsigned char pad; /* nothing */
@@ -97,7 +75,7 @@ struct sndrv_aes_iec958 {
97 75
98#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) 76#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
99 77
100enum sndrv_hwdep_iface { 78enum {
101 SNDRV_HWDEP_IFACE_OPL2 = 0, 79 SNDRV_HWDEP_IFACE_OPL2 = 0,
102 SNDRV_HWDEP_IFACE_OPL3, 80 SNDRV_HWDEP_IFACE_OPL3,
103 SNDRV_HWDEP_IFACE_OPL4, 81 SNDRV_HWDEP_IFACE_OPL4,
@@ -119,17 +97,17 @@ enum sndrv_hwdep_iface {
119 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC 97 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC
120}; 98};
121 99
122struct sndrv_hwdep_info { 100struct snd_hwdep_info {
123 unsigned int device; /* WR: device number */ 101 unsigned int device; /* WR: device number */
124 int card; /* R: card number */ 102 int card; /* R: card number */
125 unsigned char id[64]; /* ID (user selectable) */ 103 unsigned char id[64]; /* ID (user selectable) */
126 unsigned char name[80]; /* hwdep name */ 104 unsigned char name[80]; /* hwdep name */
127 enum sndrv_hwdep_iface iface; /* hwdep interface */ 105 int iface; /* hwdep interface */
128 unsigned char reserved[64]; /* reserved for future */ 106 unsigned char reserved[64]; /* reserved for future */
129}; 107};
130 108
131/* generic DSP loader */ 109/* generic DSP loader */
132struct sndrv_hwdep_dsp_status { 110struct snd_hwdep_dsp_status {
133 unsigned int version; /* R: driver-specific version */ 111 unsigned int version; /* R: driver-specific version */
134 unsigned char id[32]; /* R: driver-specific ID string */ 112 unsigned char id[32]; /* R: driver-specific ID string */
135 unsigned int num_dsps; /* R: number of DSP images to transfer */ 113 unsigned int num_dsps; /* R: number of DSP images to transfer */
@@ -138,7 +116,7 @@ struct sndrv_hwdep_dsp_status {
138 unsigned char reserved[16]; /* reserved for future use */ 116 unsigned char reserved[16]; /* reserved for future use */
139}; 117};
140 118
141struct sndrv_hwdep_dsp_image { 119struct snd_hwdep_dsp_image {
142 unsigned int index; /* W: DSP index */ 120 unsigned int index; /* W: DSP index */
143 unsigned char name[64]; /* W: ID (e.g. file name) */ 121 unsigned char name[64]; /* W: ID (e.g. file name) */
144 unsigned char __user *image; /* W: binary image */ 122 unsigned char __user *image; /* W: binary image */
@@ -148,9 +126,9 @@ struct sndrv_hwdep_dsp_image {
148 126
149enum { 127enum {
150 SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int), 128 SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int),
151 SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct sndrv_hwdep_info), 129 SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct snd_hwdep_info),
152 SNDRV_HWDEP_IOCTL_DSP_STATUS = _IOR('H', 0x02, struct sndrv_hwdep_dsp_status), 130 SNDRV_HWDEP_IOCTL_DSP_STATUS = _IOR('H', 0x02, struct snd_hwdep_dsp_status),
153 SNDRV_HWDEP_IOCTL_DSP_LOAD = _IOW('H', 0x03, struct sndrv_hwdep_dsp_image) 131 SNDRV_HWDEP_IOCTL_DSP_LOAD = _IOW('H', 0x03, struct snd_hwdep_dsp_image)
154}; 132};
155 133
156/***************************************************************************** 134/*****************************************************************************
@@ -161,10 +139,10 @@ enum {
161 139
162#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) 140#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
163 141
164typedef unsigned long sndrv_pcm_uframes_t; 142typedef unsigned long snd_pcm_uframes_t;
165typedef long sndrv_pcm_sframes_t; 143typedef signed long snd_pcm_sframes_t;
166 144
167enum sndrv_pcm_class { 145enum {
168 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ 146 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
169 SNDRV_PCM_CLASS_MULTI, /* multichannel device */ 147 SNDRV_PCM_CLASS_MULTI, /* multichannel device */
170 SNDRV_PCM_CLASS_MODEM, /* software modem class */ 148 SNDRV_PCM_CLASS_MODEM, /* software modem class */
@@ -173,97 +151,94 @@ enum sndrv_pcm_class {
173 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, 151 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
174}; 152};
175 153
176enum sndrv_pcm_subclass { 154enum {
177 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */ 155 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
178 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ 156 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
179 /* Don't forget to change the following: */ 157 /* Don't forget to change the following: */
180 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, 158 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
181}; 159};
182 160
183enum sndrv_pcm_stream { 161enum {
184 SNDRV_PCM_STREAM_PLAYBACK = 0, 162 SNDRV_PCM_STREAM_PLAYBACK = 0,
185 SNDRV_PCM_STREAM_CAPTURE, 163 SNDRV_PCM_STREAM_CAPTURE,
186 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, 164 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
187}; 165};
188 166
189enum sndrv_pcm_access { 167typedef int __bitwise snd_pcm_access_t;
190 SNDRV_PCM_ACCESS_MMAP_INTERLEAVED = 0, /* interleaved mmap */ 168#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */
191 SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED, /* noninterleaved mmap */ 169#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */
192 SNDRV_PCM_ACCESS_MMAP_COMPLEX, /* complex mmap */ 170#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */
193 SNDRV_PCM_ACCESS_RW_INTERLEAVED, /* readi/writei */ 171#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */
194 SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, /* readn/writen */ 172#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */
195 SNDRV_PCM_ACCESS_LAST = SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, 173#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
196}; 174
197 175typedef int __bitwise snd_pcm_format_t;
198enum sndrv_pcm_format { 176#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
199 SNDRV_PCM_FORMAT_S8 = 0, 177#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
200 SNDRV_PCM_FORMAT_U8, 178#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
201 SNDRV_PCM_FORMAT_S16_LE, 179#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
202 SNDRV_PCM_FORMAT_S16_BE, 180#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
203 SNDRV_PCM_FORMAT_U16_LE, 181#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
204 SNDRV_PCM_FORMAT_U16_BE, 182#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */
205 SNDRV_PCM_FORMAT_S24_LE, /* low three bytes */ 183#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
206 SNDRV_PCM_FORMAT_S24_BE, /* low three bytes */ 184#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
207 SNDRV_PCM_FORMAT_U24_LE, /* low three bytes */ 185#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
208 SNDRV_PCM_FORMAT_U24_BE, /* low three bytes */ 186#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
209 SNDRV_PCM_FORMAT_S32_LE, 187#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
210 SNDRV_PCM_FORMAT_S32_BE, 188#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
211 SNDRV_PCM_FORMAT_U32_LE, 189#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
212 SNDRV_PCM_FORMAT_U32_BE, 190#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
213 SNDRV_PCM_FORMAT_FLOAT_LE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ 191#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
214 SNDRV_PCM_FORMAT_FLOAT_BE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ 192#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
215 SNDRV_PCM_FORMAT_FLOAT64_LE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ 193#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
216 SNDRV_PCM_FORMAT_FLOAT64_BE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ 194#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
217 SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, /* IEC-958 subframe, Little Endian */ 195#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
218 SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, /* IEC-958 subframe, Big Endian */ 196#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
219 SNDRV_PCM_FORMAT_MU_LAW, 197#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
220 SNDRV_PCM_FORMAT_A_LAW, 198#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
221 SNDRV_PCM_FORMAT_IMA_ADPCM, 199#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
222 SNDRV_PCM_FORMAT_MPEG, 200#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
223 SNDRV_PCM_FORMAT_GSM, 201#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
224 SNDRV_PCM_FORMAT_SPECIAL = 31, 202#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
225 SNDRV_PCM_FORMAT_S24_3LE = 32, /* in three bytes */ 203#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
226 SNDRV_PCM_FORMAT_S24_3BE, /* in three bytes */ 204#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */
227 SNDRV_PCM_FORMAT_U24_3LE, /* in three bytes */ 205#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */
228 SNDRV_PCM_FORMAT_U24_3BE, /* in three bytes */ 206#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */
229 SNDRV_PCM_FORMAT_S20_3LE, /* in three bytes */ 207#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */
230 SNDRV_PCM_FORMAT_S20_3BE, /* in three bytes */ 208#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */
231 SNDRV_PCM_FORMAT_U20_3LE, /* in three bytes */ 209#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */
232 SNDRV_PCM_FORMAT_U20_3BE, /* in three bytes */ 210#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */
233 SNDRV_PCM_FORMAT_S18_3LE, /* in three bytes */ 211#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */
234 SNDRV_PCM_FORMAT_S18_3BE, /* in three bytes */ 212#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */
235 SNDRV_PCM_FORMAT_U18_3LE, /* in three bytes */ 213#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */
236 SNDRV_PCM_FORMAT_U18_3BE, /* in three bytes */ 214#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE
237 SNDRV_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_U18_3BE,
238 215
239#ifdef SNDRV_LITTLE_ENDIAN 216#ifdef SNDRV_LITTLE_ENDIAN
240 SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_LE, 217#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
241 SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_LE, 218#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
242 SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_LE, 219#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
243 SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_LE, 220#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
244 SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_LE, 221#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
245 SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_LE, 222#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
246 SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_LE, 223#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
247 SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_LE, 224#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
248 SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, 225#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
249#endif 226#endif
250#ifdef SNDRV_BIG_ENDIAN 227#ifdef SNDRV_BIG_ENDIAN
251 SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_BE, 228#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
252 SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_BE, 229#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
253 SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_BE, 230#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
254 SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_BE, 231#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
255 SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_BE, 232#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
256 SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_BE, 233#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
257 SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_BE, 234#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
258 SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_BE, 235#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
259 SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, 236#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
260#endif 237#endif
261};
262 238
263enum sndrv_pcm_subformat { 239typedef int __bitwise snd_pcm_subformat_t;
264 SNDRV_PCM_SUBFORMAT_STD = 0, 240#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
265 SNDRV_PCM_SUBFORMAT_LAST = SNDRV_PCM_SUBFORMAT_STD, 241#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
266};
267 242
268#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ 243#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
269#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */ 244#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
@@ -280,18 +255,17 @@ enum sndrv_pcm_subformat {
280#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ 255#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
281#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ 256#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
282 257
283enum sndrv_pcm_state { 258typedef int __bitwise snd_pcm_state_t;
284 SNDRV_PCM_STATE_OPEN = 0, /* stream is open */ 259#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */
285 SNDRV_PCM_STATE_SETUP, /* stream has a setup */ 260#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */
286 SNDRV_PCM_STATE_PREPARED, /* stream is ready to start */ 261#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */
287 SNDRV_PCM_STATE_RUNNING, /* stream is running */ 262#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */
288 SNDRV_PCM_STATE_XRUN, /* stream reached an xrun */ 263#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */
289 SNDRV_PCM_STATE_DRAINING, /* stream is draining */ 264#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */
290 SNDRV_PCM_STATE_PAUSED, /* stream is paused */ 265#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */
291 SNDRV_PCM_STATE_SUSPENDED, /* hardware is suspended */ 266#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */
292 SNDRV_PCM_STATE_DISCONNECTED, /* hardware is disconnected */ 267#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */
293 SNDRV_PCM_STATE_LAST = SNDRV_PCM_STATE_DISCONNECTED, 268#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
294};
295 269
296enum { 270enum {
297 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, 271 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
@@ -299,55 +273,53 @@ enum {
299 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, 273 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
300}; 274};
301 275
302union sndrv_pcm_sync_id { 276union snd_pcm_sync_id {
303 unsigned char id[16]; 277 unsigned char id[16];
304 unsigned short id16[8]; 278 unsigned short id16[8];
305 unsigned int id32[4]; 279 unsigned int id32[4];
306}; 280};
307 281
308struct sndrv_pcm_info { 282struct snd_pcm_info {
309 unsigned int device; /* RO/WR (control): device number */ 283 unsigned int device; /* RO/WR (control): device number */
310 unsigned int subdevice; /* RO/WR (control): subdevice number */ 284 unsigned int subdevice; /* RO/WR (control): subdevice number */
311 enum sndrv_pcm_stream stream; /* RO/WR (control): stream number */ 285 int stream; /* RO/WR (control): stream direction */
312 int card; /* R: card number */ 286 int card; /* R: card number */
313 unsigned char id[64]; /* ID (user selectable) */ 287 unsigned char id[64]; /* ID (user selectable) */
314 unsigned char name[80]; /* name of this device */ 288 unsigned char name[80]; /* name of this device */
315 unsigned char subname[32]; /* subdevice name */ 289 unsigned char subname[32]; /* subdevice name */
316 enum sndrv_pcm_class dev_class; /* SNDRV_PCM_CLASS_* */ 290 int dev_class; /* SNDRV_PCM_CLASS_* */
317 enum sndrv_pcm_subclass dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ 291 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
318 unsigned int subdevices_count; 292 unsigned int subdevices_count;
319 unsigned int subdevices_avail; 293 unsigned int subdevices_avail;
320 union sndrv_pcm_sync_id sync; /* hardware synchronization ID */ 294 union snd_pcm_sync_id sync; /* hardware synchronization ID */
321 unsigned char reserved[64]; /* reserved for future... */ 295 unsigned char reserved[64]; /* reserved for future... */
322}; 296};
323 297
324enum sndrv_pcm_hw_param { 298typedef int __bitwise snd_pcm_hw_param_t;
325 SNDRV_PCM_HW_PARAM_ACCESS = 0, /* Access type */ 299#define SNDRV_PCM_HW_PARAM_ACCESS ((__force snd_pcm_hw_param_t) 0) /* Access type */
326 SNDRV_PCM_HW_PARAM_FIRST_MASK = SNDRV_PCM_HW_PARAM_ACCESS, 300#define SNDRV_PCM_HW_PARAM_FORMAT ((__force snd_pcm_hw_param_t) 1) /* Format */
327 SNDRV_PCM_HW_PARAM_FORMAT, /* Format */ 301#define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */
328 SNDRV_PCM_HW_PARAM_SUBFORMAT, /* Subformat */ 302#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
329 SNDRV_PCM_HW_PARAM_LAST_MASK = SNDRV_PCM_HW_PARAM_SUBFORMAT, 303#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
330 304
331 SNDRV_PCM_HW_PARAM_SAMPLE_BITS = 8, /* Bits per sample */ 305#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */
332 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 306#define SNDRV_PCM_HW_PARAM_FRAME_BITS ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */
333 SNDRV_PCM_HW_PARAM_FRAME_BITS, /* Bits per frame */ 307#define SNDRV_PCM_HW_PARAM_CHANNELS ((__force snd_pcm_hw_param_t) 10) /* Channels */
334 SNDRV_PCM_HW_PARAM_CHANNELS, /* Channels */ 308#define SNDRV_PCM_HW_PARAM_RATE ((__force snd_pcm_hw_param_t) 11) /* Approx rate */
335 SNDRV_PCM_HW_PARAM_RATE, /* Approx rate */ 309#define SNDRV_PCM_HW_PARAM_PERIOD_TIME ((__force snd_pcm_hw_param_t) 12) /* Approx distance between interrupts in us */
336 SNDRV_PCM_HW_PARAM_PERIOD_TIME, /* Approx distance between interrupts 310#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE ((__force snd_pcm_hw_param_t) 13) /* Approx frames between interrupts */
337 in us */ 311#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES ((__force snd_pcm_hw_param_t) 14) /* Approx bytes between interrupts */
338 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, /* Approx frames between interrupts */ 312#define SNDRV_PCM_HW_PARAM_PERIODS ((__force snd_pcm_hw_param_t) 15) /* Approx interrupts per buffer */
339 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, /* Approx bytes between interrupts */ 313#define SNDRV_PCM_HW_PARAM_BUFFER_TIME ((__force snd_pcm_hw_param_t) 16) /* Approx duration of buffer in us */
340 SNDRV_PCM_HW_PARAM_PERIODS, /* Approx interrupts per buffer */ 314#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE ((__force snd_pcm_hw_param_t) 17) /* Size of buffer in frames */
341 SNDRV_PCM_HW_PARAM_BUFFER_TIME, /* Approx duration of buffer in us */ 315#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES ((__force snd_pcm_hw_param_t) 18) /* Size of buffer in bytes */
342 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, /* Size of buffer in frames */ 316#define SNDRV_PCM_HW_PARAM_TICK_TIME ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */
343 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, /* Size of buffer in bytes */ 317#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
344 SNDRV_PCM_HW_PARAM_TICK_TIME, /* Approx tick duration in us */ 318#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
345 SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME
346};
347 319
348#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ 320#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
349 321
350struct sndrv_interval { 322struct snd_interval {
351 unsigned int min, max; 323 unsigned int min, max;
352 unsigned int openmin:1, 324 unsigned int openmin:1,
353 openmax:1, 325 openmax:1,
@@ -357,137 +329,137 @@ struct sndrv_interval {
357 329
358#define SNDRV_MASK_MAX 256 330#define SNDRV_MASK_MAX 256
359 331
360struct sndrv_mask { 332struct snd_mask {
361 u_int32_t bits[(SNDRV_MASK_MAX+31)/32]; 333 u_int32_t bits[(SNDRV_MASK_MAX+31)/32];
362}; 334};
363 335
364struct sndrv_pcm_hw_params { 336struct snd_pcm_hw_params {
365 unsigned int flags; 337 unsigned int flags;
366 struct sndrv_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 338 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
367 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; 339 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
368 struct sndrv_mask mres[5]; /* reserved masks */ 340 struct snd_mask mres[5]; /* reserved masks */
369 struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - 341 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
370 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; 342 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
371 struct sndrv_interval ires[9]; /* reserved intervals */ 343 struct snd_interval ires[9]; /* reserved intervals */
372 unsigned int rmask; /* W: requested masks */ 344 unsigned int rmask; /* W: requested masks */
373 unsigned int cmask; /* R: changed masks */ 345 unsigned int cmask; /* R: changed masks */
374 unsigned int info; /* R: Info flags for returned setup */ 346 unsigned int info; /* R: Info flags for returned setup */
375 unsigned int msbits; /* R: used most significant bits */ 347 unsigned int msbits; /* R: used most significant bits */
376 unsigned int rate_num; /* R: rate numerator */ 348 unsigned int rate_num; /* R: rate numerator */
377 unsigned int rate_den; /* R: rate denominator */ 349 unsigned int rate_den; /* R: rate denominator */
378 sndrv_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ 350 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
379 unsigned char reserved[64]; /* reserved for future */ 351 unsigned char reserved[64]; /* reserved for future */
380}; 352};
381 353
382enum sndrv_pcm_tstamp { 354enum {
383 SNDRV_PCM_TSTAMP_NONE = 0, 355 SNDRV_PCM_TSTAMP_NONE = 0,
384 SNDRV_PCM_TSTAMP_MMAP, 356 SNDRV_PCM_TSTAMP_MMAP,
385 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, 357 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP,
386}; 358};
387 359
388struct sndrv_pcm_sw_params { 360struct snd_pcm_sw_params {
389 enum sndrv_pcm_tstamp tstamp_mode; /* timestamp mode */ 361 int tstamp_mode; /* timestamp mode */
390 unsigned int period_step; 362 unsigned int period_step;
391 unsigned int sleep_min; /* min ticks to sleep */ 363 unsigned int sleep_min; /* min ticks to sleep */
392 sndrv_pcm_uframes_t avail_min; /* min avail frames for wakeup */ 364 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
393 sndrv_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ 365 snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */
394 sndrv_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ 366 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
395 sndrv_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ 367 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
396 sndrv_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ 368 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
397 sndrv_pcm_uframes_t silence_size; /* silence block size */ 369 snd_pcm_uframes_t silence_size; /* silence block size */
398 sndrv_pcm_uframes_t boundary; /* pointers wrap point */ 370 snd_pcm_uframes_t boundary; /* pointers wrap point */
399 unsigned char reserved[64]; /* reserved for future */ 371 unsigned char reserved[64]; /* reserved for future */
400}; 372};
401 373
402struct sndrv_pcm_channel_info { 374struct snd_pcm_channel_info {
403 unsigned int channel; 375 unsigned int channel;
404 off_t offset; /* mmap offset */ 376 off_t offset; /* mmap offset */
405 unsigned int first; /* offset to first sample in bits */ 377 unsigned int first; /* offset to first sample in bits */
406 unsigned int step; /* samples distance in bits */ 378 unsigned int step; /* samples distance in bits */
407}; 379};
408 380
409struct sndrv_pcm_status { 381struct snd_pcm_status {
410 enum sndrv_pcm_state state; /* stream state */ 382 snd_pcm_state_t state; /* stream state */
411 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ 383 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
412 struct timespec tstamp; /* reference timestamp */ 384 struct timespec tstamp; /* reference timestamp */
413 sndrv_pcm_uframes_t appl_ptr; /* appl ptr */ 385 snd_pcm_uframes_t appl_ptr; /* appl ptr */
414 sndrv_pcm_uframes_t hw_ptr; /* hw ptr */ 386 snd_pcm_uframes_t hw_ptr; /* hw ptr */
415 sndrv_pcm_sframes_t delay; /* current delay in frames */ 387 snd_pcm_sframes_t delay; /* current delay in frames */
416 sndrv_pcm_uframes_t avail; /* number of frames available */ 388 snd_pcm_uframes_t avail; /* number of frames available */
417 sndrv_pcm_uframes_t avail_max; /* max frames available on hw since last status */ 389 snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
418 sndrv_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ 390 snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
419 enum sndrv_pcm_state suspended_state; /* suspended stream state */ 391 snd_pcm_state_t suspended_state; /* suspended stream state */
420 unsigned char reserved[60]; /* must be filled with zero */ 392 unsigned char reserved[60]; /* must be filled with zero */
421}; 393};
422 394
423struct sndrv_pcm_mmap_status { 395struct snd_pcm_mmap_status {
424 enum sndrv_pcm_state state; /* RO: state - SNDRV_PCM_STATE_XXXX */ 396 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
425 int pad1; /* Needed for 64 bit alignment */ 397 int pad1; /* Needed for 64 bit alignment */
426 sndrv_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ 398 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
427 struct timespec tstamp; /* Timestamp */ 399 struct timespec tstamp; /* Timestamp */
428 enum sndrv_pcm_state suspended_state; /* RO: suspended stream state */ 400 snd_pcm_state_t suspended_state; /* RO: suspended stream state */
429}; 401};
430 402
431struct sndrv_pcm_mmap_control { 403struct snd_pcm_mmap_control {
432 sndrv_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ 404 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
433 sndrv_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ 405 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
434}; 406};
435 407
436#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ 408#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
437#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */ 409#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
438#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */ 410#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
439 411
440struct sndrv_pcm_sync_ptr { 412struct snd_pcm_sync_ptr {
441 unsigned int flags; 413 unsigned int flags;
442 union { 414 union {
443 struct sndrv_pcm_mmap_status status; 415 struct snd_pcm_mmap_status status;
444 unsigned char reserved[64]; 416 unsigned char reserved[64];
445 } s; 417 } s;
446 union { 418 union {
447 struct sndrv_pcm_mmap_control control; 419 struct snd_pcm_mmap_control control;
448 unsigned char reserved[64]; 420 unsigned char reserved[64];
449 } c; 421 } c;
450}; 422};
451 423
452struct sndrv_xferi { 424struct snd_xferi {
453 sndrv_pcm_sframes_t result; 425 snd_pcm_sframes_t result;
454 void __user *buf; 426 void __user *buf;
455 sndrv_pcm_uframes_t frames; 427 snd_pcm_uframes_t frames;
456}; 428};
457 429
458struct sndrv_xfern { 430struct snd_xfern {
459 sndrv_pcm_sframes_t result; 431 snd_pcm_sframes_t result;
460 void __user * __user *bufs; 432 void __user * __user *bufs;
461 sndrv_pcm_uframes_t frames; 433 snd_pcm_uframes_t frames;
462}; 434};
463 435
464enum { 436enum {
465 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), 437 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
466 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct sndrv_pcm_info), 438 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info),
467 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int), 439 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int),
468 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct sndrv_pcm_hw_params), 440 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params),
469 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct sndrv_pcm_hw_params), 441 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params),
470 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), 442 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
471 SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct sndrv_pcm_sw_params), 443 SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct snd_pcm_sw_params),
472 SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status), 444 SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct snd_pcm_status),
473 SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t), 445 SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, snd_pcm_sframes_t),
474 SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22), 446 SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22),
475 SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct sndrv_pcm_sync_ptr), 447 SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct snd_pcm_sync_ptr),
476 SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info), 448 SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct snd_pcm_channel_info),
477 SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40), 449 SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40),
478 SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41), 450 SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41),
479 SNDRV_PCM_IOCTL_START = _IO('A', 0x42), 451 SNDRV_PCM_IOCTL_START = _IO('A', 0x42),
480 SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43), 452 SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43),
481 SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44), 453 SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44),
482 SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int), 454 SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int),
483 SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, sndrv_pcm_uframes_t), 455 SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, snd_pcm_uframes_t),
484 SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47), 456 SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47),
485 SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48), 457 SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48),
486 SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, sndrv_pcm_uframes_t), 458 SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, snd_pcm_uframes_t),
487 SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct sndrv_xferi), 459 SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct snd_xferi),
488 SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct sndrv_xferi), 460 SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct snd_xferi),
489 SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct sndrv_xfern), 461 SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct snd_xfern),
490 SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct sndrv_xfern), 462 SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct snd_xfern),
491 SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int), 463 SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int),
492 SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61), 464 SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61),
493}; 465};
@@ -507,7 +479,7 @@ enum {
507 479
508#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) 480#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
509 481
510enum sndrv_rawmidi_stream { 482enum {
511 SNDRV_RAWMIDI_STREAM_OUTPUT = 0, 483 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
512 SNDRV_RAWMIDI_STREAM_INPUT, 484 SNDRV_RAWMIDI_STREAM_INPUT,
513 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, 485 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
@@ -517,10 +489,10 @@ enum sndrv_rawmidi_stream {
517#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 489#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
518#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 490#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
519 491
520struct sndrv_rawmidi_info { 492struct snd_rawmidi_info {
521 unsigned int device; /* RO/WR (control): device number */ 493 unsigned int device; /* RO/WR (control): device number */
522 unsigned int subdevice; /* RO/WR (control): subdevice number */ 494 unsigned int subdevice; /* RO/WR (control): subdevice number */
523 enum sndrv_rawmidi_stream stream; /* WR: stream */ 495 int stream; /* WR: stream */
524 int card; /* R: card number */ 496 int card; /* R: card number */
525 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ 497 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
526 unsigned char id[64]; /* ID (user selectable) */ 498 unsigned char id[64]; /* ID (user selectable) */
@@ -531,16 +503,16 @@ struct sndrv_rawmidi_info {
531 unsigned char reserved[64]; /* reserved for future use */ 503 unsigned char reserved[64]; /* reserved for future use */
532}; 504};
533 505
534struct sndrv_rawmidi_params { 506struct snd_rawmidi_params {
535 enum sndrv_rawmidi_stream stream; 507 int stream;
536 size_t buffer_size; /* queue size in bytes */ 508 size_t buffer_size; /* queue size in bytes */
537 size_t avail_min; /* minimum avail bytes for wakeup */ 509 size_t avail_min; /* minimum avail bytes for wakeup */
538 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */ 510 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
539 unsigned char reserved[16]; /* reserved for future use */ 511 unsigned char reserved[16]; /* reserved for future use */
540}; 512};
541 513
542struct sndrv_rawmidi_status { 514struct snd_rawmidi_status {
543 enum sndrv_rawmidi_stream stream; 515 int stream;
544 struct timespec tstamp; /* Timestamp */ 516 struct timespec tstamp; /* Timestamp */
545 size_t avail; /* available bytes */ 517 size_t avail; /* available bytes */
546 size_t xruns; /* count of overruns since last status (in bytes) */ 518 size_t xruns; /* count of overruns since last status (in bytes) */
@@ -549,9 +521,9 @@ struct sndrv_rawmidi_status {
549 521
550enum { 522enum {
551 SNDRV_RAWMIDI_IOCTL_PVERSION = _IOR('W', 0x00, int), 523 SNDRV_RAWMIDI_IOCTL_PVERSION = _IOR('W', 0x00, int),
552 SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct sndrv_rawmidi_info), 524 SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct snd_rawmidi_info),
553 SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct sndrv_rawmidi_params), 525 SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct snd_rawmidi_params),
554 SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct sndrv_rawmidi_status), 526 SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct snd_rawmidi_status),
555 SNDRV_RAWMIDI_IOCTL_DROP = _IOW('W', 0x30, int), 527 SNDRV_RAWMIDI_IOCTL_DROP = _IOW('W', 0x30, int),
556 SNDRV_RAWMIDI_IOCTL_DRAIN = _IOW('W', 0x31, int), 528 SNDRV_RAWMIDI_IOCTL_DRAIN = _IOW('W', 0x31, int),
557}; 529};
@@ -562,7 +534,7 @@ enum {
562 534
563#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) 535#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
564 536
565enum sndrv_timer_class { 537enum {
566 SNDRV_TIMER_CLASS_NONE = -1, 538 SNDRV_TIMER_CLASS_NONE = -1,
567 SNDRV_TIMER_CLASS_SLAVE = 0, 539 SNDRV_TIMER_CLASS_SLAVE = 0,
568 SNDRV_TIMER_CLASS_GLOBAL, 540 SNDRV_TIMER_CLASS_GLOBAL,
@@ -572,7 +544,7 @@ enum sndrv_timer_class {
572}; 544};
573 545
574/* slave timer classes */ 546/* slave timer classes */
575enum sndrv_timer_slave_class { 547enum {
576 SNDRV_TIMER_SCLASS_NONE = 0, 548 SNDRV_TIMER_SCLASS_NONE = 0,
577 SNDRV_TIMER_SCLASS_APPLICATION, 549 SNDRV_TIMER_SCLASS_APPLICATION,
578 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ 550 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
@@ -588,16 +560,16 @@ enum sndrv_timer_slave_class {
588/* info flags */ 560/* info flags */
589#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ 561#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
590 562
591struct sndrv_timer_id { 563struct snd_timer_id {
592 enum sndrv_timer_class dev_class; 564 int dev_class;
593 enum sndrv_timer_slave_class dev_sclass; 565 int dev_sclass;
594 int card; 566 int card;
595 int device; 567 int device;
596 int subdevice; 568 int subdevice;
597}; 569};
598 570
599struct sndrv_timer_ginfo { 571struct snd_timer_ginfo {
600 struct sndrv_timer_id tid; /* requested timer ID */ 572 struct snd_timer_id tid; /* requested timer ID */
601 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ 573 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
602 int card; /* card number */ 574 int card; /* card number */
603 unsigned char id[64]; /* timer identification */ 575 unsigned char id[64]; /* timer identification */
@@ -610,27 +582,27 @@ struct sndrv_timer_ginfo {
610 unsigned char reserved[32]; 582 unsigned char reserved[32];
611}; 583};
612 584
613struct sndrv_timer_gparams { 585struct snd_timer_gparams {
614 struct sndrv_timer_id tid; /* requested timer ID */ 586 struct snd_timer_id tid; /* requested timer ID */
615 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ 587 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
616 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ 588 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
617 unsigned char reserved[32]; 589 unsigned char reserved[32];
618}; 590};
619 591
620struct sndrv_timer_gstatus { 592struct snd_timer_gstatus {
621 struct sndrv_timer_id tid; /* requested timer ID */ 593 struct snd_timer_id tid; /* requested timer ID */
622 unsigned long resolution; /* current period resolution in ns */ 594 unsigned long resolution; /* current period resolution in ns */
623 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ 595 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
624 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ 596 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
625 unsigned char reserved[32]; 597 unsigned char reserved[32];
626}; 598};
627 599
628struct sndrv_timer_select { 600struct snd_timer_select {
629 struct sndrv_timer_id id; /* bind to timer ID */ 601 struct snd_timer_id id; /* bind to timer ID */
630 unsigned char reserved[32]; /* reserved */ 602 unsigned char reserved[32]; /* reserved */
631}; 603};
632 604
633struct sndrv_timer_info { 605struct snd_timer_info {
634 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ 606 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
635 int card; /* card number */ 607 int card; /* card number */
636 unsigned char id[64]; /* timer identificator */ 608 unsigned char id[64]; /* timer identificator */
@@ -644,7 +616,7 @@ struct sndrv_timer_info {
644#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */ 616#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
645#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */ 617#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
646 618
647struct sndrv_timer_params { 619struct snd_timer_params {
648 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ 620 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
649 unsigned int ticks; /* requested resolution in ticks */ 621 unsigned int ticks; /* requested resolution in ticks */
650 unsigned int queue_size; /* total size of queue (32-1024) */ 622 unsigned int queue_size; /* total size of queue (32-1024) */
@@ -653,7 +625,7 @@ struct sndrv_timer_params {
653 unsigned char reserved[60]; /* reserved */ 625 unsigned char reserved[60]; /* reserved */
654}; 626};
655 627
656struct sndrv_timer_status { 628struct snd_timer_status {
657 struct timespec tstamp; /* Timestamp - last update */ 629 struct timespec tstamp; /* Timestamp - last update */
658 unsigned int resolution; /* current period resolution in ns */ 630 unsigned int resolution; /* current period resolution in ns */
659 unsigned int lost; /* counter of master tick lost */ 631 unsigned int lost; /* counter of master tick lost */
@@ -664,15 +636,15 @@ struct sndrv_timer_status {
664 636
665enum { 637enum {
666 SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int), 638 SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int),
667 SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, struct sndrv_timer_id), 639 SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, struct snd_timer_id),
668 SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int), 640 SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int),
669 SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct sndrv_timer_ginfo), 641 SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct snd_timer_ginfo),
670 SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct sndrv_timer_gparams), 642 SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct snd_timer_gparams),
671 SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct sndrv_timer_gstatus), 643 SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct snd_timer_gstatus),
672 SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct sndrv_timer_select), 644 SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct snd_timer_select),
673 SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), 645 SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct snd_timer_info),
674 SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), 646 SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct snd_timer_params),
675 SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), 647 SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct snd_timer_status),
676 /* The following four ioctls are changed since 1.0.9 due to confliction */ 648 /* The following four ioctls are changed since 1.0.9 due to confliction */
677 SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0), 649 SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0),
678 SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1), 650 SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1),
@@ -680,12 +652,12 @@ enum {
680 SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3), 652 SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3),
681}; 653};
682 654
683struct sndrv_timer_read { 655struct snd_timer_read {
684 unsigned int resolution; 656 unsigned int resolution;
685 unsigned int ticks; 657 unsigned int ticks;
686}; 658};
687 659
688enum sndrv_timer_event { 660enum {
689 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ 661 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
690 SNDRV_TIMER_EVENT_TICK, /* val = ticks */ 662 SNDRV_TIMER_EVENT_TICK, /* val = ticks */
691 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ 663 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
@@ -704,8 +676,8 @@ enum sndrv_timer_event {
704 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, 676 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
705}; 677};
706 678
707struct sndrv_timer_tread { 679struct snd_timer_tread {
708 enum sndrv_timer_event event; 680 int event;
709 struct timespec tstamp; 681 struct timespec tstamp;
710 unsigned int val; 682 unsigned int val;
711}; 683};
@@ -718,7 +690,7 @@ struct sndrv_timer_tread {
718 690
719#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) 691#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3)
720 692
721struct sndrv_ctl_card_info { 693struct snd_ctl_card_info {
722 int card; /* card number */ 694 int card; /* card number */
723 int pad; /* reserved for future (was type) */ 695 int pad; /* reserved for future (was type) */
724 unsigned char id[16]; /* ID of card (user selectable) */ 696 unsigned char id[16]; /* ID of card (user selectable) */
@@ -731,27 +703,25 @@ struct sndrv_ctl_card_info {
731 unsigned char reserved[48]; /* reserved for future */ 703 unsigned char reserved[48]; /* reserved for future */
732}; 704};
733 705
734enum sndrv_ctl_elem_type { 706typedef int __bitwise snd_ctl_elem_type_t;
735 SNDRV_CTL_ELEM_TYPE_NONE = 0, /* invalid */ 707#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */
736 SNDRV_CTL_ELEM_TYPE_BOOLEAN, /* boolean type */ 708#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */
737 SNDRV_CTL_ELEM_TYPE_INTEGER, /* integer type */ 709#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */
738 SNDRV_CTL_ELEM_TYPE_ENUMERATED, /* enumerated type */ 710#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */
739 SNDRV_CTL_ELEM_TYPE_BYTES, /* byte array */ 711#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */
740 SNDRV_CTL_ELEM_TYPE_IEC958, /* IEC958 (S/PDIF) setup */ 712#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
741 SNDRV_CTL_ELEM_TYPE_INTEGER64, /* 64-bit integer type */ 713#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */
742 SNDRV_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_INTEGER64, 714#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
743}; 715
744 716typedef int __bitwise snd_ctl_elem_iface_t;
745enum sndrv_ctl_elem_iface { 717#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */
746 SNDRV_CTL_ELEM_IFACE_CARD = 0, /* global control */ 718#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */
747 SNDRV_CTL_ELEM_IFACE_HWDEP, /* hardware dependent device */ 719#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */
748 SNDRV_CTL_ELEM_IFACE_MIXER, /* virtual mixer device */ 720#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */
749 SNDRV_CTL_ELEM_IFACE_PCM, /* PCM device */ 721#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */
750 SNDRV_CTL_ELEM_IFACE_RAWMIDI, /* RawMidi device */ 722#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */
751 SNDRV_CTL_ELEM_IFACE_TIMER, /* timer device */ 723#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */
752 SNDRV_CTL_ELEM_IFACE_SEQUENCER, /* sequencer client */ 724#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
753 SNDRV_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_SEQUENCER,
754};
755 725
756#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0) 726#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
757#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) 727#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
@@ -773,27 +743,27 @@ enum sndrv_ctl_elem_iface {
773#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */ 743#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
774#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */ 744#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
775 745
776struct sndrv_ctl_elem_id { 746struct snd_ctl_elem_id {
777 unsigned int numid; /* numeric identifier, zero = invalid */ 747 unsigned int numid; /* numeric identifier, zero = invalid */
778 enum sndrv_ctl_elem_iface iface; /* interface identifier */ 748 snd_ctl_elem_iface_t iface; /* interface identifier */
779 unsigned int device; /* device/client number */ 749 unsigned int device; /* device/client number */
780 unsigned int subdevice; /* subdevice (substream) number */ 750 unsigned int subdevice; /* subdevice (substream) number */
781 unsigned char name[44]; /* ASCII name of item */ 751 unsigned char name[44]; /* ASCII name of item */
782 unsigned int index; /* index of item */ 752 unsigned int index; /* index of item */
783}; 753};
784 754
785struct sndrv_ctl_elem_list { 755struct snd_ctl_elem_list {
786 unsigned int offset; /* W: first element ID to get */ 756 unsigned int offset; /* W: first element ID to get */
787 unsigned int space; /* W: count of element IDs to get */ 757 unsigned int space; /* W: count of element IDs to get */
788 unsigned int used; /* R: count of element IDs set */ 758 unsigned int used; /* R: count of element IDs set */
789 unsigned int count; /* R: count of all elements */ 759 unsigned int count; /* R: count of all elements */
790 struct sndrv_ctl_elem_id __user *pids; /* R: IDs */ 760 struct snd_ctl_elem_id __user *pids; /* R: IDs */
791 unsigned char reserved[50]; 761 unsigned char reserved[50];
792}; 762};
793 763
794struct sndrv_ctl_elem_info { 764struct snd_ctl_elem_info {
795 struct sndrv_ctl_elem_id id; /* W: element ID */ 765 struct snd_ctl_elem_id id; /* W: element ID */
796 enum sndrv_ctl_elem_type type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ 766 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
797 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ 767 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
798 unsigned int count; /* count of values */ 768 unsigned int count; /* count of values */
799 pid_t owner; /* owner's PID of this control */ 769 pid_t owner; /* owner's PID of this control */
@@ -822,8 +792,8 @@ struct sndrv_ctl_elem_info {
822 unsigned char reserved[64-4*sizeof(unsigned short)]; 792 unsigned char reserved[64-4*sizeof(unsigned short)];
823}; 793};
824 794
825struct sndrv_ctl_elem_value { 795struct snd_ctl_elem_value {
826 struct sndrv_ctl_elem_id id; /* W: element ID */ 796 struct snd_ctl_elem_id id; /* W: element ID */
827 unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ 797 unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */
828 union { 798 union {
829 union { 799 union {
@@ -842,7 +812,7 @@ struct sndrv_ctl_elem_value {
842 unsigned char data[512]; 812 unsigned char data[512];
843 unsigned char *data_ptr; 813 unsigned char *data_ptr;
844 } bytes; 814 } bytes;
845 struct sndrv_aes_iec958 iec958; 815 struct snd_aes_iec958 iec958;
846 } value; /* RO */ 816 } value; /* RO */
847 struct timespec tstamp; 817 struct timespec tstamp;
848 unsigned char reserved[128-sizeof(struct timespec)]; 818 unsigned char reserved[128-sizeof(struct timespec)];
@@ -850,24 +820,24 @@ struct sndrv_ctl_elem_value {
850 820
851enum { 821enum {
852 SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int), 822 SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int),
853 SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct sndrv_ctl_card_info), 823 SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct snd_ctl_card_info),
854 SNDRV_CTL_IOCTL_ELEM_LIST = _IOWR('U', 0x10, struct sndrv_ctl_elem_list), 824 SNDRV_CTL_IOCTL_ELEM_LIST = _IOWR('U', 0x10, struct snd_ctl_elem_list),
855 SNDRV_CTL_IOCTL_ELEM_INFO = _IOWR('U', 0x11, struct sndrv_ctl_elem_info), 825 SNDRV_CTL_IOCTL_ELEM_INFO = _IOWR('U', 0x11, struct snd_ctl_elem_info),
856 SNDRV_CTL_IOCTL_ELEM_READ = _IOWR('U', 0x12, struct sndrv_ctl_elem_value), 826 SNDRV_CTL_IOCTL_ELEM_READ = _IOWR('U', 0x12, struct snd_ctl_elem_value),
857 SNDRV_CTL_IOCTL_ELEM_WRITE = _IOWR('U', 0x13, struct sndrv_ctl_elem_value), 827 SNDRV_CTL_IOCTL_ELEM_WRITE = _IOWR('U', 0x13, struct snd_ctl_elem_value),
858 SNDRV_CTL_IOCTL_ELEM_LOCK = _IOW('U', 0x14, struct sndrv_ctl_elem_id), 828 SNDRV_CTL_IOCTL_ELEM_LOCK = _IOW('U', 0x14, struct snd_ctl_elem_id),
859 SNDRV_CTL_IOCTL_ELEM_UNLOCK = _IOW('U', 0x15, struct sndrv_ctl_elem_id), 829 SNDRV_CTL_IOCTL_ELEM_UNLOCK = _IOW('U', 0x15, struct snd_ctl_elem_id),
860 SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int), 830 SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int),
861 SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct sndrv_ctl_elem_info), 831 SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct snd_ctl_elem_info),
862 SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct sndrv_ctl_elem_info), 832 SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct snd_ctl_elem_info),
863 SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct sndrv_ctl_elem_id), 833 SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct snd_ctl_elem_id),
864 SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int), 834 SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int),
865 SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct sndrv_hwdep_info), 835 SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct snd_hwdep_info),
866 SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int), 836 SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int),
867 SNDRV_CTL_IOCTL_PCM_INFO = _IOWR('U', 0x31, struct sndrv_pcm_info), 837 SNDRV_CTL_IOCTL_PCM_INFO = _IOWR('U', 0x31, struct snd_pcm_info),
868 SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE = _IOW('U', 0x32, int), 838 SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE = _IOW('U', 0x32, int),
869 SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE = _IOWR('U', 0x40, int), 839 SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE = _IOWR('U', 0x40, int),
870 SNDRV_CTL_IOCTL_RAWMIDI_INFO = _IOWR('U', 0x41, struct sndrv_rawmidi_info), 840 SNDRV_CTL_IOCTL_RAWMIDI_INFO = _IOWR('U', 0x41, struct snd_rawmidi_info),
871 SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int), 841 SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int),
872 SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int), 842 SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int),
873 SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int), 843 SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int),
@@ -887,12 +857,12 @@ enum sndrv_ctl_event_type {
887#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ 857#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
888#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ 858#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
889 859
890struct sndrv_ctl_event { 860struct snd_ctl_event {
891 enum sndrv_ctl_event_type type; /* event type - SNDRV_CTL_EVENT_* */ 861 int type; /* event type - SNDRV_CTL_EVENT_* */
892 union { 862 union {
893 struct { 863 struct {
894 unsigned int mask; 864 unsigned int mask;
895 struct sndrv_ctl_elem_id id; 865 struct snd_ctl_elem_id id;
896 } elem; 866 } elem;
897 unsigned char data8[60]; 867 unsigned char data8[60];
898 } data; 868 } data;
@@ -920,14 +890,14 @@ struct sndrv_ctl_event {
920 * 890 *
921 */ 891 */
922 892
923struct sndrv_xferv { 893struct snd_xferv {
924 const struct iovec *vector; 894 const struct iovec *vector;
925 unsigned long count; 895 unsigned long count;
926}; 896};
927 897
928enum { 898enum {
929 SNDRV_IOCTL_READV = _IOW('K', 0x00, struct sndrv_xferv), 899 SNDRV_IOCTL_READV = _IOW('K', 0x00, struct snd_xferv),
930 SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct sndrv_xferv), 900 SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct snd_xferv),
931}; 901};
932 902
933#endif /* __SOUND_ASOUND_H */ 903#endif /* __SOUND_ASOUND_H */