diff options
-rw-r--r-- | include/sound/asound.h | 540 | ||||
-rw-r--r-- | include/sound/core.h | 199 | ||||
-rw-r--r-- | sound/core/device.c | 42 | ||||
-rw-r--r-- | sound/core/init.c | 86 | ||||
-rw-r--r-- | sound/core/sound.c | 32 |
5 files changed, 432 insertions, 467 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h index 1389704d8d6..9cc021c7ee1 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -60,7 +60,7 @@ | |||
60 | * * | 60 | * * |
61 | ****************************************************************************/ | 61 | ****************************************************************************/ |
62 | 62 | ||
63 | struct sndrv_aes_iec958 { | 63 | struct snd_aes_iec958 { |
64 | unsigned char status[24]; /* AES/IEC958 channel status bits */ | 64 | unsigned char status[24]; /* AES/IEC958 channel status bits */ |
65 | unsigned char subcode[147]; /* AES/IEC958 subcode bits */ | 65 | unsigned char subcode[147]; /* AES/IEC958 subcode bits */ |
66 | unsigned char pad; /* nothing */ | 66 | unsigned char pad; /* nothing */ |
@@ -75,7 +75,7 @@ struct sndrv_aes_iec958 { | |||
75 | 75 | ||
76 | #define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) | 76 | #define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) |
77 | 77 | ||
78 | enum sndrv_hwdep_iface { | 78 | enum { |
79 | SNDRV_HWDEP_IFACE_OPL2 = 0, | 79 | SNDRV_HWDEP_IFACE_OPL2 = 0, |
80 | SNDRV_HWDEP_IFACE_OPL3, | 80 | SNDRV_HWDEP_IFACE_OPL3, |
81 | SNDRV_HWDEP_IFACE_OPL4, | 81 | SNDRV_HWDEP_IFACE_OPL4, |
@@ -97,17 +97,17 @@ enum sndrv_hwdep_iface { | |||
97 | SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC | 97 | SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC |
98 | }; | 98 | }; |
99 | 99 | ||
100 | struct sndrv_hwdep_info { | 100 | struct snd_hwdep_info { |
101 | unsigned int device; /* WR: device number */ | 101 | unsigned int device; /* WR: device number */ |
102 | int card; /* R: card number */ | 102 | int card; /* R: card number */ |
103 | unsigned char id[64]; /* ID (user selectable) */ | 103 | unsigned char id[64]; /* ID (user selectable) */ |
104 | unsigned char name[80]; /* hwdep name */ | 104 | unsigned char name[80]; /* hwdep name */ |
105 | enum sndrv_hwdep_iface iface; /* hwdep interface */ | 105 | int iface; /* hwdep interface */ |
106 | unsigned char reserved[64]; /* reserved for future */ | 106 | unsigned char reserved[64]; /* reserved for future */ |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /* generic DSP loader */ | 109 | /* generic DSP loader */ |
110 | struct sndrv_hwdep_dsp_status { | 110 | struct snd_hwdep_dsp_status { |
111 | unsigned int version; /* R: driver-specific version */ | 111 | unsigned int version; /* R: driver-specific version */ |
112 | unsigned char id[32]; /* R: driver-specific ID string */ | 112 | unsigned char id[32]; /* R: driver-specific ID string */ |
113 | unsigned int num_dsps; /* R: number of DSP images to transfer */ | 113 | unsigned int num_dsps; /* R: number of DSP images to transfer */ |
@@ -116,7 +116,7 @@ struct sndrv_hwdep_dsp_status { | |||
116 | unsigned char reserved[16]; /* reserved for future use */ | 116 | unsigned char reserved[16]; /* reserved for future use */ |
117 | }; | 117 | }; |
118 | 118 | ||
119 | struct sndrv_hwdep_dsp_image { | 119 | struct snd_hwdep_dsp_image { |
120 | unsigned int index; /* W: DSP index */ | 120 | unsigned int index; /* W: DSP index */ |
121 | unsigned char name[64]; /* W: ID (e.g. file name) */ | 121 | unsigned char name[64]; /* W: ID (e.g. file name) */ |
122 | unsigned char __user *image; /* W: binary image */ | 122 | unsigned char __user *image; /* W: binary image */ |
@@ -126,9 +126,9 @@ struct sndrv_hwdep_dsp_image { | |||
126 | 126 | ||
127 | enum { | 127 | enum { |
128 | SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int), | 128 | SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int), |
129 | SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct sndrv_hwdep_info), | 129 | SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct snd_hwdep_info), |
130 | 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), |
131 | 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) |
132 | }; | 132 | }; |
133 | 133 | ||
134 | /***************************************************************************** | 134 | /***************************************************************************** |
@@ -139,10 +139,10 @@ enum { | |||
139 | 139 | ||
140 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) | 140 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) |
141 | 141 | ||
142 | typedef unsigned long sndrv_pcm_uframes_t; | 142 | typedef unsigned long snd_pcm_uframes_t; |
143 | typedef long sndrv_pcm_sframes_t; | 143 | typedef signed long snd_pcm_sframes_t; |
144 | 144 | ||
145 | enum sndrv_pcm_class { | 145 | enum { |
146 | SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ | 146 | SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ |
147 | SNDRV_PCM_CLASS_MULTI, /* multichannel device */ | 147 | SNDRV_PCM_CLASS_MULTI, /* multichannel device */ |
148 | SNDRV_PCM_CLASS_MODEM, /* software modem class */ | 148 | SNDRV_PCM_CLASS_MODEM, /* software modem class */ |
@@ -151,97 +151,94 @@ enum sndrv_pcm_class { | |||
151 | SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, | 151 | SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, |
152 | }; | 152 | }; |
153 | 153 | ||
154 | enum sndrv_pcm_subclass { | 154 | enum { |
155 | 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 */ |
156 | SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ | 156 | SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ |
157 | /* Don't forget to change the following: */ | 157 | /* Don't forget to change the following: */ |
158 | SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, | 158 | SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, |
159 | }; | 159 | }; |
160 | 160 | ||
161 | enum sndrv_pcm_stream { | 161 | enum { |
162 | SNDRV_PCM_STREAM_PLAYBACK = 0, | 162 | SNDRV_PCM_STREAM_PLAYBACK = 0, |
163 | SNDRV_PCM_STREAM_CAPTURE, | 163 | SNDRV_PCM_STREAM_CAPTURE, |
164 | SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, | 164 | SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, |
165 | }; | 165 | }; |
166 | 166 | ||
167 | enum sndrv_pcm_access { | 167 | typedef int __bitwise snd_pcm_access_t; |
168 | SNDRV_PCM_ACCESS_MMAP_INTERLEAVED = 0, /* interleaved mmap */ | 168 | #define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */ |
169 | SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED, /* noninterleaved mmap */ | 169 | #define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */ |
170 | SNDRV_PCM_ACCESS_MMAP_COMPLEX, /* complex mmap */ | 170 | #define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */ |
171 | SNDRV_PCM_ACCESS_RW_INTERLEAVED, /* readi/writei */ | 171 | #define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */ |
172 | SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, /* readn/writen */ | 172 | #define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */ |
173 | SNDRV_PCM_ACCESS_LAST = SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, | 173 | #define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED |
174 | }; | 174 | |
175 | 175 | typedef int __bitwise snd_pcm_format_t; | |
176 | enum sndrv_pcm_format { | 176 | #define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0) |
177 | SNDRV_PCM_FORMAT_S8 = 0, | 177 | #define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1) |
178 | SNDRV_PCM_FORMAT_U8, | 178 | #define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2) |
179 | SNDRV_PCM_FORMAT_S16_LE, | 179 | #define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3) |
180 | SNDRV_PCM_FORMAT_S16_BE, | 180 | #define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4) |
181 | SNDRV_PCM_FORMAT_U16_LE, | 181 | #define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5) |
182 | SNDRV_PCM_FORMAT_U16_BE, | 182 | #define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */ |
183 | SNDRV_PCM_FORMAT_S24_LE, /* low three bytes */ | 183 | #define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */ |
184 | SNDRV_PCM_FORMAT_S24_BE, /* low three bytes */ | 184 | #define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */ |
185 | SNDRV_PCM_FORMAT_U24_LE, /* low three bytes */ | 185 | #define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */ |
186 | SNDRV_PCM_FORMAT_U24_BE, /* low three bytes */ | 186 | #define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10) |
187 | SNDRV_PCM_FORMAT_S32_LE, | 187 | #define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11) |
188 | SNDRV_PCM_FORMAT_S32_BE, | 188 | #define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12) |
189 | SNDRV_PCM_FORMAT_U32_LE, | 189 | #define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13) |
190 | 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 */ |
191 | 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 */ |
192 | 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 */ |
193 | 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 */ |
194 | 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 */ |
195 | 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 */ |
196 | SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, /* IEC-958 subframe, Big Endian */ | 196 | #define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20) |
197 | SNDRV_PCM_FORMAT_MU_LAW, | 197 | #define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21) |
198 | SNDRV_PCM_FORMAT_A_LAW, | 198 | #define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22) |
199 | SNDRV_PCM_FORMAT_IMA_ADPCM, | 199 | #define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23) |
200 | SNDRV_PCM_FORMAT_MPEG, | 200 | #define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24) |
201 | SNDRV_PCM_FORMAT_GSM, | 201 | #define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31) |
202 | SNDRV_PCM_FORMAT_SPECIAL = 31, | 202 | #define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */ |
203 | 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 */ |
204 | SNDRV_PCM_FORMAT_S24_3BE, /* in three bytes */ | 204 | #define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */ |
205 | SNDRV_PCM_FORMAT_U24_3LE, /* in three bytes */ | 205 | #define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */ |
206 | SNDRV_PCM_FORMAT_U24_3BE, /* in three bytes */ | 206 | #define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */ |
207 | SNDRV_PCM_FORMAT_S20_3LE, /* in three bytes */ | 207 | #define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */ |
208 | SNDRV_PCM_FORMAT_S20_3BE, /* in three bytes */ | 208 | #define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */ |
209 | SNDRV_PCM_FORMAT_U20_3LE, /* in three bytes */ | 209 | #define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */ |
210 | SNDRV_PCM_FORMAT_U20_3BE, /* in three bytes */ | 210 | #define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */ |
211 | SNDRV_PCM_FORMAT_S18_3LE, /* in three bytes */ | 211 | #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ |
212 | SNDRV_PCM_FORMAT_S18_3BE, /* in three bytes */ | 212 | #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ |
213 | SNDRV_PCM_FORMAT_U18_3LE, /* in three bytes */ | 213 | #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ |
214 | SNDRV_PCM_FORMAT_U18_3BE, /* in three bytes */ | 214 | #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE |
215 | SNDRV_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_U18_3BE, | ||
216 | 215 | ||
217 | #ifdef SNDRV_LITTLE_ENDIAN | 216 | #ifdef SNDRV_LITTLE_ENDIAN |
218 | SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_LE, | 217 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE |
219 | SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_LE, | 218 | #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE |
220 | SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_LE, | 219 | #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE |
221 | SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_LE, | 220 | #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE |
222 | SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_LE, | 221 | #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE |
223 | SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_LE, | 222 | #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE |
224 | SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_LE, | 223 | #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE |
225 | SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_LE, | 224 | #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE |
226 | SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, | 225 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE |
227 | #endif | 226 | #endif |
228 | #ifdef SNDRV_BIG_ENDIAN | 227 | #ifdef SNDRV_BIG_ENDIAN |
229 | SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_BE, | 228 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE |
230 | SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_BE, | 229 | #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE |
231 | SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_BE, | 230 | #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE |
232 | SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_BE, | 231 | #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE |
233 | SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_BE, | 232 | #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE |
234 | SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_BE, | 233 | #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE |
235 | SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_BE, | 234 | #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE |
236 | SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_BE, | 235 | #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE |
237 | SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, | 236 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE |
238 | #endif | 237 | #endif |
239 | }; | ||
240 | 238 | ||
241 | enum sndrv_pcm_subformat { | 239 | typedef int __bitwise snd_pcm_subformat_t; |
242 | SNDRV_PCM_SUBFORMAT_STD = 0, | 240 | #define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0) |
243 | SNDRV_PCM_SUBFORMAT_LAST = SNDRV_PCM_SUBFORMAT_STD, | 241 | #define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD |
244 | }; | ||
245 | 242 | ||
246 | #define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ | 243 | #define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ |
247 | #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 */ |
@@ -258,18 +255,17 @@ enum sndrv_pcm_subformat { | |||
258 | #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 */ |
259 | #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 */ |
260 | 257 | ||
261 | enum sndrv_pcm_state { | 258 | typedef int __bitwise snd_pcm_state_t; |
262 | SNDRV_PCM_STATE_OPEN = 0, /* stream is open */ | 259 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ |
263 | SNDRV_PCM_STATE_SETUP, /* stream has a setup */ | 260 | #define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */ |
264 | 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 */ |
265 | SNDRV_PCM_STATE_RUNNING, /* stream is running */ | 262 | #define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */ |
266 | SNDRV_PCM_STATE_XRUN, /* stream reached an xrun */ | 263 | #define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */ |
267 | SNDRV_PCM_STATE_DRAINING, /* stream is draining */ | 264 | #define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */ |
268 | SNDRV_PCM_STATE_PAUSED, /* stream is paused */ | 265 | #define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */ |
269 | SNDRV_PCM_STATE_SUSPENDED, /* hardware is suspended */ | 266 | #define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */ |
270 | SNDRV_PCM_STATE_DISCONNECTED, /* hardware is disconnected */ | 267 | #define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */ |
271 | SNDRV_PCM_STATE_LAST = SNDRV_PCM_STATE_DISCONNECTED, | 268 | #define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED |
272 | }; | ||
273 | 269 | ||
274 | enum { | 270 | enum { |
275 | SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, | 271 | SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, |
@@ -277,55 +273,53 @@ enum { | |||
277 | SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, | 273 | SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, |
278 | }; | 274 | }; |
279 | 275 | ||
280 | union sndrv_pcm_sync_id { | 276 | union snd_pcm_sync_id { |
281 | unsigned char id[16]; | 277 | unsigned char id[16]; |
282 | unsigned short id16[8]; | 278 | unsigned short id16[8]; |
283 | unsigned int id32[4]; | 279 | unsigned int id32[4]; |
284 | }; | 280 | }; |
285 | 281 | ||
286 | struct sndrv_pcm_info { | 282 | struct snd_pcm_info { |
287 | unsigned int device; /* RO/WR (control): device number */ | 283 | unsigned int device; /* RO/WR (control): device number */ |
288 | unsigned int subdevice; /* RO/WR (control): subdevice number */ | 284 | unsigned int subdevice; /* RO/WR (control): subdevice number */ |
289 | enum sndrv_pcm_stream stream; /* RO/WR (control): stream number */ | 285 | int stream; /* RO/WR (control): stream direction */ |
290 | int card; /* R: card number */ | 286 | int card; /* R: card number */ |
291 | unsigned char id[64]; /* ID (user selectable) */ | 287 | unsigned char id[64]; /* ID (user selectable) */ |
292 | unsigned char name[80]; /* name of this device */ | 288 | unsigned char name[80]; /* name of this device */ |
293 | unsigned char subname[32]; /* subdevice name */ | 289 | unsigned char subname[32]; /* subdevice name */ |
294 | enum sndrv_pcm_class dev_class; /* SNDRV_PCM_CLASS_* */ | 290 | int dev_class; /* SNDRV_PCM_CLASS_* */ |
295 | enum sndrv_pcm_subclass dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ | 291 | int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ |
296 | unsigned int subdevices_count; | 292 | unsigned int subdevices_count; |
297 | unsigned int subdevices_avail; | 293 | unsigned int subdevices_avail; |
298 | union sndrv_pcm_sync_id sync; /* hardware synchronization ID */ | 294 | union snd_pcm_sync_id sync; /* hardware synchronization ID */ |
299 | unsigned char reserved[64]; /* reserved for future... */ | 295 | unsigned char reserved[64]; /* reserved for future... */ |
300 | }; | 296 | }; |
301 | 297 | ||
302 | enum sndrv_pcm_hw_param { | 298 | typedef int __bitwise snd_pcm_hw_param_t; |
303 | SNDRV_PCM_HW_PARAM_ACCESS = 0, /* Access type */ | 299 | #define SNDRV_PCM_HW_PARAM_ACCESS ((__force snd_pcm_hw_param_t) 0) /* Access type */ |
304 | 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 */ |
305 | SNDRV_PCM_HW_PARAM_FORMAT, /* Format */ | 301 | #define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */ |
306 | SNDRV_PCM_HW_PARAM_SUBFORMAT, /* Subformat */ | 302 | #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS |
307 | SNDRV_PCM_HW_PARAM_LAST_MASK = SNDRV_PCM_HW_PARAM_SUBFORMAT, | 303 | #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT |
308 | 304 | ||
309 | 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 */ |
310 | 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 */ |
311 | SNDRV_PCM_HW_PARAM_FRAME_BITS, /* Bits per frame */ | 307 | #define SNDRV_PCM_HW_PARAM_CHANNELS ((__force snd_pcm_hw_param_t) 10) /* Channels */ |
312 | SNDRV_PCM_HW_PARAM_CHANNELS, /* Channels */ | 308 | #define SNDRV_PCM_HW_PARAM_RATE ((__force snd_pcm_hw_param_t) 11) /* Approx rate */ |
313 | 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 */ |
314 | 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 */ |
315 | in us */ | 311 | #define SNDRV_PCM_HW_PARAM_PERIOD_BYTES ((__force snd_pcm_hw_param_t) 14) /* Approx bytes between interrupts */ |
316 | 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 */ |
317 | 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 */ |
318 | 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 */ |
319 | 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 */ |
320 | 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 */ |
321 | 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 |
322 | 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 |
323 | SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME | ||
324 | }; | ||
325 | 319 | ||
326 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ | 320 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ |
327 | 321 | ||
328 | struct sndrv_interval { | 322 | struct snd_interval { |
329 | unsigned int min, max; | 323 | unsigned int min, max; |
330 | unsigned int openmin:1, | 324 | unsigned int openmin:1, |
331 | openmax:1, | 325 | openmax:1, |
@@ -335,137 +329,137 @@ struct sndrv_interval { | |||
335 | 329 | ||
336 | #define SNDRV_MASK_MAX 256 | 330 | #define SNDRV_MASK_MAX 256 |
337 | 331 | ||
338 | struct sndrv_mask { | 332 | struct snd_mask { |
339 | u_int32_t bits[(SNDRV_MASK_MAX+31)/32]; | 333 | u_int32_t bits[(SNDRV_MASK_MAX+31)/32]; |
340 | }; | 334 | }; |
341 | 335 | ||
342 | struct sndrv_pcm_hw_params { | 336 | struct snd_pcm_hw_params { |
343 | unsigned int flags; | 337 | unsigned int flags; |
344 | struct sndrv_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - | 338 | struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - |
345 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; | 339 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; |
346 | struct sndrv_mask mres[5]; /* reserved masks */ | 340 | struct snd_mask mres[5]; /* reserved masks */ |
347 | struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - | 341 | struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - |
348 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; | 342 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; |
349 | struct sndrv_interval ires[9]; /* reserved intervals */ | 343 | struct snd_interval ires[9]; /* reserved intervals */ |
350 | unsigned int rmask; /* W: requested masks */ | 344 | unsigned int rmask; /* W: requested masks */ |
351 | unsigned int cmask; /* R: changed masks */ | 345 | unsigned int cmask; /* R: changed masks */ |
352 | unsigned int info; /* R: Info flags for returned setup */ | 346 | unsigned int info; /* R: Info flags for returned setup */ |
353 | unsigned int msbits; /* R: used most significant bits */ | 347 | unsigned int msbits; /* R: used most significant bits */ |
354 | unsigned int rate_num; /* R: rate numerator */ | 348 | unsigned int rate_num; /* R: rate numerator */ |
355 | unsigned int rate_den; /* R: rate denominator */ | 349 | unsigned int rate_den; /* R: rate denominator */ |
356 | 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 */ |
357 | unsigned char reserved[64]; /* reserved for future */ | 351 | unsigned char reserved[64]; /* reserved for future */ |
358 | }; | 352 | }; |
359 | 353 | ||
360 | enum sndrv_pcm_tstamp { | 354 | enum { |
361 | SNDRV_PCM_TSTAMP_NONE = 0, | 355 | SNDRV_PCM_TSTAMP_NONE = 0, |
362 | SNDRV_PCM_TSTAMP_MMAP, | 356 | SNDRV_PCM_TSTAMP_MMAP, |
363 | SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, | 357 | SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, |
364 | }; | 358 | }; |
365 | 359 | ||
366 | struct sndrv_pcm_sw_params { | 360 | struct snd_pcm_sw_params { |
367 | enum sndrv_pcm_tstamp tstamp_mode; /* timestamp mode */ | 361 | int tstamp_mode; /* timestamp mode */ |
368 | unsigned int period_step; | 362 | unsigned int period_step; |
369 | unsigned int sleep_min; /* min ticks to sleep */ | 363 | unsigned int sleep_min; /* min ticks to sleep */ |
370 | sndrv_pcm_uframes_t avail_min; /* min avail frames for wakeup */ | 364 | snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */ |
371 | 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 */ |
372 | 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 */ |
373 | 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 */ |
374 | 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 */ |
375 | sndrv_pcm_uframes_t silence_size; /* silence block size */ | 369 | snd_pcm_uframes_t silence_size; /* silence block size */ |
376 | sndrv_pcm_uframes_t boundary; /* pointers wrap point */ | 370 | snd_pcm_uframes_t boundary; /* pointers wrap point */ |
377 | unsigned char reserved[64]; /* reserved for future */ | 371 | unsigned char reserved[64]; /* reserved for future */ |
378 | }; | 372 | }; |
379 | 373 | ||
380 | struct sndrv_pcm_channel_info { | 374 | struct snd_pcm_channel_info { |
381 | unsigned int channel; | 375 | unsigned int channel; |
382 | off_t offset; /* mmap offset */ | 376 | off_t offset; /* mmap offset */ |
383 | unsigned int first; /* offset to first sample in bits */ | 377 | unsigned int first; /* offset to first sample in bits */ |
384 | unsigned int step; /* samples distance in bits */ | 378 | unsigned int step; /* samples distance in bits */ |
385 | }; | 379 | }; |
386 | 380 | ||
387 | struct sndrv_pcm_status { | 381 | struct snd_pcm_status { |
388 | enum sndrv_pcm_state state; /* stream state */ | 382 | snd_pcm_state_t state; /* stream state */ |
389 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ | 383 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ |
390 | struct timespec tstamp; /* reference timestamp */ | 384 | struct timespec tstamp; /* reference timestamp */ |
391 | sndrv_pcm_uframes_t appl_ptr; /* appl ptr */ | 385 | snd_pcm_uframes_t appl_ptr; /* appl ptr */ |
392 | sndrv_pcm_uframes_t hw_ptr; /* hw ptr */ | 386 | snd_pcm_uframes_t hw_ptr; /* hw ptr */ |
393 | sndrv_pcm_sframes_t delay; /* current delay in frames */ | 387 | snd_pcm_sframes_t delay; /* current delay in frames */ |
394 | sndrv_pcm_uframes_t avail; /* number of frames available */ | 388 | snd_pcm_uframes_t avail; /* number of frames available */ |
395 | 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 */ |
396 | 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 */ |
397 | enum sndrv_pcm_state suspended_state; /* suspended stream state */ | 391 | snd_pcm_state_t suspended_state; /* suspended stream state */ |
398 | unsigned char reserved[60]; /* must be filled with zero */ | 392 | unsigned char reserved[60]; /* must be filled with zero */ |
399 | }; | 393 | }; |
400 | 394 | ||
401 | struct sndrv_pcm_mmap_status { | 395 | struct snd_pcm_mmap_status { |
402 | enum sndrv_pcm_state state; /* RO: state - SNDRV_PCM_STATE_XXXX */ | 396 | snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */ |
403 | int pad1; /* Needed for 64 bit alignment */ | 397 | int pad1; /* Needed for 64 bit alignment */ |
404 | 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) */ |
405 | struct timespec tstamp; /* Timestamp */ | 399 | struct timespec tstamp; /* Timestamp */ |
406 | enum sndrv_pcm_state suspended_state; /* RO: suspended stream state */ | 400 | snd_pcm_state_t suspended_state; /* RO: suspended stream state */ |
407 | }; | 401 | }; |
408 | 402 | ||
409 | struct sndrv_pcm_mmap_control { | 403 | struct snd_pcm_mmap_control { |
410 | 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) */ |
411 | 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 */ |
412 | }; | 406 | }; |
413 | 407 | ||
414 | #define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ | 408 | #define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ |
415 | #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) */ |
416 | #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 */ |
417 | 411 | ||
418 | struct sndrv_pcm_sync_ptr { | 412 | struct snd_pcm_sync_ptr { |
419 | unsigned int flags; | 413 | unsigned int flags; |
420 | union { | 414 | union { |
421 | struct sndrv_pcm_mmap_status status; | 415 | struct snd_pcm_mmap_status status; |
422 | unsigned char reserved[64]; | 416 | unsigned char reserved[64]; |
423 | } s; | 417 | } s; |
424 | union { | 418 | union { |
425 | struct sndrv_pcm_mmap_control control; | 419 | struct snd_pcm_mmap_control control; |
426 | unsigned char reserved[64]; | 420 | unsigned char reserved[64]; |
427 | } c; | 421 | } c; |
428 | }; | 422 | }; |
429 | 423 | ||
430 | struct sndrv_xferi { | 424 | struct snd_xferi { |
431 | sndrv_pcm_sframes_t result; | 425 | snd_pcm_sframes_t result; |
432 | void __user *buf; | 426 | void __user *buf; |
433 | sndrv_pcm_uframes_t frames; | 427 | snd_pcm_uframes_t frames; |
434 | }; | 428 | }; |
435 | 429 | ||
436 | struct sndrv_xfern { | 430 | struct snd_xfern { |
437 | sndrv_pcm_sframes_t result; | 431 | snd_pcm_sframes_t result; |
438 | void __user * __user *bufs; | 432 | void __user * __user *bufs; |
439 | sndrv_pcm_uframes_t frames; | 433 | snd_pcm_uframes_t frames; |
440 | }; | 434 | }; |
441 | 435 | ||
442 | enum { | 436 | enum { |
443 | SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), | 437 | SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), |
444 | SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct sndrv_pcm_info), | 438 | SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info), |
445 | SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int), | 439 | SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int), |
446 | 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), |
447 | 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), |
448 | SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), | 442 | SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), |
449 | 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), |
450 | SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status), | 444 | SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct snd_pcm_status), |
451 | SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t), | 445 | SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, snd_pcm_sframes_t), |
452 | SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22), | 446 | SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22), |
453 | 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), |
454 | 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), |
455 | SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40), | 449 | SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40), |
456 | SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41), | 450 | SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41), |
457 | SNDRV_PCM_IOCTL_START = _IO('A', 0x42), | 451 | SNDRV_PCM_IOCTL_START = _IO('A', 0x42), |
458 | SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43), | 452 | SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43), |
459 | SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44), | 453 | SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44), |
460 | SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int), | 454 | SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int), |
461 | SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, sndrv_pcm_uframes_t), | 455 | SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, snd_pcm_uframes_t), |
462 | SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47), | 456 | SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47), |
463 | SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48), | 457 | SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48), |
464 | SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, sndrv_pcm_uframes_t), | 458 | SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, snd_pcm_uframes_t), |
465 | SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct sndrv_xferi), | 459 | SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct snd_xferi), |
466 | SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct sndrv_xferi), | 460 | SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct snd_xferi), |
467 | SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct sndrv_xfern), | 461 | SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct snd_xfern), |
468 | SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct sndrv_xfern), | 462 | SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct snd_xfern), |
469 | SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int), | 463 | SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int), |
470 | SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61), | 464 | SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61), |
471 | }; | 465 | }; |
@@ -485,7 +479,7 @@ enum { | |||
485 | 479 | ||
486 | #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) | 480 | #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) |
487 | 481 | ||
488 | enum sndrv_rawmidi_stream { | 482 | enum { |
489 | SNDRV_RAWMIDI_STREAM_OUTPUT = 0, | 483 | SNDRV_RAWMIDI_STREAM_OUTPUT = 0, |
490 | SNDRV_RAWMIDI_STREAM_INPUT, | 484 | SNDRV_RAWMIDI_STREAM_INPUT, |
491 | SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, | 485 | SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, |
@@ -495,10 +489,10 @@ enum sndrv_rawmidi_stream { | |||
495 | #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 | 489 | #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 |
496 | #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 | 490 | #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 |
497 | 491 | ||
498 | struct sndrv_rawmidi_info { | 492 | struct snd_rawmidi_info { |
499 | unsigned int device; /* RO/WR (control): device number */ | 493 | unsigned int device; /* RO/WR (control): device number */ |
500 | unsigned int subdevice; /* RO/WR (control): subdevice number */ | 494 | unsigned int subdevice; /* RO/WR (control): subdevice number */ |
501 | enum sndrv_rawmidi_stream stream; /* WR: stream */ | 495 | int stream; /* WR: stream */ |
502 | int card; /* R: card number */ | 496 | int card; /* R: card number */ |
503 | unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ | 497 | unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ |
504 | unsigned char id[64]; /* ID (user selectable) */ | 498 | unsigned char id[64]; /* ID (user selectable) */ |
@@ -509,16 +503,16 @@ struct sndrv_rawmidi_info { | |||
509 | unsigned char reserved[64]; /* reserved for future use */ | 503 | unsigned char reserved[64]; /* reserved for future use */ |
510 | }; | 504 | }; |
511 | 505 | ||
512 | struct sndrv_rawmidi_params { | 506 | struct snd_rawmidi_params { |
513 | enum sndrv_rawmidi_stream stream; | 507 | int stream; |
514 | size_t buffer_size; /* queue size in bytes */ | 508 | size_t buffer_size; /* queue size in bytes */ |
515 | size_t avail_min; /* minimum avail bytes for wakeup */ | 509 | size_t avail_min; /* minimum avail bytes for wakeup */ |
516 | 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() */ |
517 | unsigned char reserved[16]; /* reserved for future use */ | 511 | unsigned char reserved[16]; /* reserved for future use */ |
518 | }; | 512 | }; |
519 | 513 | ||
520 | struct sndrv_rawmidi_status { | 514 | struct snd_rawmidi_status { |
521 | enum sndrv_rawmidi_stream stream; | 515 | int stream; |
522 | struct timespec tstamp; /* Timestamp */ | 516 | struct timespec tstamp; /* Timestamp */ |
523 | size_t avail; /* available bytes */ | 517 | size_t avail; /* available bytes */ |
524 | size_t xruns; /* count of overruns since last status (in bytes) */ | 518 | size_t xruns; /* count of overruns since last status (in bytes) */ |
@@ -527,9 +521,9 @@ struct sndrv_rawmidi_status { | |||
527 | 521 | ||
528 | enum { | 522 | enum { |
529 | SNDRV_RAWMIDI_IOCTL_PVERSION = _IOR('W', 0x00, int), | 523 | SNDRV_RAWMIDI_IOCTL_PVERSION = _IOR('W', 0x00, int), |
530 | SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct sndrv_rawmidi_info), | 524 | SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct snd_rawmidi_info), |
531 | SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct sndrv_rawmidi_params), | 525 | SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct snd_rawmidi_params), |
532 | SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct sndrv_rawmidi_status), | 526 | SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct snd_rawmidi_status), |
533 | SNDRV_RAWMIDI_IOCTL_DROP = _IOW('W', 0x30, int), | 527 | SNDRV_RAWMIDI_IOCTL_DROP = _IOW('W', 0x30, int), |
534 | SNDRV_RAWMIDI_IOCTL_DRAIN = _IOW('W', 0x31, int), | 528 | SNDRV_RAWMIDI_IOCTL_DRAIN = _IOW('W', 0x31, int), |
535 | }; | 529 | }; |
@@ -540,7 +534,7 @@ enum { | |||
540 | 534 | ||
541 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) | 535 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) |
542 | 536 | ||
543 | enum sndrv_timer_class { | 537 | enum { |
544 | SNDRV_TIMER_CLASS_NONE = -1, | 538 | SNDRV_TIMER_CLASS_NONE = -1, |
545 | SNDRV_TIMER_CLASS_SLAVE = 0, | 539 | SNDRV_TIMER_CLASS_SLAVE = 0, |
546 | SNDRV_TIMER_CLASS_GLOBAL, | 540 | SNDRV_TIMER_CLASS_GLOBAL, |
@@ -550,7 +544,7 @@ enum sndrv_timer_class { | |||
550 | }; | 544 | }; |
551 | 545 | ||
552 | /* slave timer classes */ | 546 | /* slave timer classes */ |
553 | enum sndrv_timer_slave_class { | 547 | enum { |
554 | SNDRV_TIMER_SCLASS_NONE = 0, | 548 | SNDRV_TIMER_SCLASS_NONE = 0, |
555 | SNDRV_TIMER_SCLASS_APPLICATION, | 549 | SNDRV_TIMER_SCLASS_APPLICATION, |
556 | SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ | 550 | SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ |
@@ -566,16 +560,16 @@ enum sndrv_timer_slave_class { | |||
566 | /* info flags */ | 560 | /* info flags */ |
567 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ | 561 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ |
568 | 562 | ||
569 | struct sndrv_timer_id { | 563 | struct snd_timer_id { |
570 | enum sndrv_timer_class dev_class; | 564 | int dev_class; |
571 | enum sndrv_timer_slave_class dev_sclass; | 565 | int dev_sclass; |
572 | int card; | 566 | int card; |
573 | int device; | 567 | int device; |
574 | int subdevice; | 568 | int subdevice; |
575 | }; | 569 | }; |
576 | 570 | ||
577 | struct sndrv_timer_ginfo { | 571 | struct snd_timer_ginfo { |
578 | struct sndrv_timer_id tid; /* requested timer ID */ | 572 | struct snd_timer_id tid; /* requested timer ID */ |
579 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ | 573 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ |
580 | int card; /* card number */ | 574 | int card; /* card number */ |
581 | unsigned char id[64]; /* timer identification */ | 575 | unsigned char id[64]; /* timer identification */ |
@@ -588,27 +582,27 @@ struct sndrv_timer_ginfo { | |||
588 | unsigned char reserved[32]; | 582 | unsigned char reserved[32]; |
589 | }; | 583 | }; |
590 | 584 | ||
591 | struct sndrv_timer_gparams { | 585 | struct snd_timer_gparams { |
592 | struct sndrv_timer_id tid; /* requested timer ID */ | 586 | struct snd_timer_id tid; /* requested timer ID */ |
593 | unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ | 587 | unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ |
594 | unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ | 588 | unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ |
595 | unsigned char reserved[32]; | 589 | unsigned char reserved[32]; |
596 | }; | 590 | }; |
597 | 591 | ||
598 | struct sndrv_timer_gstatus { | 592 | struct snd_timer_gstatus { |
599 | struct sndrv_timer_id tid; /* requested timer ID */ | 593 | struct snd_timer_id tid; /* requested timer ID */ |
600 | unsigned long resolution; /* current period resolution in ns */ | 594 | unsigned long resolution; /* current period resolution in ns */ |
601 | unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ | 595 | unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ |
602 | unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ | 596 | unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ |
603 | unsigned char reserved[32]; | 597 | unsigned char reserved[32]; |
604 | }; | 598 | }; |
605 | 599 | ||
606 | struct sndrv_timer_select { | 600 | struct snd_timer_select { |
607 | struct sndrv_timer_id id; /* bind to timer ID */ | 601 | struct snd_timer_id id; /* bind to timer ID */ |
608 | unsigned char reserved[32]; /* reserved */ | 602 | unsigned char reserved[32]; /* reserved */ |
609 | }; | 603 | }; |
610 | 604 | ||
611 | struct sndrv_timer_info { | 605 | struct snd_timer_info { |
612 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ | 606 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ |
613 | int card; /* card number */ | 607 | int card; /* card number */ |
614 | unsigned char id[64]; /* timer identificator */ | 608 | unsigned char id[64]; /* timer identificator */ |
@@ -622,7 +616,7 @@ struct sndrv_timer_info { | |||
622 | #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 */ |
623 | #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 */ |
624 | 618 | ||
625 | struct sndrv_timer_params { | 619 | struct snd_timer_params { |
626 | unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ | 620 | unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ |
627 | unsigned int ticks; /* requested resolution in ticks */ | 621 | unsigned int ticks; /* requested resolution in ticks */ |
628 | unsigned int queue_size; /* total size of queue (32-1024) */ | 622 | unsigned int queue_size; /* total size of queue (32-1024) */ |
@@ -631,7 +625,7 @@ struct sndrv_timer_params { | |||
631 | unsigned char reserved[60]; /* reserved */ | 625 | unsigned char reserved[60]; /* reserved */ |
632 | }; | 626 | }; |
633 | 627 | ||
634 | struct sndrv_timer_status { | 628 | struct snd_timer_status { |
635 | struct timespec tstamp; /* Timestamp - last update */ | 629 | struct timespec tstamp; /* Timestamp - last update */ |
636 | unsigned int resolution; /* current period resolution in ns */ | 630 | unsigned int resolution; /* current period resolution in ns */ |
637 | unsigned int lost; /* counter of master tick lost */ | 631 | unsigned int lost; /* counter of master tick lost */ |
@@ -642,15 +636,15 @@ struct sndrv_timer_status { | |||
642 | 636 | ||
643 | enum { | 637 | enum { |
644 | SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int), | 638 | SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int), |
645 | 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), |
646 | SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int), | 640 | SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int), |
647 | SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct sndrv_timer_ginfo), | 641 | SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct snd_timer_ginfo), |
648 | SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct sndrv_timer_gparams), | 642 | SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct snd_timer_gparams), |
649 | SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct sndrv_timer_gstatus), | 643 | SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct snd_timer_gstatus), |
650 | SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct sndrv_timer_select), | 644 | SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct snd_timer_select), |
651 | SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), | 645 | SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct snd_timer_info), |
652 | SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), | 646 | SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct snd_timer_params), |
653 | SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), | 647 | SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct snd_timer_status), |
654 | /* 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 */ |
655 | SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0), | 649 | SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0), |
656 | SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1), | 650 | SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1), |
@@ -658,12 +652,12 @@ enum { | |||
658 | SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3), | 652 | SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3), |
659 | }; | 653 | }; |
660 | 654 | ||
661 | struct sndrv_timer_read { | 655 | struct snd_timer_read { |
662 | unsigned int resolution; | 656 | unsigned int resolution; |
663 | unsigned int ticks; | 657 | unsigned int ticks; |
664 | }; | 658 | }; |
665 | 659 | ||
666 | enum sndrv_timer_event { | 660 | enum { |
667 | SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ | 661 | SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ |
668 | SNDRV_TIMER_EVENT_TICK, /* val = ticks */ | 662 | SNDRV_TIMER_EVENT_TICK, /* val = ticks */ |
669 | SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ | 663 | SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ |
@@ -682,8 +676,8 @@ enum sndrv_timer_event { | |||
682 | SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, | 676 | SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, |
683 | }; | 677 | }; |
684 | 678 | ||
685 | struct sndrv_timer_tread { | 679 | struct snd_timer_tread { |
686 | enum sndrv_timer_event event; | 680 | int event; |
687 | struct timespec tstamp; | 681 | struct timespec tstamp; |
688 | unsigned int val; | 682 | unsigned int val; |
689 | }; | 683 | }; |
@@ -696,7 +690,7 @@ struct sndrv_timer_tread { | |||
696 | 690 | ||
697 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) | 691 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) |
698 | 692 | ||
699 | struct sndrv_ctl_card_info { | 693 | struct snd_ctl_card_info { |
700 | int card; /* card number */ | 694 | int card; /* card number */ |
701 | int pad; /* reserved for future (was type) */ | 695 | int pad; /* reserved for future (was type) */ |
702 | unsigned char id[16]; /* ID of card (user selectable) */ | 696 | unsigned char id[16]; /* ID of card (user selectable) */ |
@@ -709,27 +703,25 @@ struct sndrv_ctl_card_info { | |||
709 | unsigned char reserved[48]; /* reserved for future */ | 703 | unsigned char reserved[48]; /* reserved for future */ |
710 | }; | 704 | }; |
711 | 705 | ||
712 | enum sndrv_ctl_elem_type { | 706 | typedef int __bitwise snd_ctl_elem_type_t; |
713 | SNDRV_CTL_ELEM_TYPE_NONE = 0, /* invalid */ | 707 | #define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */ |
714 | SNDRV_CTL_ELEM_TYPE_BOOLEAN, /* boolean type */ | 708 | #define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */ |
715 | SNDRV_CTL_ELEM_TYPE_INTEGER, /* integer type */ | 709 | #define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */ |
716 | SNDRV_CTL_ELEM_TYPE_ENUMERATED, /* enumerated type */ | 710 | #define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */ |
717 | SNDRV_CTL_ELEM_TYPE_BYTES, /* byte array */ | 711 | #define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */ |
718 | 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 */ |
719 | 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 */ |
720 | SNDRV_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_INTEGER64, | 714 | #define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64 |
721 | }; | 715 | |
722 | 716 | typedef int __bitwise snd_ctl_elem_iface_t; | |
723 | enum sndrv_ctl_elem_iface { | 717 | #define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */ |
724 | 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 */ |
725 | 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 */ |
726 | SNDRV_CTL_ELEM_IFACE_MIXER, /* virtual mixer device */ | 720 | #define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */ |
727 | SNDRV_CTL_ELEM_IFACE_PCM, /* PCM device */ | 721 | #define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */ |
728 | SNDRV_CTL_ELEM_IFACE_RAWMIDI, /* RawMidi device */ | 722 | #define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */ |
729 | SNDRV_CTL_ELEM_IFACE_TIMER, /* timer device */ | 723 | #define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */ |
730 | SNDRV_CTL_ELEM_IFACE_SEQUENCER, /* sequencer client */ | 724 | #define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER |
731 | SNDRV_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_SEQUENCER, | ||
732 | }; | ||
733 | 725 | ||
734 | #define SNDRV_CTL_ELEM_ACCESS_READ (1<<0) | 726 | #define SNDRV_CTL_ELEM_ACCESS_READ (1<<0) |
735 | #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) | 727 | #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) |
@@ -751,27 +743,27 @@ enum sndrv_ctl_elem_iface { | |||
751 | #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 */ |
752 | #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 */ |
753 | 745 | ||
754 | struct sndrv_ctl_elem_id { | 746 | struct snd_ctl_elem_id { |
755 | unsigned int numid; /* numeric identifier, zero = invalid */ | 747 | unsigned int numid; /* numeric identifier, zero = invalid */ |
756 | enum sndrv_ctl_elem_iface iface; /* interface identifier */ | 748 | snd_ctl_elem_iface_t iface; /* interface identifier */ |
757 | unsigned int device; /* device/client number */ | 749 | unsigned int device; /* device/client number */ |
758 | unsigned int subdevice; /* subdevice (substream) number */ | 750 | unsigned int subdevice; /* subdevice (substream) number */ |
759 | unsigned char name[44]; /* ASCII name of item */ | 751 | unsigned char name[44]; /* ASCII name of item */ |
760 | unsigned int index; /* index of item */ | 752 | unsigned int index; /* index of item */ |
761 | }; | 753 | }; |
762 | 754 | ||
763 | struct sndrv_ctl_elem_list { | 755 | struct snd_ctl_elem_list { |
764 | unsigned int offset; /* W: first element ID to get */ | 756 | unsigned int offset; /* W: first element ID to get */ |
765 | unsigned int space; /* W: count of element IDs to get */ | 757 | unsigned int space; /* W: count of element IDs to get */ |
766 | unsigned int used; /* R: count of element IDs set */ | 758 | unsigned int used; /* R: count of element IDs set */ |
767 | unsigned int count; /* R: count of all elements */ | 759 | unsigned int count; /* R: count of all elements */ |
768 | struct sndrv_ctl_elem_id __user *pids; /* R: IDs */ | 760 | struct snd_ctl_elem_id __user *pids; /* R: IDs */ |
769 | unsigned char reserved[50]; | 761 | unsigned char reserved[50]; |
770 | }; | 762 | }; |
771 | 763 | ||
772 | struct sndrv_ctl_elem_info { | 764 | struct snd_ctl_elem_info { |
773 | struct sndrv_ctl_elem_id id; /* W: element ID */ | 765 | struct snd_ctl_elem_id id; /* W: element ID */ |
774 | 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_* */ |
775 | unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ | 767 | unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ |
776 | unsigned int count; /* count of values */ | 768 | unsigned int count; /* count of values */ |
777 | pid_t owner; /* owner's PID of this control */ | 769 | pid_t owner; /* owner's PID of this control */ |
@@ -800,8 +792,8 @@ struct sndrv_ctl_elem_info { | |||
800 | unsigned char reserved[64-4*sizeof(unsigned short)]; | 792 | unsigned char reserved[64-4*sizeof(unsigned short)]; |
801 | }; | 793 | }; |
802 | 794 | ||
803 | struct sndrv_ctl_elem_value { | 795 | struct snd_ctl_elem_value { |
804 | struct sndrv_ctl_elem_id id; /* W: element ID */ | 796 | struct snd_ctl_elem_id id; /* W: element ID */ |
805 | unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ | 797 | unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ |
806 | union { | 798 | union { |
807 | union { | 799 | union { |
@@ -820,7 +812,7 @@ struct sndrv_ctl_elem_value { | |||
820 | unsigned char data[512]; | 812 | unsigned char data[512]; |
821 | unsigned char *data_ptr; | 813 | unsigned char *data_ptr; |
822 | } bytes; | 814 | } bytes; |
823 | struct sndrv_aes_iec958 iec958; | 815 | struct snd_aes_iec958 iec958; |
824 | } value; /* RO */ | 816 | } value; /* RO */ |
825 | struct timespec tstamp; | 817 | struct timespec tstamp; |
826 | unsigned char reserved[128-sizeof(struct timespec)]; | 818 | unsigned char reserved[128-sizeof(struct timespec)]; |
@@ -828,24 +820,24 @@ struct sndrv_ctl_elem_value { | |||
828 | 820 | ||
829 | enum { | 821 | enum { |
830 | SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int), | 822 | SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int), |
831 | 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), |
832 | 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), |
833 | 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), |
834 | 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), |
835 | 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), |
836 | 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), |
837 | 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), |
838 | SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int), | 830 | SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int), |
839 | 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), |
840 | 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), |
841 | 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), |
842 | SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int), | 834 | SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int), |
843 | 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), |
844 | SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int), | 836 | SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int), |
845 | 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), |
846 | SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE = _IOW('U', 0x32, int), | 838 | SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE = _IOW('U', 0x32, int), |
847 | SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE = _IOWR('U', 0x40, int), | 839 | SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE = _IOWR('U', 0x40, int), |
848 | 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), |
849 | SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int), | 841 | SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int), |
850 | SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int), | 842 | SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int), |
851 | SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int), | 843 | SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int), |
@@ -865,12 +857,12 @@ enum sndrv_ctl_event_type { | |||
865 | #define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ | 857 | #define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ |
866 | #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ | 858 | #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ |
867 | 859 | ||
868 | struct sndrv_ctl_event { | 860 | struct snd_ctl_event { |
869 | enum sndrv_ctl_event_type type; /* event type - SNDRV_CTL_EVENT_* */ | 861 | int type; /* event type - SNDRV_CTL_EVENT_* */ |
870 | union { | 862 | union { |
871 | struct { | 863 | struct { |
872 | unsigned int mask; | 864 | unsigned int mask; |
873 | struct sndrv_ctl_elem_id id; | 865 | struct snd_ctl_elem_id id; |
874 | } elem; | 866 | } elem; |
875 | unsigned char data8[60]; | 867 | unsigned char data8[60]; |
876 | } data; | 868 | } data; |
@@ -898,14 +890,14 @@ struct sndrv_ctl_event { | |||
898 | * | 890 | * |
899 | */ | 891 | */ |
900 | 892 | ||
901 | struct sndrv_xferv { | 893 | struct snd_xferv { |
902 | const struct iovec *vector; | 894 | const struct iovec *vector; |
903 | unsigned long count; | 895 | unsigned long count; |
904 | }; | 896 | }; |
905 | 897 | ||
906 | enum { | 898 | enum { |
907 | SNDRV_IOCTL_READV = _IOW('K', 0x00, struct sndrv_xferv), | 899 | SNDRV_IOCTL_READV = _IOW('K', 0x00, struct snd_xferv), |
908 | SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct sndrv_xferv), | 900 | SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct snd_xferv), |
909 | }; | 901 | }; |
910 | 902 | ||
911 | #endif /* __SOUND_ASOUND_H */ | 903 | #endif /* __SOUND_ASOUND_H */ |
diff --git a/include/sound/core.h b/include/sound/core.h index 2be65ad2fd8..f867433e65f 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -28,13 +28,6 @@ | |||
28 | #include <linux/workqueue.h> /* struct workqueue_struct */ | 28 | #include <linux/workqueue.h> /* struct workqueue_struct */ |
29 | #include <linux/pm.h> /* pm_message_t */ | 29 | #include <linux/pm.h> /* pm_message_t */ |
30 | 30 | ||
31 | /* Typedef's */ | ||
32 | typedef struct sndrv_interval snd_interval_t; | ||
33 | typedef enum sndrv_card_type snd_card_type; | ||
34 | typedef struct sndrv_xferi snd_xferi_t; | ||
35 | typedef struct sndrv_xfern snd_xfern_t; | ||
36 | typedef struct sndrv_xferv snd_xferv_t; | ||
37 | |||
38 | /* forward declarations */ | 31 | /* forward declarations */ |
39 | #ifdef CONFIG_PCI | 32 | #ifdef CONFIG_PCI |
40 | struct pci_dev; | 33 | struct pci_dev; |
@@ -47,76 +40,50 @@ struct sbus_dev; | |||
47 | 40 | ||
48 | #define SNDRV_DEV_TYPE_RANGE_SIZE 0x1000 | 41 | #define SNDRV_DEV_TYPE_RANGE_SIZE 0x1000 |
49 | 42 | ||
50 | typedef enum { | 43 | typedef int __bitwise snd_device_type_t; |
51 | SNDRV_DEV_TOPLEVEL = (0*SNDRV_DEV_TYPE_RANGE_SIZE), | 44 | #define SNDRV_DEV_TOPLEVEL ((__force snd_device_type_t) 0) |
52 | SNDRV_DEV_CONTROL, | 45 | #define SNDRV_DEV_CONTROL ((__force snd_device_type_t) 1) |
53 | SNDRV_DEV_LOWLEVEL_PRE, | 46 | #define SNDRV_DEV_LOWLEVEL_PRE ((__force snd_device_type_t) 2) |
54 | SNDRV_DEV_LOWLEVEL_NORMAL = (1*SNDRV_DEV_TYPE_RANGE_SIZE), | 47 | #define SNDRV_DEV_LOWLEVEL_NORMAL ((__force snd_device_type_t) 0x1000) |
55 | SNDRV_DEV_PCM, | 48 | #define SNDRV_DEV_PCM ((__force snd_device_type_t) 0x1001) |
56 | SNDRV_DEV_RAWMIDI, | 49 | #define SNDRV_DEV_RAWMIDI ((__force snd_device_type_t) 0x1002) |
57 | SNDRV_DEV_TIMER, | 50 | #define SNDRV_DEV_TIMER ((__force snd_device_type_t) 0x1003) |
58 | SNDRV_DEV_SEQUENCER, | 51 | #define SNDRV_DEV_SEQUENCER ((__force snd_device_type_t) 0x1004) |
59 | SNDRV_DEV_HWDEP, | 52 | #define SNDRV_DEV_HWDEP ((__force snd_device_type_t) 0x1005) |
60 | SNDRV_DEV_INFO, | 53 | #define SNDRV_DEV_INFO ((__force snd_device_type_t) 0x1006) |
61 | SNDRV_DEV_BUS, | 54 | #define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007) |
62 | SNDRV_DEV_CODEC, | 55 | #define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008) |
63 | SNDRV_DEV_LOWLEVEL = (2*SNDRV_DEV_TYPE_RANGE_SIZE) | 56 | #define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000) |
64 | } snd_device_type_t; | 57 | |
65 | 58 | typedef int __bitwise snd_device_state_t; | |
66 | typedef enum { | 59 | #define SNDRV_DEV_BUILD ((__force snd_device_state_t) 0) |
67 | SNDRV_DEV_BUILD, | 60 | #define SNDRV_DEV_REGISTERED ((__force snd_device_state_t) 1) |
68 | SNDRV_DEV_REGISTERED, | 61 | #define SNDRV_DEV_DISCONNECTED ((__force snd_device_state_t) 2) |
69 | SNDRV_DEV_DISCONNECTED | 62 | |
70 | } snd_device_state_t; | 63 | typedef int __bitwise snd_device_cmd_t; |
71 | 64 | #define SNDRV_DEV_CMD_PRE ((__force snd_device_cmd_t) 0) | |
72 | typedef enum { | 65 | #define SNDRV_DEV_CMD_NORMAL ((__force snd_device_cmd_t) 1) |
73 | SNDRV_DEV_CMD_PRE = 0, | 66 | #define SNDRV_DEV_CMD_POST ((__force snd_device_cmd_t) 2) |
74 | SNDRV_DEV_CMD_NORMAL = 1, | 67 | |
75 | SNDRV_DEV_CMD_POST = 2 | 68 | struct snd_device; |
76 | } snd_device_cmd_t; | 69 | |
77 | 70 | struct snd_device_ops { | |
78 | typedef struct _snd_card snd_card_t; | 71 | int (*dev_free)(struct snd_device *dev); |
79 | typedef struct _snd_device snd_device_t; | 72 | int (*dev_register)(struct snd_device *dev); |
80 | 73 | int (*dev_disconnect)(struct snd_device *dev); | |
81 | typedef int (snd_dev_free_t)(snd_device_t *device); | 74 | int (*dev_unregister)(struct snd_device *dev); |
82 | typedef int (snd_dev_register_t)(snd_device_t *device); | 75 | }; |
83 | typedef int (snd_dev_disconnect_t)(snd_device_t *device); | 76 | |
84 | typedef int (snd_dev_unregister_t)(snd_device_t *device); | 77 | struct snd_device { |
85 | |||
86 | typedef struct { | ||
87 | snd_dev_free_t *dev_free; | ||
88 | snd_dev_register_t *dev_register; | ||
89 | snd_dev_disconnect_t *dev_disconnect; | ||
90 | snd_dev_unregister_t *dev_unregister; | ||
91 | } snd_device_ops_t; | ||
92 | |||
93 | struct _snd_device { | ||
94 | struct list_head list; /* list of registered devices */ | 78 | struct list_head list; /* list of registered devices */ |
95 | snd_card_t *card; /* card which holds this device */ | 79 | struct snd_card *card; /* card which holds this device */ |
96 | snd_device_state_t state; /* state of the device */ | 80 | snd_device_state_t state; /* state of the device */ |
97 | snd_device_type_t type; /* device type */ | 81 | snd_device_type_t type; /* device type */ |
98 | void *device_data; /* device structure */ | 82 | void *device_data; /* device structure */ |
99 | snd_device_ops_t *ops; /* operations */ | 83 | struct snd_device_ops *ops; /* operations */ |
100 | }; | 84 | }; |
101 | 85 | ||
102 | #define snd_device(n) list_entry(n, snd_device_t, list) | 86 | #define snd_device(n) list_entry(n, struct snd_device, list) |
103 | |||
104 | /* various typedefs */ | ||
105 | |||
106 | typedef struct snd_info_entry snd_info_entry_t; | ||
107 | typedef struct _snd_pcm snd_pcm_t; | ||
108 | typedef struct _snd_pcm_str snd_pcm_str_t; | ||
109 | typedef struct _snd_pcm_substream snd_pcm_substream_t; | ||
110 | typedef struct _snd_mixer snd_kmixer_t; | ||
111 | typedef struct _snd_rawmidi snd_rawmidi_t; | ||
112 | typedef struct _snd_ctl_file snd_ctl_file_t; | ||
113 | typedef struct _snd_kcontrol snd_kcontrol_t; | ||
114 | typedef struct _snd_timer snd_timer_t; | ||
115 | typedef struct _snd_timer_instance snd_timer_instance_t; | ||
116 | typedef struct _snd_hwdep snd_hwdep_t; | ||
117 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) | ||
118 | typedef struct _snd_oss_mixer snd_mixer_oss_t; | ||
119 | #endif | ||
120 | 87 | ||
121 | /* monitor files for graceful shutdown (hotplug) */ | 88 | /* monitor files for graceful shutdown (hotplug) */ |
122 | 89 | ||
@@ -129,7 +96,7 @@ struct snd_shutdown_f_ops; /* define it later in init.c */ | |||
129 | 96 | ||
130 | /* main structure for soundcard */ | 97 | /* main structure for soundcard */ |
131 | 98 | ||
132 | struct _snd_card { | 99 | struct snd_card { |
133 | int number; /* number of soundcard (index to | 100 | int number; /* number of soundcard (index to |
134 | snd_cards) */ | 101 | snd_cards) */ |
135 | 102 | ||
@@ -143,7 +110,7 @@ struct _snd_card { | |||
143 | struct module *module; /* top-level module */ | 110 | struct module *module; /* top-level module */ |
144 | 111 | ||
145 | void *private_data; /* private data for soundcard */ | 112 | void *private_data; /* private data for soundcard */ |
146 | void (*private_free) (snd_card_t *card); /* callback for freeing of | 113 | void (*private_free) (struct snd_card *card); /* callback for freeing of |
147 | private data */ | 114 | private data */ |
148 | struct list_head devices; /* devices */ | 115 | struct list_head devices; /* devices */ |
149 | 116 | ||
@@ -155,8 +122,8 @@ struct _snd_card { | |||
155 | struct list_head controls; /* all controls for this card */ | 122 | struct list_head controls; /* all controls for this card */ |
156 | struct list_head ctl_files; /* active control files */ | 123 | struct list_head ctl_files; /* active control files */ |
157 | 124 | ||
158 | snd_info_entry_t *proc_root; /* root for soundcard specific files */ | 125 | struct snd_info_entry *proc_root; /* root for soundcard specific files */ |
159 | snd_info_entry_t *proc_id; /* the card id */ | 126 | struct snd_info_entry *proc_id; /* the card id */ |
160 | struct proc_dir_entry *proc_root_link; /* number link to real id */ | 127 | struct proc_dir_entry *proc_root_link; /* number link to real id */ |
161 | 128 | ||
162 | struct snd_monitor_file *files; /* all files associated to this card */ | 129 | struct snd_monitor_file *files; /* all files associated to this card */ |
@@ -172,8 +139,8 @@ struct _snd_card { | |||
172 | #endif | 139 | #endif |
173 | 140 | ||
174 | #ifdef CONFIG_PM | 141 | #ifdef CONFIG_PM |
175 | int (*pm_suspend)(snd_card_t *card, pm_message_t state); | 142 | int (*pm_suspend)(struct snd_card *card, pm_message_t state); |
176 | int (*pm_resume)(snd_card_t *card); | 143 | int (*pm_resume)(struct snd_card *card); |
177 | void *pm_private_data; | 144 | void *pm_private_data; |
178 | unsigned int power_state; /* power state */ | 145 | unsigned int power_state; /* power state */ |
179 | struct semaphore power_lock; /* power lock */ | 146 | struct semaphore power_lock; /* power lock */ |
@@ -181,43 +148,43 @@ struct _snd_card { | |||
181 | #endif | 148 | #endif |
182 | 149 | ||
183 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) | 150 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) |
184 | snd_mixer_oss_t *mixer_oss; | 151 | struct snd_mixer_oss *mixer_oss; |
185 | int mixer_oss_change_count; | 152 | int mixer_oss_change_count; |
186 | #endif | 153 | #endif |
187 | }; | 154 | }; |
188 | 155 | ||
189 | #ifdef CONFIG_PM | 156 | #ifdef CONFIG_PM |
190 | static inline void snd_power_lock(snd_card_t *card) | 157 | static inline void snd_power_lock(struct snd_card *card) |
191 | { | 158 | { |
192 | down(&card->power_lock); | 159 | down(&card->power_lock); |
193 | } | 160 | } |
194 | 161 | ||
195 | static inline void snd_power_unlock(snd_card_t *card) | 162 | static inline void snd_power_unlock(struct snd_card *card) |
196 | { | 163 | { |
197 | up(&card->power_lock); | 164 | up(&card->power_lock); |
198 | } | 165 | } |
199 | 166 | ||
200 | static inline unsigned int snd_power_get_state(snd_card_t *card) | 167 | static inline unsigned int snd_power_get_state(struct snd_card *card) |
201 | { | 168 | { |
202 | return card->power_state; | 169 | return card->power_state; |
203 | } | 170 | } |
204 | 171 | ||
205 | static inline void snd_power_change_state(snd_card_t *card, unsigned int state) | 172 | static inline void snd_power_change_state(struct snd_card *card, unsigned int state) |
206 | { | 173 | { |
207 | card->power_state = state; | 174 | card->power_state = state; |
208 | wake_up(&card->power_sleep); | 175 | wake_up(&card->power_sleep); |
209 | } | 176 | } |
210 | 177 | ||
211 | /* init.c */ | 178 | /* init.c */ |
212 | int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file); | 179 | int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file); |
213 | 180 | ||
214 | int snd_card_set_pm_callback(snd_card_t *card, | 181 | int snd_card_set_pm_callback(struct snd_card *card, |
215 | int (*suspend)(snd_card_t *, pm_message_t), | 182 | int (*suspend)(struct snd_card *, pm_message_t), |
216 | int (*resume)(snd_card_t *), | 183 | int (*resume)(struct snd_card *), |
217 | void *private_data); | 184 | void *private_data); |
218 | int snd_card_set_generic_pm_callback(snd_card_t *card, | 185 | int snd_card_set_generic_pm_callback(struct snd_card *card, |
219 | int (*suspend)(snd_card_t *, pm_message_t), | 186 | int (*suspend)(struct snd_card *, pm_message_t), |
220 | int (*resume)(snd_card_t *), | 187 | int (*resume)(struct snd_card *), |
221 | void *private_data); | 188 | void *private_data); |
222 | #define snd_card_set_isa_pm_callback(card,suspend,resume,data) \ | 189 | #define snd_card_set_isa_pm_callback(card,suspend,resume,data) \ |
223 | snd_card_set_generic_pm_callback(card, suspend, resume, data) | 190 | snd_card_set_generic_pm_callback(card, suspend, resume, data) |
@@ -231,7 +198,7 @@ int snd_card_pci_resume(struct pci_dev *dev); | |||
231 | 198 | ||
232 | #define snd_power_lock(card) do { (void)(card); } while (0) | 199 | #define snd_power_lock(card) do { (void)(card); } while (0) |
233 | #define snd_power_unlock(card) do { (void)(card); } while (0) | 200 | #define snd_power_unlock(card) do { (void)(card); } while (0) |
234 | static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct file *file) { return 0; } | 201 | static inline int snd_power_wait(struct snd_card *card, unsigned int state, struct file *file) { return 0; } |
235 | #define snd_power_get_state(card) SNDRV_CTL_POWER_D0 | 202 | #define snd_power_get_state(card) SNDRV_CTL_POWER_D0 |
236 | #define snd_power_change_state(card, state) do { (void)(card); } while (0) | 203 | #define snd_power_change_state(card, state) do { (void)(card); } while (0) |
237 | #define snd_card_set_pm_callback(card,suspend,resume,data) | 204 | #define snd_card_set_pm_callback(card,suspend,resume,data) |
@@ -241,7 +208,7 @@ static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct fi | |||
241 | 208 | ||
242 | #endif /* CONFIG_PM */ | 209 | #endif /* CONFIG_PM */ |
243 | 210 | ||
244 | struct _snd_minor { | 211 | struct snd_minor { |
245 | struct list_head list; /* list of all minors per card */ | 212 | struct list_head list; /* list of all minors per card */ |
246 | int number; /* minor number */ | 213 | int number; /* minor number */ |
247 | int device; /* device number */ | 214 | int device; /* device number */ |
@@ -251,8 +218,6 @@ struct _snd_minor { | |||
251 | structure) */ | 218 | structure) */ |
252 | }; | 219 | }; |
253 | 220 | ||
254 | typedef struct _snd_minor snd_minor_t; | ||
255 | |||
256 | /* sound.c */ | 221 | /* sound.c */ |
257 | 222 | ||
258 | extern int snd_major; | 223 | extern int snd_major; |
@@ -260,12 +225,12 @@ extern int snd_ecards_limit; | |||
260 | 225 | ||
261 | void snd_request_card(int card); | 226 | void snd_request_card(int card); |
262 | 227 | ||
263 | int snd_register_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name); | 228 | int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name); |
264 | int snd_unregister_device(int type, snd_card_t *card, int dev); | 229 | int snd_unregister_device(int type, struct snd_card *card, int dev); |
265 | 230 | ||
266 | #ifdef CONFIG_SND_OSSEMUL | 231 | #ifdef CONFIG_SND_OSSEMUL |
267 | int snd_register_oss_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name); | 232 | int snd_register_oss_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name); |
268 | int snd_unregister_oss_device(int type, snd_card_t *card, int dev); | 233 | int snd_unregister_oss_device(int type, struct snd_card *card, int dev); |
269 | #endif | 234 | #endif |
270 | 235 | ||
271 | int snd_minor_info_init(void); | 236 | int snd_minor_info_init(void); |
@@ -291,43 +256,43 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size | |||
291 | /* init.c */ | 256 | /* init.c */ |
292 | 257 | ||
293 | extern unsigned int snd_cards_lock; | 258 | extern unsigned int snd_cards_lock; |
294 | extern snd_card_t *snd_cards[SNDRV_CARDS]; | 259 | extern struct snd_card *snd_cards[SNDRV_CARDS]; |
295 | extern rwlock_t snd_card_rwlock; | 260 | extern rwlock_t snd_card_rwlock; |
296 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) | 261 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) |
297 | #define SND_MIXER_OSS_NOTIFY_REGISTER 0 | 262 | #define SND_MIXER_OSS_NOTIFY_REGISTER 0 |
298 | #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 | 263 | #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 |
299 | #define SND_MIXER_OSS_NOTIFY_FREE 2 | 264 | #define SND_MIXER_OSS_NOTIFY_FREE 2 |
300 | extern int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int cmd); | 265 | extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd); |
301 | #endif | 266 | #endif |
302 | 267 | ||
303 | snd_card_t *snd_card_new(int idx, const char *id, | 268 | struct snd_card *snd_card_new(int idx, const char *id, |
304 | struct module *module, int extra_size); | 269 | struct module *module, int extra_size); |
305 | int snd_card_disconnect(snd_card_t *card); | 270 | int snd_card_disconnect(struct snd_card *card); |
306 | int snd_card_free(snd_card_t *card); | 271 | int snd_card_free(struct snd_card *card); |
307 | int snd_card_free_in_thread(snd_card_t *card); | 272 | int snd_card_free_in_thread(struct snd_card *card); |
308 | int snd_card_register(snd_card_t *card); | 273 | int snd_card_register(struct snd_card *card); |
309 | int snd_card_info_init(void); | 274 | int snd_card_info_init(void); |
310 | int snd_card_info_done(void); | 275 | int snd_card_info_done(void); |
311 | int snd_component_add(snd_card_t *card, const char *component); | 276 | int snd_component_add(struct snd_card *card, const char *component); |
312 | int snd_card_file_add(snd_card_t *card, struct file *file); | 277 | int snd_card_file_add(struct snd_card *card, struct file *file); |
313 | int snd_card_file_remove(snd_card_t *card, struct file *file); | 278 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
314 | 279 | ||
315 | #ifndef snd_card_set_dev | 280 | #ifndef snd_card_set_dev |
316 | #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) | 281 | #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) |
317 | #endif | 282 | #endif |
318 | /* register a generic device (for ISA, etc) */ | 283 | /* register a generic device (for ISA, etc) */ |
319 | int snd_card_set_generic_dev(snd_card_t *card); | 284 | int snd_card_set_generic_dev(struct snd_card *card); |
320 | 285 | ||
321 | /* device.c */ | 286 | /* device.c */ |
322 | 287 | ||
323 | int snd_device_new(snd_card_t *card, snd_device_type_t type, | 288 | int snd_device_new(struct snd_card *card, snd_device_type_t type, |
324 | void *device_data, snd_device_ops_t *ops); | 289 | void *device_data, struct snd_device_ops *ops); |
325 | int snd_device_register(snd_card_t *card, void *device_data); | 290 | int snd_device_register(struct snd_card *card, void *device_data); |
326 | int snd_device_register_all(snd_card_t *card); | 291 | int snd_device_register_all(struct snd_card *card); |
327 | int snd_device_disconnect(snd_card_t *card, void *device_data); | 292 | int snd_device_disconnect(struct snd_card *card, void *device_data); |
328 | int snd_device_disconnect_all(snd_card_t *card); | 293 | int snd_device_disconnect_all(struct snd_card *card); |
329 | int snd_device_free(snd_card_t *card, void *device_data); | 294 | int snd_device_free(struct snd_card *card, void *device_data); |
330 | int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd); | 295 | int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd); |
331 | 296 | ||
332 | /* isadma.c */ | 297 | /* isadma.c */ |
333 | 298 | ||
@@ -443,4 +408,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
443 | #endif | 408 | #endif |
444 | #endif | 409 | #endif |
445 | 410 | ||
411 | #include "typedefs.h" | ||
412 | |||
446 | #endif /* __SOUND_CORE_H */ | 413 | #endif /* __SOUND_CORE_H */ |
diff --git a/sound/core/device.c b/sound/core/device.c index 1f509f56e60..afa8cc7fb05 100644 --- a/sound/core/device.c +++ b/sound/core/device.c | |||
@@ -41,10 +41,10 @@ | |||
41 | * | 41 | * |
42 | * Returns zero if successful, or a negative error code on failure. | 42 | * Returns zero if successful, or a negative error code on failure. |
43 | */ | 43 | */ |
44 | int snd_device_new(snd_card_t *card, snd_device_type_t type, | 44 | int snd_device_new(struct snd_card *card, snd_device_type_t type, |
45 | void *device_data, snd_device_ops_t *ops) | 45 | void *device_data, struct snd_device_ops *ops) |
46 | { | 46 | { |
47 | snd_device_t *dev; | 47 | struct snd_device *dev; |
48 | 48 | ||
49 | snd_assert(card != NULL, return -ENXIO); | 49 | snd_assert(card != NULL, return -ENXIO); |
50 | snd_assert(device_data != NULL, return -ENXIO); | 50 | snd_assert(device_data != NULL, return -ENXIO); |
@@ -73,10 +73,10 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type, | |||
73 | * Returns zero if successful, or a negative error code on failure or if the | 73 | * Returns zero if successful, or a negative error code on failure or if the |
74 | * device not found. | 74 | * device not found. |
75 | */ | 75 | */ |
76 | int snd_device_free(snd_card_t *card, void *device_data) | 76 | int snd_device_free(struct snd_card *card, void *device_data) |
77 | { | 77 | { |
78 | struct list_head *list; | 78 | struct list_head *list; |
79 | snd_device_t *dev; | 79 | struct snd_device *dev; |
80 | 80 | ||
81 | snd_assert(card != NULL, return -ENXIO); | 81 | snd_assert(card != NULL, return -ENXIO); |
82 | snd_assert(device_data != NULL, return -ENXIO); | 82 | snd_assert(device_data != NULL, return -ENXIO); |
@@ -86,7 +86,8 @@ int snd_device_free(snd_card_t *card, void *device_data) | |||
86 | continue; | 86 | continue; |
87 | /* unlink */ | 87 | /* unlink */ |
88 | list_del(&dev->list); | 88 | list_del(&dev->list); |
89 | if ((dev->state == SNDRV_DEV_REGISTERED || dev->state == SNDRV_DEV_DISCONNECTED) && | 89 | if ((dev->state == SNDRV_DEV_REGISTERED || |
90 | dev->state == SNDRV_DEV_DISCONNECTED) && | ||
90 | dev->ops->dev_unregister) { | 91 | dev->ops->dev_unregister) { |
91 | if (dev->ops->dev_unregister(dev)) | 92 | if (dev->ops->dev_unregister(dev)) |
92 | snd_printk(KERN_ERR "device unregister failure\n"); | 93 | snd_printk(KERN_ERR "device unregister failure\n"); |
@@ -99,7 +100,8 @@ int snd_device_free(snd_card_t *card, void *device_data) | |||
99 | kfree(dev); | 100 | kfree(dev); |
100 | return 0; | 101 | return 0; |
101 | } | 102 | } |
102 | snd_printd("device free %p (from %p), not found\n", device_data, __builtin_return_address(0)); | 103 | snd_printd("device free %p (from %p), not found\n", device_data, |
104 | __builtin_return_address(0)); | ||
103 | return -ENXIO; | 105 | return -ENXIO; |
104 | } | 106 | } |
105 | 107 | ||
@@ -116,10 +118,10 @@ int snd_device_free(snd_card_t *card, void *device_data) | |||
116 | * Returns zero if successful, or a negative error code on failure or if the | 118 | * Returns zero if successful, or a negative error code on failure or if the |
117 | * device not found. | 119 | * device not found. |
118 | */ | 120 | */ |
119 | int snd_device_disconnect(snd_card_t *card, void *device_data) | 121 | int snd_device_disconnect(struct snd_card *card, void *device_data) |
120 | { | 122 | { |
121 | struct list_head *list; | 123 | struct list_head *list; |
122 | snd_device_t *dev; | 124 | struct snd_device *dev; |
123 | 125 | ||
124 | snd_assert(card != NULL, return -ENXIO); | 126 | snd_assert(card != NULL, return -ENXIO); |
125 | snd_assert(device_data != NULL, return -ENXIO); | 127 | snd_assert(device_data != NULL, return -ENXIO); |
@@ -127,14 +129,16 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) | |||
127 | dev = snd_device(list); | 129 | dev = snd_device(list); |
128 | if (dev->device_data != device_data) | 130 | if (dev->device_data != device_data) |
129 | continue; | 131 | continue; |
130 | if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) { | 132 | if (dev->state == SNDRV_DEV_REGISTERED && |
133 | dev->ops->dev_disconnect) { | ||
131 | if (dev->ops->dev_disconnect(dev)) | 134 | if (dev->ops->dev_disconnect(dev)) |
132 | snd_printk(KERN_ERR "device disconnect failure\n"); | 135 | snd_printk(KERN_ERR "device disconnect failure\n"); |
133 | dev->state = SNDRV_DEV_DISCONNECTED; | 136 | dev->state = SNDRV_DEV_DISCONNECTED; |
134 | } | 137 | } |
135 | return 0; | 138 | return 0; |
136 | } | 139 | } |
137 | snd_printd("device disconnect %p (from %p), not found\n", device_data, __builtin_return_address(0)); | 140 | snd_printd("device disconnect %p (from %p), not found\n", device_data, |
141 | __builtin_return_address(0)); | ||
138 | return -ENXIO; | 142 | return -ENXIO; |
139 | } | 143 | } |
140 | 144 | ||
@@ -151,10 +155,10 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) | |||
151 | * Returns zero if successful, or a negative error code on failure or if the | 155 | * Returns zero if successful, or a negative error code on failure or if the |
152 | * device not found. | 156 | * device not found. |
153 | */ | 157 | */ |
154 | int snd_device_register(snd_card_t *card, void *device_data) | 158 | int snd_device_register(struct snd_card *card, void *device_data) |
155 | { | 159 | { |
156 | struct list_head *list; | 160 | struct list_head *list; |
157 | snd_device_t *dev; | 161 | struct snd_device *dev; |
158 | int err; | 162 | int err; |
159 | 163 | ||
160 | snd_assert(card != NULL, return -ENXIO); | 164 | snd_assert(card != NULL, return -ENXIO); |
@@ -179,10 +183,10 @@ int snd_device_register(snd_card_t *card, void *device_data) | |||
179 | * register all the devices on the card. | 183 | * register all the devices on the card. |
180 | * called from init.c | 184 | * called from init.c |
181 | */ | 185 | */ |
182 | int snd_device_register_all(snd_card_t *card) | 186 | int snd_device_register_all(struct snd_card *card) |
183 | { | 187 | { |
184 | struct list_head *list; | 188 | struct list_head *list; |
185 | snd_device_t *dev; | 189 | struct snd_device *dev; |
186 | int err; | 190 | int err; |
187 | 191 | ||
188 | snd_assert(card != NULL, return -ENXIO); | 192 | snd_assert(card != NULL, return -ENXIO); |
@@ -201,9 +205,9 @@ int snd_device_register_all(snd_card_t *card) | |||
201 | * disconnect all the devices on the card. | 205 | * disconnect all the devices on the card. |
202 | * called from init.c | 206 | * called from init.c |
203 | */ | 207 | */ |
204 | int snd_device_disconnect_all(snd_card_t *card) | 208 | int snd_device_disconnect_all(struct snd_card *card) |
205 | { | 209 | { |
206 | snd_device_t *dev; | 210 | struct snd_device *dev; |
207 | struct list_head *list; | 211 | struct list_head *list; |
208 | int err = 0; | 212 | int err = 0; |
209 | 213 | ||
@@ -220,9 +224,9 @@ int snd_device_disconnect_all(snd_card_t *card) | |||
220 | * release all the devices on the card. | 224 | * release all the devices on the card. |
221 | * called from init.c | 225 | * called from init.c |
222 | */ | 226 | */ |
223 | int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd) | 227 | int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd) |
224 | { | 228 | { |
225 | snd_device_t *dev; | 229 | struct snd_device *dev; |
226 | struct list_head *list; | 230 | struct list_head *list; |
227 | int err; | 231 | int err; |
228 | unsigned int range_low, range_high; | 232 | unsigned int range_low, range_high; |
diff --git a/sound/core/init.c b/sound/core/init.c index 33813f92ab5..dca64d199cb 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
@@ -40,14 +40,15 @@ struct snd_shutdown_f_ops { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | unsigned int snd_cards_lock = 0; /* locked for registering/using */ | 42 | unsigned int snd_cards_lock = 0; /* locked for registering/using */ |
43 | snd_card_t *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL}; | 43 | struct snd_card *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL}; |
44 | DEFINE_RWLOCK(snd_card_rwlock); | 44 | DEFINE_RWLOCK(snd_card_rwlock); |
45 | 45 | ||
46 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) | 46 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) |
47 | int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int free_flag); | 47 | int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag); |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | static void snd_card_id_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) | 50 | static void snd_card_id_read(struct snd_info_entry *entry, |
51 | struct snd_info_buffer *buffer) | ||
51 | { | 52 | { |
52 | snd_iprintf(buffer, "%s\n", entry->card->id); | 53 | snd_iprintf(buffer, "%s\n", entry->card->id); |
53 | } | 54 | } |
@@ -63,13 +64,13 @@ static void snd_card_free_thread(void * __card); | |||
63 | * | 64 | * |
64 | * Creates and initializes a soundcard structure. | 65 | * Creates and initializes a soundcard structure. |
65 | * | 66 | * |
66 | * Returns kmallocated snd_card_t structure. Creates the ALSA control interface | 67 | * Returns kmallocated snd_card structure. Creates the ALSA control interface |
67 | * (which is blocked until snd_card_register function is called). | 68 | * (which is blocked until snd_card_register function is called). |
68 | */ | 69 | */ |
69 | snd_card_t *snd_card_new(int idx, const char *xid, | 70 | struct snd_card *snd_card_new(int idx, const char *xid, |
70 | struct module *module, int extra_size) | 71 | struct module *module, int extra_size) |
71 | { | 72 | { |
72 | snd_card_t *card; | 73 | struct snd_card *card; |
73 | int err; | 74 | int err; |
74 | 75 | ||
75 | if (extra_size < 0) | 76 | if (extra_size < 0) |
@@ -132,7 +133,7 @@ snd_card_t *snd_card_new(int idx, const char *xid, | |||
132 | goto __error_ctl; | 133 | goto __error_ctl; |
133 | } | 134 | } |
134 | if (extra_size > 0) | 135 | if (extra_size > 0) |
135 | card->private_data = (char *)card + sizeof(snd_card_t); | 136 | card->private_data = (char *)card + sizeof(struct snd_card); |
136 | return card; | 137 | return card; |
137 | 138 | ||
138 | __error_ctl: | 139 | __error_ctl: |
@@ -158,7 +159,7 @@ static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait) | |||
158 | * Note: The current implementation replaces all active file->f_op with special | 159 | * Note: The current implementation replaces all active file->f_op with special |
159 | * dummy file operations (they do nothing except release). | 160 | * dummy file operations (they do nothing except release). |
160 | */ | 161 | */ |
161 | int snd_card_disconnect(snd_card_t * card) | 162 | int snd_card_disconnect(struct snd_card *card) |
162 | { | 163 | { |
163 | struct snd_monitor_file *mfile; | 164 | struct snd_monitor_file *mfile; |
164 | struct file *file; | 165 | struct file *file; |
@@ -229,7 +230,7 @@ int snd_card_disconnect(snd_card_t * card) | |||
229 | } | 230 | } |
230 | 231 | ||
231 | #ifdef CONFIG_SND_GENERIC_DRIVER | 232 | #ifdef CONFIG_SND_GENERIC_DRIVER |
232 | static void snd_generic_device_unregister(snd_card_t *card); | 233 | static void snd_generic_device_unregister(struct snd_card *card); |
233 | #else | 234 | #else |
234 | #define snd_generic_device_unregister(x) /*NOP*/ | 235 | #define snd_generic_device_unregister(x) /*NOP*/ |
235 | #endif | 236 | #endif |
@@ -245,7 +246,7 @@ static void snd_generic_device_unregister(snd_card_t *card); | |||
245 | * Returns zero. Frees all associated devices and frees the control | 246 | * Returns zero. Frees all associated devices and frees the control |
246 | * interface associated to given soundcard. | 247 | * interface associated to given soundcard. |
247 | */ | 248 | */ |
248 | int snd_card_free(snd_card_t * card) | 249 | int snd_card_free(struct snd_card *card) |
249 | { | 250 | { |
250 | struct snd_shutdown_f_ops *s_f_ops; | 251 | struct snd_shutdown_f_ops *s_f_ops; |
251 | 252 | ||
@@ -300,7 +301,7 @@ int snd_card_free(snd_card_t * card) | |||
300 | 301 | ||
301 | static void snd_card_free_thread(void * __card) | 302 | static void snd_card_free_thread(void * __card) |
302 | { | 303 | { |
303 | snd_card_t *card = __card; | 304 | struct snd_card *card = __card; |
304 | struct module * module = card->module; | 305 | struct module * module = card->module; |
305 | 306 | ||
306 | if (!try_module_get(module)) { | 307 | if (!try_module_get(module)) { |
@@ -327,7 +328,7 @@ static void snd_card_free_thread(void * __card) | |||
327 | * | 328 | * |
328 | * Returns - zero otherwise a negative error code if the start of thread failed. | 329 | * Returns - zero otherwise a negative error code if the start of thread failed. |
329 | */ | 330 | */ |
330 | int snd_card_free_in_thread(snd_card_t * card) | 331 | int snd_card_free_in_thread(struct snd_card *card) |
331 | { | 332 | { |
332 | if (card->files == NULL) { | 333 | if (card->files == NULL) { |
333 | snd_card_free(card); | 334 | snd_card_free(card); |
@@ -343,7 +344,7 @@ int snd_card_free_in_thread(snd_card_t * card) | |||
343 | return -EFAULT; | 344 | return -EFAULT; |
344 | } | 345 | } |
345 | 346 | ||
346 | static void choose_default_id(snd_card_t * card) | 347 | static void choose_default_id(struct snd_card *card) |
347 | { | 348 | { |
348 | int i, len, idx_flag = 0, loops = 8; | 349 | int i, len, idx_flag = 0, loops = 8; |
349 | char *id, *spos; | 350 | char *id, *spos; |
@@ -415,10 +416,10 @@ static void choose_default_id(snd_card_t * card) | |||
415 | * | 416 | * |
416 | * Returns zero otherwise a negative error code if the registrain failed. | 417 | * Returns zero otherwise a negative error code if the registrain failed. |
417 | */ | 418 | */ |
418 | int snd_card_register(snd_card_t * card) | 419 | int snd_card_register(struct snd_card *card) |
419 | { | 420 | { |
420 | int err; | 421 | int err; |
421 | snd_info_entry_t *entry; | 422 | struct snd_info_entry *entry; |
422 | 423 | ||
423 | snd_assert(card != NULL, return -EINVAL); | 424 | snd_assert(card != NULL, return -EINVAL); |
424 | if ((err = snd_device_register_all(card)) < 0) | 425 | if ((err = snd_device_register_all(card)) < 0) |
@@ -456,12 +457,12 @@ int snd_card_register(snd_card_t * card) | |||
456 | return 0; | 457 | return 0; |
457 | } | 458 | } |
458 | 459 | ||
459 | static snd_info_entry_t *snd_card_info_entry = NULL; | 460 | static struct snd_info_entry *snd_card_info_entry = NULL; |
460 | 461 | ||
461 | static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) | 462 | static void snd_card_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
462 | { | 463 | { |
463 | int idx, count; | 464 | int idx, count; |
464 | snd_card_t *card; | 465 | struct snd_card *card; |
465 | 466 | ||
466 | for (idx = count = 0; idx < SNDRV_CARDS; idx++) { | 467 | for (idx = count = 0; idx < SNDRV_CARDS; idx++) { |
467 | read_lock(&snd_card_rwlock); | 468 | read_lock(&snd_card_rwlock); |
@@ -483,10 +484,10 @@ static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buff | |||
483 | 484 | ||
484 | #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) | 485 | #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) |
485 | 486 | ||
486 | void snd_card_info_read_oss(snd_info_buffer_t * buffer) | 487 | void snd_card_info_read_oss(struct snd_info_buffer *buffer) |
487 | { | 488 | { |
488 | int idx, count; | 489 | int idx, count; |
489 | snd_card_t *card; | 490 | struct snd_card *card; |
490 | 491 | ||
491 | for (idx = count = 0; idx < SNDRV_CARDS; idx++) { | 492 | for (idx = count = 0; idx < SNDRV_CARDS; idx++) { |
492 | read_lock(&snd_card_rwlock); | 493 | read_lock(&snd_card_rwlock); |
@@ -504,11 +505,12 @@ void snd_card_info_read_oss(snd_info_buffer_t * buffer) | |||
504 | #endif | 505 | #endif |
505 | 506 | ||
506 | #ifdef MODULE | 507 | #ifdef MODULE |
507 | static snd_info_entry_t *snd_card_module_info_entry; | 508 | static struct snd_info_entry *snd_card_module_info_entry; |
508 | static void snd_card_module_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) | 509 | static void snd_card_module_info_read(struct snd_info_entry *entry, |
510 | struct snd_info_buffer *buffer) | ||
509 | { | 511 | { |
510 | int idx; | 512 | int idx; |
511 | snd_card_t *card; | 513 | struct snd_card *card; |
512 | 514 | ||
513 | for (idx = 0; idx < SNDRV_CARDS; idx++) { | 515 | for (idx = 0; idx < SNDRV_CARDS; idx++) { |
514 | read_lock(&snd_card_rwlock); | 516 | read_lock(&snd_card_rwlock); |
@@ -521,7 +523,7 @@ static void snd_card_module_info_read(snd_info_entry_t *entry, snd_info_buffer_t | |||
521 | 523 | ||
522 | int __init snd_card_info_init(void) | 524 | int __init snd_card_info_init(void) |
523 | { | 525 | { |
524 | snd_info_entry_t *entry; | 526 | struct snd_info_entry *entry; |
525 | 527 | ||
526 | entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL); | 528 | entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL); |
527 | if (! entry) | 529 | if (! entry) |
@@ -571,7 +573,7 @@ int __exit snd_card_info_done(void) | |||
571 | * Returns zero otherwise a negative error code. | 573 | * Returns zero otherwise a negative error code. |
572 | */ | 574 | */ |
573 | 575 | ||
574 | int snd_component_add(snd_card_t *card, const char *component) | 576 | int snd_component_add(struct snd_card *card, const char *component) |
575 | { | 577 | { |
576 | char *ptr; | 578 | char *ptr; |
577 | int len = strlen(component); | 579 | int len = strlen(component); |
@@ -602,7 +604,7 @@ int snd_component_add(snd_card_t *card, const char *component) | |||
602 | * | 604 | * |
603 | * Returns zero or a negative error code. | 605 | * Returns zero or a negative error code. |
604 | */ | 606 | */ |
605 | int snd_card_file_add(snd_card_t *card, struct file *file) | 607 | int snd_card_file_add(struct snd_card *card, struct file *file) |
606 | { | 608 | { |
607 | struct snd_monitor_file *mfile; | 609 | struct snd_monitor_file *mfile; |
608 | 610 | ||
@@ -636,7 +638,7 @@ int snd_card_file_add(snd_card_t *card, struct file *file) | |||
636 | * | 638 | * |
637 | * Returns zero or a negative error code. | 639 | * Returns zero or a negative error code. |
638 | */ | 640 | */ |
639 | int snd_card_file_remove(snd_card_t *card, struct file *file) | 641 | int snd_card_file_remove(struct snd_card *card, struct file *file) |
640 | { | 642 | { |
641 | struct snd_monitor_file *mfile, *pfile = NULL; | 643 | struct snd_monitor_file *mfile, *pfile = NULL; |
642 | 644 | ||
@@ -671,7 +673,7 @@ int snd_card_file_remove(snd_card_t *card, struct file *file) | |||
671 | */ | 673 | */ |
672 | struct snd_generic_device { | 674 | struct snd_generic_device { |
673 | struct platform_device pdev; | 675 | struct platform_device pdev; |
674 | snd_card_t *card; | 676 | struct snd_card *card; |
675 | }; | 677 | }; |
676 | 678 | ||
677 | #define get_snd_generic_card(dev) container_of(dev, struct snd_generic_device, pdev)->card | 679 | #define get_snd_generic_card(dev) container_of(dev, struct snd_generic_device, pdev)->card |
@@ -698,7 +700,7 @@ void snd_generic_device_release(struct device *dev) | |||
698 | { | 700 | { |
699 | } | 701 | } |
700 | 702 | ||
701 | static int snd_generic_device_register(snd_card_t *card) | 703 | static int snd_generic_device_register(struct snd_card *card) |
702 | { | 704 | { |
703 | struct snd_generic_device *dev; | 705 | struct snd_generic_device *dev; |
704 | int err; | 706 | int err; |
@@ -724,7 +726,7 @@ static int snd_generic_device_register(snd_card_t *card) | |||
724 | return 0; | 726 | return 0; |
725 | } | 727 | } |
726 | 728 | ||
727 | static void snd_generic_device_unregister(snd_card_t *card) | 729 | static void snd_generic_device_unregister(struct snd_card *card) |
728 | { | 730 | { |
729 | struct snd_generic_device *dev = card->generic_dev; | 731 | struct snd_generic_device *dev = card->generic_dev; |
730 | if (dev) { | 732 | if (dev) { |
@@ -744,7 +746,7 @@ static void snd_generic_device_unregister(snd_card_t *card) | |||
744 | * | 746 | * |
745 | * Returns zero if successful, or a negative error code. | 747 | * Returns zero if successful, or a negative error code. |
746 | */ | 748 | */ |
747 | int snd_card_set_generic_dev(snd_card_t *card) | 749 | int snd_card_set_generic_dev(struct snd_card *card) |
748 | { | 750 | { |
749 | int err; | 751 | int err; |
750 | if ((err = snd_generic_device_register(card)) < 0) | 752 | if ((err = snd_generic_device_register(card)) < 0) |
@@ -766,7 +768,7 @@ int snd_card_set_generic_dev(snd_card_t *card) | |||
766 | * | 768 | * |
767 | * Note: the power lock must be active before call. | 769 | * Note: the power lock must be active before call. |
768 | */ | 770 | */ |
769 | int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file) | 771 | int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file) |
770 | { | 772 | { |
771 | wait_queue_t wait; | 773 | wait_queue_t wait; |
772 | int result = 0; | 774 | int result = 0; |
@@ -809,9 +811,9 @@ int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file | |||
809 | * These callbacks are called from ALSA's common PCI suspend/resume | 811 | * These callbacks are called from ALSA's common PCI suspend/resume |
810 | * handler and from the control API. | 812 | * handler and from the control API. |
811 | */ | 813 | */ |
812 | int snd_card_set_pm_callback(snd_card_t *card, | 814 | int snd_card_set_pm_callback(struct snd_card *card, |
813 | int (*suspend)(snd_card_t *, pm_message_t), | 815 | int (*suspend)(struct snd_card *, pm_message_t), |
814 | int (*resume)(snd_card_t *), | 816 | int (*resume)(struct snd_card *), |
815 | void *private_data) | 817 | void *private_data) |
816 | { | 818 | { |
817 | card->pm_suspend = suspend; | 819 | card->pm_suspend = suspend; |
@@ -824,7 +826,7 @@ int snd_card_set_pm_callback(snd_card_t *card, | |||
824 | /* suspend/resume callbacks for snd_generic platform device */ | 826 | /* suspend/resume callbacks for snd_generic platform device */ |
825 | static int snd_generic_suspend(struct platform_device *dev, pm_message_t state) | 827 | static int snd_generic_suspend(struct platform_device *dev, pm_message_t state) |
826 | { | 828 | { |
827 | snd_card_t *card; | 829 | struct snd_card *card; |
828 | 830 | ||
829 | card = get_snd_generic_card(dev); | 831 | card = get_snd_generic_card(dev); |
830 | if (card->power_state == SNDRV_CTL_POWER_D3hot) | 832 | if (card->power_state == SNDRV_CTL_POWER_D3hot) |
@@ -837,7 +839,7 @@ static int snd_generic_suspend(struct platform_device *dev, pm_message_t state) | |||
837 | 839 | ||
838 | static int snd_generic_resume(struct platform_device *dev) | 840 | static int snd_generic_resume(struct platform_device *dev) |
839 | { | 841 | { |
840 | snd_card_t *card; | 842 | struct snd_card *card; |
841 | 843 | ||
842 | card = get_snd_generic_card(dev); | 844 | card = get_snd_generic_card(dev); |
843 | if (card->power_state == SNDRV_CTL_POWER_D0) | 845 | if (card->power_state == SNDRV_CTL_POWER_D0) |
@@ -859,9 +861,9 @@ static int snd_generic_resume(struct platform_device *dev) | |||
859 | * the given card. These callbacks are called from the ALSA's common | 861 | * the given card. These callbacks are called from the ALSA's common |
860 | * PM handler and from the control API. | 862 | * PM handler and from the control API. |
861 | */ | 863 | */ |
862 | int snd_card_set_generic_pm_callback(snd_card_t *card, | 864 | int snd_card_set_generic_pm_callback(struct snd_card *card, |
863 | int (*suspend)(snd_card_t *, pm_message_t), | 865 | int (*suspend)(struct snd_card *, pm_message_t), |
864 | int (*resume)(snd_card_t *), | 866 | int (*resume)(struct snd_card *), |
865 | void *private_data) | 867 | void *private_data) |
866 | { | 868 | { |
867 | int err; | 869 | int err; |
@@ -874,7 +876,7 @@ int snd_card_set_generic_pm_callback(snd_card_t *card, | |||
874 | #ifdef CONFIG_PCI | 876 | #ifdef CONFIG_PCI |
875 | int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state) | 877 | int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state) |
876 | { | 878 | { |
877 | snd_card_t *card = pci_get_drvdata(dev); | 879 | struct snd_card *card = pci_get_drvdata(dev); |
878 | int err; | 880 | int err; |
879 | if (! card || ! card->pm_suspend) | 881 | if (! card || ! card->pm_suspend) |
880 | return 0; | 882 | return 0; |
@@ -888,7 +890,7 @@ int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state) | |||
888 | 890 | ||
889 | int snd_card_pci_resume(struct pci_dev *dev) | 891 | int snd_card_pci_resume(struct pci_dev *dev) |
890 | { | 892 | { |
891 | snd_card_t *card = pci_get_drvdata(dev); | 893 | struct snd_card *card = pci_get_drvdata(dev); |
892 | if (! card || ! card->pm_resume) | 894 | if (! card || ! card->pm_resume) |
893 | return 0; | 895 | return 0; |
894 | if (card->power_state == SNDRV_CTL_POWER_D0) | 896 | if (card->power_state == SNDRV_CTL_POWER_D0) |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 6e7cad1e947..04de0084e42 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -108,13 +108,13 @@ static void snd_request_other(int minor) | |||
108 | 108 | ||
109 | #endif /* request_module support */ | 109 | #endif /* request_module support */ |
110 | 110 | ||
111 | static snd_minor_t *snd_minor_search(int minor) | 111 | static struct snd_minor *snd_minor_search(int minor) |
112 | { | 112 | { |
113 | struct list_head *list; | 113 | struct list_head *list; |
114 | snd_minor_t *mptr; | 114 | struct snd_minor *mptr; |
115 | 115 | ||
116 | list_for_each(list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]) { | 116 | list_for_each(list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]) { |
117 | mptr = list_entry(list, snd_minor_t, list); | 117 | mptr = list_entry(list, struct snd_minor, list); |
118 | if (mptr->number == minor) | 118 | if (mptr->number == minor) |
119 | return mptr; | 119 | return mptr; |
120 | } | 120 | } |
@@ -126,7 +126,7 @@ static int snd_open(struct inode *inode, struct file *file) | |||
126 | int minor = iminor(inode); | 126 | int minor = iminor(inode); |
127 | int card = SNDRV_MINOR_CARD(minor); | 127 | int card = SNDRV_MINOR_CARD(minor); |
128 | int dev = SNDRV_MINOR_DEVICE(minor); | 128 | int dev = SNDRV_MINOR_DEVICE(minor); |
129 | snd_minor_t *mptr = NULL; | 129 | struct snd_minor *mptr = NULL; |
130 | struct file_operations *old_fops; | 130 | struct file_operations *old_fops; |
131 | int err = 0; | 131 | int err = 0; |
132 | 132 | ||
@@ -164,7 +164,7 @@ static struct file_operations snd_fops = | |||
164 | .open = snd_open | 164 | .open = snd_open |
165 | }; | 165 | }; |
166 | 166 | ||
167 | static int snd_kernel_minor(int type, snd_card_t * card, int dev) | 167 | static int snd_kernel_minor(int type, struct snd_card *card, int dev) |
168 | { | 168 | { |
169 | int minor; | 169 | int minor; |
170 | 170 | ||
@@ -196,7 +196,7 @@ static int snd_kernel_minor(int type, snd_card_t * card, int dev) | |||
196 | * @type: the device type, SNDRV_DEVICE_TYPE_XXX | 196 | * @type: the device type, SNDRV_DEVICE_TYPE_XXX |
197 | * @card: the card instance | 197 | * @card: the card instance |
198 | * @dev: the device index | 198 | * @dev: the device index |
199 | * @reg: the snd_minor_t record | 199 | * @reg: the struct snd_minor record |
200 | * @name: the device file name | 200 | * @name: the device file name |
201 | * | 201 | * |
202 | * Registers an ALSA device file for the given card. | 202 | * Registers an ALSA device file for the given card. |
@@ -204,16 +204,16 @@ static int snd_kernel_minor(int type, snd_card_t * card, int dev) | |||
204 | * | 204 | * |
205 | * Retrurns zero if successful, or a negative error code on failure. | 205 | * Retrurns zero if successful, or a negative error code on failure. |
206 | */ | 206 | */ |
207 | int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg, const char *name) | 207 | int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor * reg, const char *name) |
208 | { | 208 | { |
209 | int minor = snd_kernel_minor(type, card, dev); | 209 | int minor = snd_kernel_minor(type, card, dev); |
210 | snd_minor_t *preg; | 210 | struct snd_minor *preg; |
211 | struct device *device = NULL; | 211 | struct device *device = NULL; |
212 | 212 | ||
213 | if (minor < 0) | 213 | if (minor < 0) |
214 | return minor; | 214 | return minor; |
215 | snd_assert(name, return -EINVAL); | 215 | snd_assert(name, return -EINVAL); |
216 | preg = (snd_minor_t *)kmalloc(sizeof(snd_minor_t) + strlen(name) + 1, GFP_KERNEL); | 216 | preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL); |
217 | if (preg == NULL) | 217 | if (preg == NULL) |
218 | return -ENOMEM; | 218 | return -ENOMEM; |
219 | *preg = *reg; | 219 | *preg = *reg; |
@@ -248,10 +248,10 @@ int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg, | |||
248 | * | 248 | * |
249 | * Returns zero if sucecessful, or a negative error code on failure | 249 | * Returns zero if sucecessful, or a negative error code on failure |
250 | */ | 250 | */ |
251 | int snd_unregister_device(int type, snd_card_t * card, int dev) | 251 | int snd_unregister_device(int type, struct snd_card *card, int dev) |
252 | { | 252 | { |
253 | int minor = snd_kernel_minor(type, card, dev); | 253 | int minor = snd_kernel_minor(type, card, dev); |
254 | snd_minor_t *mptr; | 254 | struct snd_minor *mptr; |
255 | 255 | ||
256 | if (minor < 0) | 256 | if (minor < 0) |
257 | return minor; | 257 | return minor; |
@@ -275,18 +275,18 @@ int snd_unregister_device(int type, snd_card_t * card, int dev) | |||
275 | * INFO PART | 275 | * INFO PART |
276 | */ | 276 | */ |
277 | 277 | ||
278 | static snd_info_entry_t *snd_minor_info_entry = NULL; | 278 | static struct snd_info_entry *snd_minor_info_entry = NULL; |
279 | 279 | ||
280 | static void snd_minor_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) | 280 | static void snd_minor_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
281 | { | 281 | { |
282 | int card, device; | 282 | int card, device; |
283 | struct list_head *list; | 283 | struct list_head *list; |
284 | snd_minor_t *mptr; | 284 | struct snd_minor *mptr; |
285 | 285 | ||
286 | down(&sound_mutex); | 286 | down(&sound_mutex); |
287 | for (card = 0; card < SNDRV_CARDS; card++) { | 287 | for (card = 0; card < SNDRV_CARDS; card++) { |
288 | list_for_each(list, &snd_minors_hash[card]) { | 288 | list_for_each(list, &snd_minors_hash[card]) { |
289 | mptr = list_entry(list, snd_minor_t, list); | 289 | mptr = list_entry(list, struct snd_minor, list); |
290 | if (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_GLOBAL) { | 290 | if (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_GLOBAL) { |
291 | if ((device = mptr->device) >= 0) | 291 | if ((device = mptr->device) >= 0) |
292 | snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, mptr->comment); | 292 | snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, mptr->comment); |
@@ -302,7 +302,7 @@ static void snd_minor_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buf | |||
302 | 302 | ||
303 | int __init snd_minor_info_init(void) | 303 | int __init snd_minor_info_init(void) |
304 | { | 304 | { |
305 | snd_info_entry_t *entry; | 305 | struct snd_info_entry *entry; |
306 | 306 | ||
307 | entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL); | 307 | entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL); |
308 | if (entry) { | 308 | if (entry) { |