diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 07:59:38 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:17:43 -0500 |
commit | 877211f5e1b1196179ba1290e8e1a3dc00427c55 (patch) | |
tree | 9964e0e46043cee6c76a614ac35ab982faba7f99 /include/sound/pcm.h | |
parent | 24c1f93188b4438c7f30df5b4cd78340cdb28daf (diff) |
[ALSA] Remove xxx_t typedefs: PCM
Modules: PCM Midlevel
Remove xxx_t typedefs from the core PCM codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r-- | include/sound/pcm.h | 477 |
1 files changed, 227 insertions, 250 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index acc4fa9d5abe..7e77c0add80a 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -28,36 +28,9 @@ | |||
28 | #include <linux/poll.h> | 28 | #include <linux/poll.h> |
29 | #include <linux/bitops.h> | 29 | #include <linux/bitops.h> |
30 | 30 | ||
31 | typedef sndrv_pcm_uframes_t snd_pcm_uframes_t; | ||
32 | typedef sndrv_pcm_sframes_t snd_pcm_sframes_t; | ||
33 | typedef enum sndrv_pcm_class snd_pcm_class_t; | ||
34 | typedef enum sndrv_pcm_subclass snd_pcm_subclass_t; | ||
35 | typedef enum sndrv_pcm_stream snd_pcm_stream_t; | ||
36 | typedef enum sndrv_pcm_access snd_pcm_access_t; | ||
37 | typedef enum sndrv_pcm_format snd_pcm_format_t; | ||
38 | typedef enum sndrv_pcm_subformat snd_pcm_subformat_t; | ||
39 | typedef enum sndrv_pcm_state snd_pcm_state_t; | ||
40 | typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t; | ||
41 | typedef struct sndrv_pcm_info snd_pcm_info_t; | ||
42 | typedef enum sndrv_pcm_hw_param snd_pcm_hw_param_t; | ||
43 | typedef struct sndrv_pcm_hw_params snd_pcm_hw_params_t; | ||
44 | typedef enum sndrv_pcm_start snd_pcm_start_t; | ||
45 | typedef enum sndrv_pcm_xrun snd_pcm_xrun_t; | ||
46 | typedef enum sndrv_pcm_tstamp snd_pcm_tstamp_t; | ||
47 | typedef struct sndrv_pcm_sw_params snd_pcm_sw_params_t; | ||
48 | typedef struct sndrv_pcm_channel_info snd_pcm_channel_info_t; | ||
49 | typedef struct sndrv_pcm_status snd_pcm_status_t; | ||
50 | typedef struct sndrv_pcm_mmap_status snd_pcm_mmap_status_t; | ||
51 | typedef struct sndrv_pcm_mmap_control snd_pcm_mmap_control_t; | ||
52 | typedef struct sndrv_mask snd_mask_t; | ||
53 | typedef struct snd_sg_buf snd_pcm_sgbuf_t; | ||
54 | |||
55 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) | 31 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) |
56 | #define snd_pcm_chip(pcm) ((pcm)->private_data) | 32 | #define snd_pcm_chip(pcm) ((pcm)->private_data) |
57 | 33 | ||
58 | typedef struct _snd_pcm_file snd_pcm_file_t; | ||
59 | typedef struct _snd_pcm_runtime snd_pcm_runtime_t; | ||
60 | |||
61 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 34 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
62 | #include "pcm_oss.h" | 35 | #include "pcm_oss.h" |
63 | #endif | 36 | #endif |
@@ -66,7 +39,7 @@ typedef struct _snd_pcm_runtime snd_pcm_runtime_t; | |||
66 | * Hardware (lowlevel) section | 39 | * Hardware (lowlevel) section |
67 | */ | 40 | */ |
68 | 41 | ||
69 | typedef struct _snd_pcm_hardware { | 42 | struct snd_pcm_hardware { |
70 | unsigned int info; /* SNDRV_PCM_INFO_* */ | 43 | unsigned int info; /* SNDRV_PCM_INFO_* */ |
71 | u64 formats; /* SNDRV_PCM_FMTBIT_* */ | 44 | u64 formats; /* SNDRV_PCM_FMTBIT_* */ |
72 | unsigned int rates; /* SNDRV_PCM_RATE_* */ | 45 | unsigned int rates; /* SNDRV_PCM_RATE_* */ |
@@ -80,26 +53,29 @@ typedef struct _snd_pcm_hardware { | |||
80 | unsigned int periods_min; /* min # of periods */ | 53 | unsigned int periods_min; /* min # of periods */ |
81 | unsigned int periods_max; /* max # of periods */ | 54 | unsigned int periods_max; /* max # of periods */ |
82 | size_t fifo_size; /* fifo size in bytes */ | 55 | size_t fifo_size; /* fifo size in bytes */ |
83 | } snd_pcm_hardware_t; | 56 | }; |
84 | 57 | ||
85 | typedef struct _snd_pcm_ops { | 58 | struct snd_pcm_ops { |
86 | int (*open)(snd_pcm_substream_t *substream); | 59 | int (*open)(struct snd_pcm_substream *substream); |
87 | int (*close)(snd_pcm_substream_t *substream); | 60 | int (*close)(struct snd_pcm_substream *substream); |
88 | int (*ioctl)(snd_pcm_substream_t * substream, | 61 | int (*ioctl)(struct snd_pcm_substream * substream, |
89 | unsigned int cmd, void *arg); | 62 | unsigned int cmd, void *arg); |
90 | int (*hw_params)(snd_pcm_substream_t * substream, snd_pcm_hw_params_t * params); | 63 | int (*hw_params)(struct snd_pcm_substream *substream, |
91 | int (*hw_free)(snd_pcm_substream_t *substream); | 64 | struct snd_pcm_hw_params *params); |
92 | int (*prepare)(snd_pcm_substream_t * substream); | 65 | int (*hw_free)(struct snd_pcm_substream *substream); |
93 | int (*trigger)(snd_pcm_substream_t * substream, int cmd); | 66 | int (*prepare)(struct snd_pcm_substream *substream); |
94 | snd_pcm_uframes_t (*pointer)(snd_pcm_substream_t * substream); | 67 | int (*trigger)(struct snd_pcm_substream *substream, int cmd); |
95 | int (*copy)(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t pos, | 68 | snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); |
69 | int (*copy)(struct snd_pcm_substream *substream, int channel, | ||
70 | snd_pcm_uframes_t pos, | ||
96 | void __user *buf, snd_pcm_uframes_t count); | 71 | void __user *buf, snd_pcm_uframes_t count); |
97 | int (*silence)(snd_pcm_substream_t *substream, int channel, | 72 | int (*silence)(struct snd_pcm_substream *substream, int channel, |
98 | snd_pcm_uframes_t pos, snd_pcm_uframes_t count); | 73 | snd_pcm_uframes_t pos, snd_pcm_uframes_t count); |
99 | struct page *(*page)(snd_pcm_substream_t *substream, unsigned long offset); | 74 | struct page *(*page)(struct snd_pcm_substream *substream, |
100 | int (*mmap)(snd_pcm_substream_t *substream, struct vm_area_struct *vma); | 75 | unsigned long offset); |
101 | int (*ack)(snd_pcm_substream_t *substream); | 76 | int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma); |
102 | } snd_pcm_ops_t; | 77 | int (*ack)(struct snd_pcm_substream *substream); |
78 | }; | ||
103 | 79 | ||
104 | /* | 80 | /* |
105 | * | 81 | * |
@@ -212,17 +188,16 @@ typedef struct _snd_pcm_ops { | |||
212 | #define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE | 188 | #define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE |
213 | #endif | 189 | #endif |
214 | 190 | ||
215 | struct _snd_pcm_file { | 191 | struct snd_pcm_file { |
216 | snd_pcm_substream_t * substream; | 192 | struct snd_pcm_substream *substream; |
217 | struct _snd_pcm_file * next; | 193 | struct snd_pcm_file *next; |
218 | }; | 194 | }; |
219 | 195 | ||
220 | typedef struct _snd_pcm_hw_rule snd_pcm_hw_rule_t; | 196 | struct snd_pcm_hw_rule; |
197 | typedef int (*snd_pcm_hw_rule_func_t)(struct snd_pcm_hw_params *params, | ||
198 | struct snd_pcm_hw_rule *rule); | ||
221 | 199 | ||
222 | typedef int (*snd_pcm_hw_rule_func_t)(snd_pcm_hw_params_t *params, | 200 | struct snd_pcm_hw_rule { |
223 | snd_pcm_hw_rule_t *rule); | ||
224 | |||
225 | struct _snd_pcm_hw_rule { | ||
226 | unsigned int cond; | 201 | unsigned int cond; |
227 | snd_pcm_hw_rule_func_t func; | 202 | snd_pcm_hw_rule_func_t func; |
228 | int var; | 203 | int var; |
@@ -230,57 +205,57 @@ struct _snd_pcm_hw_rule { | |||
230 | void *private; | 205 | void *private; |
231 | }; | 206 | }; |
232 | 207 | ||
233 | typedef struct _snd_pcm_hw_constraints { | 208 | struct snd_pcm_hw_constraints { |
234 | snd_mask_t masks[SNDRV_PCM_HW_PARAM_LAST_MASK - | 209 | struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - |
235 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; | 210 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; |
236 | snd_interval_t intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - | 211 | struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - |
237 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; | 212 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; |
238 | unsigned int rules_num; | 213 | unsigned int rules_num; |
239 | unsigned int rules_all; | 214 | unsigned int rules_all; |
240 | snd_pcm_hw_rule_t *rules; | 215 | struct snd_pcm_hw_rule *rules; |
241 | } snd_pcm_hw_constraints_t; | 216 | }; |
242 | 217 | ||
243 | static inline snd_mask_t *constrs_mask(snd_pcm_hw_constraints_t *constrs, | 218 | static inline struct snd_mask *constrs_mask(struct snd_pcm_hw_constraints *constrs, |
244 | snd_pcm_hw_param_t var) | 219 | snd_pcm_hw_param_t var) |
245 | { | 220 | { |
246 | return &constrs->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; | 221 | return &constrs->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; |
247 | } | 222 | } |
248 | 223 | ||
249 | static inline snd_interval_t *constrs_interval(snd_pcm_hw_constraints_t *constrs, | 224 | static inline struct snd_interval *constrs_interval(struct snd_pcm_hw_constraints *constrs, |
250 | snd_pcm_hw_param_t var) | 225 | snd_pcm_hw_param_t var) |
251 | { | 226 | { |
252 | return &constrs->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; | 227 | return &constrs->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; |
253 | } | 228 | } |
254 | 229 | ||
255 | typedef struct { | 230 | struct snd_ratnum { |
256 | unsigned int num; | 231 | unsigned int num; |
257 | unsigned int den_min, den_max, den_step; | 232 | unsigned int den_min, den_max, den_step; |
258 | } ratnum_t; | 233 | }; |
259 | 234 | ||
260 | typedef struct { | 235 | struct snd_ratden { |
261 | unsigned int num_min, num_max, num_step; | 236 | unsigned int num_min, num_max, num_step; |
262 | unsigned int den; | 237 | unsigned int den; |
263 | } ratden_t; | 238 | }; |
264 | 239 | ||
265 | typedef struct { | 240 | struct snd_pcm_hw_constraint_ratnums { |
266 | int nrats; | 241 | int nrats; |
267 | ratnum_t *rats; | 242 | struct snd_ratnum *rats; |
268 | } snd_pcm_hw_constraint_ratnums_t; | 243 | }; |
269 | 244 | ||
270 | typedef struct { | 245 | struct snd_pcm_hw_constraint_ratdens { |
271 | int nrats; | 246 | int nrats; |
272 | ratden_t *rats; | 247 | struct snd_ratden *rats; |
273 | } snd_pcm_hw_constraint_ratdens_t; | 248 | }; |
274 | 249 | ||
275 | typedef struct { | 250 | struct snd_pcm_hw_constraint_list { |
276 | unsigned int count; | 251 | unsigned int count; |
277 | unsigned int *list; | 252 | unsigned int *list; |
278 | unsigned int mask; | 253 | unsigned int mask; |
279 | } snd_pcm_hw_constraint_list_t; | 254 | }; |
280 | 255 | ||
281 | struct _snd_pcm_runtime { | 256 | struct snd_pcm_runtime { |
282 | /* -- Status -- */ | 257 | /* -- Status -- */ |
283 | snd_pcm_substream_t *trigger_master; | 258 | struct snd_pcm_substream *trigger_master; |
284 | struct timespec trigger_tstamp; /* trigger timestamp */ | 259 | struct timespec trigger_tstamp; /* trigger timestamp */ |
285 | int overrange; | 260 | int overrange; |
286 | snd_pcm_uframes_t avail_max; | 261 | snd_pcm_uframes_t avail_max; |
@@ -306,7 +281,7 @@ struct _snd_pcm_runtime { | |||
306 | unsigned int rate_den; | 281 | unsigned int rate_den; |
307 | 282 | ||
308 | /* -- SW params -- */ | 283 | /* -- SW params -- */ |
309 | snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */ | 284 | int tstamp_mode; /* mmap timestamp is updated */ |
310 | unsigned int period_step; | 285 | unsigned int period_step; |
311 | unsigned int sleep_min; /* min ticks to sleep */ | 286 | unsigned int sleep_min; /* min ticks to sleep */ |
312 | snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ | 287 | snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ |
@@ -320,11 +295,11 @@ struct _snd_pcm_runtime { | |||
320 | snd_pcm_uframes_t silence_start; /* starting pointer to silence area */ | 295 | snd_pcm_uframes_t silence_start; /* starting pointer to silence area */ |
321 | snd_pcm_uframes_t silence_filled; /* size filled with silence */ | 296 | snd_pcm_uframes_t silence_filled; /* size filled with silence */ |
322 | 297 | ||
323 | snd_pcm_sync_id_t sync; /* hardware synchronization ID */ | 298 | union snd_pcm_sync_id sync; /* hardware synchronization ID */ |
324 | 299 | ||
325 | /* -- mmap -- */ | 300 | /* -- mmap -- */ |
326 | volatile snd_pcm_mmap_status_t *status; | 301 | volatile struct snd_pcm_mmap_status *status; |
327 | volatile snd_pcm_mmap_control_t *control; | 302 | volatile struct snd_pcm_mmap_control *control; |
328 | atomic_t mmap_count; | 303 | atomic_t mmap_count; |
329 | 304 | ||
330 | /* -- locking / scheduling -- */ | 305 | /* -- locking / scheduling -- */ |
@@ -334,15 +309,15 @@ struct _snd_pcm_runtime { | |||
334 | 309 | ||
335 | /* -- private section -- */ | 310 | /* -- private section -- */ |
336 | void *private_data; | 311 | void *private_data; |
337 | void (*private_free)(snd_pcm_runtime_t *runtime); | 312 | void (*private_free)(struct snd_pcm_runtime *runtime); |
338 | 313 | ||
339 | /* -- hardware description -- */ | 314 | /* -- hardware description -- */ |
340 | snd_pcm_hardware_t hw; | 315 | struct snd_pcm_hardware hw; |
341 | snd_pcm_hw_constraints_t hw_constraints; | 316 | struct snd_pcm_hw_constraints hw_constraints; |
342 | 317 | ||
343 | /* -- interrupt callbacks -- */ | 318 | /* -- interrupt callbacks -- */ |
344 | void (*transfer_ack_begin)(snd_pcm_substream_t *substream); | 319 | void (*transfer_ack_begin)(struct snd_pcm_substream *substream); |
345 | void (*transfer_ack_end)(snd_pcm_substream_t *substream); | 320 | void (*transfer_ack_end)(struct snd_pcm_substream *substream); |
346 | 321 | ||
347 | /* -- timer -- */ | 322 | /* -- timer -- */ |
348 | unsigned int timer_resolution; /* timer resolution */ | 323 | unsigned int timer_resolution; /* timer resolution */ |
@@ -356,19 +331,19 @@ struct _snd_pcm_runtime { | |||
356 | 331 | ||
357 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 332 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
358 | /* -- OSS things -- */ | 333 | /* -- OSS things -- */ |
359 | snd_pcm_oss_runtime_t oss; | 334 | struct snd_pcm_oss_runtime oss; |
360 | #endif | 335 | #endif |
361 | }; | 336 | }; |
362 | 337 | ||
363 | typedef struct _snd_pcm_group { /* keep linked substreams */ | 338 | struct snd_pcm_group { /* keep linked substreams */ |
364 | spinlock_t lock; | 339 | spinlock_t lock; |
365 | struct list_head substreams; | 340 | struct list_head substreams; |
366 | int count; | 341 | int count; |
367 | } snd_pcm_group_t; | 342 | }; |
368 | 343 | ||
369 | struct _snd_pcm_substream { | 344 | struct snd_pcm_substream { |
370 | snd_pcm_t *pcm; | 345 | struct snd_pcm *pcm; |
371 | snd_pcm_str_t *pstr; | 346 | struct snd_pcm_str *pstr; |
372 | void *private_data; /* copied from pcm->private_data */ | 347 | void *private_data; /* copied from pcm->private_data */ |
373 | int number; | 348 | int number; |
374 | char name[32]; /* substream name */ | 349 | char name[32]; /* substream name */ |
@@ -378,32 +353,32 @@ struct _snd_pcm_substream { | |||
378 | unsigned int dma_buf_id; | 353 | unsigned int dma_buf_id; |
379 | size_t dma_max; | 354 | size_t dma_max; |
380 | /* -- hardware operations -- */ | 355 | /* -- hardware operations -- */ |
381 | snd_pcm_ops_t *ops; | 356 | struct snd_pcm_ops *ops; |
382 | /* -- runtime information -- */ | 357 | /* -- runtime information -- */ |
383 | snd_pcm_runtime_t *runtime; | 358 | struct snd_pcm_runtime *runtime; |
384 | /* -- timer section -- */ | 359 | /* -- timer section -- */ |
385 | snd_timer_t *timer; /* timer */ | 360 | struct snd_timer *timer; /* timer */ |
386 | unsigned timer_running: 1; /* time is running */ | 361 | unsigned timer_running: 1; /* time is running */ |
387 | spinlock_t timer_lock; | 362 | spinlock_t timer_lock; |
388 | /* -- next substream -- */ | 363 | /* -- next substream -- */ |
389 | snd_pcm_substream_t *next; | 364 | struct snd_pcm_substream *next; |
390 | /* -- linked substreams -- */ | 365 | /* -- linked substreams -- */ |
391 | struct list_head link_list; /* linked list member */ | 366 | struct list_head link_list; /* linked list member */ |
392 | snd_pcm_group_t self_group; /* fake group for non linked substream (with substream lock inside) */ | 367 | struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ |
393 | snd_pcm_group_t *group; /* pointer to current group */ | 368 | struct snd_pcm_group *group; /* pointer to current group */ |
394 | /* -- assigned files -- */ | 369 | /* -- assigned files -- */ |
395 | snd_pcm_file_t *file; | 370 | struct snd_pcm_file *file; |
396 | struct file *ffile; | 371 | struct file *ffile; |
397 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 372 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
398 | /* -- OSS things -- */ | 373 | /* -- OSS things -- */ |
399 | snd_pcm_oss_substream_t oss; | 374 | struct snd_pcm_oss_substream oss; |
400 | #endif | 375 | #endif |
401 | snd_info_entry_t *proc_root; | 376 | struct snd_info_entry *proc_root; |
402 | snd_info_entry_t *proc_info_entry; | 377 | struct snd_info_entry *proc_info_entry; |
403 | snd_info_entry_t *proc_hw_params_entry; | 378 | struct snd_info_entry *proc_hw_params_entry; |
404 | snd_info_entry_t *proc_sw_params_entry; | 379 | struct snd_info_entry *proc_sw_params_entry; |
405 | snd_info_entry_t *proc_status_entry; | 380 | struct snd_info_entry *proc_status_entry; |
406 | snd_info_entry_t *proc_prealloc_entry; | 381 | struct snd_info_entry *proc_prealloc_entry; |
407 | /* misc flags */ | 382 | /* misc flags */ |
408 | unsigned int no_mmap_ctrl: 1; | 383 | unsigned int no_mmap_ctrl: 1; |
409 | }; | 384 | }; |
@@ -415,65 +390,65 @@ struct _snd_pcm_substream { | |||
415 | #endif | 390 | #endif |
416 | 391 | ||
417 | 392 | ||
418 | struct _snd_pcm_str { | 393 | struct snd_pcm_str { |
419 | int stream; /* stream (direction) */ | 394 | int stream; /* stream (direction) */ |
420 | snd_pcm_t *pcm; | 395 | struct snd_pcm *pcm; |
421 | /* -- substreams -- */ | 396 | /* -- substreams -- */ |
422 | unsigned int substream_count; | 397 | unsigned int substream_count; |
423 | unsigned int substream_opened; | 398 | unsigned int substream_opened; |
424 | snd_pcm_substream_t *substream; | 399 | struct snd_pcm_substream *substream; |
425 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 400 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
426 | /* -- OSS things -- */ | 401 | /* -- OSS things -- */ |
427 | snd_pcm_oss_stream_t oss; | 402 | struct snd_pcm_oss_stream oss; |
428 | #endif | 403 | #endif |
429 | snd_pcm_file_t *files; | 404 | struct snd_pcm_file *files; |
430 | snd_minor_t *reg; | 405 | struct snd_minor *reg; |
431 | snd_info_entry_t *proc_root; | 406 | struct snd_info_entry *proc_root; |
432 | snd_info_entry_t *proc_info_entry; | 407 | struct snd_info_entry *proc_info_entry; |
433 | #ifdef CONFIG_SND_DEBUG | 408 | #ifdef CONFIG_SND_DEBUG |
434 | unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ | 409 | unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ |
435 | snd_info_entry_t *proc_xrun_debug_entry; | 410 | struct snd_info_entry *proc_xrun_debug_entry; |
436 | #endif | 411 | #endif |
437 | }; | 412 | }; |
438 | 413 | ||
439 | struct _snd_pcm { | 414 | struct snd_pcm { |
440 | snd_card_t *card; | 415 | struct snd_card *card; |
441 | unsigned int device; /* device number */ | 416 | unsigned int device; /* device number */ |
442 | unsigned int info_flags; | 417 | unsigned int info_flags; |
443 | unsigned short dev_class; | 418 | unsigned short dev_class; |
444 | unsigned short dev_subclass; | 419 | unsigned short dev_subclass; |
445 | char id[64]; | 420 | char id[64]; |
446 | char name[80]; | 421 | char name[80]; |
447 | snd_pcm_str_t streams[2]; | 422 | struct snd_pcm_str streams[2]; |
448 | struct semaphore open_mutex; | 423 | struct semaphore open_mutex; |
449 | wait_queue_head_t open_wait; | 424 | wait_queue_head_t open_wait; |
450 | void *private_data; | 425 | void *private_data; |
451 | void (*private_free) (snd_pcm_t *pcm); | 426 | void (*private_free) (struct snd_pcm *pcm); |
452 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 427 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
453 | snd_pcm_oss_t oss; | 428 | struct snd_pcm_oss oss; |
454 | #endif | 429 | #endif |
455 | }; | 430 | }; |
456 | 431 | ||
457 | typedef struct _snd_pcm_notify { | 432 | struct snd_pcm_notify { |
458 | int (*n_register) (snd_pcm_t * pcm); | 433 | int (*n_register) (struct snd_pcm * pcm); |
459 | int (*n_disconnect) (snd_pcm_t * pcm); | 434 | int (*n_disconnect) (struct snd_pcm * pcm); |
460 | int (*n_unregister) (snd_pcm_t * pcm); | 435 | int (*n_unregister) (struct snd_pcm * pcm); |
461 | struct list_head list; | 436 | struct list_head list; |
462 | } snd_pcm_notify_t; | 437 | }; |
463 | 438 | ||
464 | /* | 439 | /* |
465 | * Registering | 440 | * Registering |
466 | */ | 441 | */ |
467 | 442 | ||
468 | extern snd_pcm_t *snd_pcm_devices[]; | 443 | extern struct snd_pcm *snd_pcm_devices[]; |
469 | extern snd_minor_t snd_pcm_reg[2]; | 444 | extern struct snd_minor snd_pcm_reg[2]; |
470 | 445 | ||
471 | int snd_pcm_new(snd_card_t * card, char *id, int device, | 446 | int snd_pcm_new(struct snd_card *card, char *id, int device, |
472 | int playback_count, int capture_count, | 447 | int playback_count, int capture_count, |
473 | snd_pcm_t **rpcm); | 448 | struct snd_pcm **rpcm); |
474 | int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count); | 449 | int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count); |
475 | 450 | ||
476 | int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree); | 451 | int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree); |
477 | 452 | ||
478 | /* | 453 | /* |
479 | * Native I/O | 454 | * Native I/O |
@@ -481,24 +456,26 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree); | |||
481 | 456 | ||
482 | extern rwlock_t snd_pcm_link_rwlock; | 457 | extern rwlock_t snd_pcm_link_rwlock; |
483 | 458 | ||
484 | int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info); | 459 | int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info); |
485 | int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t __user *info); | 460 | int snd_pcm_info_user(struct snd_pcm_substream *substream, |
486 | int snd_pcm_status(snd_pcm_substream_t * substream, snd_pcm_status_t *status); | 461 | struct snd_pcm_info __user *info); |
487 | int snd_pcm_prepare(snd_pcm_substream_t *substream); | 462 | int snd_pcm_status(struct snd_pcm_substream *substream, |
488 | int snd_pcm_start(snd_pcm_substream_t *substream); | 463 | struct snd_pcm_status *status); |
489 | int snd_pcm_stop(snd_pcm_substream_t *substream, int status); | 464 | int snd_pcm_prepare(struct snd_pcm_substream *substream); |
490 | int snd_pcm_drain_done(snd_pcm_substream_t *substream); | 465 | int snd_pcm_start(struct snd_pcm_substream *substream); |
466 | int snd_pcm_stop(struct snd_pcm_substream *substream, int status); | ||
467 | int snd_pcm_drain_done(struct snd_pcm_substream *substream); | ||
491 | #ifdef CONFIG_PM | 468 | #ifdef CONFIG_PM |
492 | int snd_pcm_suspend(snd_pcm_substream_t *substream); | 469 | int snd_pcm_suspend(struct snd_pcm_substream *substream); |
493 | int snd_pcm_suspend_all(snd_pcm_t *pcm); | 470 | int snd_pcm_suspend_all(struct snd_pcm *pcm); |
494 | #endif | 471 | #endif |
495 | int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); | 472 | int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); |
496 | int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); | 473 | int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); |
497 | int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); | 474 | int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); |
498 | int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, snd_pcm_substream_t **rsubstream); | 475 | int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct snd_pcm_substream **rsubstream); |
499 | void snd_pcm_release_substream(snd_pcm_substream_t *substream); | 476 | void snd_pcm_release_substream(struct snd_pcm_substream *substream); |
500 | void snd_pcm_vma_notify_data(void *client, void *data); | 477 | void snd_pcm_vma_notify_data(void *client, void *data); |
501 | int snd_pcm_mmap_data(snd_pcm_substream_t *substream, struct file *file, struct vm_area_struct *area); | 478 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); |
502 | 479 | ||
503 | #if BITS_PER_LONG >= 64 | 480 | #if BITS_PER_LONG >= 64 |
504 | 481 | ||
@@ -578,30 +555,30 @@ static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | |||
578 | * PCM library | 555 | * PCM library |
579 | */ | 556 | */ |
580 | 557 | ||
581 | static inline int snd_pcm_stream_linked(snd_pcm_substream_t *substream) | 558 | static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream) |
582 | { | 559 | { |
583 | return substream->group != &substream->self_group; | 560 | return substream->group != &substream->self_group; |
584 | } | 561 | } |
585 | 562 | ||
586 | static inline void snd_pcm_stream_lock(snd_pcm_substream_t *substream) | 563 | static inline void snd_pcm_stream_lock(struct snd_pcm_substream *substream) |
587 | { | 564 | { |
588 | read_lock(&snd_pcm_link_rwlock); | 565 | read_lock(&snd_pcm_link_rwlock); |
589 | spin_lock(&substream->self_group.lock); | 566 | spin_lock(&substream->self_group.lock); |
590 | } | 567 | } |
591 | 568 | ||
592 | static inline void snd_pcm_stream_unlock(snd_pcm_substream_t *substream) | 569 | static inline void snd_pcm_stream_unlock(struct snd_pcm_substream *substream) |
593 | { | 570 | { |
594 | spin_unlock(&substream->self_group.lock); | 571 | spin_unlock(&substream->self_group.lock); |
595 | read_unlock(&snd_pcm_link_rwlock); | 572 | read_unlock(&snd_pcm_link_rwlock); |
596 | } | 573 | } |
597 | 574 | ||
598 | static inline void snd_pcm_stream_lock_irq(snd_pcm_substream_t *substream) | 575 | static inline void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream) |
599 | { | 576 | { |
600 | read_lock_irq(&snd_pcm_link_rwlock); | 577 | read_lock_irq(&snd_pcm_link_rwlock); |
601 | spin_lock(&substream->self_group.lock); | 578 | spin_lock(&substream->self_group.lock); |
602 | } | 579 | } |
603 | 580 | ||
604 | static inline void snd_pcm_stream_unlock_irq(snd_pcm_substream_t *substream) | 581 | static inline void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream) |
605 | { | 582 | { |
606 | spin_unlock(&substream->self_group.lock); | 583 | spin_unlock(&substream->self_group.lock); |
607 | read_unlock_irq(&snd_pcm_link_rwlock); | 584 | read_unlock_irq(&snd_pcm_link_rwlock); |
@@ -623,56 +600,56 @@ do { \ | |||
623 | list_for_each(pos, &substream->group->substreams) | 600 | list_for_each(pos, &substream->group->substreams) |
624 | 601 | ||
625 | #define snd_pcm_group_substream_entry(pos) \ | 602 | #define snd_pcm_group_substream_entry(pos) \ |
626 | list_entry(pos, snd_pcm_substream_t, link_list) | 603 | list_entry(pos, struct snd_pcm_substream, link_list) |
627 | 604 | ||
628 | static inline int snd_pcm_running(snd_pcm_substream_t *substream) | 605 | static inline int snd_pcm_running(struct snd_pcm_substream *substream) |
629 | { | 606 | { |
630 | return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || | 607 | return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || |
631 | (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && | 608 | (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && |
632 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); | 609 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); |
633 | } | 610 | } |
634 | 611 | ||
635 | static inline ssize_t bytes_to_samples(snd_pcm_runtime_t *runtime, ssize_t size) | 612 | static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size) |
636 | { | 613 | { |
637 | return size * 8 / runtime->sample_bits; | 614 | return size * 8 / runtime->sample_bits; |
638 | } | 615 | } |
639 | 616 | ||
640 | static inline snd_pcm_sframes_t bytes_to_frames(snd_pcm_runtime_t *runtime, ssize_t size) | 617 | static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size) |
641 | { | 618 | { |
642 | return size * 8 / runtime->frame_bits; | 619 | return size * 8 / runtime->frame_bits; |
643 | } | 620 | } |
644 | 621 | ||
645 | static inline ssize_t samples_to_bytes(snd_pcm_runtime_t *runtime, ssize_t size) | 622 | static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size) |
646 | { | 623 | { |
647 | return size * runtime->sample_bits / 8; | 624 | return size * runtime->sample_bits / 8; |
648 | } | 625 | } |
649 | 626 | ||
650 | static inline ssize_t frames_to_bytes(snd_pcm_runtime_t *runtime, snd_pcm_sframes_t size) | 627 | static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size) |
651 | { | 628 | { |
652 | return size * runtime->frame_bits / 8; | 629 | return size * runtime->frame_bits / 8; |
653 | } | 630 | } |
654 | 631 | ||
655 | static inline int frame_aligned(snd_pcm_runtime_t *runtime, ssize_t bytes) | 632 | static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes) |
656 | { | 633 | { |
657 | return bytes % runtime->byte_align == 0; | 634 | return bytes % runtime->byte_align == 0; |
658 | } | 635 | } |
659 | 636 | ||
660 | static inline size_t snd_pcm_lib_buffer_bytes(snd_pcm_substream_t *substream) | 637 | static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream) |
661 | { | 638 | { |
662 | snd_pcm_runtime_t *runtime = substream->runtime; | 639 | struct snd_pcm_runtime *runtime = substream->runtime; |
663 | return frames_to_bytes(runtime, runtime->buffer_size); | 640 | return frames_to_bytes(runtime, runtime->buffer_size); |
664 | } | 641 | } |
665 | 642 | ||
666 | static inline size_t snd_pcm_lib_period_bytes(snd_pcm_substream_t *substream) | 643 | static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream) |
667 | { | 644 | { |
668 | snd_pcm_runtime_t *runtime = substream->runtime; | 645 | struct snd_pcm_runtime *runtime = substream->runtime; |
669 | return frames_to_bytes(runtime, runtime->period_size); | 646 | return frames_to_bytes(runtime, runtime->period_size); |
670 | } | 647 | } |
671 | 648 | ||
672 | /* | 649 | /* |
673 | * result is: 0 ... (boundary - 1) | 650 | * result is: 0 ... (boundary - 1) |
674 | */ | 651 | */ |
675 | static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtime) | 652 | static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime) |
676 | { | 653 | { |
677 | snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; | 654 | snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; |
678 | if (avail < 0) | 655 | if (avail < 0) |
@@ -685,7 +662,7 @@ static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtim | |||
685 | /* | 662 | /* |
686 | * result is: 0 ... (boundary - 1) | 663 | * result is: 0 ... (boundary - 1) |
687 | */ | 664 | */ |
688 | static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime) | 665 | static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime) |
689 | { | 666 | { |
690 | snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; | 667 | snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; |
691 | if (avail < 0) | 668 | if (avail < 0) |
@@ -693,12 +670,12 @@ static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime | |||
693 | return avail; | 670 | return avail; |
694 | } | 671 | } |
695 | 672 | ||
696 | static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(snd_pcm_runtime_t *runtime) | 673 | static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime) |
697 | { | 674 | { |
698 | return runtime->buffer_size - snd_pcm_playback_avail(runtime); | 675 | return runtime->buffer_size - snd_pcm_playback_avail(runtime); |
699 | } | 676 | } |
700 | 677 | ||
701 | static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runtime) | 678 | static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime) |
702 | { | 679 | { |
703 | return runtime->buffer_size - snd_pcm_capture_avail(runtime); | 680 | return runtime->buffer_size - snd_pcm_capture_avail(runtime); |
704 | } | 681 | } |
@@ -711,9 +688,9 @@ static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runt | |||
711 | * | 688 | * |
712 | * Returns non-zero if available, or zero if not. | 689 | * Returns non-zero if available, or zero if not. |
713 | */ | 690 | */ |
714 | static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream) | 691 | static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream) |
715 | { | 692 | { |
716 | snd_pcm_runtime_t *runtime = substream->runtime; | 693 | struct snd_pcm_runtime *runtime = substream->runtime; |
717 | return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; | 694 | return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; |
718 | } | 695 | } |
719 | 696 | ||
@@ -725,9 +702,9 @@ static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream) | |||
725 | * | 702 | * |
726 | * Returns non-zero if available, or zero if not. | 703 | * Returns non-zero if available, or zero if not. |
727 | */ | 704 | */ |
728 | static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream) | 705 | static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream) |
729 | { | 706 | { |
730 | snd_pcm_runtime_t *runtime = substream->runtime; | 707 | struct snd_pcm_runtime *runtime = substream->runtime; |
731 | return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; | 708 | return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; |
732 | } | 709 | } |
733 | 710 | ||
@@ -740,9 +717,9 @@ static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream) | |||
740 | * | 717 | * |
741 | * Returns non-zero if exists, or zero if not. | 718 | * Returns non-zero if exists, or zero if not. |
742 | */ | 719 | */ |
743 | static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream) | 720 | static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream) |
744 | { | 721 | { |
745 | snd_pcm_runtime_t *runtime = substream->runtime; | 722 | struct snd_pcm_runtime *runtime = substream->runtime; |
746 | 723 | ||
747 | if (runtime->stop_threshold >= runtime->boundary) | 724 | if (runtime->stop_threshold >= runtime->boundary) |
748 | return 1; | 725 | return 1; |
@@ -757,9 +734,9 @@ static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream) | |||
757 | * | 734 | * |
758 | * Returns non-zero if empty, or zero if not. | 735 | * Returns non-zero if empty, or zero if not. |
759 | */ | 736 | */ |
760 | static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream) | 737 | static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream) |
761 | { | 738 | { |
762 | snd_pcm_runtime_t *runtime = substream->runtime; | 739 | struct snd_pcm_runtime *runtime = substream->runtime; |
763 | return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; | 740 | return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; |
764 | } | 741 | } |
765 | 742 | ||
@@ -771,14 +748,14 @@ static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream) | |||
771 | * | 748 | * |
772 | * Returns non-zero if empty, or zero if not. | 749 | * Returns non-zero if empty, or zero if not. |
773 | */ | 750 | */ |
774 | static inline int snd_pcm_capture_empty(snd_pcm_substream_t *substream) | 751 | static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream) |
775 | { | 752 | { |
776 | snd_pcm_runtime_t *runtime = substream->runtime; | 753 | struct snd_pcm_runtime *runtime = substream->runtime; |
777 | return snd_pcm_capture_avail(runtime) == 0; | 754 | return snd_pcm_capture_avail(runtime) == 0; |
778 | } | 755 | } |
779 | 756 | ||
780 | static inline void snd_pcm_trigger_done(snd_pcm_substream_t *substream, | 757 | static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, |
781 | snd_pcm_substream_t *master) | 758 | struct snd_pcm_substream *master) |
782 | { | 759 | { |
783 | substream->runtime->trigger_master = master; | 760 | substream->runtime->trigger_master = master; |
784 | } | 761 | } |
@@ -795,28 +772,28 @@ static inline int hw_is_interval(int var) | |||
795 | var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; | 772 | var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; |
796 | } | 773 | } |
797 | 774 | ||
798 | static inline snd_mask_t *hw_param_mask(snd_pcm_hw_params_t *params, | 775 | static inline struct snd_mask *hw_param_mask(struct snd_pcm_hw_params *params, |
799 | snd_pcm_hw_param_t var) | 776 | snd_pcm_hw_param_t var) |
800 | { | 777 | { |
801 | return ¶ms->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; | 778 | return ¶ms->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; |
802 | } | 779 | } |
803 | 780 | ||
804 | static inline snd_interval_t *hw_param_interval(snd_pcm_hw_params_t *params, | 781 | static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *params, |
805 | snd_pcm_hw_param_t var) | 782 | snd_pcm_hw_param_t var) |
806 | { | 783 | { |
807 | return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; | 784 | return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; |
808 | } | 785 | } |
809 | 786 | ||
810 | static inline const snd_mask_t *hw_param_mask_c(const snd_pcm_hw_params_t *params, | 787 | static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params, |
811 | snd_pcm_hw_param_t var) | 788 | snd_pcm_hw_param_t var) |
812 | { | 789 | { |
813 | return (const snd_mask_t *)hw_param_mask((snd_pcm_hw_params_t*) params, var); | 790 | return (const struct snd_mask *)hw_param_mask((struct snd_pcm_hw_params*) params, var); |
814 | } | 791 | } |
815 | 792 | ||
816 | static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_t *params, | 793 | static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params, |
817 | snd_pcm_hw_param_t var) | 794 | snd_pcm_hw_param_t var) |
818 | { | 795 | { |
819 | return (const snd_interval_t *)hw_param_interval((snd_pcm_hw_params_t*) params, var); | 796 | return (const struct snd_interval *)hw_param_interval((struct snd_pcm_hw_params*) params, var); |
820 | } | 797 | } |
821 | 798 | ||
822 | #define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) | 799 | #define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) |
@@ -832,66 +809,66 @@ static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_ | |||
832 | #define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min | 809 | #define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min |
833 | 810 | ||
834 | 811 | ||
835 | int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v); | 812 | int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v); |
836 | void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); | 813 | void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); |
837 | void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); | 814 | void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); |
838 | void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, | 815 | void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, |
839 | unsigned int k, snd_interval_t *c); | 816 | unsigned int k, struct snd_interval *c); |
840 | void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, | 817 | void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, |
841 | const snd_interval_t *b, snd_interval_t *c); | 818 | const struct snd_interval *b, struct snd_interval *c); |
842 | int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask); | 819 | int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask); |
843 | int snd_interval_ratnum(snd_interval_t *i, | 820 | int snd_interval_ratnum(struct snd_interval *i, |
844 | unsigned int rats_count, ratnum_t *rats, | 821 | unsigned int rats_count, struct snd_ratnum *rats, |
845 | unsigned int *nump, unsigned int *denp); | 822 | unsigned int *nump, unsigned int *denp); |
846 | 823 | ||
847 | void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); | 824 | void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); |
848 | void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); | 825 | void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); |
849 | int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, | 826 | int snd_pcm_hw_param_near(struct snd_pcm_substream *substream, |
850 | snd_pcm_hw_params_t *params, | 827 | struct snd_pcm_hw_params *params, |
851 | snd_pcm_hw_param_t var, | 828 | snd_pcm_hw_param_t var, |
852 | unsigned int val, int *dir); | 829 | unsigned int val, int *dir); |
853 | int snd_pcm_hw_param_set(snd_pcm_substream_t *pcm, | 830 | int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm, |
854 | snd_pcm_hw_params_t *params, | 831 | struct snd_pcm_hw_params *params, |
855 | snd_pcm_hw_param_t var, | 832 | snd_pcm_hw_param_t var, |
856 | unsigned int val, int dir); | 833 | unsigned int val, int dir); |
857 | int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); | 834 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
858 | 835 | ||
859 | int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); | 836 | int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
860 | 837 | ||
861 | int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream); | 838 | int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream); |
862 | int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream); | 839 | int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream); |
863 | 840 | ||
864 | int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 841 | int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
865 | u_int32_t mask); | 842 | u_int32_t mask); |
866 | int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 843 | int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
867 | u_int64_t mask); | 844 | u_int64_t mask); |
868 | int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 845 | int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
869 | unsigned int min, unsigned int max); | 846 | unsigned int min, unsigned int max); |
870 | int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var); | 847 | int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var); |
871 | int snd_pcm_hw_constraint_list(snd_pcm_runtime_t *runtime, | 848 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, |
872 | unsigned int cond, | 849 | unsigned int cond, |
873 | snd_pcm_hw_param_t var, | 850 | snd_pcm_hw_param_t var, |
874 | snd_pcm_hw_constraint_list_t *l); | 851 | struct snd_pcm_hw_constraint_list *l); |
875 | int snd_pcm_hw_constraint_ratnums(snd_pcm_runtime_t *runtime, | 852 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, |
876 | unsigned int cond, | 853 | unsigned int cond, |
877 | snd_pcm_hw_param_t var, | 854 | snd_pcm_hw_param_t var, |
878 | snd_pcm_hw_constraint_ratnums_t *r); | 855 | struct snd_pcm_hw_constraint_ratnums *r); |
879 | int snd_pcm_hw_constraint_ratdens(snd_pcm_runtime_t *runtime, | 856 | int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, |
880 | unsigned int cond, | 857 | unsigned int cond, |
881 | snd_pcm_hw_param_t var, | 858 | snd_pcm_hw_param_t var, |
882 | snd_pcm_hw_constraint_ratdens_t *r); | 859 | struct snd_pcm_hw_constraint_ratdens *r); |
883 | int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime, | 860 | int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, |
884 | unsigned int cond, | 861 | unsigned int cond, |
885 | unsigned int width, | 862 | unsigned int width, |
886 | unsigned int msbits); | 863 | unsigned int msbits); |
887 | int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime, | 864 | int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, |
888 | unsigned int cond, | 865 | unsigned int cond, |
889 | snd_pcm_hw_param_t var, | 866 | snd_pcm_hw_param_t var, |
890 | unsigned long step); | 867 | unsigned long step); |
891 | int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime, | 868 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, |
892 | unsigned int cond, | 869 | unsigned int cond, |
893 | snd_pcm_hw_param_t var); | 870 | snd_pcm_hw_param_t var); |
894 | int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, | 871 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, |
895 | unsigned int cond, | 872 | unsigned int cond, |
896 | int var, | 873 | int var, |
897 | snd_pcm_hw_rule_func_t func, void *private, | 874 | snd_pcm_hw_rule_func_t func, void *private, |
@@ -925,37 +902,37 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int | |||
925 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); | 902 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); |
926 | const char *snd_pcm_format_name(snd_pcm_format_t format); | 903 | const char *snd_pcm_format_name(snd_pcm_format_t format); |
927 | 904 | ||
928 | void snd_pcm_set_ops(snd_pcm_t * pcm, int direction, snd_pcm_ops_t *ops); | 905 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); |
929 | void snd_pcm_set_sync(snd_pcm_substream_t * substream); | 906 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); |
930 | int snd_pcm_lib_interleave_len(snd_pcm_substream_t *substream); | 907 | int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); |
931 | int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, | 908 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, |
932 | unsigned int cmd, void *arg); | 909 | unsigned int cmd, void *arg); |
933 | int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream); | 910 | int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); |
934 | int snd_pcm_playback_xrun_check(snd_pcm_substream_t *substream); | 911 | int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); |
935 | int snd_pcm_capture_xrun_check(snd_pcm_substream_t *substream); | 912 | int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream); |
936 | int snd_pcm_playback_xrun_asap(snd_pcm_substream_t *substream); | 913 | int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream); |
937 | int snd_pcm_capture_xrun_asap(snd_pcm_substream_t *substream); | 914 | int snd_pcm_capture_xrun_asap(struct snd_pcm_substream *substream); |
938 | void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr); | 915 | void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr); |
939 | void snd_pcm_tick_prepare(snd_pcm_substream_t *substream); | 916 | void snd_pcm_tick_prepare(struct snd_pcm_substream *substream); |
940 | void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks); | 917 | void snd_pcm_tick_set(struct snd_pcm_substream *substream, unsigned long ticks); |
941 | void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream); | 918 | void snd_pcm_tick_elapsed(struct snd_pcm_substream *substream); |
942 | void snd_pcm_period_elapsed(snd_pcm_substream_t *substream); | 919 | void snd_pcm_period_elapsed(struct snd_pcm_substream *substream); |
943 | snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, | 920 | snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, |
944 | const void __user *buf, | 921 | const void __user *buf, |
945 | snd_pcm_uframes_t frames); | 922 | snd_pcm_uframes_t frames); |
946 | snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, | 923 | snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream, |
947 | void __user *buf, snd_pcm_uframes_t frames); | 924 | void __user *buf, snd_pcm_uframes_t frames); |
948 | snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, | 925 | snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream, |
949 | void __user **bufs, snd_pcm_uframes_t frames); | 926 | void __user **bufs, snd_pcm_uframes_t frames); |
950 | snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, | 927 | snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, |
951 | void __user **bufs, snd_pcm_uframes_t frames); | 928 | void __user **bufs, snd_pcm_uframes_t frames); |
952 | 929 | ||
953 | int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime); | 930 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); |
954 | 931 | ||
955 | static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream, | 932 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, |
956 | struct snd_dma_buffer *bufp) | 933 | struct snd_dma_buffer *bufp) |
957 | { | 934 | { |
958 | snd_pcm_runtime_t *runtime = substream->runtime; | 935 | struct snd_pcm_runtime *runtime = substream->runtime; |
959 | if (bufp) { | 936 | if (bufp) { |
960 | runtime->dma_buffer_p = bufp; | 937 | runtime->dma_buffer_p = bufp; |
961 | runtime->dma_area = bufp->area; | 938 | runtime->dma_area = bufp->area; |
@@ -973,47 +950,47 @@ static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream, | |||
973 | * Timer interface | 950 | * Timer interface |
974 | */ | 951 | */ |
975 | 952 | ||
976 | void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream); | 953 | void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream); |
977 | void snd_pcm_timer_init(snd_pcm_substream_t * substream); | 954 | void snd_pcm_timer_init(struct snd_pcm_substream *substream); |
978 | void snd_pcm_timer_done(snd_pcm_substream_t * substream); | 955 | void snd_pcm_timer_done(struct snd_pcm_substream *substream); |
979 | 956 | ||
980 | /* | 957 | /* |
981 | * Memory | 958 | * Memory |
982 | */ | 959 | */ |
983 | 960 | ||
984 | int snd_pcm_lib_preallocate_free(snd_pcm_substream_t *substream); | 961 | int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream); |
985 | int snd_pcm_lib_preallocate_free_for_all(snd_pcm_t *pcm); | 962 | int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm); |
986 | int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream, | 963 | int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream, |
987 | int type, struct device *data, | 964 | int type, struct device *data, |
988 | size_t size, size_t max); | 965 | size_t size, size_t max); |
989 | int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm, | 966 | int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, |
990 | int type, void *data, | 967 | int type, void *data, |
991 | size_t size, size_t max); | 968 | size_t size, size_t max); |
992 | int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size); | 969 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
993 | int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream); | 970 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
994 | 971 | ||
995 | #define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) | 972 | #define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) |
996 | #define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) | 973 | #define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) |
997 | #define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) | 974 | #define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) |
998 | struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset); | 975 | struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset); |
999 | 976 | ||
1000 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ | 977 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ |
1001 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 978 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
1002 | { | 979 | { |
1003 | snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; | 980 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
1004 | atomic_inc(&substream->runtime->mmap_count); | 981 | atomic_inc(&substream->runtime->mmap_count); |
1005 | } | 982 | } |
1006 | 983 | ||
1007 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | 984 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) |
1008 | { | 985 | { |
1009 | snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; | 986 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
1010 | atomic_dec(&substream->runtime->mmap_count); | 987 | atomic_dec(&substream->runtime->mmap_count); |
1011 | } | 988 | } |
1012 | 989 | ||
1013 | /* mmap for io-memory area */ | 990 | /* mmap for io-memory area */ |
1014 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) | 991 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) |
1015 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP | 992 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP |
1016 | int snd_pcm_lib_mmap_iomem(snd_pcm_substream_t *substream, struct vm_area_struct *area); | 993 | int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area); |
1017 | #else | 994 | #else |
1018 | #define SNDRV_PCM_INFO_MMAP_IOMEM 0 | 995 | #define SNDRV_PCM_INFO_MMAP_IOMEM 0 |
1019 | #define snd_pcm_lib_mmap_iomem NULL | 996 | #define snd_pcm_lib_mmap_iomem NULL |