aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/pcm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r--include/sound/pcm.h476
1 files changed, 226 insertions, 250 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index acc4fa9d5abe..314268a11048 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
31typedef sndrv_pcm_uframes_t snd_pcm_uframes_t;
32typedef sndrv_pcm_sframes_t snd_pcm_sframes_t;
33typedef enum sndrv_pcm_class snd_pcm_class_t;
34typedef enum sndrv_pcm_subclass snd_pcm_subclass_t;
35typedef enum sndrv_pcm_stream snd_pcm_stream_t;
36typedef enum sndrv_pcm_access snd_pcm_access_t;
37typedef enum sndrv_pcm_format snd_pcm_format_t;
38typedef enum sndrv_pcm_subformat snd_pcm_subformat_t;
39typedef enum sndrv_pcm_state snd_pcm_state_t;
40typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t;
41typedef struct sndrv_pcm_info snd_pcm_info_t;
42typedef enum sndrv_pcm_hw_param snd_pcm_hw_param_t;
43typedef struct sndrv_pcm_hw_params snd_pcm_hw_params_t;
44typedef enum sndrv_pcm_start snd_pcm_start_t;
45typedef enum sndrv_pcm_xrun snd_pcm_xrun_t;
46typedef enum sndrv_pcm_tstamp snd_pcm_tstamp_t;
47typedef struct sndrv_pcm_sw_params snd_pcm_sw_params_t;
48typedef struct sndrv_pcm_channel_info snd_pcm_channel_info_t;
49typedef struct sndrv_pcm_status snd_pcm_status_t;
50typedef struct sndrv_pcm_mmap_status snd_pcm_mmap_status_t;
51typedef struct sndrv_pcm_mmap_control snd_pcm_mmap_control_t;
52typedef struct sndrv_mask snd_mask_t;
53typedef 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
58typedef struct _snd_pcm_file snd_pcm_file_t;
59typedef 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
69typedef struct _snd_pcm_hardware { 42struct 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
85typedef struct _snd_pcm_ops { 58struct 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
215struct _snd_pcm_file { 191struct 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
220typedef struct _snd_pcm_hw_rule snd_pcm_hw_rule_t; 196struct snd_pcm_hw_rule;
197typedef int (*snd_pcm_hw_rule_func_t)(struct snd_pcm_hw_params *params,
198 struct snd_pcm_hw_rule *rule);
221 199
222typedef int (*snd_pcm_hw_rule_func_t)(snd_pcm_hw_params_t *params, 200struct snd_pcm_hw_rule {
223 snd_pcm_hw_rule_t *rule);
224
225struct _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
233typedef struct _snd_pcm_hw_constraints { 208struct 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
243static inline snd_mask_t *constrs_mask(snd_pcm_hw_constraints_t *constrs, 218static 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
249static inline snd_interval_t *constrs_interval(snd_pcm_hw_constraints_t *constrs, 224static 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
255typedef struct { 230struct 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
260typedef struct { 235struct 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
265typedef struct { 240struct 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
270typedef struct { 245struct 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
275typedef struct { 250struct 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
281struct _snd_pcm_runtime { 256struct 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
363typedef struct _snd_pcm_group { /* keep linked substreams */ 338struct 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
369struct _snd_pcm_substream { 344struct 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,64 @@ struct _snd_pcm_substream {
415#endif 390#endif
416 391
417 392
418struct _snd_pcm_str { 393struct 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_info_entry *proc_root;
431 snd_info_entry_t *proc_root; 406 struct snd_info_entry *proc_info_entry;
432 snd_info_entry_t *proc_info_entry;
433#ifdef CONFIG_SND_DEBUG 407#ifdef CONFIG_SND_DEBUG
434 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ 408 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
435 snd_info_entry_t *proc_xrun_debug_entry; 409 struct snd_info_entry *proc_xrun_debug_entry;
436#endif 410#endif
437}; 411};
438 412
439struct _snd_pcm { 413struct snd_pcm {
440 snd_card_t *card; 414 struct snd_card *card;
415 struct list_head list;
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
457typedef struct _snd_pcm_notify { 432struct 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
468extern snd_pcm_t *snd_pcm_devices[]; 443extern struct file_operations snd_pcm_f_ops[2];
469extern snd_minor_t snd_pcm_reg[2];
470 444
471int snd_pcm_new(snd_card_t * card, char *id, int device, 445int snd_pcm_new(struct snd_card *card, char *id, int device,
472 int playback_count, int capture_count, 446 int playback_count, int capture_count,
473 snd_pcm_t **rpcm); 447 struct snd_pcm **rpcm);
474int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count); 448int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count);
475 449
476int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree); 450int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree);
477 451
478/* 452/*
479 * Native I/O 453 * Native I/O
@@ -481,24 +455,26 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree);
481 455
482extern rwlock_t snd_pcm_link_rwlock; 456extern rwlock_t snd_pcm_link_rwlock;
483 457
484int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info); 458int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
485int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t __user *info); 459int snd_pcm_info_user(struct snd_pcm_substream *substream,
486int snd_pcm_status(snd_pcm_substream_t * substream, snd_pcm_status_t *status); 460 struct snd_pcm_info __user *info);
487int snd_pcm_prepare(snd_pcm_substream_t *substream); 461int snd_pcm_status(struct snd_pcm_substream *substream,
488int snd_pcm_start(snd_pcm_substream_t *substream); 462 struct snd_pcm_status *status);
489int snd_pcm_stop(snd_pcm_substream_t *substream, int status); 463int snd_pcm_prepare(struct snd_pcm_substream *substream);
490int snd_pcm_drain_done(snd_pcm_substream_t *substream); 464int snd_pcm_start(struct snd_pcm_substream *substream);
465int snd_pcm_stop(struct snd_pcm_substream *substream, int status);
466int snd_pcm_drain_done(struct snd_pcm_substream *substream);
491#ifdef CONFIG_PM 467#ifdef CONFIG_PM
492int snd_pcm_suspend(snd_pcm_substream_t *substream); 468int snd_pcm_suspend(struct snd_pcm_substream *substream);
493int snd_pcm_suspend_all(snd_pcm_t *pcm); 469int snd_pcm_suspend_all(struct snd_pcm *pcm);
494#endif 470#endif
495int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); 471int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
496int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); 472int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
497int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); 473int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
498int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, snd_pcm_substream_t **rsubstream); 474int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct snd_pcm_substream **rsubstream);
499void snd_pcm_release_substream(snd_pcm_substream_t *substream); 475void snd_pcm_release_substream(struct snd_pcm_substream *substream);
500void snd_pcm_vma_notify_data(void *client, void *data); 476void snd_pcm_vma_notify_data(void *client, void *data);
501int snd_pcm_mmap_data(snd_pcm_substream_t *substream, struct file *file, struct vm_area_struct *area); 477int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
502 478
503#if BITS_PER_LONG >= 64 479#if BITS_PER_LONG >= 64
504 480
@@ -578,30 +554,30 @@ static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
578 * PCM library 554 * PCM library
579 */ 555 */
580 556
581static inline int snd_pcm_stream_linked(snd_pcm_substream_t *substream) 557static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream)
582{ 558{
583 return substream->group != &substream->self_group; 559 return substream->group != &substream->self_group;
584} 560}
585 561
586static inline void snd_pcm_stream_lock(snd_pcm_substream_t *substream) 562static inline void snd_pcm_stream_lock(struct snd_pcm_substream *substream)
587{ 563{
588 read_lock(&snd_pcm_link_rwlock); 564 read_lock(&snd_pcm_link_rwlock);
589 spin_lock(&substream->self_group.lock); 565 spin_lock(&substream->self_group.lock);
590} 566}
591 567
592static inline void snd_pcm_stream_unlock(snd_pcm_substream_t *substream) 568static inline void snd_pcm_stream_unlock(struct snd_pcm_substream *substream)
593{ 569{
594 spin_unlock(&substream->self_group.lock); 570 spin_unlock(&substream->self_group.lock);
595 read_unlock(&snd_pcm_link_rwlock); 571 read_unlock(&snd_pcm_link_rwlock);
596} 572}
597 573
598static inline void snd_pcm_stream_lock_irq(snd_pcm_substream_t *substream) 574static inline void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream)
599{ 575{
600 read_lock_irq(&snd_pcm_link_rwlock); 576 read_lock_irq(&snd_pcm_link_rwlock);
601 spin_lock(&substream->self_group.lock); 577 spin_lock(&substream->self_group.lock);
602} 578}
603 579
604static inline void snd_pcm_stream_unlock_irq(snd_pcm_substream_t *substream) 580static inline void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream)
605{ 581{
606 spin_unlock(&substream->self_group.lock); 582 spin_unlock(&substream->self_group.lock);
607 read_unlock_irq(&snd_pcm_link_rwlock); 583 read_unlock_irq(&snd_pcm_link_rwlock);
@@ -623,56 +599,56 @@ do { \
623 list_for_each(pos, &substream->group->substreams) 599 list_for_each(pos, &substream->group->substreams)
624 600
625#define snd_pcm_group_substream_entry(pos) \ 601#define snd_pcm_group_substream_entry(pos) \
626 list_entry(pos, snd_pcm_substream_t, link_list) 602 list_entry(pos, struct snd_pcm_substream, link_list)
627 603
628static inline int snd_pcm_running(snd_pcm_substream_t *substream) 604static inline int snd_pcm_running(struct snd_pcm_substream *substream)
629{ 605{
630 return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || 606 return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
631 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && 607 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING &&
632 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); 608 substream->stream == SNDRV_PCM_STREAM_PLAYBACK));
633} 609}
634 610
635static inline ssize_t bytes_to_samples(snd_pcm_runtime_t *runtime, ssize_t size) 611static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size)
636{ 612{
637 return size * 8 / runtime->sample_bits; 613 return size * 8 / runtime->sample_bits;
638} 614}
639 615
640static inline snd_pcm_sframes_t bytes_to_frames(snd_pcm_runtime_t *runtime, ssize_t size) 616static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size)
641{ 617{
642 return size * 8 / runtime->frame_bits; 618 return size * 8 / runtime->frame_bits;
643} 619}
644 620
645static inline ssize_t samples_to_bytes(snd_pcm_runtime_t *runtime, ssize_t size) 621static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size)
646{ 622{
647 return size * runtime->sample_bits / 8; 623 return size * runtime->sample_bits / 8;
648} 624}
649 625
650static inline ssize_t frames_to_bytes(snd_pcm_runtime_t *runtime, snd_pcm_sframes_t size) 626static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size)
651{ 627{
652 return size * runtime->frame_bits / 8; 628 return size * runtime->frame_bits / 8;
653} 629}
654 630
655static inline int frame_aligned(snd_pcm_runtime_t *runtime, ssize_t bytes) 631static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes)
656{ 632{
657 return bytes % runtime->byte_align == 0; 633 return bytes % runtime->byte_align == 0;
658} 634}
659 635
660static inline size_t snd_pcm_lib_buffer_bytes(snd_pcm_substream_t *substream) 636static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream)
661{ 637{
662 snd_pcm_runtime_t *runtime = substream->runtime; 638 struct snd_pcm_runtime *runtime = substream->runtime;
663 return frames_to_bytes(runtime, runtime->buffer_size); 639 return frames_to_bytes(runtime, runtime->buffer_size);
664} 640}
665 641
666static inline size_t snd_pcm_lib_period_bytes(snd_pcm_substream_t *substream) 642static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream)
667{ 643{
668 snd_pcm_runtime_t *runtime = substream->runtime; 644 struct snd_pcm_runtime *runtime = substream->runtime;
669 return frames_to_bytes(runtime, runtime->period_size); 645 return frames_to_bytes(runtime, runtime->period_size);
670} 646}
671 647
672/* 648/*
673 * result is: 0 ... (boundary - 1) 649 * result is: 0 ... (boundary - 1)
674 */ 650 */
675static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtime) 651static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime)
676{ 652{
677 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 653 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr;
678 if (avail < 0) 654 if (avail < 0)
@@ -685,7 +661,7 @@ static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtim
685/* 661/*
686 * result is: 0 ... (boundary - 1) 662 * result is: 0 ... (boundary - 1)
687 */ 663 */
688static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime) 664static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime)
689{ 665{
690 snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; 666 snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr;
691 if (avail < 0) 667 if (avail < 0)
@@ -693,12 +669,12 @@ static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime
693 return avail; 669 return avail;
694} 670}
695 671
696static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(snd_pcm_runtime_t *runtime) 672static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime)
697{ 673{
698 return runtime->buffer_size - snd_pcm_playback_avail(runtime); 674 return runtime->buffer_size - snd_pcm_playback_avail(runtime);
699} 675}
700 676
701static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runtime) 677static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime)
702{ 678{
703 return runtime->buffer_size - snd_pcm_capture_avail(runtime); 679 return runtime->buffer_size - snd_pcm_capture_avail(runtime);
704} 680}
@@ -711,9 +687,9 @@ static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runt
711 * 687 *
712 * Returns non-zero if available, or zero if not. 688 * Returns non-zero if available, or zero if not.
713 */ 689 */
714static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream) 690static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream)
715{ 691{
716 snd_pcm_runtime_t *runtime = substream->runtime; 692 struct snd_pcm_runtime *runtime = substream->runtime;
717 return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; 693 return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min;
718} 694}
719 695
@@ -725,9 +701,9 @@ static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream)
725 * 701 *
726 * Returns non-zero if available, or zero if not. 702 * Returns non-zero if available, or zero if not.
727 */ 703 */
728static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream) 704static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream)
729{ 705{
730 snd_pcm_runtime_t *runtime = substream->runtime; 706 struct snd_pcm_runtime *runtime = substream->runtime;
731 return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; 707 return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min;
732} 708}
733 709
@@ -740,9 +716,9 @@ static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream)
740 * 716 *
741 * Returns non-zero if exists, or zero if not. 717 * Returns non-zero if exists, or zero if not.
742 */ 718 */
743static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream) 719static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream)
744{ 720{
745 snd_pcm_runtime_t *runtime = substream->runtime; 721 struct snd_pcm_runtime *runtime = substream->runtime;
746 722
747 if (runtime->stop_threshold >= runtime->boundary) 723 if (runtime->stop_threshold >= runtime->boundary)
748 return 1; 724 return 1;
@@ -757,9 +733,9 @@ static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream)
757 * 733 *
758 * Returns non-zero if empty, or zero if not. 734 * Returns non-zero if empty, or zero if not.
759 */ 735 */
760static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream) 736static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream)
761{ 737{
762 snd_pcm_runtime_t *runtime = substream->runtime; 738 struct snd_pcm_runtime *runtime = substream->runtime;
763 return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; 739 return snd_pcm_playback_avail(runtime) >= runtime->buffer_size;
764} 740}
765 741
@@ -771,14 +747,14 @@ static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream)
771 * 747 *
772 * Returns non-zero if empty, or zero if not. 748 * Returns non-zero if empty, or zero if not.
773 */ 749 */
774static inline int snd_pcm_capture_empty(snd_pcm_substream_t *substream) 750static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream)
775{ 751{
776 snd_pcm_runtime_t *runtime = substream->runtime; 752 struct snd_pcm_runtime *runtime = substream->runtime;
777 return snd_pcm_capture_avail(runtime) == 0; 753 return snd_pcm_capture_avail(runtime) == 0;
778} 754}
779 755
780static inline void snd_pcm_trigger_done(snd_pcm_substream_t *substream, 756static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream,
781 snd_pcm_substream_t *master) 757 struct snd_pcm_substream *master)
782{ 758{
783 substream->runtime->trigger_master = master; 759 substream->runtime->trigger_master = master;
784} 760}
@@ -795,28 +771,28 @@ static inline int hw_is_interval(int var)
795 var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; 771 var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL;
796} 772}
797 773
798static inline snd_mask_t *hw_param_mask(snd_pcm_hw_params_t *params, 774static inline struct snd_mask *hw_param_mask(struct snd_pcm_hw_params *params,
799 snd_pcm_hw_param_t var) 775 snd_pcm_hw_param_t var)
800{ 776{
801 return &params->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; 777 return &params->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
802} 778}
803 779
804static inline snd_interval_t *hw_param_interval(snd_pcm_hw_params_t *params, 780static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *params,
805 snd_pcm_hw_param_t var) 781 snd_pcm_hw_param_t var)
806{ 782{
807 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 783 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
808} 784}
809 785
810static inline const snd_mask_t *hw_param_mask_c(const snd_pcm_hw_params_t *params, 786static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params,
811 snd_pcm_hw_param_t var) 787 snd_pcm_hw_param_t var)
812{ 788{
813 return (const snd_mask_t *)hw_param_mask((snd_pcm_hw_params_t*) params, var); 789 return (const struct snd_mask *)hw_param_mask((struct snd_pcm_hw_params*) params, var);
814} 790}
815 791
816static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_t *params, 792static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params,
817 snd_pcm_hw_param_t var) 793 snd_pcm_hw_param_t var)
818{ 794{
819 return (const snd_interval_t *)hw_param_interval((snd_pcm_hw_params_t*) params, var); 795 return (const struct snd_interval *)hw_param_interval((struct snd_pcm_hw_params*) params, var);
820} 796}
821 797
822#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) 798#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS))
@@ -832,66 +808,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 808#define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min
833 809
834 810
835int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v); 811int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
836void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 812void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
837void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 813void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
838void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, 814void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b,
839 unsigned int k, snd_interval_t *c); 815 unsigned int k, struct snd_interval *c);
840void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, 816void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
841 const snd_interval_t *b, snd_interval_t *c); 817 const struct snd_interval *b, struct snd_interval *c);
842int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask); 818int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask);
843int snd_interval_ratnum(snd_interval_t *i, 819int snd_interval_ratnum(struct snd_interval *i,
844 unsigned int rats_count, ratnum_t *rats, 820 unsigned int rats_count, struct snd_ratnum *rats,
845 unsigned int *nump, unsigned int *denp); 821 unsigned int *nump, unsigned int *denp);
846 822
847void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); 823void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params);
848void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); 824void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var);
849int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, 825int snd_pcm_hw_param_near(struct snd_pcm_substream *substream,
850 snd_pcm_hw_params_t *params, 826 struct snd_pcm_hw_params *params,
851 snd_pcm_hw_param_t var, 827 snd_pcm_hw_param_t var,
852 unsigned int val, int *dir); 828 unsigned int val, int *dir);
853int snd_pcm_hw_param_set(snd_pcm_substream_t *pcm, 829int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm,
854 snd_pcm_hw_params_t *params, 830 struct snd_pcm_hw_params *params,
855 snd_pcm_hw_param_t var, 831 snd_pcm_hw_param_t var,
856 unsigned int val, int dir); 832 unsigned int val, int dir);
857int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); 833int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
858 834
859int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); 835int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
860 836
861int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream); 837int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream);
862int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream); 838int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream);
863 839
864int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 840int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
865 u_int32_t mask); 841 u_int32_t mask);
866int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 842int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
867 u_int64_t mask); 843 u_int64_t mask);
868int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 844int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
869 unsigned int min, unsigned int max); 845 unsigned int min, unsigned int max);
870int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var); 846int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var);
871int snd_pcm_hw_constraint_list(snd_pcm_runtime_t *runtime, 847int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
872 unsigned int cond, 848 unsigned int cond,
873 snd_pcm_hw_param_t var, 849 snd_pcm_hw_param_t var,
874 snd_pcm_hw_constraint_list_t *l); 850 struct snd_pcm_hw_constraint_list *l);
875int snd_pcm_hw_constraint_ratnums(snd_pcm_runtime_t *runtime, 851int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
876 unsigned int cond, 852 unsigned int cond,
877 snd_pcm_hw_param_t var, 853 snd_pcm_hw_param_t var,
878 snd_pcm_hw_constraint_ratnums_t *r); 854 struct snd_pcm_hw_constraint_ratnums *r);
879int snd_pcm_hw_constraint_ratdens(snd_pcm_runtime_t *runtime, 855int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
880 unsigned int cond, 856 unsigned int cond,
881 snd_pcm_hw_param_t var, 857 snd_pcm_hw_param_t var,
882 snd_pcm_hw_constraint_ratdens_t *r); 858 struct snd_pcm_hw_constraint_ratdens *r);
883int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime, 859int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
884 unsigned int cond, 860 unsigned int cond,
885 unsigned int width, 861 unsigned int width,
886 unsigned int msbits); 862 unsigned int msbits);
887int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime, 863int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
888 unsigned int cond, 864 unsigned int cond,
889 snd_pcm_hw_param_t var, 865 snd_pcm_hw_param_t var,
890 unsigned long step); 866 unsigned long step);
891int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime, 867int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
892 unsigned int cond, 868 unsigned int cond,
893 snd_pcm_hw_param_t var); 869 snd_pcm_hw_param_t var);
894int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, 870int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
895 unsigned int cond, 871 unsigned int cond,
896 int var, 872 int var,
897 snd_pcm_hw_rule_func_t func, void *private, 873 snd_pcm_hw_rule_func_t func, void *private,
@@ -925,37 +901,37 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int
925snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); 901snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian);
926const char *snd_pcm_format_name(snd_pcm_format_t format); 902const char *snd_pcm_format_name(snd_pcm_format_t format);
927 903
928void snd_pcm_set_ops(snd_pcm_t * pcm, int direction, snd_pcm_ops_t *ops); 904void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops);
929void snd_pcm_set_sync(snd_pcm_substream_t * substream); 905void snd_pcm_set_sync(struct snd_pcm_substream *substream);
930int snd_pcm_lib_interleave_len(snd_pcm_substream_t *substream); 906int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream);
931int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, 907int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
932 unsigned int cmd, void *arg); 908 unsigned int cmd, void *arg);
933int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream); 909int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
934int snd_pcm_playback_xrun_check(snd_pcm_substream_t *substream); 910int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream);
935int snd_pcm_capture_xrun_check(snd_pcm_substream_t *substream); 911int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream);
936int snd_pcm_playback_xrun_asap(snd_pcm_substream_t *substream); 912int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream);
937int snd_pcm_capture_xrun_asap(snd_pcm_substream_t *substream); 913int snd_pcm_capture_xrun_asap(struct snd_pcm_substream *substream);
938void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr); 914void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr);
939void snd_pcm_tick_prepare(snd_pcm_substream_t *substream); 915void snd_pcm_tick_prepare(struct snd_pcm_substream *substream);
940void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks); 916void snd_pcm_tick_set(struct snd_pcm_substream *substream, unsigned long ticks);
941void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream); 917void snd_pcm_tick_elapsed(struct snd_pcm_substream *substream);
942void snd_pcm_period_elapsed(snd_pcm_substream_t *substream); 918void snd_pcm_period_elapsed(struct snd_pcm_substream *substream);
943snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, 919snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream,
944 const void __user *buf, 920 const void __user *buf,
945 snd_pcm_uframes_t frames); 921 snd_pcm_uframes_t frames);
946snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, 922snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream,
947 void __user *buf, snd_pcm_uframes_t frames); 923 void __user *buf, snd_pcm_uframes_t frames);
948snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, 924snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream,
949 void __user **bufs, snd_pcm_uframes_t frames); 925 void __user **bufs, snd_pcm_uframes_t frames);
950snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, 926snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream,
951 void __user **bufs, snd_pcm_uframes_t frames); 927 void __user **bufs, snd_pcm_uframes_t frames);
952 928
953int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime); 929int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime);
954 930
955static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream, 931static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
956 struct snd_dma_buffer *bufp) 932 struct snd_dma_buffer *bufp)
957{ 933{
958 snd_pcm_runtime_t *runtime = substream->runtime; 934 struct snd_pcm_runtime *runtime = substream->runtime;
959 if (bufp) { 935 if (bufp) {
960 runtime->dma_buffer_p = bufp; 936 runtime->dma_buffer_p = bufp;
961 runtime->dma_area = bufp->area; 937 runtime->dma_area = bufp->area;
@@ -973,47 +949,47 @@ static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream,
973 * Timer interface 949 * Timer interface
974 */ 950 */
975 951
976void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream); 952void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
977void snd_pcm_timer_init(snd_pcm_substream_t * substream); 953void snd_pcm_timer_init(struct snd_pcm_substream *substream);
978void snd_pcm_timer_done(snd_pcm_substream_t * substream); 954void snd_pcm_timer_done(struct snd_pcm_substream *substream);
979 955
980/* 956/*
981 * Memory 957 * Memory
982 */ 958 */
983 959
984int snd_pcm_lib_preallocate_free(snd_pcm_substream_t *substream); 960int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream);
985int snd_pcm_lib_preallocate_free_for_all(snd_pcm_t *pcm); 961int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm);
986int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream, 962int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
987 int type, struct device *data, 963 int type, struct device *data,
988 size_t size, size_t max); 964 size_t size, size_t max);
989int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm, 965int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
990 int type, void *data, 966 int type, void *data,
991 size_t size, size_t max); 967 size_t size, size_t max);
992int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size); 968int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
993int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream); 969int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
994 970
995#define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) 971#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) 972#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) 973#define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs)
998struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset); 974struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset);
999 975
1000/* handle mmap counter - PCM mmap callback should handle this counter properly */ 976/* handle mmap counter - PCM mmap callback should handle this counter properly */
1001static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) 977static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
1002{ 978{
1003 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; 979 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1004 atomic_inc(&substream->runtime->mmap_count); 980 atomic_inc(&substream->runtime->mmap_count);
1005} 981}
1006 982
1007static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) 983static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area)
1008{ 984{
1009 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; 985 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1010 atomic_dec(&substream->runtime->mmap_count); 986 atomic_dec(&substream->runtime->mmap_count);
1011} 987}
1012 988
1013/* mmap for io-memory area */ 989/* mmap for io-memory area */
1014#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) 990#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA)
1015#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP 991#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP
1016int snd_pcm_lib_mmap_iomem(snd_pcm_substream_t *substream, struct vm_area_struct *area); 992int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area);
1017#else 993#else
1018#define SNDRV_PCM_INFO_MMAP_IOMEM 0 994#define SNDRV_PCM_INFO_MMAP_IOMEM 0
1019#define snd_pcm_lib_mmap_iomem NULL 995#define snd_pcm_lib_mmap_iomem NULL