aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 07:59:38 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:17:43 -0500
commit877211f5e1b1196179ba1290e8e1a3dc00427c55 (patch)
tree9964e0e46043cee6c76a614ac35ab982faba7f99 /sound
parent24c1f93188b4438c7f30df5b4cd78340cdb28daf (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 'sound')
-rw-r--r--sound/core/pcm.c214
-rw-r--r--sound/core/pcm_compat.c110
-rw-r--r--sound/core/pcm_lib.c320
-rw-r--r--sound/core/pcm_memory.c45
-rw-r--r--sound/core/pcm_misc.c2
-rw-r--r--sound/core/pcm_native.c623
-rw-r--r--sound/core/pcm_timer.c30
7 files changed, 699 insertions, 645 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 184e74b75ba9..59c995bbf15b 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -33,18 +33,18 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Abramo Bagnara <abramo@alsa-proj
33MODULE_DESCRIPTION("Midlevel PCM code for ALSA."); 33MODULE_DESCRIPTION("Midlevel PCM code for ALSA.");
34MODULE_LICENSE("GPL"); 34MODULE_LICENSE("GPL");
35 35
36snd_pcm_t *snd_pcm_devices[SNDRV_CARDS * SNDRV_PCM_DEVICES]; 36struct snd_pcm *snd_pcm_devices[SNDRV_CARDS * SNDRV_PCM_DEVICES];
37static LIST_HEAD(snd_pcm_notify_list); 37static LIST_HEAD(snd_pcm_notify_list);
38static DECLARE_MUTEX(register_mutex); 38static DECLARE_MUTEX(register_mutex);
39 39
40static int snd_pcm_free(snd_pcm_t *pcm); 40static int snd_pcm_free(struct snd_pcm *pcm);
41static int snd_pcm_dev_free(snd_device_t *device); 41static int snd_pcm_dev_free(struct snd_device *device);
42static int snd_pcm_dev_register(snd_device_t *device); 42static int snd_pcm_dev_register(struct snd_device *device);
43static int snd_pcm_dev_disconnect(snd_device_t *device); 43static int snd_pcm_dev_disconnect(struct snd_device *device);
44static int snd_pcm_dev_unregister(snd_device_t *device); 44static int snd_pcm_dev_unregister(struct snd_device *device);
45 45
46static int snd_pcm_control_ioctl(snd_card_t * card, 46static int snd_pcm_control_ioctl(struct snd_card *card,
47 snd_ctl_file_t * control, 47 struct snd_ctl_file *control,
48 unsigned int cmd, unsigned long arg) 48 unsigned int cmd, unsigned long arg)
49{ 49{
50 unsigned int tmp; 50 unsigned int tmp;
@@ -71,13 +71,13 @@ static int snd_pcm_control_ioctl(snd_card_t * card,
71 } 71 }
72 case SNDRV_CTL_IOCTL_PCM_INFO: 72 case SNDRV_CTL_IOCTL_PCM_INFO:
73 { 73 {
74 snd_pcm_info_t __user *info; 74 struct snd_pcm_info __user *info;
75 unsigned int device, subdevice; 75 unsigned int device, subdevice;
76 snd_pcm_stream_t stream; 76 int stream;
77 snd_pcm_t *pcm; 77 struct snd_pcm *pcm;
78 snd_pcm_str_t *pstr; 78 struct snd_pcm_str *pstr;
79 snd_pcm_substream_t *substream; 79 struct snd_pcm_substream *substream;
80 info = (snd_pcm_info_t __user *)arg; 80 info = (struct snd_pcm_info __user *)arg;
81 if (get_user(device, &info->device)) 81 if (get_user(device, &info->device))
82 return -EFAULT; 82 return -EFAULT;
83 if (device >= SNDRV_PCM_DEVICES) 83 if (device >= SNDRV_PCM_DEVICES)
@@ -200,7 +200,7 @@ static char *snd_pcm_tstamp_mode_names[] = {
200 TSTAMP(MMAP), 200 TSTAMP(MMAP),
201}; 201};
202 202
203static const char *snd_pcm_stream_name(snd_pcm_stream_t stream) 203static const char *snd_pcm_stream_name(int stream)
204{ 204{
205 snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return NULL); 205 snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return NULL);
206 return snd_pcm_stream_names[stream]; 206 return snd_pcm_stream_names[stream];
@@ -208,23 +208,20 @@ static const char *snd_pcm_stream_name(snd_pcm_stream_t stream)
208 208
209static const char *snd_pcm_access_name(snd_pcm_access_t access) 209static const char *snd_pcm_access_name(snd_pcm_access_t access)
210{ 210{
211 snd_assert(access <= SNDRV_PCM_ACCESS_LAST, return NULL);
212 return snd_pcm_access_names[access]; 211 return snd_pcm_access_names[access];
213} 212}
214 213
215const char *snd_pcm_format_name(snd_pcm_format_t format) 214const char *snd_pcm_format_name(snd_pcm_format_t format)
216{ 215{
217 snd_assert(format <= SNDRV_PCM_FORMAT_LAST, return NULL);
218 return snd_pcm_format_names[format]; 216 return snd_pcm_format_names[format];
219} 217}
220 218
221static const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat) 219static const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat)
222{ 220{
223 snd_assert(subformat <= SNDRV_PCM_SUBFORMAT_LAST, return NULL);
224 return snd_pcm_subformat_names[subformat]; 221 return snd_pcm_subformat_names[subformat];
225} 222}
226 223
227static const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode) 224static const char *snd_pcm_tstamp_mode_name(int mode)
228{ 225{
229 snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return NULL); 226 snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return NULL);
230 return snd_pcm_tstamp_mode_names[mode]; 227 return snd_pcm_tstamp_mode_names[mode];
@@ -232,7 +229,6 @@ static const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
232 229
233static const char *snd_pcm_state_name(snd_pcm_state_t state) 230static const char *snd_pcm_state_name(snd_pcm_state_t state)
234{ 231{
235 snd_assert(state <= SNDRV_PCM_STATE_LAST, return NULL);
236 return snd_pcm_state_names[state]; 232 return snd_pcm_state_names[state];
237} 233}
238 234
@@ -268,9 +264,10 @@ static const char *snd_pcm_oss_format_name(int format)
268#endif 264#endif
269 265
270#ifdef CONFIG_PROC_FS 266#ifdef CONFIG_PROC_FS
271static void snd_pcm_proc_info_read(snd_pcm_substream_t *substream, snd_info_buffer_t *buffer) 267static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream,
268 struct snd_info_buffer *buffer)
272{ 269{
273 snd_pcm_info_t *info; 270 struct snd_pcm_info *info;
274 int err; 271 int err;
275 272
276 if (! substream) 273 if (! substream)
@@ -302,20 +299,25 @@ static void snd_pcm_proc_info_read(snd_pcm_substream_t *substream, snd_info_buff
302 kfree(info); 299 kfree(info);
303} 300}
304 301
305static void snd_pcm_stream_proc_info_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 302static void snd_pcm_stream_proc_info_read(struct snd_info_entry *entry,
303 struct snd_info_buffer *buffer)
306{ 304{
307 snd_pcm_proc_info_read(((snd_pcm_str_t *)entry->private_data)->substream, buffer); 305 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream,
306 buffer);
308} 307}
309 308
310static void snd_pcm_substream_proc_info_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 309static void snd_pcm_substream_proc_info_read(struct snd_info_entry *entry,
310 struct snd_info_buffer *buffer)
311{ 311{
312 snd_pcm_proc_info_read((snd_pcm_substream_t *)entry->private_data, buffer); 312 snd_pcm_proc_info_read((struct snd_pcm_substream *)entry->private_data,
313 buffer);
313} 314}
314 315
315static void snd_pcm_substream_proc_hw_params_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 316static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry,
317 struct snd_info_buffer *buffer)
316{ 318{
317 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)entry->private_data; 319 struct snd_pcm_substream *substream = entry->private_data;
318 snd_pcm_runtime_t *runtime = substream->runtime; 320 struct snd_pcm_runtime *runtime = substream->runtime;
319 if (!runtime) { 321 if (!runtime) {
320 snd_iprintf(buffer, "closed\n"); 322 snd_iprintf(buffer, "closed\n");
321 return; 323 return;
@@ -347,10 +349,11 @@ static void snd_pcm_substream_proc_hw_params_read(snd_info_entry_t *entry, snd_i
347 snd_pcm_stream_unlock_irq(substream); 349 snd_pcm_stream_unlock_irq(substream);
348} 350}
349 351
350static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 352static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry,
353 struct snd_info_buffer *buffer)
351{ 354{
352 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)entry->private_data; 355 struct snd_pcm_substream *substream = entry->private_data;
353 snd_pcm_runtime_t *runtime = substream->runtime; 356 struct snd_pcm_runtime *runtime = substream->runtime;
354 if (!runtime) { 357 if (!runtime) {
355 snd_iprintf(buffer, "closed\n"); 358 snd_iprintf(buffer, "closed\n");
356 return; 359 return;
@@ -374,11 +377,12 @@ static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_i
374 snd_pcm_stream_unlock_irq(substream); 377 snd_pcm_stream_unlock_irq(substream);
375} 378}
376 379
377static void snd_pcm_substream_proc_status_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 380static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry,
381 struct snd_info_buffer *buffer)
378{ 382{
379 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)entry->private_data; 383 struct snd_pcm_substream *substream = entry->private_data;
380 snd_pcm_runtime_t *runtime = substream->runtime; 384 struct snd_pcm_runtime *runtime = substream->runtime;
381 snd_pcm_status_t status; 385 struct snd_pcm_status status;
382 int err; 386 int err;
383 if (!runtime) { 387 if (!runtime) {
384 snd_iprintf(buffer, "closed\n"); 388 snd_iprintf(buffer, "closed\n");
@@ -405,25 +409,27 @@ static void snd_pcm_substream_proc_status_read(snd_info_entry_t *entry, snd_info
405#endif 409#endif
406 410
407#ifdef CONFIG_SND_DEBUG 411#ifdef CONFIG_SND_DEBUG
408static void snd_pcm_xrun_debug_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 412static void snd_pcm_xrun_debug_read(struct snd_info_entry *entry,
413 struct snd_info_buffer *buffer)
409{ 414{
410 snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data; 415 struct snd_pcm_str *pstr = entry->private_data;
411 snd_iprintf(buffer, "%d\n", pstr->xrun_debug); 416 snd_iprintf(buffer, "%d\n", pstr->xrun_debug);
412} 417}
413 418
414static void snd_pcm_xrun_debug_write(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 419static void snd_pcm_xrun_debug_write(struct snd_info_entry *entry,
420 struct snd_info_buffer *buffer)
415{ 421{
416 snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data; 422 struct snd_pcm_str *pstr = entry->private_data;
417 char line[64]; 423 char line[64];
418 if (!snd_info_get_line(buffer, line, sizeof(line))) 424 if (!snd_info_get_line(buffer, line, sizeof(line)))
419 pstr->xrun_debug = simple_strtoul(line, NULL, 10); 425 pstr->xrun_debug = simple_strtoul(line, NULL, 10);
420} 426}
421#endif 427#endif
422 428
423static int snd_pcm_stream_proc_init(snd_pcm_str_t *pstr) 429static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
424{ 430{
425 snd_pcm_t *pcm = pstr->pcm; 431 struct snd_pcm *pcm = pstr->pcm;
426 snd_info_entry_t *entry; 432 struct snd_info_entry *entry;
427 char name[16]; 433 char name[16];
428 434
429 sprintf(name, "pcm%i%c", pcm->device, 435 sprintf(name, "pcm%i%c", pcm->device,
@@ -447,7 +453,8 @@ static int snd_pcm_stream_proc_init(snd_pcm_str_t *pstr)
447 pstr->proc_info_entry = entry; 453 pstr->proc_info_entry = entry;
448 454
449#ifdef CONFIG_SND_DEBUG 455#ifdef CONFIG_SND_DEBUG
450 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", pstr->proc_root)) != NULL) { 456 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug",
457 pstr->proc_root)) != NULL) {
451 entry->c.text.read_size = 64; 458 entry->c.text.read_size = 64;
452 entry->c.text.read = snd_pcm_xrun_debug_read; 459 entry->c.text.read = snd_pcm_xrun_debug_read;
453 entry->c.text.write_size = 64; 460 entry->c.text.write_size = 64;
@@ -464,7 +471,7 @@ static int snd_pcm_stream_proc_init(snd_pcm_str_t *pstr)
464 return 0; 471 return 0;
465} 472}
466 473
467static int snd_pcm_stream_proc_done(snd_pcm_str_t *pstr) 474static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr)
468{ 475{
469#ifdef CONFIG_SND_DEBUG 476#ifdef CONFIG_SND_DEBUG
470 if (pstr->proc_xrun_debug_entry) { 477 if (pstr->proc_xrun_debug_entry) {
@@ -483,10 +490,10 @@ static int snd_pcm_stream_proc_done(snd_pcm_str_t *pstr)
483 return 0; 490 return 0;
484} 491}
485 492
486static int snd_pcm_substream_proc_init(snd_pcm_substream_t *substream) 493static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
487{ 494{
488 snd_info_entry_t *entry; 495 struct snd_info_entry *entry;
489 snd_card_t *card; 496 struct snd_card *card;
490 char name[16]; 497 char name[16];
491 498
492 card = substream->pcm->card; 499 card = substream->pcm->card;
@@ -540,7 +547,7 @@ static int snd_pcm_substream_proc_init(snd_pcm_substream_t *substream)
540 return 0; 547 return 0;
541} 548}
542 549
543static int snd_pcm_substream_proc_done(snd_pcm_substream_t *substream) 550static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream)
544{ 551{
545 if (substream->proc_info_entry) { 552 if (substream->proc_info_entry) {
546 snd_info_unregister(substream->proc_info_entry); 553 snd_info_unregister(substream->proc_info_entry);
@@ -578,11 +585,11 @@ static int snd_pcm_substream_proc_done(snd_pcm_substream_t *substream)
578 * 585 *
579 * Returns zero if successful, or a negative error code on failure. 586 * Returns zero if successful, or a negative error code on failure.
580 */ 587 */
581int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count) 588int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
582{ 589{
583 int idx, err; 590 int idx, err;
584 snd_pcm_str_t *pstr = &pcm->streams[stream]; 591 struct snd_pcm_str *pstr = &pcm->streams[stream];
585 snd_pcm_substream_t *substream, *prev; 592 struct snd_pcm_substream *substream, *prev;
586 593
587#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 594#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
588 init_MUTEX(&pstr->oss.setup_mutex); 595 init_MUTEX(&pstr->oss.setup_mutex);
@@ -642,13 +649,13 @@ int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count)
642 * 649 *
643 * Returns zero if successful, or a negative error code on failure. 650 * Returns zero if successful, or a negative error code on failure.
644 */ 651 */
645int snd_pcm_new(snd_card_t * card, char *id, int device, 652int snd_pcm_new(struct snd_card *card, char *id, int device,
646 int playback_count, int capture_count, 653 int playback_count, int capture_count,
647 snd_pcm_t ** rpcm) 654 struct snd_pcm ** rpcm)
648{ 655{
649 snd_pcm_t *pcm; 656 struct snd_pcm *pcm;
650 int err; 657 int err;
651 static snd_device_ops_t ops = { 658 static struct snd_device_ops ops = {
652 .dev_free = snd_pcm_dev_free, 659 .dev_free = snd_pcm_dev_free,
653 .dev_register = snd_pcm_dev_register, 660 .dev_register = snd_pcm_dev_register,
654 .dev_disconnect = snd_pcm_dev_disconnect, 661 .dev_disconnect = snd_pcm_dev_disconnect,
@@ -684,11 +691,11 @@ int snd_pcm_new(snd_card_t * card, char *id, int device,
684 return 0; 691 return 0;
685} 692}
686 693
687static void snd_pcm_free_stream(snd_pcm_str_t * pstr) 694static void snd_pcm_free_stream(struct snd_pcm_str * pstr)
688{ 695{
689 snd_pcm_substream_t *substream, *substream_next; 696 struct snd_pcm_substream *substream, *substream_next;
690#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 697#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
691 snd_pcm_oss_setup_t *setup, *setupn; 698 struct snd_pcm_oss_setup *setup, *setupn;
692#endif 699#endif
693 substream = pstr->substream; 700 substream = pstr->substream;
694 while (substream) { 701 while (substream) {
@@ -707,7 +714,7 @@ static void snd_pcm_free_stream(snd_pcm_str_t * pstr)
707#endif 714#endif
708} 715}
709 716
710static int snd_pcm_free(snd_pcm_t *pcm) 717static int snd_pcm_free(struct snd_pcm *pcm)
711{ 718{
712 snd_assert(pcm != NULL, return -ENXIO); 719 snd_assert(pcm != NULL, return -ENXIO);
713 if (pcm->private_free) 720 if (pcm->private_free)
@@ -719,26 +726,26 @@ static int snd_pcm_free(snd_pcm_t *pcm)
719 return 0; 726 return 0;
720} 727}
721 728
722static int snd_pcm_dev_free(snd_device_t *device) 729static int snd_pcm_dev_free(struct snd_device *device)
723{ 730{
724 snd_pcm_t *pcm = device->device_data; 731 struct snd_pcm *pcm = device->device_data;
725 return snd_pcm_free(pcm); 732 return snd_pcm_free(pcm);
726} 733}
727 734
728static void snd_pcm_tick_timer_func(unsigned long data) 735static void snd_pcm_tick_timer_func(unsigned long data)
729{ 736{
730 snd_pcm_substream_t *substream = (snd_pcm_substream_t*) data; 737 struct snd_pcm_substream *substream = (struct snd_pcm_substream *) data;
731 snd_pcm_tick_elapsed(substream); 738 snd_pcm_tick_elapsed(substream);
732} 739}
733 740
734int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, 741int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
735 snd_pcm_substream_t **rsubstream) 742 struct snd_pcm_substream **rsubstream)
736{ 743{
737 snd_pcm_str_t * pstr; 744 struct snd_pcm_str * pstr;
738 snd_pcm_substream_t * substream; 745 struct snd_pcm_substream *substream;
739 snd_pcm_runtime_t * runtime; 746 struct snd_pcm_runtime *runtime;
740 snd_ctl_file_t *kctl; 747 struct snd_ctl_file *kctl;
741 snd_card_t *card; 748 struct snd_card *card;
742 struct list_head *list; 749 struct list_head *list;
743 int prefer_subdevice = -1; 750 int prefer_subdevice = -1;
744 size_t size; 751 size_t size;
@@ -800,7 +807,7 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream,
800 if (runtime == NULL) 807 if (runtime == NULL)
801 return -ENOMEM; 808 return -ENOMEM;
802 809
803 size = PAGE_ALIGN(sizeof(snd_pcm_mmap_status_t)); 810 size = PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status));
804 runtime->status = snd_malloc_pages(size, GFP_KERNEL); 811 runtime->status = snd_malloc_pages(size, GFP_KERNEL);
805 if (runtime->status == NULL) { 812 if (runtime->status == NULL) {
806 kfree(runtime); 813 kfree(runtime);
@@ -808,10 +815,11 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream,
808 } 815 }
809 memset((void*)runtime->status, 0, size); 816 memset((void*)runtime->status, 0, size);
810 817
811 size = PAGE_ALIGN(sizeof(snd_pcm_mmap_control_t)); 818 size = PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control));
812 runtime->control = snd_malloc_pages(size, GFP_KERNEL); 819 runtime->control = snd_malloc_pages(size, GFP_KERNEL);
813 if (runtime->control == NULL) { 820 if (runtime->control == NULL) {
814 snd_free_pages((void*)runtime->status, PAGE_ALIGN(sizeof(snd_pcm_mmap_status_t))); 821 snd_free_pages((void*)runtime->status,
822 PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status)));
815 kfree(runtime); 823 kfree(runtime);
816 return -ENOMEM; 824 return -ENOMEM;
817 } 825 }
@@ -832,30 +840,32 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream,
832 return 0; 840 return 0;
833} 841}
834 842
835void snd_pcm_release_substream(snd_pcm_substream_t *substream) 843void snd_pcm_release_substream(struct snd_pcm_substream *substream)
836{ 844{
837 snd_pcm_runtime_t * runtime; 845 struct snd_pcm_runtime *runtime;
838 substream->file = NULL; 846 substream->file = NULL;
839 runtime = substream->runtime; 847 runtime = substream->runtime;
840 snd_assert(runtime != NULL, return); 848 snd_assert(runtime != NULL, return);
841 if (runtime->private_free != NULL) 849 if (runtime->private_free != NULL)
842 runtime->private_free(runtime); 850 runtime->private_free(runtime);
843 snd_free_pages((void*)runtime->status, PAGE_ALIGN(sizeof(snd_pcm_mmap_status_t))); 851 snd_free_pages((void*)runtime->status,
844 snd_free_pages((void*)runtime->control, PAGE_ALIGN(sizeof(snd_pcm_mmap_control_t))); 852 PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status)));
853 snd_free_pages((void*)runtime->control,
854 PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)));
845 kfree(runtime->hw_constraints.rules); 855 kfree(runtime->hw_constraints.rules);
846 kfree(runtime); 856 kfree(runtime);
847 substream->runtime = NULL; 857 substream->runtime = NULL;
848 substream->pstr->substream_opened--; 858 substream->pstr->substream_opened--;
849} 859}
850 860
851static int snd_pcm_dev_register(snd_device_t *device) 861static int snd_pcm_dev_register(struct snd_device *device)
852{ 862{
853 int idx, cidx, err; 863 int idx, cidx, err;
854 unsigned short minor; 864 unsigned short minor;
855 snd_pcm_substream_t *substream; 865 struct snd_pcm_substream *substream;
856 struct list_head *list; 866 struct list_head *list;
857 char str[16]; 867 char str[16];
858 snd_pcm_t *pcm = device->device_data; 868 struct snd_pcm *pcm = device->device_data;
859 869
860 snd_assert(pcm != NULL && device != NULL, return -ENXIO); 870 snd_assert(pcm != NULL && device != NULL, return -ENXIO);
861 down(&register_mutex); 871 down(&register_mutex);
@@ -890,19 +900,19 @@ static int snd_pcm_dev_register(snd_device_t *device)
890 snd_pcm_timer_init(substream); 900 snd_pcm_timer_init(substream);
891 } 901 }
892 list_for_each(list, &snd_pcm_notify_list) { 902 list_for_each(list, &snd_pcm_notify_list) {
893 snd_pcm_notify_t *notify; 903 struct snd_pcm_notify *notify;
894 notify = list_entry(list, snd_pcm_notify_t, list); 904 notify = list_entry(list, struct snd_pcm_notify, list);
895 notify->n_register(pcm); 905 notify->n_register(pcm);
896 } 906 }
897 up(&register_mutex); 907 up(&register_mutex);
898 return 0; 908 return 0;
899} 909}
900 910
901static int snd_pcm_dev_disconnect(snd_device_t *device) 911static int snd_pcm_dev_disconnect(struct snd_device *device)
902{ 912{
903 snd_pcm_t *pcm = device->device_data; 913 struct snd_pcm *pcm = device->device_data;
904 struct list_head *list; 914 struct list_head *list;
905 snd_pcm_substream_t *substream; 915 struct snd_pcm_substream *substream;
906 int idx, cidx; 916 int idx, cidx;
907 917
908 down(&register_mutex); 918 down(&register_mutex);
@@ -913,20 +923,20 @@ static int snd_pcm_dev_disconnect(snd_device_t *device)
913 if (substream->runtime) 923 if (substream->runtime)
914 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; 924 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED;
915 list_for_each(list, &snd_pcm_notify_list) { 925 list_for_each(list, &snd_pcm_notify_list) {
916 snd_pcm_notify_t *notify; 926 struct snd_pcm_notify *notify;
917 notify = list_entry(list, snd_pcm_notify_t, list); 927 notify = list_entry(list, struct snd_pcm_notify, list);
918 notify->n_disconnect(pcm); 928 notify->n_disconnect(pcm);
919 } 929 }
920 up(&register_mutex); 930 up(&register_mutex);
921 return 0; 931 return 0;
922} 932}
923 933
924static int snd_pcm_dev_unregister(snd_device_t *device) 934static int snd_pcm_dev_unregister(struct snd_device *device)
925{ 935{
926 int idx, cidx, devtype; 936 int idx, cidx, devtype;
927 snd_pcm_substream_t *substream; 937 struct snd_pcm_substream *substream;
928 struct list_head *list; 938 struct list_head *list;
929 snd_pcm_t *pcm = device->device_data; 939 struct snd_pcm *pcm = device->device_data;
930 940
931 snd_assert(pcm != NULL, return -ENXIO); 941 snd_assert(pcm != NULL, return -ENXIO);
932 down(&register_mutex); 942 down(&register_mutex);
@@ -947,15 +957,15 @@ static int snd_pcm_dev_unregister(snd_device_t *device)
947 snd_pcm_timer_done(substream); 957 snd_pcm_timer_done(substream);
948 } 958 }
949 list_for_each(list, &snd_pcm_notify_list) { 959 list_for_each(list, &snd_pcm_notify_list) {
950 snd_pcm_notify_t *notify; 960 struct snd_pcm_notify *notify;
951 notify = list_entry(list, snd_pcm_notify_t, list); 961 notify = list_entry(list, struct snd_pcm_notify, list);
952 notify->n_unregister(pcm); 962 notify->n_unregister(pcm);
953 } 963 }
954 up(&register_mutex); 964 up(&register_mutex);
955 return snd_pcm_free(pcm); 965 return snd_pcm_free(pcm);
956} 966}
957 967
958int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree) 968int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree)
959{ 969{
960 int idx; 970 int idx;
961 971
@@ -984,10 +994,11 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree)
984 * Info interface 994 * Info interface
985 */ 995 */
986 996
987static void snd_pcm_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) 997static void snd_pcm_proc_read(struct snd_info_entry *entry,
998 struct snd_info_buffer *buffer)
988{ 999{
989 int idx; 1000 int idx;
990 snd_pcm_t *pcm; 1001 struct snd_pcm *pcm;
991 1002
992 down(&register_mutex); 1003 down(&register_mutex);
993 for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) { 1004 for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) {
@@ -997,9 +1008,11 @@ static void snd_pcm_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buffe
997 snd_iprintf(buffer, "%02i-%02i: %s : %s", idx / SNDRV_PCM_DEVICES, 1008 snd_iprintf(buffer, "%02i-%02i: %s : %s", idx / SNDRV_PCM_DEVICES,
998 idx % SNDRV_PCM_DEVICES, pcm->id, pcm->name); 1009 idx % SNDRV_PCM_DEVICES, pcm->id, pcm->name);
999 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) 1010 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)
1000 snd_iprintf(buffer, " : playback %i", pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count); 1011 snd_iprintf(buffer, " : playback %i",
1012 pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count);
1001 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) 1013 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream)
1002 snd_iprintf(buffer, " : capture %i", pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count); 1014 snd_iprintf(buffer, " : capture %i",
1015 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count);
1003 snd_iprintf(buffer, "\n"); 1016 snd_iprintf(buffer, "\n");
1004 } 1017 }
1005 up(&register_mutex); 1018 up(&register_mutex);
@@ -1009,16 +1022,17 @@ static void snd_pcm_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buffe
1009 * ENTRY functions 1022 * ENTRY functions
1010 */ 1023 */
1011 1024
1012static snd_info_entry_t *snd_pcm_proc_entry = NULL; 1025static struct snd_info_entry *snd_pcm_proc_entry = NULL;
1013 1026
1014static int __init alsa_pcm_init(void) 1027static int __init alsa_pcm_init(void)
1015{ 1028{
1016 snd_info_entry_t *entry; 1029 struct snd_info_entry *entry;
1017 1030
1018 snd_ctl_register_ioctl(snd_pcm_control_ioctl); 1031 snd_ctl_register_ioctl(snd_pcm_control_ioctl);
1019 snd_ctl_register_ioctl_compat(snd_pcm_control_ioctl); 1032 snd_ctl_register_ioctl_compat(snd_pcm_control_ioctl);
1020 if ((entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL)) != NULL) { 1033 if ((entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL)) != NULL) {
1021 snd_info_set_text_ops(entry, NULL, SNDRV_CARDS * SNDRV_PCM_DEVICES * 128, snd_pcm_proc_read); 1034 snd_info_set_text_ops(entry, NULL, SNDRV_CARDS * SNDRV_PCM_DEVICES * 128,
1035 snd_pcm_proc_read);
1022 if (snd_info_register(entry) < 0) { 1036 if (snd_info_register(entry) < 0) {
1023 snd_info_free_entry(entry); 1037 snd_info_free_entry(entry);
1024 entry = NULL; 1038 entry = NULL;
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index 4b6307df846d..e5133033de5e 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -22,7 +22,7 @@
22 22
23#include <linux/compat.h> 23#include <linux/compat.h>
24 24
25static int snd_pcm_ioctl_delay_compat(snd_pcm_substream_t *substream, 25static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream *substream,
26 s32 __user *src) 26 s32 __user *src)
27{ 27{
28 snd_pcm_sframes_t delay; 28 snd_pcm_sframes_t delay;
@@ -39,7 +39,7 @@ static int snd_pcm_ioctl_delay_compat(snd_pcm_substream_t *substream,
39 return err; 39 return err;
40} 40}
41 41
42static int snd_pcm_ioctl_rewind_compat(snd_pcm_substream_t *substream, 42static int snd_pcm_ioctl_rewind_compat(struct snd_pcm_substream *substream,
43 u32 __user *src) 43 u32 __user *src)
44{ 44{
45 snd_pcm_uframes_t frames; 45 snd_pcm_uframes_t frames;
@@ -56,7 +56,7 @@ static int snd_pcm_ioctl_rewind_compat(snd_pcm_substream_t *substream,
56 return err < 0 ? err : 0; 56 return err < 0 ? err : 0;
57} 57}
58 58
59static int snd_pcm_ioctl_forward_compat(snd_pcm_substream_t *substream, 59static int snd_pcm_ioctl_forward_compat(struct snd_pcm_substream *substream,
60 u32 __user *src) 60 u32 __user *src)
61{ 61{
62 snd_pcm_uframes_t frames; 62 snd_pcm_uframes_t frames;
@@ -73,12 +73,12 @@ static int snd_pcm_ioctl_forward_compat(snd_pcm_substream_t *substream,
73 return err < 0 ? err : 0; 73 return err < 0 ? err : 0;
74} 74}
75 75
76struct sndrv_pcm_hw_params32 { 76struct snd_pcm_hw_params32 {
77 u32 flags; 77 u32 flags;
78 struct sndrv_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; /* this must be identical */ 78 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; /* this must be identical */
79 struct sndrv_mask mres[5]; /* reserved masks */ 79 struct snd_mask mres[5]; /* reserved masks */
80 struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; 80 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
81 struct sndrv_interval ires[9]; /* reserved intervals */ 81 struct snd_interval ires[9]; /* reserved intervals */
82 u32 rmask; 82 u32 rmask;
83 u32 cmask; 83 u32 cmask;
84 u32 info; 84 u32 info;
@@ -89,7 +89,7 @@ struct sndrv_pcm_hw_params32 {
89 unsigned char reserved[64]; 89 unsigned char reserved[64];
90}; 90};
91 91
92struct sndrv_pcm_sw_params32 { 92struct snd_pcm_sw_params32 {
93 s32 tstamp_mode; 93 s32 tstamp_mode;
94 u32 period_step; 94 u32 period_step;
95 u32 sleep_min; 95 u32 sleep_min;
@@ -104,7 +104,7 @@ struct sndrv_pcm_sw_params32 {
104}; 104};
105 105
106/* recalcuate the boundary within 32bit */ 106/* recalcuate the boundary within 32bit */
107static snd_pcm_uframes_t recalculate_boundary(snd_pcm_runtime_t *runtime) 107static snd_pcm_uframes_t recalculate_boundary(struct snd_pcm_runtime *runtime)
108{ 108{
109 snd_pcm_uframes_t boundary; 109 snd_pcm_uframes_t boundary;
110 110
@@ -116,10 +116,10 @@ static snd_pcm_uframes_t recalculate_boundary(snd_pcm_runtime_t *runtime)
116 return boundary; 116 return boundary;
117} 117}
118 118
119static int snd_pcm_ioctl_sw_params_compat(snd_pcm_substream_t *substream, 119static int snd_pcm_ioctl_sw_params_compat(struct snd_pcm_substream *substream,
120 struct sndrv_pcm_sw_params32 __user *src) 120 struct snd_pcm_sw_params32 __user *src)
121{ 121{
122 snd_pcm_sw_params_t params; 122 struct snd_pcm_sw_params params;
123 snd_pcm_uframes_t boundary; 123 snd_pcm_uframes_t boundary;
124 int err; 124 int err;
125 125
@@ -149,17 +149,17 @@ static int snd_pcm_ioctl_sw_params_compat(snd_pcm_substream_t *substream,
149 return err; 149 return err;
150} 150}
151 151
152struct sndrv_pcm_channel_info32 { 152struct snd_pcm_channel_info32 {
153 u32 channel; 153 u32 channel;
154 u32 offset; 154 u32 offset;
155 u32 first; 155 u32 first;
156 u32 step; 156 u32 step;
157}; 157};
158 158
159static int snd_pcm_ioctl_channel_info_compat(snd_pcm_substream_t *substream, 159static int snd_pcm_ioctl_channel_info_compat(struct snd_pcm_substream *substream,
160 struct sndrv_pcm_channel_info32 __user *src) 160 struct snd_pcm_channel_info32 __user *src)
161{ 161{
162 snd_pcm_channel_info_t info; 162 struct snd_pcm_channel_info info;
163 int err; 163 int err;
164 164
165 if (get_user(info.channel, &src->channel) || 165 if (get_user(info.channel, &src->channel) ||
@@ -178,7 +178,7 @@ static int snd_pcm_ioctl_channel_info_compat(snd_pcm_substream_t *substream,
178 return err; 178 return err;
179} 179}
180 180
181struct sndrv_pcm_status32 { 181struct snd_pcm_status32 {
182 s32 state; 182 s32 state;
183 struct compat_timespec trigger_tstamp; 183 struct compat_timespec trigger_tstamp;
184 struct compat_timespec tstamp; 184 struct compat_timespec tstamp;
@@ -193,10 +193,10 @@ struct sndrv_pcm_status32 {
193} __attribute__((packed)); 193} __attribute__((packed));
194 194
195 195
196static int snd_pcm_status_user_compat(snd_pcm_substream_t *substream, 196static int snd_pcm_status_user_compat(struct snd_pcm_substream *substream,
197 struct sndrv_pcm_status32 __user *src) 197 struct snd_pcm_status32 __user *src)
198{ 198{
199 snd_pcm_status_t status; 199 struct snd_pcm_status status;
200 int err; 200 int err;
201 201
202 err = snd_pcm_status(substream, &status); 202 err = snd_pcm_status(substream, &status);
@@ -221,12 +221,12 @@ static int snd_pcm_status_user_compat(snd_pcm_substream_t *substream,
221} 221}
222 222
223/* both for HW_PARAMS and HW_REFINE */ 223/* both for HW_PARAMS and HW_REFINE */
224static int snd_pcm_ioctl_hw_params_compat(snd_pcm_substream_t *substream, 224static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,
225 int refine, 225 int refine,
226 struct sndrv_pcm_hw_params32 __user *data32) 226 struct snd_pcm_hw_params32 __user *data32)
227{ 227{
228 struct sndrv_pcm_hw_params *data; 228 struct snd_pcm_hw_params *data;
229 snd_pcm_runtime_t *runtime; 229 struct snd_pcm_runtime *runtime;
230 int err; 230 int err;
231 231
232 if (! (runtime = substream->runtime)) 232 if (! (runtime = substream->runtime))
@@ -265,14 +265,14 @@ static int snd_pcm_ioctl_hw_params_compat(snd_pcm_substream_t *substream,
265 265
266/* 266/*
267 */ 267 */
268struct sndrv_xferi32 { 268struct snd_xferi32 {
269 s32 result; 269 s32 result;
270 u32 buf; 270 u32 buf;
271 u32 frames; 271 u32 frames;
272}; 272};
273 273
274static int snd_pcm_ioctl_xferi_compat(snd_pcm_substream_t *substream, 274static int snd_pcm_ioctl_xferi_compat(struct snd_pcm_substream *substream,
275 int dir, struct sndrv_xferi32 __user *data32) 275 int dir, struct snd_xferi32 __user *data32)
276{ 276{
277 compat_caddr_t buf; 277 compat_caddr_t buf;
278 u32 frames; 278 u32 frames;
@@ -303,7 +303,7 @@ static int snd_pcm_ioctl_xferi_compat(snd_pcm_substream_t *substream,
303 303
304 304
305/* snd_xfern needs remapping of bufs */ 305/* snd_xfern needs remapping of bufs */
306struct sndrv_xfern32 { 306struct snd_xfern32 {
307 s32 result; 307 s32 result;
308 u32 bufs; /* this is void **; */ 308 u32 bufs; /* this is void **; */
309 u32 frames; 309 u32 frames;
@@ -315,8 +315,8 @@ struct sndrv_xfern32 {
315 * handler there expands again the same 128 pointers on stack, so it is better 315 * handler there expands again the same 128 pointers on stack, so it is better
316 * to handle the function (calling pcm_readv/writev) directly in this handler. 316 * to handle the function (calling pcm_readv/writev) directly in this handler.
317 */ 317 */
318static int snd_pcm_ioctl_xfern_compat(snd_pcm_substream_t *substream, 318static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream,
319 int dir, struct sndrv_xfern32 __user *data32) 319 int dir, struct snd_xfern32 __user *data32)
320{ 320{
321 compat_caddr_t buf; 321 compat_caddr_t buf;
322 compat_caddr_t __user *bufptr; 322 compat_caddr_t __user *bufptr;
@@ -360,7 +360,7 @@ static int snd_pcm_ioctl_xfern_compat(snd_pcm_substream_t *substream,
360} 360}
361 361
362 362
363struct sndrv_pcm_mmap_status32 { 363struct snd_pcm_mmap_status32 {
364 s32 state; 364 s32 state;
365 s32 pad1; 365 s32 pad1;
366 u32 hw_ptr; 366 u32 hw_ptr;
@@ -368,32 +368,32 @@ struct sndrv_pcm_mmap_status32 {
368 s32 suspended_state; 368 s32 suspended_state;
369} __attribute__((packed)); 369} __attribute__((packed));
370 370
371struct sndrv_pcm_mmap_control32 { 371struct snd_pcm_mmap_control32 {
372 u32 appl_ptr; 372 u32 appl_ptr;
373 u32 avail_min; 373 u32 avail_min;
374}; 374};
375 375
376struct sndrv_pcm_sync_ptr32 { 376struct snd_pcm_sync_ptr32 {
377 u32 flags; 377 u32 flags;
378 union { 378 union {
379 struct sndrv_pcm_mmap_status32 status; 379 struct snd_pcm_mmap_status32 status;
380 unsigned char reserved[64]; 380 unsigned char reserved[64];
381 } s; 381 } s;
382 union { 382 union {
383 struct sndrv_pcm_mmap_control32 control; 383 struct snd_pcm_mmap_control32 control;
384 unsigned char reserved[64]; 384 unsigned char reserved[64];
385 } c; 385 } c;
386} __attribute__((packed)); 386} __attribute__((packed));
387 387
388static int snd_pcm_ioctl_sync_ptr_compat(snd_pcm_substream_t *substream, 388static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream,
389 struct sndrv_pcm_sync_ptr32 __user *src) 389 struct snd_pcm_sync_ptr32 __user *src)
390{ 390{
391 snd_pcm_runtime_t *runtime = substream->runtime; 391 struct snd_pcm_runtime *runtime = substream->runtime;
392 volatile struct sndrv_pcm_mmap_status *status; 392 volatile struct snd_pcm_mmap_status *status;
393 volatile struct sndrv_pcm_mmap_control *control; 393 volatile struct snd_pcm_mmap_control *control;
394 u32 sflags; 394 u32 sflags;
395 struct sndrv_pcm_mmap_control scontrol; 395 struct snd_pcm_mmap_control scontrol;
396 struct sndrv_pcm_mmap_status sstatus; 396 struct snd_pcm_mmap_status sstatus;
397 snd_pcm_uframes_t boundary; 397 snd_pcm_uframes_t boundary;
398 int err; 398 int err;
399 399
@@ -444,26 +444,26 @@ static int snd_pcm_ioctl_sync_ptr_compat(snd_pcm_substream_t *substream,
444/* 444/*
445 */ 445 */
446enum { 446enum {
447 SNDRV_PCM_IOCTL_HW_REFINE32 = _IOWR('A', 0x10, struct sndrv_pcm_hw_params32), 447 SNDRV_PCM_IOCTL_HW_REFINE32 = _IOWR('A', 0x10, struct snd_pcm_hw_params32),
448 SNDRV_PCM_IOCTL_HW_PARAMS32 = _IOWR('A', 0x11, struct sndrv_pcm_hw_params32), 448 SNDRV_PCM_IOCTL_HW_PARAMS32 = _IOWR('A', 0x11, struct snd_pcm_hw_params32),
449 SNDRV_PCM_IOCTL_SW_PARAMS32 = _IOWR('A', 0x13, struct sndrv_pcm_sw_params32), 449 SNDRV_PCM_IOCTL_SW_PARAMS32 = _IOWR('A', 0x13, struct snd_pcm_sw_params32),
450 SNDRV_PCM_IOCTL_STATUS32 = _IOR('A', 0x20, struct sndrv_pcm_status32), 450 SNDRV_PCM_IOCTL_STATUS32 = _IOR('A', 0x20, struct snd_pcm_status32),
451 SNDRV_PCM_IOCTL_DELAY32 = _IOR('A', 0x21, s32), 451 SNDRV_PCM_IOCTL_DELAY32 = _IOR('A', 0x21, s32),
452 SNDRV_PCM_IOCTL_CHANNEL_INFO32 = _IOR('A', 0x32, struct sndrv_pcm_channel_info32), 452 SNDRV_PCM_IOCTL_CHANNEL_INFO32 = _IOR('A', 0x32, struct snd_pcm_channel_info32),
453 SNDRV_PCM_IOCTL_REWIND32 = _IOW('A', 0x46, u32), 453 SNDRV_PCM_IOCTL_REWIND32 = _IOW('A', 0x46, u32),
454 SNDRV_PCM_IOCTL_FORWARD32 = _IOW('A', 0x49, u32), 454 SNDRV_PCM_IOCTL_FORWARD32 = _IOW('A', 0x49, u32),
455 SNDRV_PCM_IOCTL_WRITEI_FRAMES32 = _IOW('A', 0x50, struct sndrv_xferi32), 455 SNDRV_PCM_IOCTL_WRITEI_FRAMES32 = _IOW('A', 0x50, struct snd_xferi32),
456 SNDRV_PCM_IOCTL_READI_FRAMES32 = _IOR('A', 0x51, struct sndrv_xferi32), 456 SNDRV_PCM_IOCTL_READI_FRAMES32 = _IOR('A', 0x51, struct snd_xferi32),
457 SNDRV_PCM_IOCTL_WRITEN_FRAMES32 = _IOW('A', 0x52, struct sndrv_xfern32), 457 SNDRV_PCM_IOCTL_WRITEN_FRAMES32 = _IOW('A', 0x52, struct snd_xfern32),
458 SNDRV_PCM_IOCTL_READN_FRAMES32 = _IOR('A', 0x53, struct sndrv_xfern32), 458 SNDRV_PCM_IOCTL_READN_FRAMES32 = _IOR('A', 0x53, struct snd_xfern32),
459 SNDRV_PCM_IOCTL_SYNC_PTR32 = _IOWR('A', 0x23, struct sndrv_pcm_sync_ptr32), 459 SNDRV_PCM_IOCTL_SYNC_PTR32 = _IOWR('A', 0x23, struct snd_pcm_sync_ptr32),
460 460
461}; 461};
462 462
463static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) 463static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
464{ 464{
465 snd_pcm_file_t *pcm_file; 465 struct snd_pcm_file *pcm_file;
466 snd_pcm_substream_t *substream; 466 struct snd_pcm_substream *substream;
467 void __user *argp = compat_ptr(arg); 467 void __user *argp = compat_ptr(arg);
468 468
469 pcm_file = file->private_data; 469 pcm_file = file->private_data;
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 3dbf9bf2ac16..c58ec67d1cbf 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -39,9 +39,9 @@
39 * 39 *
40 * when runtime->silence_size >= runtime->boundary - fill processed area with silence immediately 40 * when runtime->silence_size >= runtime->boundary - fill processed area with silence immediately
41 */ 41 */
42void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr) 42void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr)
43{ 43{
44 snd_pcm_runtime_t *runtime = substream->runtime; 44 struct snd_pcm_runtime *runtime = substream->runtime;
45 snd_pcm_uframes_t frames, ofs, transfer; 45 snd_pcm_uframes_t frames, ofs, transfer;
46 46
47 if (runtime->silence_size < runtime->boundary) { 47 if (runtime->silence_size < runtime->boundary) {
@@ -128,7 +128,7 @@ void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t
128 } 128 }
129} 129}
130 130
131static void xrun(snd_pcm_substream_t *substream) 131static void xrun(struct snd_pcm_substream *substream)
132{ 132{
133 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); 133 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
134#ifdef CONFIG_SND_DEBUG 134#ifdef CONFIG_SND_DEBUG
@@ -143,8 +143,8 @@ static void xrun(snd_pcm_substream_t *substream)
143#endif 143#endif
144} 144}
145 145
146static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(snd_pcm_substream_t *substream, 146static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(struct snd_pcm_substream *substream,
147 snd_pcm_runtime_t *runtime) 147 struct snd_pcm_runtime *runtime)
148{ 148{
149 snd_pcm_uframes_t pos; 149 snd_pcm_uframes_t pos;
150 150
@@ -162,8 +162,8 @@ static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(snd_pcm_substream_t *s
162 return pos; 162 return pos;
163} 163}
164 164
165static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream, 165static inline int snd_pcm_update_hw_ptr_post(struct snd_pcm_substream *substream,
166 snd_pcm_runtime_t *runtime) 166 struct snd_pcm_runtime *runtime)
167{ 167{
168 snd_pcm_uframes_t avail; 168 snd_pcm_uframes_t avail;
169 169
@@ -185,9 +185,9 @@ static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream,
185 return 0; 185 return 0;
186} 186}
187 187
188static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream) 188static inline int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
189{ 189{
190 snd_pcm_runtime_t *runtime = substream->runtime; 190 struct snd_pcm_runtime *runtime = substream->runtime;
191 snd_pcm_uframes_t pos; 191 snd_pcm_uframes_t pos;
192 snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt; 192 snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt;
193 snd_pcm_sframes_t delta; 193 snd_pcm_sframes_t delta;
@@ -232,9 +232,9 @@ static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream
232} 232}
233 233
234/* CAUTION: call it with irq disabled */ 234/* CAUTION: call it with irq disabled */
235int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream) 235int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
236{ 236{
237 snd_pcm_runtime_t *runtime = substream->runtime; 237 struct snd_pcm_runtime *runtime = substream->runtime;
238 snd_pcm_uframes_t pos; 238 snd_pcm_uframes_t pos;
239 snd_pcm_uframes_t old_hw_ptr, new_hw_ptr; 239 snd_pcm_uframes_t old_hw_ptr, new_hw_ptr;
240 snd_pcm_sframes_t delta; 240 snd_pcm_sframes_t delta;
@@ -281,10 +281,10 @@ int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream)
281 * 281 *
282 * Sets the given PCM operators to the pcm instance. 282 * Sets the given PCM operators to the pcm instance.
283 */ 283 */
284void snd_pcm_set_ops(snd_pcm_t *pcm, int direction, snd_pcm_ops_t *ops) 284void snd_pcm_set_ops(struct snd_pcm *pcm, int direction, struct snd_pcm_ops *ops)
285{ 285{
286 snd_pcm_str_t *stream = &pcm->streams[direction]; 286 struct snd_pcm_str *stream = &pcm->streams[direction];
287 snd_pcm_substream_t *substream; 287 struct snd_pcm_substream *substream;
288 288
289 for (substream = stream->substream; substream != NULL; substream = substream->next) 289 for (substream = stream->substream; substream != NULL; substream = substream->next)
290 substream->ops = ops; 290 substream->ops = ops;
@@ -297,9 +297,9 @@ void snd_pcm_set_ops(snd_pcm_t *pcm, int direction, snd_pcm_ops_t *ops)
297 * 297 *
298 * Sets the PCM sync identifier for the card. 298 * Sets the PCM sync identifier for the card.
299 */ 299 */
300void snd_pcm_set_sync(snd_pcm_substream_t * substream) 300void snd_pcm_set_sync(struct snd_pcm_substream *substream)
301{ 301{
302 snd_pcm_runtime_t *runtime = substream->runtime; 302 struct snd_pcm_runtime *runtime = substream->runtime;
303 303
304 runtime->sync.id32[0] = substream->pcm->card->number; 304 runtime->sync.id32[0] = substream->pcm->card->number;
305 runtime->sync.id32[1] = -1; 305 runtime->sync.id32[1] = -1;
@@ -370,7 +370,7 @@ static inline unsigned int muldiv32(unsigned int a, unsigned int b,
370 return n; 370 return n;
371} 371}
372 372
373static int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin) 373static int snd_interval_refine_min(struct snd_interval *i, unsigned int min, int openmin)
374{ 374{
375 int changed = 0; 375 int changed = 0;
376 assert(!snd_interval_empty(i)); 376 assert(!snd_interval_empty(i));
@@ -395,7 +395,7 @@ static int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int open
395 return changed; 395 return changed;
396} 396}
397 397
398static int snd_interval_refine_max(snd_interval_t *i, unsigned int max, int openmax) 398static int snd_interval_refine_max(struct snd_interval *i, unsigned int max, int openmax)
399{ 399{
400 int changed = 0; 400 int changed = 0;
401 assert(!snd_interval_empty(i)); 401 assert(!snd_interval_empty(i));
@@ -431,7 +431,7 @@ static int snd_interval_refine_max(snd_interval_t *i, unsigned int max, int open
431 * 431 *
432 * Returns non-zero if the value is changed, zero if not changed. 432 * Returns non-zero if the value is changed, zero if not changed.
433 */ 433 */
434int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v) 434int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v)
435{ 435{
436 int changed = 0; 436 int changed = 0;
437 assert(!snd_interval_empty(i)); 437 assert(!snd_interval_empty(i));
@@ -473,7 +473,7 @@ int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v)
473 return changed; 473 return changed;
474} 474}
475 475
476static int snd_interval_refine_first(snd_interval_t *i) 476static int snd_interval_refine_first(struct snd_interval *i)
477{ 477{
478 assert(!snd_interval_empty(i)); 478 assert(!snd_interval_empty(i));
479 if (snd_interval_single(i)) 479 if (snd_interval_single(i))
@@ -485,7 +485,7 @@ static int snd_interval_refine_first(snd_interval_t *i)
485 return 1; 485 return 1;
486} 486}
487 487
488static int snd_interval_refine_last(snd_interval_t *i) 488static int snd_interval_refine_last(struct snd_interval *i)
489{ 489{
490 assert(!snd_interval_empty(i)); 490 assert(!snd_interval_empty(i));
491 if (snd_interval_single(i)) 491 if (snd_interval_single(i))
@@ -497,9 +497,9 @@ static int snd_interval_refine_last(snd_interval_t *i)
497 return 1; 497 return 1;
498} 498}
499 499
500static int snd_interval_refine_set(snd_interval_t *i, unsigned int val) 500static int snd_interval_refine_set(struct snd_interval *i, unsigned int val)
501{ 501{
502 snd_interval_t t; 502 struct snd_interval t;
503 t.empty = 0; 503 t.empty = 0;
504 t.min = t.max = val; 504 t.min = t.max = val;
505 t.openmin = t.openmax = 0; 505 t.openmin = t.openmax = 0;
@@ -507,7 +507,7 @@ static int snd_interval_refine_set(snd_interval_t *i, unsigned int val)
507 return snd_interval_refine(i, &t); 507 return snd_interval_refine(i, &t);
508} 508}
509 509
510void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c) 510void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c)
511{ 511{
512 if (a->empty || b->empty) { 512 if (a->empty || b->empty) {
513 snd_interval_none(c); 513 snd_interval_none(c);
@@ -531,7 +531,7 @@ void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_inte
531 * 531 *
532 * Returns non-zero if the value is changed, zero if not changed. 532 * Returns non-zero if the value is changed, zero if not changed.
533 */ 533 */
534void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c) 534void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c)
535{ 535{
536 unsigned int r; 536 unsigned int r;
537 if (a->empty || b->empty) { 537 if (a->empty || b->empty) {
@@ -566,8 +566,8 @@ void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_inte
566 * 566 *
567 * Returns non-zero if the value is changed, zero if not changed. 567 * Returns non-zero if the value is changed, zero if not changed.
568 */ 568 */
569void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, 569void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b,
570 unsigned int k, snd_interval_t *c) 570 unsigned int k, struct snd_interval *c)
571{ 571{
572 unsigned int r; 572 unsigned int r;
573 if (a->empty || b->empty) { 573 if (a->empty || b->empty) {
@@ -597,8 +597,8 @@ void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b,
597 * 597 *
598 * Returns non-zero if the value is changed, zero if not changed. 598 * Returns non-zero if the value is changed, zero if not changed.
599 */ 599 */
600void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, 600void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
601 const snd_interval_t *b, snd_interval_t *c) 601 const struct snd_interval *b, struct snd_interval *c)
602{ 602{
603 unsigned int r; 603 unsigned int r;
604 if (a->empty || b->empty) { 604 if (a->empty || b->empty) {
@@ -636,13 +636,13 @@ void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k,
636 * 636 *
637 * Returns non-zero if the value is changed, zero if not changed. 637 * Returns non-zero if the value is changed, zero if not changed.
638 */ 638 */
639int snd_interval_ratnum(snd_interval_t *i, 639int snd_interval_ratnum(struct snd_interval *i,
640 unsigned int rats_count, ratnum_t *rats, 640 unsigned int rats_count, struct snd_ratnum *rats,
641 unsigned int *nump, unsigned int *denp) 641 unsigned int *nump, unsigned int *denp)
642{ 642{
643 unsigned int best_num, best_diff, best_den; 643 unsigned int best_num, best_diff, best_den;
644 unsigned int k; 644 unsigned int k;
645 snd_interval_t t; 645 struct snd_interval t;
646 int err; 646 int err;
647 647
648 best_num = best_den = best_diff = 0; 648 best_num = best_den = best_diff = 0;
@@ -731,20 +731,20 @@ int snd_interval_ratnum(snd_interval_t *i,
731/** 731/**
732 * snd_interval_ratden - refine the interval value 732 * snd_interval_ratden - refine the interval value
733 * @i: interval to refine 733 * @i: interval to refine
734 * @rats_count: number of ratden_t 734 * @rats_count: number of struct ratden
735 * @rats: ratden_t array 735 * @rats: struct ratden array
736 * @nump: pointer to store the resultant numerator 736 * @nump: pointer to store the resultant numerator
737 * @denp: pointer to store the resultant denominator 737 * @denp: pointer to store the resultant denominator
738 * 738 *
739 * Returns non-zero if the value is changed, zero if not changed. 739 * Returns non-zero if the value is changed, zero if not changed.
740 */ 740 */
741static int snd_interval_ratden(snd_interval_t *i, 741static int snd_interval_ratden(struct snd_interval *i,
742 unsigned int rats_count, ratden_t *rats, 742 unsigned int rats_count, struct snd_ratden *rats,
743 unsigned int *nump, unsigned int *denp) 743 unsigned int *nump, unsigned int *denp)
744{ 744{
745 unsigned int best_num, best_diff, best_den; 745 unsigned int best_num, best_diff, best_den;
746 unsigned int k; 746 unsigned int k;
747 snd_interval_t t; 747 struct snd_interval t;
748 int err; 748 int err;
749 749
750 best_num = best_den = best_diff = 0; 750 best_num = best_den = best_diff = 0;
@@ -837,7 +837,7 @@ static int snd_interval_ratden(snd_interval_t *i,
837 * 837 *
838 * Returns non-zero if the value is changed, zero if not changed. 838 * Returns non-zero if the value is changed, zero if not changed.
839 */ 839 */
840int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask) 840int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask)
841{ 841{
842 unsigned int k; 842 unsigned int k;
843 int changed = 0; 843 int changed = 0;
@@ -878,7 +878,7 @@ int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list,
878 return changed; 878 return changed;
879} 879}
880 880
881static int snd_interval_step(snd_interval_t *i, unsigned int min, unsigned int step) 881static int snd_interval_step(struct snd_interval *i, unsigned int min, unsigned int step)
882{ 882{
883 unsigned int n; 883 unsigned int n;
884 int changed = 0; 884 int changed = 0;
@@ -912,18 +912,18 @@ static int snd_interval_step(snd_interval_t *i, unsigned int min, unsigned int s
912 * 912 *
913 * Returns zero if successful, or a negative error code on failure. 913 * Returns zero if successful, or a negative error code on failure.
914 */ 914 */
915int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, unsigned int cond, 915int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond,
916 int var, 916 int var,
917 snd_pcm_hw_rule_func_t func, void *private, 917 snd_pcm_hw_rule_func_t func, void *private,
918 int dep, ...) 918 int dep, ...)
919{ 919{
920 snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; 920 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
921 snd_pcm_hw_rule_t *c; 921 struct snd_pcm_hw_rule *c;
922 unsigned int k; 922 unsigned int k;
923 va_list args; 923 va_list args;
924 va_start(args, dep); 924 va_start(args, dep);
925 if (constrs->rules_num >= constrs->rules_all) { 925 if (constrs->rules_num >= constrs->rules_all) {
926 snd_pcm_hw_rule_t *new; 926 struct snd_pcm_hw_rule *new;
927 unsigned int new_rules = constrs->rules_all + 16; 927 unsigned int new_rules = constrs->rules_all + 16;
928 new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); 928 new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL);
929 if (!new) 929 if (!new)
@@ -962,11 +962,11 @@ int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, unsigned int cond,
962 * 962 *
963 * Apply the constraint of the given bitmap mask to a mask parameter. 963 * Apply the constraint of the given bitmap mask to a mask parameter.
964 */ 964 */
965int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 965int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
966 u_int32_t mask) 966 u_int32_t mask)
967{ 967{
968 snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; 968 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
969 snd_mask_t *maskp = constrs_mask(constrs, var); 969 struct snd_mask *maskp = constrs_mask(constrs, var);
970 *maskp->bits &= mask; 970 *maskp->bits &= mask;
971 memset(maskp->bits + 1, 0, (SNDRV_MASK_MAX-32) / 8); /* clear rest */ 971 memset(maskp->bits + 1, 0, (SNDRV_MASK_MAX-32) / 8); /* clear rest */
972 if (*maskp->bits == 0) 972 if (*maskp->bits == 0)
@@ -982,11 +982,11 @@ int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t va
982 * 982 *
983 * Apply the constraint of the given bitmap mask to a mask parameter. 983 * Apply the constraint of the given bitmap mask to a mask parameter.
984 */ 984 */
985int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 985int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
986 u_int64_t mask) 986 u_int64_t mask)
987{ 987{
988 snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; 988 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
989 snd_mask_t *maskp = constrs_mask(constrs, var); 989 struct snd_mask *maskp = constrs_mask(constrs, var);
990 maskp->bits[0] &= (u_int32_t)mask; 990 maskp->bits[0] &= (u_int32_t)mask;
991 maskp->bits[1] &= (u_int32_t)(mask >> 32); 991 maskp->bits[1] &= (u_int32_t)(mask >> 32);
992 memset(maskp->bits + 2, 0, (SNDRV_MASK_MAX-64) / 8); /* clear rest */ 992 memset(maskp->bits + 2, 0, (SNDRV_MASK_MAX-64) / 8); /* clear rest */
@@ -1002,9 +1002,9 @@ int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t
1002 * 1002 *
1003 * Apply the constraint of integer to an interval parameter. 1003 * Apply the constraint of integer to an interval parameter.
1004 */ 1004 */
1005int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var) 1005int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var)
1006{ 1006{
1007 snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; 1007 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
1008 return snd_interval_setinteger(constrs_interval(constrs, var)); 1008 return snd_interval_setinteger(constrs_interval(constrs, var));
1009} 1009}
1010 1010
@@ -1017,11 +1017,11 @@ int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t
1017 * 1017 *
1018 * Apply the min/max range constraint to an interval parameter. 1018 * Apply the min/max range constraint to an interval parameter.
1019 */ 1019 */
1020int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 1020int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
1021 unsigned int min, unsigned int max) 1021 unsigned int min, unsigned int max)
1022{ 1022{
1023 snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; 1023 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
1024 snd_interval_t t; 1024 struct snd_interval t;
1025 t.min = min; 1025 t.min = min;
1026 t.max = max; 1026 t.max = max;
1027 t.openmin = t.openmax = 0; 1027 t.openmin = t.openmax = 0;
@@ -1029,10 +1029,10 @@ int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t
1029 return snd_interval_refine(constrs_interval(constrs, var), &t); 1029 return snd_interval_refine(constrs_interval(constrs, var), &t);
1030} 1030}
1031 1031
1032static int snd_pcm_hw_rule_list(snd_pcm_hw_params_t *params, 1032static int snd_pcm_hw_rule_list(struct snd_pcm_hw_params *params,
1033 snd_pcm_hw_rule_t *rule) 1033 struct snd_pcm_hw_rule *rule)
1034{ 1034{
1035 snd_pcm_hw_constraint_list_t *list = rule->private; 1035 struct snd_pcm_hw_constraint_list *list = rule->private;
1036 return snd_interval_list(hw_param_interval(params, rule->var), list->count, list->list, list->mask); 1036 return snd_interval_list(hw_param_interval(params, rule->var), list->count, list->list, list->mask);
1037} 1037}
1038 1038
@@ -1046,20 +1046,20 @@ static int snd_pcm_hw_rule_list(snd_pcm_hw_params_t *params,
1046 * 1046 *
1047 * Apply the list of constraints to an interval parameter. 1047 * Apply the list of constraints to an interval parameter.
1048 */ 1048 */
1049int snd_pcm_hw_constraint_list(snd_pcm_runtime_t *runtime, 1049int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
1050 unsigned int cond, 1050 unsigned int cond,
1051 snd_pcm_hw_param_t var, 1051 snd_pcm_hw_param_t var,
1052 snd_pcm_hw_constraint_list_t *l) 1052 struct snd_pcm_hw_constraint_list *l)
1053{ 1053{
1054 return snd_pcm_hw_rule_add(runtime, cond, var, 1054 return snd_pcm_hw_rule_add(runtime, cond, var,
1055 snd_pcm_hw_rule_list, l, 1055 snd_pcm_hw_rule_list, l,
1056 var, -1); 1056 var, -1);
1057} 1057}
1058 1058
1059static int snd_pcm_hw_rule_ratnums(snd_pcm_hw_params_t *params, 1059static int snd_pcm_hw_rule_ratnums(struct snd_pcm_hw_params *params,
1060 snd_pcm_hw_rule_t *rule) 1060 struct snd_pcm_hw_rule *rule)
1061{ 1061{
1062 snd_pcm_hw_constraint_ratnums_t *r = rule->private; 1062 struct snd_pcm_hw_constraint_ratnums *r = rule->private;
1063 unsigned int num = 0, den = 0; 1063 unsigned int num = 0, den = 0;
1064 int err; 1064 int err;
1065 err = snd_interval_ratnum(hw_param_interval(params, rule->var), 1065 err = snd_interval_ratnum(hw_param_interval(params, rule->var),
@@ -1076,22 +1076,22 @@ static int snd_pcm_hw_rule_ratnums(snd_pcm_hw_params_t *params,
1076 * @runtime: PCM runtime instance 1076 * @runtime: PCM runtime instance
1077 * @cond: condition bits 1077 * @cond: condition bits
1078 * @var: hw_params variable to apply the ratnums constraint 1078 * @var: hw_params variable to apply the ratnums constraint
1079 * @r: ratnums_t constriants 1079 * @r: struct snd_ratnums constriants
1080 */ 1080 */
1081int snd_pcm_hw_constraint_ratnums(snd_pcm_runtime_t *runtime, 1081int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
1082 unsigned int cond, 1082 unsigned int cond,
1083 snd_pcm_hw_param_t var, 1083 snd_pcm_hw_param_t var,
1084 snd_pcm_hw_constraint_ratnums_t *r) 1084 struct snd_pcm_hw_constraint_ratnums *r)
1085{ 1085{
1086 return snd_pcm_hw_rule_add(runtime, cond, var, 1086 return snd_pcm_hw_rule_add(runtime, cond, var,
1087 snd_pcm_hw_rule_ratnums, r, 1087 snd_pcm_hw_rule_ratnums, r,
1088 var, -1); 1088 var, -1);
1089} 1089}
1090 1090
1091static int snd_pcm_hw_rule_ratdens(snd_pcm_hw_params_t *params, 1091static int snd_pcm_hw_rule_ratdens(struct snd_pcm_hw_params *params,
1092 snd_pcm_hw_rule_t *rule) 1092 struct snd_pcm_hw_rule *rule)
1093{ 1093{
1094 snd_pcm_hw_constraint_ratdens_t *r = rule->private; 1094 struct snd_pcm_hw_constraint_ratdens *r = rule->private;
1095 unsigned int num = 0, den = 0; 1095 unsigned int num = 0, den = 0;
1096 int err = snd_interval_ratden(hw_param_interval(params, rule->var), 1096 int err = snd_interval_ratden(hw_param_interval(params, rule->var),
1097 r->nrats, r->rats, &num, &den); 1097 r->nrats, r->rats, &num, &den);
@@ -1107,25 +1107,25 @@ static int snd_pcm_hw_rule_ratdens(snd_pcm_hw_params_t *params,
1107 * @runtime: PCM runtime instance 1107 * @runtime: PCM runtime instance
1108 * @cond: condition bits 1108 * @cond: condition bits
1109 * @var: hw_params variable to apply the ratdens constraint 1109 * @var: hw_params variable to apply the ratdens constraint
1110 * @r: ratdens_t constriants 1110 * @r: struct snd_ratdens constriants
1111 */ 1111 */
1112int snd_pcm_hw_constraint_ratdens(snd_pcm_runtime_t *runtime, 1112int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
1113 unsigned int cond, 1113 unsigned int cond,
1114 snd_pcm_hw_param_t var, 1114 snd_pcm_hw_param_t var,
1115 snd_pcm_hw_constraint_ratdens_t *r) 1115 struct snd_pcm_hw_constraint_ratdens *r)
1116{ 1116{
1117 return snd_pcm_hw_rule_add(runtime, cond, var, 1117 return snd_pcm_hw_rule_add(runtime, cond, var,
1118 snd_pcm_hw_rule_ratdens, r, 1118 snd_pcm_hw_rule_ratdens, r,
1119 var, -1); 1119 var, -1);
1120} 1120}
1121 1121
1122static int snd_pcm_hw_rule_msbits(snd_pcm_hw_params_t *params, 1122static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params,
1123 snd_pcm_hw_rule_t *rule) 1123 struct snd_pcm_hw_rule *rule)
1124{ 1124{
1125 unsigned int l = (unsigned long) rule->private; 1125 unsigned int l = (unsigned long) rule->private;
1126 int width = l & 0xffff; 1126 int width = l & 0xffff;
1127 unsigned int msbits = l >> 16; 1127 unsigned int msbits = l >> 16;
1128 snd_interval_t *i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); 1128 struct snd_interval *i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS);
1129 if (snd_interval_single(i) && snd_interval_value(i) == width) 1129 if (snd_interval_single(i) && snd_interval_value(i) == width)
1130 params->msbits = msbits; 1130 params->msbits = msbits;
1131 return 0; 1131 return 0;
@@ -1138,7 +1138,7 @@ static int snd_pcm_hw_rule_msbits(snd_pcm_hw_params_t *params,
1138 * @width: sample bits width 1138 * @width: sample bits width
1139 * @msbits: msbits width 1139 * @msbits: msbits width
1140 */ 1140 */
1141int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime, 1141int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
1142 unsigned int cond, 1142 unsigned int cond,
1143 unsigned int width, 1143 unsigned int width,
1144 unsigned int msbits) 1144 unsigned int msbits)
@@ -1150,8 +1150,8 @@ int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime,
1150 SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1); 1150 SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
1151} 1151}
1152 1152
1153static int snd_pcm_hw_rule_step(snd_pcm_hw_params_t *params, 1153static int snd_pcm_hw_rule_step(struct snd_pcm_hw_params *params,
1154 snd_pcm_hw_rule_t *rule) 1154 struct snd_pcm_hw_rule *rule)
1155{ 1155{
1156 unsigned long step = (unsigned long) rule->private; 1156 unsigned long step = (unsigned long) rule->private;
1157 return snd_interval_step(hw_param_interval(params, rule->var), 0, step); 1157 return snd_interval_step(hw_param_interval(params, rule->var), 0, step);
@@ -1164,7 +1164,7 @@ static int snd_pcm_hw_rule_step(snd_pcm_hw_params_t *params,
1164 * @var: hw_params variable to apply the step constraint 1164 * @var: hw_params variable to apply the step constraint
1165 * @step: step size 1165 * @step: step size
1166 */ 1166 */
1167int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime, 1167int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
1168 unsigned int cond, 1168 unsigned int cond,
1169 snd_pcm_hw_param_t var, 1169 snd_pcm_hw_param_t var,
1170 unsigned long step) 1170 unsigned long step)
@@ -1174,7 +1174,7 @@ int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime,
1174 var, -1); 1174 var, -1);
1175} 1175}
1176 1176
1177static int snd_pcm_hw_rule_pow2(snd_pcm_hw_params_t *params, snd_pcm_hw_rule_t *rule) 1177static int snd_pcm_hw_rule_pow2(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule)
1178{ 1178{
1179 static int pow2_sizes[] = { 1179 static int pow2_sizes[] = {
1180 1<<0, 1<<1, 1<<2, 1<<3, 1<<4, 1<<5, 1<<6, 1<<7, 1180 1<<0, 1<<1, 1<<2, 1<<3, 1<<4, 1<<5, 1<<6, 1<<7,
@@ -1192,7 +1192,7 @@ static int snd_pcm_hw_rule_pow2(snd_pcm_hw_params_t *params, snd_pcm_hw_rule_t *
1192 * @cond: condition bits 1192 * @cond: condition bits
1193 * @var: hw_params variable to apply the power-of-2 constraint 1193 * @var: hw_params variable to apply the power-of-2 constraint
1194 */ 1194 */
1195int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime, 1195int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
1196 unsigned int cond, 1196 unsigned int cond,
1197 snd_pcm_hw_param_t var) 1197 snd_pcm_hw_param_t var)
1198{ 1198{
@@ -1202,13 +1202,12 @@ int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime,
1202} 1202}
1203 1203
1204/* To use the same code we have in alsa-lib */ 1204/* To use the same code we have in alsa-lib */
1205#define snd_pcm_t snd_pcm_substream_t
1206#define assert(i) snd_assert((i), return -EINVAL) 1205#define assert(i) snd_assert((i), return -EINVAL)
1207#ifndef INT_MIN 1206#ifndef INT_MIN
1208#define INT_MIN ((int)((unsigned int)INT_MAX+1)) 1207#define INT_MIN ((int)((unsigned int)INT_MAX+1))
1209#endif 1208#endif
1210 1209
1211static void _snd_pcm_hw_param_any(snd_pcm_hw_params_t *params, 1210static void _snd_pcm_hw_param_any(struct snd_pcm_hw_params *params,
1212 snd_pcm_hw_param_t var) 1211 snd_pcm_hw_param_t var)
1213{ 1212{
1214 if (hw_is_mask(var)) { 1213 if (hw_is_mask(var)) {
@@ -1230,7 +1229,7 @@ static void _snd_pcm_hw_param_any(snd_pcm_hw_params_t *params,
1230/* 1229/*
1231 * snd_pcm_hw_param_any 1230 * snd_pcm_hw_param_any
1232 */ 1231 */
1233int snd_pcm_hw_param_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, 1232int snd_pcm_hw_param_any(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
1234 snd_pcm_hw_param_t var) 1233 snd_pcm_hw_param_t var)
1235{ 1234{
1236 _snd_pcm_hw_param_any(params, var); 1235 _snd_pcm_hw_param_any(params, var);
@@ -1238,7 +1237,7 @@ int snd_pcm_hw_param_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
1238} 1237}
1239#endif /* 0 */ 1238#endif /* 0 */
1240 1239
1241void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params) 1240void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params)
1242{ 1241{
1243 unsigned int k; 1242 unsigned int k;
1244 memset(params, 0, sizeof(*params)); 1243 memset(params, 0, sizeof(*params));
@@ -1255,7 +1254,7 @@ void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params)
1255 * 1254 *
1256 * Fill PARAMS with full configuration space boundaries 1255 * Fill PARAMS with full configuration space boundaries
1257 */ 1256 */
1258int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) 1257int snd_pcm_hw_params_any(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params)
1259{ 1258{
1260 _snd_pcm_hw_params_any(params); 1259 _snd_pcm_hw_params_any(params);
1261 return snd_pcm_hw_refine(pcm, params); 1260 return snd_pcm_hw_refine(pcm, params);
@@ -1271,11 +1270,11 @@ int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
1271 * Return the value for field PAR if it's fixed in configuration space 1270 * Return the value for field PAR if it's fixed in configuration space
1272 * defined by PARAMS. Return -EINVAL otherwise 1271 * defined by PARAMS. Return -EINVAL otherwise
1273 */ 1272 */
1274static int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params, 1273static int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params,
1275 snd_pcm_hw_param_t var, int *dir) 1274 snd_pcm_hw_param_t var, int *dir)
1276{ 1275{
1277 if (hw_is_mask(var)) { 1276 if (hw_is_mask(var)) {
1278 const snd_mask_t *mask = hw_param_mask_c(params, var); 1277 const struct snd_mask *mask = hw_param_mask_c(params, var);
1279 if (!snd_mask_single(mask)) 1278 if (!snd_mask_single(mask))
1280 return -EINVAL; 1279 return -EINVAL;
1281 if (dir) 1280 if (dir)
@@ -1283,7 +1282,7 @@ static int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params,
1283 return snd_mask_value(mask); 1282 return snd_mask_value(mask);
1284 } 1283 }
1285 if (hw_is_interval(var)) { 1284 if (hw_is_interval(var)) {
1286 const snd_interval_t *i = hw_param_interval_c(params, var); 1285 const struct snd_interval *i = hw_param_interval_c(params, var);
1287 if (!snd_interval_single(i)) 1286 if (!snd_interval_single(i))
1288 return -EINVAL; 1287 return -EINVAL;
1289 if (dir) 1288 if (dir)
@@ -1302,7 +1301,7 @@ static int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params,
1302 * 1301 *
1303 * Return the minimum value for field PAR. 1302 * Return the minimum value for field PAR.
1304 */ 1303 */
1305unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params, 1304unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params,
1306 snd_pcm_hw_param_t var, int *dir) 1305 snd_pcm_hw_param_t var, int *dir)
1307{ 1306{
1308 if (hw_is_mask(var)) { 1307 if (hw_is_mask(var)) {
@@ -1311,7 +1310,7 @@ unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params,
1311 return snd_mask_min(hw_param_mask_c(params, var)); 1310 return snd_mask_min(hw_param_mask_c(params, var));
1312 } 1311 }
1313 if (hw_is_interval(var)) { 1312 if (hw_is_interval(var)) {
1314 const snd_interval_t *i = hw_param_interval_c(params, var); 1313 const struct snd_interval *i = hw_param_interval_c(params, var);
1315 if (dir) 1314 if (dir)
1316 *dir = i->openmin; 1315 *dir = i->openmin;
1317 return snd_interval_min(i); 1316 return snd_interval_min(i);
@@ -1328,7 +1327,7 @@ unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params,
1328 * 1327 *
1329 * Return the maximum value for field PAR. 1328 * Return the maximum value for field PAR.
1330 */ 1329 */
1331unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params, 1330unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params,
1332 snd_pcm_hw_param_t var, int *dir) 1331 snd_pcm_hw_param_t var, int *dir)
1333{ 1332{
1334 if (hw_is_mask(var)) { 1333 if (hw_is_mask(var)) {
@@ -1337,7 +1336,7 @@ unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params,
1337 return snd_mask_max(hw_param_mask_c(params, var)); 1336 return snd_mask_max(hw_param_mask_c(params, var));
1338 } 1337 }
1339 if (hw_is_interval(var)) { 1338 if (hw_is_interval(var)) {
1340 const snd_interval_t *i = hw_param_interval_c(params, var); 1339 const struct snd_interval *i = hw_param_interval_c(params, var);
1341 if (dir) 1340 if (dir)
1342 *dir = - (int) i->openmax; 1341 *dir = - (int) i->openmax;
1343 return snd_interval_max(i); 1342 return snd_interval_max(i);
@@ -1346,7 +1345,7 @@ unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params,
1346 return -EINVAL; 1345 return -EINVAL;
1347} 1346}
1348 1347
1349void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, 1348void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params,
1350 snd_pcm_hw_param_t var) 1349 snd_pcm_hw_param_t var)
1351{ 1350{
1352 if (hw_is_mask(var)) { 1351 if (hw_is_mask(var)) {
@@ -1362,7 +1361,7 @@ void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params,
1362 } 1361 }
1363} 1362}
1364 1363
1365int _snd_pcm_hw_param_setinteger(snd_pcm_hw_params_t *params, 1364int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params,
1366 snd_pcm_hw_param_t var) 1365 snd_pcm_hw_param_t var)
1367{ 1366{
1368 int changed; 1367 int changed;
@@ -1383,8 +1382,8 @@ int _snd_pcm_hw_param_setinteger(snd_pcm_hw_params_t *params,
1383 * non integer values. Reduce configuration space accordingly. 1382 * non integer values. Reduce configuration space accordingly.
1384 * Return -EINVAL if the configuration space is empty 1383 * Return -EINVAL if the configuration space is empty
1385 */ 1384 */
1386int snd_pcm_hw_param_setinteger(snd_pcm_t *pcm, 1385int snd_pcm_hw_param_setinteger(struct snd_pcm_substream *pcm,
1387 snd_pcm_hw_params_t *params, 1386 struct snd_pcm_hw_params *params,
1388 snd_pcm_hw_param_t var) 1387 snd_pcm_hw_param_t var)
1389{ 1388{
1390 int changed = _snd_pcm_hw_param_setinteger(params, var); 1389 int changed = _snd_pcm_hw_param_setinteger(params, var);
@@ -1399,7 +1398,7 @@ int snd_pcm_hw_param_setinteger(snd_pcm_t *pcm,
1399} 1398}
1400#endif /* 0 */ 1399#endif /* 0 */
1401 1400
1402static int _snd_pcm_hw_param_first(snd_pcm_hw_params_t *params, 1401static int _snd_pcm_hw_param_first(struct snd_pcm_hw_params *params,
1403 snd_pcm_hw_param_t var) 1402 snd_pcm_hw_param_t var)
1404{ 1403{
1405 int changed; 1404 int changed;
@@ -1430,8 +1429,8 @@ static int _snd_pcm_hw_param_first(snd_pcm_hw_params_t *params,
1430 * values > minimum. Reduce configuration space accordingly. 1429 * values > minimum. Reduce configuration space accordingly.
1431 * Return the minimum. 1430 * Return the minimum.
1432 */ 1431 */
1433static int snd_pcm_hw_param_first(snd_pcm_t *pcm, 1432static int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm,
1434 snd_pcm_hw_params_t *params, 1433 struct snd_pcm_hw_params *params,
1435 snd_pcm_hw_param_t var, int *dir) 1434 snd_pcm_hw_param_t var, int *dir)
1436{ 1435{
1437 int changed = _snd_pcm_hw_param_first(params, var); 1436 int changed = _snd_pcm_hw_param_first(params, var);
@@ -1444,7 +1443,7 @@ static int snd_pcm_hw_param_first(snd_pcm_t *pcm,
1444 return snd_pcm_hw_param_value(params, var, dir); 1443 return snd_pcm_hw_param_value(params, var, dir);
1445} 1444}
1446 1445
1447static int _snd_pcm_hw_param_last(snd_pcm_hw_params_t *params, 1446static int _snd_pcm_hw_param_last(struct snd_pcm_hw_params *params,
1448 snd_pcm_hw_param_t var) 1447 snd_pcm_hw_param_t var)
1449{ 1448{
1450 int changed; 1449 int changed;
@@ -1475,8 +1474,8 @@ static int _snd_pcm_hw_param_last(snd_pcm_hw_params_t *params,
1475 * values < maximum. Reduce configuration space accordingly. 1474 * values < maximum. Reduce configuration space accordingly.
1476 * Return the maximum. 1475 * Return the maximum.
1477 */ 1476 */
1478static int snd_pcm_hw_param_last(snd_pcm_t *pcm, 1477static int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm,
1479 snd_pcm_hw_params_t *params, 1478 struct snd_pcm_hw_params *params,
1480 snd_pcm_hw_param_t var, int *dir) 1479 snd_pcm_hw_param_t var, int *dir)
1481{ 1480{
1482 int changed = _snd_pcm_hw_param_last(params, var); 1481 int changed = _snd_pcm_hw_param_last(params, var);
@@ -1489,7 +1488,7 @@ static int snd_pcm_hw_param_last(snd_pcm_t *pcm,
1489 return snd_pcm_hw_param_value(params, var, dir); 1488 return snd_pcm_hw_param_value(params, var, dir);
1490} 1489}
1491 1490
1492int _snd_pcm_hw_param_min(snd_pcm_hw_params_t *params, 1491int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params,
1493 snd_pcm_hw_param_t var, unsigned int val, int dir) 1492 snd_pcm_hw_param_t var, unsigned int val, int dir)
1494{ 1493{
1495 int changed; 1494 int changed;
@@ -1531,7 +1530,7 @@ int _snd_pcm_hw_param_min(snd_pcm_hw_params_t *params,
1531 * values < VAL. Reduce configuration space accordingly. 1530 * values < VAL. Reduce configuration space accordingly.
1532 * Return new minimum or -EINVAL if the configuration space is empty 1531 * Return new minimum or -EINVAL if the configuration space is empty
1533 */ 1532 */
1534static int snd_pcm_hw_param_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, 1533static int snd_pcm_hw_param_min(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
1535 snd_pcm_hw_param_t var, unsigned int val, 1534 snd_pcm_hw_param_t var, unsigned int val,
1536 int *dir) 1535 int *dir)
1537{ 1536{
@@ -1546,7 +1545,7 @@ static int snd_pcm_hw_param_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
1546 return snd_pcm_hw_param_value_min(params, var, dir); 1545 return snd_pcm_hw_param_value_min(params, var, dir);
1547} 1546}
1548 1547
1549static int _snd_pcm_hw_param_max(snd_pcm_hw_params_t *params, 1548static int _snd_pcm_hw_param_max(struct snd_pcm_hw_params *params,
1550 snd_pcm_hw_param_t var, unsigned int val, 1549 snd_pcm_hw_param_t var, unsigned int val,
1551 int dir) 1550 int dir)
1552{ 1551{
@@ -1591,7 +1590,7 @@ static int _snd_pcm_hw_param_max(snd_pcm_hw_params_t *params,
1591 * values >= VAL + 1. Reduce configuration space accordingly. 1590 * values >= VAL + 1. Reduce configuration space accordingly.
1592 * Return new maximum or -EINVAL if the configuration space is empty 1591 * Return new maximum or -EINVAL if the configuration space is empty
1593 */ 1592 */
1594static int snd_pcm_hw_param_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, 1593static int snd_pcm_hw_param_max(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
1595 snd_pcm_hw_param_t var, unsigned int val, 1594 snd_pcm_hw_param_t var, unsigned int val,
1596 int *dir) 1595 int *dir)
1597{ 1596{
@@ -1606,12 +1605,12 @@ static int snd_pcm_hw_param_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
1606 return snd_pcm_hw_param_value_max(params, var, dir); 1605 return snd_pcm_hw_param_value_max(params, var, dir);
1607} 1606}
1608 1607
1609int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, 1608int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params,
1610 snd_pcm_hw_param_t var, unsigned int val, int dir) 1609 snd_pcm_hw_param_t var, unsigned int val, int dir)
1611{ 1610{
1612 int changed; 1611 int changed;
1613 if (hw_is_mask(var)) { 1612 if (hw_is_mask(var)) {
1614 snd_mask_t *m = hw_param_mask(params, var); 1613 struct snd_mask *m = hw_param_mask(params, var);
1615 if (val == 0 && dir < 0) { 1614 if (val == 0 && dir < 0) {
1616 changed = -EINVAL; 1615 changed = -EINVAL;
1617 snd_mask_none(m); 1616 snd_mask_none(m);
@@ -1623,14 +1622,14 @@ int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params,
1623 changed = snd_mask_refine_set(hw_param_mask(params, var), val); 1622 changed = snd_mask_refine_set(hw_param_mask(params, var), val);
1624 } 1623 }
1625 } else if (hw_is_interval(var)) { 1624 } else if (hw_is_interval(var)) {
1626 snd_interval_t *i = hw_param_interval(params, var); 1625 struct snd_interval *i = hw_param_interval(params, var);
1627 if (val == 0 && dir < 0) { 1626 if (val == 0 && dir < 0) {
1628 changed = -EINVAL; 1627 changed = -EINVAL;
1629 snd_interval_none(i); 1628 snd_interval_none(i);
1630 } else if (dir == 0) 1629 } else if (dir == 0)
1631 changed = snd_interval_refine_set(i, val); 1630 changed = snd_interval_refine_set(i, val);
1632 else { 1631 else {
1633 snd_interval_t t; 1632 struct snd_interval t;
1634 t.openmin = 1; 1633 t.openmin = 1;
1635 t.openmax = 1; 1634 t.openmax = 1;
1636 t.empty = 0; 1635 t.empty = 0;
@@ -1667,7 +1666,7 @@ int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params,
1667 * values != VAL. Reduce configuration space accordingly. 1666 * values != VAL. Reduce configuration space accordingly.
1668 * Return VAL or -EINVAL if the configuration space is empty 1667 * Return VAL or -EINVAL if the configuration space is empty
1669 */ 1668 */
1670int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, 1669int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
1671 snd_pcm_hw_param_t var, unsigned int val, int dir) 1670 snd_pcm_hw_param_t var, unsigned int val, int dir)
1672{ 1671{
1673 int changed = _snd_pcm_hw_param_set(params, var, val, dir); 1672 int changed = _snd_pcm_hw_param_set(params, var, val, dir);
@@ -1681,8 +1680,8 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
1681 return snd_pcm_hw_param_value(params, var, NULL); 1680 return snd_pcm_hw_param_value(params, var, NULL);
1682} 1681}
1683 1682
1684static int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params, 1683static int _snd_pcm_hw_param_mask(struct snd_pcm_hw_params *params,
1685 snd_pcm_hw_param_t var, const snd_mask_t *val) 1684 snd_pcm_hw_param_t var, const struct snd_mask *val)
1686{ 1685{
1687 int changed; 1686 int changed;
1688 assert(hw_is_mask(var)); 1687 assert(hw_is_mask(var));
@@ -1708,8 +1707,8 @@ static int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params,
1708 * Return 0 on success or -EINVAL 1707 * Return 0 on success or -EINVAL
1709 * if the configuration space is empty 1708 * if the configuration space is empty
1710 */ 1709 */
1711int snd_pcm_hw_param_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, 1710int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
1712 snd_pcm_hw_param_t var, const snd_mask_t *val) 1711 snd_pcm_hw_param_t var, const struct snd_mask *val)
1713{ 1712{
1714 int changed = _snd_pcm_hw_param_mask(params, var, val); 1713 int changed = _snd_pcm_hw_param_mask(params, var, val);
1715 if (changed < 0) 1714 if (changed < 0)
@@ -1784,10 +1783,10 @@ static int boundary_nearer(int min, int mindir,
1784 * SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_SUBFORMAT. 1783 * SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_SUBFORMAT.
1785 * Return the value found. 1784 * Return the value found.
1786 */ 1785 */
1787int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, 1786int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
1788 snd_pcm_hw_param_t var, unsigned int best, int *dir) 1787 snd_pcm_hw_param_t var, unsigned int best, int *dir)
1789{ 1788{
1790 snd_pcm_hw_params_t *save = NULL; 1789 struct snd_pcm_hw_params *save = NULL;
1791 int v; 1790 int v;
1792 unsigned int saved_min; 1791 unsigned int saved_min;
1793 int last = 0; 1792 int last = 0;
@@ -1814,7 +1813,7 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
1814 saved_min = min; 1813 saved_min = min;
1815 min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir); 1814 min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir);
1816 if (min >= 0) { 1815 if (min >= 0) {
1817 snd_pcm_hw_params_t *params1; 1816 struct snd_pcm_hw_params *params1;
1818 if (max < 0) 1817 if (max < 0)
1819 goto _end; 1818 goto _end;
1820 if ((unsigned int)min == saved_min && mindir == valdir) 1819 if ((unsigned int)min == saved_min && mindir == valdir)
@@ -1861,7 +1860,7 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
1861 * first access, first format, first subformat, min channels, 1860 * first access, first format, first subformat, min channels,
1862 * min rate, min period time, max buffer size, min tick time 1861 * min rate, min period time, max buffer size, min tick time
1863 */ 1862 */
1864int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) 1863int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params)
1865{ 1864{
1866 int err; 1865 int err;
1867 1866
@@ -1892,13 +1891,12 @@ int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
1892 return 0; 1891 return 0;
1893} 1892}
1894 1893
1895#undef snd_pcm_t
1896#undef assert 1894#undef assert
1897 1895
1898static int snd_pcm_lib_ioctl_reset(snd_pcm_substream_t *substream, 1896static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream,
1899 void *arg) 1897 void *arg)
1900{ 1898{
1901 snd_pcm_runtime_t *runtime = substream->runtime; 1899 struct snd_pcm_runtime *runtime = substream->runtime;
1902 unsigned long flags; 1900 unsigned long flags;
1903 snd_pcm_stream_lock_irqsave(substream, flags); 1901 snd_pcm_stream_lock_irqsave(substream, flags);
1904 if (snd_pcm_running(substream) && 1902 if (snd_pcm_running(substream) &&
@@ -1910,11 +1908,11 @@ static int snd_pcm_lib_ioctl_reset(snd_pcm_substream_t *substream,
1910 return 0; 1908 return 0;
1911} 1909}
1912 1910
1913static int snd_pcm_lib_ioctl_channel_info(snd_pcm_substream_t *substream, 1911static int snd_pcm_lib_ioctl_channel_info(struct snd_pcm_substream *substream,
1914 void *arg) 1912 void *arg)
1915{ 1913{
1916 snd_pcm_channel_info_t *info = arg; 1914 struct snd_pcm_channel_info *info = arg;
1917 snd_pcm_runtime_t *runtime = substream->runtime; 1915 struct snd_pcm_runtime *runtime = substream->runtime;
1918 int width; 1916 int width;
1919 if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) { 1917 if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) {
1920 info->offset = -1; 1918 info->offset = -1;
@@ -1956,7 +1954,7 @@ static int snd_pcm_lib_ioctl_channel_info(snd_pcm_substream_t *substream,
1956 * 1954 *
1957 * Returns zero if successful, or a negative error code on failure. 1955 * Returns zero if successful, or a negative error code on failure.
1958 */ 1956 */
1959int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, 1957int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
1960 unsigned int cmd, void *arg) 1958 unsigned int cmd, void *arg)
1961{ 1959{
1962 switch (cmd) { 1960 switch (cmd) {
@@ -1974,10 +1972,10 @@ int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream,
1974 * Conditions 1972 * Conditions
1975 */ 1973 */
1976 1974
1977static void snd_pcm_system_tick_set(snd_pcm_substream_t *substream, 1975static void snd_pcm_system_tick_set(struct snd_pcm_substream *substream,
1978 unsigned long ticks) 1976 unsigned long ticks)
1979{ 1977{
1980 snd_pcm_runtime_t *runtime = substream->runtime; 1978 struct snd_pcm_runtime *runtime = substream->runtime;
1981 if (ticks == 0) 1979 if (ticks == 0)
1982 del_timer(&runtime->tick_timer); 1980 del_timer(&runtime->tick_timer);
1983 else { 1981 else {
@@ -1988,14 +1986,14 @@ static void snd_pcm_system_tick_set(snd_pcm_substream_t *substream,
1988} 1986}
1989 1987
1990/* Temporary alias */ 1988/* Temporary alias */
1991void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks) 1989void snd_pcm_tick_set(struct snd_pcm_substream *substream, unsigned long ticks)
1992{ 1990{
1993 snd_pcm_system_tick_set(substream, ticks); 1991 snd_pcm_system_tick_set(substream, ticks);
1994} 1992}
1995 1993
1996void snd_pcm_tick_prepare(snd_pcm_substream_t *substream) 1994void snd_pcm_tick_prepare(struct snd_pcm_substream *substream)
1997{ 1995{
1998 snd_pcm_runtime_t *runtime = substream->runtime; 1996 struct snd_pcm_runtime *runtime = substream->runtime;
1999 snd_pcm_uframes_t frames = ULONG_MAX; 1997 snd_pcm_uframes_t frames = ULONG_MAX;
2000 snd_pcm_uframes_t avail, dist; 1998 snd_pcm_uframes_t avail, dist;
2001 unsigned int ticks; 1999 unsigned int ticks;
@@ -2046,9 +2044,9 @@ void snd_pcm_tick_prepare(snd_pcm_substream_t *substream)
2046 snd_pcm_tick_set(substream, (unsigned long) ticks); 2044 snd_pcm_tick_set(substream, (unsigned long) ticks);
2047} 2045}
2048 2046
2049void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream) 2047void snd_pcm_tick_elapsed(struct snd_pcm_substream *substream)
2050{ 2048{
2051 snd_pcm_runtime_t *runtime; 2049 struct snd_pcm_runtime *runtime;
2052 unsigned long flags; 2050 unsigned long flags;
2053 2051
2054 snd_assert(substream != NULL, return); 2052 snd_assert(substream != NULL, return);
@@ -2076,9 +2074,9 @@ void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream)
2076 * Even if more than one periods have elapsed since the last call, you 2074 * Even if more than one periods have elapsed since the last call, you
2077 * have to call this only once. 2075 * have to call this only once.
2078 */ 2076 */
2079void snd_pcm_period_elapsed(snd_pcm_substream_t *substream) 2077void snd_pcm_period_elapsed(struct snd_pcm_substream *substream)
2080{ 2078{
2081 snd_pcm_runtime_t *runtime; 2079 struct snd_pcm_runtime *runtime;
2082 unsigned long flags; 2080 unsigned long flags;
2083 2081
2084 snd_assert(substream != NULL, return); 2082 snd_assert(substream != NULL, return);
@@ -2104,12 +2102,12 @@ void snd_pcm_period_elapsed(snd_pcm_substream_t *substream)
2104 kill_fasync(&runtime->fasync, SIGIO, POLL_IN); 2102 kill_fasync(&runtime->fasync, SIGIO, POLL_IN);
2105} 2103}
2106 2104
2107static int snd_pcm_lib_write_transfer(snd_pcm_substream_t *substream, 2105static int snd_pcm_lib_write_transfer(struct snd_pcm_substream *substream,
2108 unsigned int hwoff, 2106 unsigned int hwoff,
2109 unsigned long data, unsigned int off, 2107 unsigned long data, unsigned int off,
2110 snd_pcm_uframes_t frames) 2108 snd_pcm_uframes_t frames)
2111{ 2109{
2112 snd_pcm_runtime_t *runtime = substream->runtime; 2110 struct snd_pcm_runtime *runtime = substream->runtime;
2113 int err; 2111 int err;
2114 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); 2112 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off);
2115 if (substream->ops->copy) { 2113 if (substream->ops->copy) {
@@ -2124,17 +2122,17 @@ static int snd_pcm_lib_write_transfer(snd_pcm_substream_t *substream,
2124 return 0; 2122 return 0;
2125} 2123}
2126 2124
2127typedef int (*transfer_f)(snd_pcm_substream_t *substream, unsigned int hwoff, 2125typedef int (*transfer_f)(struct snd_pcm_substream *substream, unsigned int hwoff,
2128 unsigned long data, unsigned int off, 2126 unsigned long data, unsigned int off,
2129 snd_pcm_uframes_t size); 2127 snd_pcm_uframes_t size);
2130 2128
2131static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, 2129static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
2132 unsigned long data, 2130 unsigned long data,
2133 snd_pcm_uframes_t size, 2131 snd_pcm_uframes_t size,
2134 int nonblock, 2132 int nonblock,
2135 transfer_f transfer) 2133 transfer_f transfer)
2136{ 2134{
2137 snd_pcm_runtime_t *runtime = substream->runtime; 2135 struct snd_pcm_runtime *runtime = substream->runtime;
2138 snd_pcm_uframes_t xfer = 0; 2136 snd_pcm_uframes_t xfer = 0;
2139 snd_pcm_uframes_t offset = 0; 2137 snd_pcm_uframes_t offset = 0;
2140 int err = 0; 2138 int err = 0;
@@ -2290,9 +2288,9 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
2290 return xfer > 0 ? (snd_pcm_sframes_t)xfer : err; 2288 return xfer > 0 ? (snd_pcm_sframes_t)xfer : err;
2291} 2289}
2292 2290
2293snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void __user *buf, snd_pcm_uframes_t size) 2291snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, const void __user *buf, snd_pcm_uframes_t size)
2294{ 2292{
2295 snd_pcm_runtime_t *runtime; 2293 struct snd_pcm_runtime *runtime;
2296 int nonblock; 2294 int nonblock;
2297 2295
2298 snd_assert(substream != NULL, return -ENXIO); 2296 snd_assert(substream != NULL, return -ENXIO);
@@ -2306,7 +2304,7 @@ snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void _
2306 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); 2304 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
2307#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 2305#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
2308 if (substream->oss.oss) { 2306 if (substream->oss.oss) {
2309 snd_pcm_oss_setup_t *setup = substream->oss.setup; 2307 struct snd_pcm_oss_setup *setup = substream->oss.setup;
2310 if (setup != NULL) { 2308 if (setup != NULL) {
2311 if (setup->nonblock) 2309 if (setup->nonblock)
2312 nonblock = 1; 2310 nonblock = 1;
@@ -2323,12 +2321,12 @@ snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void _
2323 snd_pcm_lib_write_transfer); 2321 snd_pcm_lib_write_transfer);
2324} 2322}
2325 2323
2326static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream, 2324static int snd_pcm_lib_writev_transfer(struct snd_pcm_substream *substream,
2327 unsigned int hwoff, 2325 unsigned int hwoff,
2328 unsigned long data, unsigned int off, 2326 unsigned long data, unsigned int off,
2329 snd_pcm_uframes_t frames) 2327 snd_pcm_uframes_t frames)
2330{ 2328{
2331 snd_pcm_runtime_t *runtime = substream->runtime; 2329 struct snd_pcm_runtime *runtime = substream->runtime;
2332 int err; 2330 int err;
2333 void __user **bufs = (void __user **)data; 2331 void __user **bufs = (void __user **)data;
2334 int channels = runtime->channels; 2332 int channels = runtime->channels;
@@ -2363,11 +2361,11 @@ static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream,
2363 return 0; 2361 return 0;
2364} 2362}
2365 2363
2366snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, 2364snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream,
2367 void __user **bufs, 2365 void __user **bufs,
2368 snd_pcm_uframes_t frames) 2366 snd_pcm_uframes_t frames)
2369{ 2367{
2370 snd_pcm_runtime_t *runtime; 2368 struct snd_pcm_runtime *runtime;
2371 int nonblock; 2369 int nonblock;
2372 2370
2373 snd_assert(substream != NULL, return -ENXIO); 2371 snd_assert(substream != NULL, return -ENXIO);
@@ -2381,7 +2379,7 @@ snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream,
2381 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); 2379 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
2382#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 2380#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
2383 if (substream->oss.oss) { 2381 if (substream->oss.oss) {
2384 snd_pcm_oss_setup_t *setup = substream->oss.setup; 2382 struct snd_pcm_oss_setup *setup = substream->oss.setup;
2385 if (setup != NULL) { 2383 if (setup != NULL) {
2386 if (setup->nonblock) 2384 if (setup->nonblock)
2387 nonblock = 1; 2385 nonblock = 1;
@@ -2397,12 +2395,12 @@ snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream,
2397 nonblock, snd_pcm_lib_writev_transfer); 2395 nonblock, snd_pcm_lib_writev_transfer);
2398} 2396}
2399 2397
2400static int snd_pcm_lib_read_transfer(snd_pcm_substream_t *substream, 2398static int snd_pcm_lib_read_transfer(struct snd_pcm_substream *substream,
2401 unsigned int hwoff, 2399 unsigned int hwoff,
2402 unsigned long data, unsigned int off, 2400 unsigned long data, unsigned int off,
2403 snd_pcm_uframes_t frames) 2401 snd_pcm_uframes_t frames)
2404{ 2402{
2405 snd_pcm_runtime_t *runtime = substream->runtime; 2403 struct snd_pcm_runtime *runtime = substream->runtime;
2406 int err; 2404 int err;
2407 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); 2405 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off);
2408 if (substream->ops->copy) { 2406 if (substream->ops->copy) {
@@ -2417,13 +2415,13 @@ static int snd_pcm_lib_read_transfer(snd_pcm_substream_t *substream,
2417 return 0; 2415 return 0;
2418} 2416}
2419 2417
2420static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, 2418static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
2421 unsigned long data, 2419 unsigned long data,
2422 snd_pcm_uframes_t size, 2420 snd_pcm_uframes_t size,
2423 int nonblock, 2421 int nonblock,
2424 transfer_f transfer) 2422 transfer_f transfer)
2425{ 2423{
2426 snd_pcm_runtime_t *runtime = substream->runtime; 2424 struct snd_pcm_runtime *runtime = substream->runtime;
2427 snd_pcm_uframes_t xfer = 0; 2425 snd_pcm_uframes_t xfer = 0;
2428 snd_pcm_uframes_t offset = 0; 2426 snd_pcm_uframes_t offset = 0;
2429 int err = 0; 2427 int err = 0;
@@ -2587,9 +2585,9 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream,
2587 return xfer > 0 ? (snd_pcm_sframes_t)xfer : err; 2585 return xfer > 0 ? (snd_pcm_sframes_t)xfer : err;
2588} 2586}
2589 2587
2590snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void __user *buf, snd_pcm_uframes_t size) 2588snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream, void __user *buf, snd_pcm_uframes_t size)
2591{ 2589{
2592 snd_pcm_runtime_t *runtime; 2590 struct snd_pcm_runtime *runtime;
2593 int nonblock; 2591 int nonblock;
2594 2592
2595 snd_assert(substream != NULL, return -ENXIO); 2593 snd_assert(substream != NULL, return -ENXIO);
@@ -2603,7 +2601,7 @@ snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void __user *
2603 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); 2601 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
2604#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 2602#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
2605 if (substream->oss.oss) { 2603 if (substream->oss.oss) {
2606 snd_pcm_oss_setup_t *setup = substream->oss.setup; 2604 struct snd_pcm_oss_setup *setup = substream->oss.setup;
2607 if (setup != NULL) { 2605 if (setup != NULL) {
2608 if (setup->nonblock) 2606 if (setup->nonblock)
2609 nonblock = 1; 2607 nonblock = 1;
@@ -2617,12 +2615,12 @@ snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void __user *
2617 return snd_pcm_lib_read1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_read_transfer); 2615 return snd_pcm_lib_read1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_read_transfer);
2618} 2616}
2619 2617
2620static int snd_pcm_lib_readv_transfer(snd_pcm_substream_t *substream, 2618static int snd_pcm_lib_readv_transfer(struct snd_pcm_substream *substream,
2621 unsigned int hwoff, 2619 unsigned int hwoff,
2622 unsigned long data, unsigned int off, 2620 unsigned long data, unsigned int off,
2623 snd_pcm_uframes_t frames) 2621 snd_pcm_uframes_t frames)
2624{ 2622{
2625 snd_pcm_runtime_t *runtime = substream->runtime; 2623 struct snd_pcm_runtime *runtime = substream->runtime;
2626 int err; 2624 int err;
2627 void __user **bufs = (void __user **)data; 2625 void __user **bufs = (void __user **)data;
2628 int channels = runtime->channels; 2626 int channels = runtime->channels;
@@ -2654,11 +2652,11 @@ static int snd_pcm_lib_readv_transfer(snd_pcm_substream_t *substream,
2654 return 0; 2652 return 0;
2655} 2653}
2656 2654
2657snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, 2655snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream,
2658 void __user **bufs, 2656 void __user **bufs,
2659 snd_pcm_uframes_t frames) 2657 snd_pcm_uframes_t frames)
2660{ 2658{
2661 snd_pcm_runtime_t *runtime; 2659 struct snd_pcm_runtime *runtime;
2662 int nonblock; 2660 int nonblock;
2663 2661
2664 snd_assert(substream != NULL, return -ENXIO); 2662 snd_assert(substream != NULL, return -ENXIO);
@@ -2672,7 +2670,7 @@ snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream,
2672 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); 2670 nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
2673#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 2671#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
2674 if (substream->oss.oss) { 2672 if (substream->oss.oss) {
2675 snd_pcm_oss_setup_t *setup = substream->oss.setup; 2673 struct snd_pcm_oss_setup *setup = substream->oss.setup;
2676 if (setup != NULL) { 2674 if (setup != NULL) {
2677 if (setup->nonblock) 2675 if (setup->nonblock)
2678 nonblock = 1; 2676 nonblock = 1;
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index b3f5344f60be..d37bcb761884 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -46,7 +46,7 @@ static const size_t snd_minimum_buffer = 16384;
46 * 46 *
47 * the minimum size is snd_minimum_buffer. it should be power of 2. 47 * the minimum size is snd_minimum_buffer. it should be power of 2.
48 */ 48 */
49static int preallocate_pcm_pages(snd_pcm_substream_t *substream, size_t size) 49static int preallocate_pcm_pages(struct snd_pcm_substream *substream, size_t size)
50{ 50{
51 struct snd_dma_buffer *dmab = &substream->dma_buffer; 51 struct snd_dma_buffer *dmab = &substream->dma_buffer;
52 int err; 52 int err;
@@ -78,7 +78,7 @@ static int preallocate_pcm_pages(snd_pcm_substream_t *substream, size_t size)
78/* 78/*
79 * release the preallocated buffer if not yet done. 79 * release the preallocated buffer if not yet done.
80 */ 80 */
81static void snd_pcm_lib_preallocate_dma_free(snd_pcm_substream_t *substream) 81static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream)
82{ 82{
83 if (substream->dma_buffer.area == NULL) 83 if (substream->dma_buffer.area == NULL)
84 return; 84 return;
@@ -97,7 +97,7 @@ static void snd_pcm_lib_preallocate_dma_free(snd_pcm_substream_t *substream)
97 * 97 *
98 * Returns zero if successful, or a negative error code on failure. 98 * Returns zero if successful, or a negative error code on failure.
99 */ 99 */
100int snd_pcm_lib_preallocate_free(snd_pcm_substream_t *substream) 100int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream)
101{ 101{
102 snd_pcm_lib_preallocate_dma_free(substream); 102 snd_pcm_lib_preallocate_dma_free(substream);
103 if (substream->proc_prealloc_entry) { 103 if (substream->proc_prealloc_entry) {
@@ -115,9 +115,9 @@ int snd_pcm_lib_preallocate_free(snd_pcm_substream_t *substream)
115 * 115 *
116 * Returns zero if successful, or a negative error code on failure. 116 * Returns zero if successful, or a negative error code on failure.
117 */ 117 */
118int snd_pcm_lib_preallocate_free_for_all(snd_pcm_t *pcm) 118int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm)
119{ 119{
120 snd_pcm_substream_t *substream; 120 struct snd_pcm_substream *substream;
121 int stream; 121 int stream;
122 122
123 for (stream = 0; stream < 2; stream++) 123 for (stream = 0; stream < 2; stream++)
@@ -131,10 +131,10 @@ int snd_pcm_lib_preallocate_free_for_all(snd_pcm_t *pcm)
131 * 131 *
132 * prints the current allocated size in kB. 132 * prints the current allocated size in kB.
133 */ 133 */
134static void snd_pcm_lib_preallocate_proc_read(snd_info_entry_t *entry, 134static void snd_pcm_lib_preallocate_proc_read(struct snd_info_entry *entry,
135 snd_info_buffer_t *buffer) 135 struct snd_info_buffer *buffer)
136{ 136{
137 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)entry->private_data; 137 struct snd_pcm_substream *substream = entry->private_data;
138 snd_iprintf(buffer, "%lu\n", (unsigned long) substream->dma_buffer.bytes / 1024); 138 snd_iprintf(buffer, "%lu\n", (unsigned long) substream->dma_buffer.bytes / 1024);
139} 139}
140 140
@@ -143,10 +143,10 @@ static void snd_pcm_lib_preallocate_proc_read(snd_info_entry_t *entry,
143 * 143 *
144 * accepts the preallocation size in kB. 144 * accepts the preallocation size in kB.
145 */ 145 */
146static void snd_pcm_lib_preallocate_proc_write(snd_info_entry_t *entry, 146static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry,
147 snd_info_buffer_t *buffer) 147 struct snd_info_buffer *buffer)
148{ 148{
149 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)entry->private_data; 149 struct snd_pcm_substream *substream = entry->private_data;
150 char line[64], str[64]; 150 char line[64], str[64];
151 size_t size; 151 size_t size;
152 struct snd_dma_buffer new_dmab; 152 struct snd_dma_buffer new_dmab;
@@ -188,10 +188,10 @@ static void snd_pcm_lib_preallocate_proc_write(snd_info_entry_t *entry,
188/* 188/*
189 * pre-allocate the buffer and create a proc file for the substream 189 * pre-allocate the buffer and create a proc file for the substream
190 */ 190 */
191static int snd_pcm_lib_preallocate_pages1(snd_pcm_substream_t *substream, 191static int snd_pcm_lib_preallocate_pages1(struct snd_pcm_substream *substream,
192 size_t size, size_t max) 192 size_t size, size_t max)
193{ 193{
194 snd_info_entry_t *entry; 194 struct snd_info_entry *entry;
195 195
196 if (size > 0 && preallocate_dma && substream->number < maximum_substreams) 196 if (size > 0 && preallocate_dma && substream->number < maximum_substreams)
197 preallocate_pcm_pages(substream, size); 197 preallocate_pcm_pages(substream, size);
@@ -233,7 +233,7 @@ static int snd_pcm_lib_preallocate_pages1(snd_pcm_substream_t *substream,
233 * 233 *
234 * Returns zero if successful, or a negative error code on failure. 234 * Returns zero if successful, or a negative error code on failure.
235 */ 235 */
236int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream, 236int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
237 int type, struct device *data, 237 int type, struct device *data,
238 size_t size, size_t max) 238 size_t size, size_t max)
239{ 239{
@@ -255,11 +255,11 @@ int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream,
255 * 255 *
256 * Returns zero if successful, or a negative error code on failure. 256 * Returns zero if successful, or a negative error code on failure.
257 */ 257 */
258int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm, 258int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
259 int type, void *data, 259 int type, void *data,
260 size_t size, size_t max) 260 size_t size, size_t max)
261{ 261{
262 snd_pcm_substream_t *substream; 262 struct snd_pcm_substream *substream;
263 int stream, err; 263 int stream, err;
264 264
265 for (stream = 0; stream < 2; stream++) 265 for (stream = 0; stream < 2; stream++)
@@ -277,7 +277,7 @@ int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm,
277 * Returns the page struct at the given buffer offset. 277 * Returns the page struct at the given buffer offset.
278 * Used as the page callback of PCM ops. 278 * Used as the page callback of PCM ops.
279 */ 279 */
280struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset) 280struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset)
281{ 281{
282 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); 282 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream);
283 283
@@ -298,9 +298,9 @@ struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned lon
298 * Returns 1 if the buffer is changed, 0 if not changed, or a negative 298 * Returns 1 if the buffer is changed, 0 if not changed, or a negative
299 * code on failure. 299 * code on failure.
300 */ 300 */
301int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size) 301int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size)
302{ 302{
303 snd_pcm_runtime_t *runtime; 303 struct snd_pcm_runtime *runtime;
304 struct snd_dma_buffer *dmab = NULL; 304 struct snd_dma_buffer *dmab = NULL;
305 305
306 snd_assert(substream->dma_buffer.dev.type != SNDRV_DMA_TYPE_UNKNOWN, return -EINVAL); 306 snd_assert(substream->dma_buffer.dev.type != SNDRV_DMA_TYPE_UNKNOWN, return -EINVAL);
@@ -318,7 +318,8 @@ int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size)
318 } 318 }
319 snd_pcm_lib_free_pages(substream); 319 snd_pcm_lib_free_pages(substream);
320 } 320 }
321 if (substream->dma_buffer.area != NULL && substream->dma_buffer.bytes >= size) { 321 if (substream->dma_buffer.area != NULL &&
322 substream->dma_buffer.bytes >= size) {
322 dmab = &substream->dma_buffer; /* use the pre-allocated buffer */ 323 dmab = &substream->dma_buffer; /* use the pre-allocated buffer */
323 } else { 324 } else {
324 dmab = kzalloc(sizeof(*dmab), GFP_KERNEL); 325 dmab = kzalloc(sizeof(*dmab), GFP_KERNEL);
@@ -345,9 +346,9 @@ int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size)
345 * 346 *
346 * Returns zero if successful, or a negative error code on failure. 347 * Returns zero if successful, or a negative error code on failure.
347 */ 348 */
348int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream) 349int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream)
349{ 350{
350 snd_pcm_runtime_t *runtime; 351 struct snd_pcm_runtime *runtime;
351 352
352 snd_assert(substream != NULL, return -EINVAL); 353 snd_assert(substream != NULL, return -EINVAL);
353 runtime = substream->runtime; 354 runtime = substream->runtime;
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index 1453743e4da0..593c77f4d181 100644
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -441,7 +441,7 @@ snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_end
441 * 441 *
442 * Returns zero if successful. 442 * Returns zero if successful.
443 */ 443 */
444int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime) 444int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime)
445{ 445{
446 static unsigned rates[] = { 446 static unsigned rates[] = {
447 /* ATTENTION: these values depend on the definition in pcm.h! */ 447 /* ATTENTION: these values depend on the definition in pcm.h! */
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 16e252f54954..263c01a70fdd 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -39,11 +39,11 @@
39 * Compatibility 39 * Compatibility
40 */ 40 */
41 41
42struct sndrv_pcm_hw_params_old { 42struct snd_pcm_hw_params_old {
43 unsigned int flags; 43 unsigned int flags;
44 unsigned int masks[SNDRV_PCM_HW_PARAM_SUBFORMAT - 44 unsigned int masks[SNDRV_PCM_HW_PARAM_SUBFORMAT -
45 SNDRV_PCM_HW_PARAM_ACCESS + 1]; 45 SNDRV_PCM_HW_PARAM_ACCESS + 1];
46 struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_TICK_TIME - 46 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_TICK_TIME -
47 SNDRV_PCM_HW_PARAM_SAMPLE_BITS + 1]; 47 SNDRV_PCM_HW_PARAM_SAMPLE_BITS + 1];
48 unsigned int rmask; 48 unsigned int rmask;
49 unsigned int cmask; 49 unsigned int cmask;
@@ -51,15 +51,17 @@ struct sndrv_pcm_hw_params_old {
51 unsigned int msbits; 51 unsigned int msbits;
52 unsigned int rate_num; 52 unsigned int rate_num;
53 unsigned int rate_den; 53 unsigned int rate_den;
54 sndrv_pcm_uframes_t fifo_size; 54 snd_pcm_uframes_t fifo_size;
55 unsigned char reserved[64]; 55 unsigned char reserved[64];
56}; 56};
57 57
58#define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct sndrv_pcm_hw_params_old) 58#define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct snd_pcm_hw_params_old)
59#define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct sndrv_pcm_hw_params_old) 59#define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct snd_pcm_hw_params_old)
60 60
61static int snd_pcm_hw_refine_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams); 61static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
62static int snd_pcm_hw_params_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams); 62 struct snd_pcm_hw_params_old __user * _oparams);
63static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
64 struct snd_pcm_hw_params_old __user * _oparams);
63 65
64/* 66/*
65 * 67 *
@@ -83,11 +85,11 @@ static inline void snd_leave_user(mm_segment_t fs)
83 85
84 86
85 87
86int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info) 88int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info)
87{ 89{
88 snd_pcm_runtime_t * runtime; 90 struct snd_pcm_runtime *runtime;
89 snd_pcm_t *pcm = substream->pcm; 91 struct snd_pcm *pcm = substream->pcm;
90 snd_pcm_str_t *pstr = substream->pstr; 92 struct snd_pcm_str *pstr = substream->pstr;
91 93
92 snd_assert(substream != NULL, return -ENXIO); 94 snd_assert(substream != NULL, return -ENXIO);
93 memset(info, 0, sizeof(*info)); 95 memset(info, 0, sizeof(*info));
@@ -111,9 +113,10 @@ int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info)
111 return 0; 113 return 0;
112} 114}
113 115
114int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t __user * _info) 116int snd_pcm_info_user(struct snd_pcm_substream *substream,
117 struct snd_pcm_info __user * _info)
115{ 118{
116 snd_pcm_info_t *info; 119 struct snd_pcm_info *info;
117 int err; 120 int err;
118 121
119 info = kmalloc(sizeof(*info), GFP_KERNEL); 122 info = kmalloc(sizeof(*info), GFP_KERNEL);
@@ -151,14 +154,14 @@ char *snd_pcm_hw_param_names[] = {
151}; 154};
152#endif 155#endif
153 156
154int snd_pcm_hw_refine(snd_pcm_substream_t *substream, 157int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
155 snd_pcm_hw_params_t *params) 158 struct snd_pcm_hw_params *params)
156{ 159{
157 unsigned int k; 160 unsigned int k;
158 snd_pcm_hardware_t *hw; 161 struct snd_pcm_hardware *hw;
159 snd_interval_t *i = NULL; 162 struct snd_interval *i = NULL;
160 snd_mask_t *m = NULL; 163 struct snd_mask *m = NULL;
161 snd_pcm_hw_constraints_t *constrs = &substream->runtime->hw_constraints; 164 struct snd_pcm_hw_constraints *constrs = &substream->runtime->hw_constraints;
162 unsigned int rstamps[constrs->rules_num]; 165 unsigned int rstamps[constrs->rules_num];
163 unsigned int vstamps[SNDRV_PCM_HW_PARAM_LAST_INTERVAL + 1]; 166 unsigned int vstamps[SNDRV_PCM_HW_PARAM_LAST_INTERVAL + 1];
164 unsigned int stamp = 2; 167 unsigned int stamp = 2;
@@ -231,7 +234,7 @@ int snd_pcm_hw_refine(snd_pcm_substream_t *substream,
231 do { 234 do {
232 again = 0; 235 again = 0;
233 for (k = 0; k < constrs->rules_num; k++) { 236 for (k = 0; k < constrs->rules_num; k++) {
234 snd_pcm_hw_rule_t *r = &constrs->rules[k]; 237 struct snd_pcm_hw_rule *r = &constrs->rules[k];
235 unsigned int d; 238 unsigned int d;
236 int doit = 0; 239 int doit = 0;
237 if (r->cond && !(r->cond & params->flags)) 240 if (r->cond && !(r->cond & params->flags))
@@ -313,9 +316,10 @@ int snd_pcm_hw_refine(snd_pcm_substream_t *substream,
313 return 0; 316 return 0;
314} 317}
315 318
316static int snd_pcm_hw_refine_user(snd_pcm_substream_t * substream, snd_pcm_hw_params_t __user * _params) 319static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
320 struct snd_pcm_hw_params __user * _params)
317{ 321{
318 snd_pcm_hw_params_t *params; 322 struct snd_pcm_hw_params *params;
319 int err; 323 int err;
320 324
321 params = kmalloc(sizeof(*params), GFP_KERNEL); 325 params = kmalloc(sizeof(*params), GFP_KERNEL);
@@ -337,10 +341,10 @@ out:
337 return err; 341 return err;
338} 342}
339 343
340static int snd_pcm_hw_params(snd_pcm_substream_t *substream, 344static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
341 snd_pcm_hw_params_t *params) 345 struct snd_pcm_hw_params *params)
342{ 346{
343 snd_pcm_runtime_t *runtime; 347 struct snd_pcm_runtime *runtime;
344 int err; 348 int err;
345 unsigned int bits; 349 unsigned int bits;
346 snd_pcm_uframes_t frames; 350 snd_pcm_uframes_t frames;
@@ -432,9 +436,10 @@ static int snd_pcm_hw_params(snd_pcm_substream_t *substream,
432 return err; 436 return err;
433} 437}
434 438
435static int snd_pcm_hw_params_user(snd_pcm_substream_t * substream, snd_pcm_hw_params_t __user * _params) 439static int snd_pcm_hw_params_user(struct snd_pcm_substream *substream,
440 struct snd_pcm_hw_params __user * _params)
436{ 441{
437 snd_pcm_hw_params_t *params; 442 struct snd_pcm_hw_params *params;
438 int err; 443 int err;
439 444
440 params = kmalloc(sizeof(*params), GFP_KERNEL); 445 params = kmalloc(sizeof(*params), GFP_KERNEL);
@@ -456,9 +461,9 @@ out:
456 return err; 461 return err;
457} 462}
458 463
459static int snd_pcm_hw_free(snd_pcm_substream_t * substream) 464static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
460{ 465{
461 snd_pcm_runtime_t *runtime; 466 struct snd_pcm_runtime *runtime;
462 int result = 0; 467 int result = 0;
463 468
464 snd_assert(substream != NULL, return -ENXIO); 469 snd_assert(substream != NULL, return -ENXIO);
@@ -482,9 +487,10 @@ static int snd_pcm_hw_free(snd_pcm_substream_t * substream)
482 return result; 487 return result;
483} 488}
484 489
485static int snd_pcm_sw_params(snd_pcm_substream_t * substream, snd_pcm_sw_params_t *params) 490static int snd_pcm_sw_params(struct snd_pcm_substream *substream,
491 struct snd_pcm_sw_params *params)
486{ 492{
487 snd_pcm_runtime_t *runtime; 493 struct snd_pcm_runtime *runtime;
488 494
489 snd_assert(substream != NULL, return -ENXIO); 495 snd_assert(substream != NULL, return -ENXIO);
490 runtime = substream->runtime; 496 runtime = substream->runtime;
@@ -537,9 +543,10 @@ static int snd_pcm_sw_params(snd_pcm_substream_t * substream, snd_pcm_sw_params_
537 return 0; 543 return 0;
538} 544}
539 545
540static int snd_pcm_sw_params_user(snd_pcm_substream_t * substream, snd_pcm_sw_params_t __user * _params) 546static int snd_pcm_sw_params_user(struct snd_pcm_substream *substream,
547 struct snd_pcm_sw_params __user * _params)
541{ 548{
542 snd_pcm_sw_params_t params; 549 struct snd_pcm_sw_params params;
543 int err; 550 int err;
544 if (copy_from_user(&params, _params, sizeof(params))) 551 if (copy_from_user(&params, _params, sizeof(params)))
545 return -EFAULT; 552 return -EFAULT;
@@ -549,10 +556,10 @@ static int snd_pcm_sw_params_user(snd_pcm_substream_t * substream, snd_pcm_sw_pa
549 return err; 556 return err;
550} 557}
551 558
552int snd_pcm_status(snd_pcm_substream_t *substream, 559int snd_pcm_status(struct snd_pcm_substream *substream,
553 snd_pcm_status_t *status) 560 struct snd_pcm_status *status)
554{ 561{
555 snd_pcm_runtime_t *runtime = substream->runtime; 562 struct snd_pcm_runtime *runtime = substream->runtime;
556 563
557 snd_pcm_stream_lock_irq(substream); 564 snd_pcm_stream_lock_irq(substream);
558 status->state = runtime->status->state; 565 status->state = runtime->status->state;
@@ -593,10 +600,11 @@ int snd_pcm_status(snd_pcm_substream_t *substream,
593 return 0; 600 return 0;
594} 601}
595 602
596static int snd_pcm_status_user(snd_pcm_substream_t * substream, snd_pcm_status_t __user * _status) 603static int snd_pcm_status_user(struct snd_pcm_substream *substream,
604 struct snd_pcm_status __user * _status)
597{ 605{
598 snd_pcm_status_t status; 606 struct snd_pcm_status status;
599 snd_pcm_runtime_t *runtime; 607 struct snd_pcm_runtime *runtime;
600 int res; 608 int res;
601 609
602 snd_assert(substream != NULL, return -ENXIO); 610 snd_assert(substream != NULL, return -ENXIO);
@@ -610,9 +618,10 @@ static int snd_pcm_status_user(snd_pcm_substream_t * substream, snd_pcm_status_t
610 return 0; 618 return 0;
611} 619}
612 620
613static int snd_pcm_channel_info(snd_pcm_substream_t * substream, snd_pcm_channel_info_t * info) 621static int snd_pcm_channel_info(struct snd_pcm_substream *substream,
622 struct snd_pcm_channel_info * info)
614{ 623{
615 snd_pcm_runtime_t *runtime; 624 struct snd_pcm_runtime *runtime;
616 unsigned int channel; 625 unsigned int channel;
617 626
618 snd_assert(substream != NULL, return -ENXIO); 627 snd_assert(substream != NULL, return -ENXIO);
@@ -631,9 +640,10 @@ static int snd_pcm_channel_info(snd_pcm_substream_t * substream, snd_pcm_channel
631 return substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_CHANNEL_INFO, info); 640 return substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_CHANNEL_INFO, info);
632} 641}
633 642
634static int snd_pcm_channel_info_user(snd_pcm_substream_t * substream, snd_pcm_channel_info_t __user * _info) 643static int snd_pcm_channel_info_user(struct snd_pcm_substream *substream,
644 struct snd_pcm_channel_info __user * _info)
635{ 645{
636 snd_pcm_channel_info_t info; 646 struct snd_pcm_channel_info info;
637 int res; 647 int res;
638 648
639 if (copy_from_user(&info, _info, sizeof(info))) 649 if (copy_from_user(&info, _info, sizeof(info)))
@@ -646,9 +656,9 @@ static int snd_pcm_channel_info_user(snd_pcm_substream_t * substream, snd_pcm_ch
646 return 0; 656 return 0;
647} 657}
648 658
649static void snd_pcm_trigger_tstamp(snd_pcm_substream_t *substream) 659static void snd_pcm_trigger_tstamp(struct snd_pcm_substream *substream)
650{ 660{
651 snd_pcm_runtime_t *runtime = substream->runtime; 661 struct snd_pcm_runtime *runtime = substream->runtime;
652 if (runtime->trigger_master == NULL) 662 if (runtime->trigger_master == NULL)
653 return; 663 return;
654 if (runtime->trigger_master == substream) { 664 if (runtime->trigger_master == substream) {
@@ -661,10 +671,10 @@ static void snd_pcm_trigger_tstamp(snd_pcm_substream_t *substream)
661} 671}
662 672
663struct action_ops { 673struct action_ops {
664 int (*pre_action)(snd_pcm_substream_t *substream, int state); 674 int (*pre_action)(struct snd_pcm_substream *substream, int state);
665 int (*do_action)(snd_pcm_substream_t *substream, int state); 675 int (*do_action)(struct snd_pcm_substream *substream, int state);
666 void (*undo_action)(snd_pcm_substream_t *substream, int state); 676 void (*undo_action)(struct snd_pcm_substream *substream, int state);
667 void (*post_action)(snd_pcm_substream_t *substream, int state); 677 void (*post_action)(struct snd_pcm_substream *substream, int state);
668}; 678};
669 679
670/* 680/*
@@ -673,12 +683,12 @@ struct action_ops {
673 * Note2: call with calling stream lock + link lock 683 * Note2: call with calling stream lock + link lock
674 */ 684 */
675static int snd_pcm_action_group(struct action_ops *ops, 685static int snd_pcm_action_group(struct action_ops *ops,
676 snd_pcm_substream_t *substream, 686 struct snd_pcm_substream *substream,
677 int state, int do_lock) 687 int state, int do_lock)
678{ 688{
679 struct list_head *pos; 689 struct list_head *pos;
680 snd_pcm_substream_t *s = NULL; 690 struct snd_pcm_substream *s = NULL;
681 snd_pcm_substream_t *s1; 691 struct snd_pcm_substream *s1;
682 int res = 0; 692 int res = 0;
683 693
684 snd_pcm_group_for_each(pos, substream) { 694 snd_pcm_group_for_each(pos, substream) {
@@ -727,7 +737,7 @@ static int snd_pcm_action_group(struct action_ops *ops,
727 * Note: call with stream lock 737 * Note: call with stream lock
728 */ 738 */
729static int snd_pcm_action_single(struct action_ops *ops, 739static int snd_pcm_action_single(struct action_ops *ops,
730 snd_pcm_substream_t *substream, 740 struct snd_pcm_substream *substream,
731 int state) 741 int state)
732{ 742{
733 int res; 743 int res;
@@ -747,7 +757,7 @@ static int snd_pcm_action_single(struct action_ops *ops,
747 * Note: call with stream lock 757 * Note: call with stream lock
748 */ 758 */
749static int snd_pcm_action(struct action_ops *ops, 759static int snd_pcm_action(struct action_ops *ops,
750 snd_pcm_substream_t *substream, 760 struct snd_pcm_substream *substream,
751 int state) 761 int state)
752{ 762{
753 int res; 763 int res;
@@ -770,7 +780,7 @@ static int snd_pcm_action(struct action_ops *ops,
770 * Note: don't use any locks before 780 * Note: don't use any locks before
771 */ 781 */
772static int snd_pcm_action_lock_irq(struct action_ops *ops, 782static int snd_pcm_action_lock_irq(struct action_ops *ops,
773 snd_pcm_substream_t *substream, 783 struct snd_pcm_substream *substream,
774 int state) 784 int state)
775{ 785{
776 int res; 786 int res;
@@ -794,7 +804,7 @@ static int snd_pcm_action_lock_irq(struct action_ops *ops,
794/* 804/*
795 */ 805 */
796static int snd_pcm_action_nonatomic(struct action_ops *ops, 806static int snd_pcm_action_nonatomic(struct action_ops *ops,
797 snd_pcm_substream_t *substream, 807 struct snd_pcm_substream *substream,
798 int state) 808 int state)
799{ 809{
800 int res; 810 int res;
@@ -811,9 +821,9 @@ static int snd_pcm_action_nonatomic(struct action_ops *ops,
811/* 821/*
812 * start callbacks 822 * start callbacks
813 */ 823 */
814static int snd_pcm_pre_start(snd_pcm_substream_t *substream, int state) 824static int snd_pcm_pre_start(struct snd_pcm_substream *substream, int state)
815{ 825{
816 snd_pcm_runtime_t *runtime = substream->runtime; 826 struct snd_pcm_runtime *runtime = substream->runtime;
817 if (runtime->status->state != SNDRV_PCM_STATE_PREPARED) 827 if (runtime->status->state != SNDRV_PCM_STATE_PREPARED)
818 return -EBADFD; 828 return -EBADFD;
819 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 829 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
@@ -823,22 +833,22 @@ static int snd_pcm_pre_start(snd_pcm_substream_t *substream, int state)
823 return 0; 833 return 0;
824} 834}
825 835
826static int snd_pcm_do_start(snd_pcm_substream_t *substream, int state) 836static int snd_pcm_do_start(struct snd_pcm_substream *substream, int state)
827{ 837{
828 if (substream->runtime->trigger_master != substream) 838 if (substream->runtime->trigger_master != substream)
829 return 0; 839 return 0;
830 return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START); 840 return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);
831} 841}
832 842
833static void snd_pcm_undo_start(snd_pcm_substream_t *substream, int state) 843static void snd_pcm_undo_start(struct snd_pcm_substream *substream, int state)
834{ 844{
835 if (substream->runtime->trigger_master == substream) 845 if (substream->runtime->trigger_master == substream)
836 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); 846 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
837} 847}
838 848
839static void snd_pcm_post_start(snd_pcm_substream_t *substream, int state) 849static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state)
840{ 850{
841 snd_pcm_runtime_t *runtime = substream->runtime; 851 struct snd_pcm_runtime *runtime = substream->runtime;
842 snd_pcm_trigger_tstamp(substream); 852 snd_pcm_trigger_tstamp(substream);
843 runtime->status->state = state; 853 runtime->status->state = state;
844 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 854 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
@@ -847,7 +857,8 @@ static void snd_pcm_post_start(snd_pcm_substream_t *substream, int state)
847 if (runtime->sleep_min) 857 if (runtime->sleep_min)
848 snd_pcm_tick_prepare(substream); 858 snd_pcm_tick_prepare(substream);
849 if (substream->timer) 859 if (substream->timer)
850 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTART, &runtime->trigger_tstamp); 860 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTART,
861 &runtime->trigger_tstamp);
851} 862}
852 863
853static struct action_ops snd_pcm_action_start = { 864static struct action_ops snd_pcm_action_start = {
@@ -863,24 +874,25 @@ static struct action_ops snd_pcm_action_start = {
863 * 874 *
864 * Start all linked streams. 875 * Start all linked streams.
865 */ 876 */
866int snd_pcm_start(snd_pcm_substream_t *substream) 877int snd_pcm_start(struct snd_pcm_substream *substream)
867{ 878{
868 return snd_pcm_action(&snd_pcm_action_start, substream, SNDRV_PCM_STATE_RUNNING); 879 return snd_pcm_action(&snd_pcm_action_start, substream,
880 SNDRV_PCM_STATE_RUNNING);
869} 881}
870 882
871/* 883/*
872 * stop callbacks 884 * stop callbacks
873 */ 885 */
874static int snd_pcm_pre_stop(snd_pcm_substream_t *substream, int state) 886static int snd_pcm_pre_stop(struct snd_pcm_substream *substream, int state)
875{ 887{
876 snd_pcm_runtime_t *runtime = substream->runtime; 888 struct snd_pcm_runtime *runtime = substream->runtime;
877 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 889 if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
878 return -EBADFD; 890 return -EBADFD;
879 runtime->trigger_master = substream; 891 runtime->trigger_master = substream;
880 return 0; 892 return 0;
881} 893}
882 894
883static int snd_pcm_do_stop(snd_pcm_substream_t *substream, int state) 895static int snd_pcm_do_stop(struct snd_pcm_substream *substream, int state)
884{ 896{
885 if (substream->runtime->trigger_master == substream && 897 if (substream->runtime->trigger_master == substream &&
886 snd_pcm_running(substream)) 898 snd_pcm_running(substream))
@@ -888,13 +900,14 @@ static int snd_pcm_do_stop(snd_pcm_substream_t *substream, int state)
888 return 0; /* unconditonally stop all substreams */ 900 return 0; /* unconditonally stop all substreams */
889} 901}
890 902
891static void snd_pcm_post_stop(snd_pcm_substream_t *substream, int state) 903static void snd_pcm_post_stop(struct snd_pcm_substream *substream, int state)
892{ 904{
893 snd_pcm_runtime_t *runtime = substream->runtime; 905 struct snd_pcm_runtime *runtime = substream->runtime;
894 if (runtime->status->state != state) { 906 if (runtime->status->state != state) {
895 snd_pcm_trigger_tstamp(substream); 907 snd_pcm_trigger_tstamp(substream);
896 if (substream->timer) 908 if (substream->timer)
897 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTOP, &runtime->trigger_tstamp); 909 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTOP,
910 &runtime->trigger_tstamp);
898 runtime->status->state = state; 911 runtime->status->state = state;
899 snd_pcm_tick_set(substream, 0); 912 snd_pcm_tick_set(substream, 0);
900 } 913 }
@@ -915,7 +928,7 @@ static struct action_ops snd_pcm_action_stop = {
915 * Try to stop all running streams in the substream group. 928 * Try to stop all running streams in the substream group.
916 * The state of each stream is changed to the given value after that unconditionally. 929 * The state of each stream is changed to the given value after that unconditionally.
917 */ 930 */
918int snd_pcm_stop(snd_pcm_substream_t *substream, int state) 931int snd_pcm_stop(struct snd_pcm_substream *substream, int state)
919{ 932{
920 return snd_pcm_action(&snd_pcm_action_stop, substream, state); 933 return snd_pcm_action(&snd_pcm_action_stop, substream, state);
921} 934}
@@ -928,17 +941,18 @@ int snd_pcm_stop(snd_pcm_substream_t *substream, int state)
928 * The state is changed to SETUP. 941 * The state is changed to SETUP.
929 * Unlike snd_pcm_stop(), this affects only the given stream. 942 * Unlike snd_pcm_stop(), this affects only the given stream.
930 */ 943 */
931int snd_pcm_drain_done(snd_pcm_substream_t *substream) 944int snd_pcm_drain_done(struct snd_pcm_substream *substream)
932{ 945{
933 return snd_pcm_action_single(&snd_pcm_action_stop, substream, SNDRV_PCM_STATE_SETUP); 946 return snd_pcm_action_single(&snd_pcm_action_stop, substream,
947 SNDRV_PCM_STATE_SETUP);
934} 948}
935 949
936/* 950/*
937 * pause callbacks 951 * pause callbacks
938 */ 952 */
939static int snd_pcm_pre_pause(snd_pcm_substream_t *substream, int push) 953static int snd_pcm_pre_pause(struct snd_pcm_substream *substream, int push)
940{ 954{
941 snd_pcm_runtime_t *runtime = substream->runtime; 955 struct snd_pcm_runtime *runtime = substream->runtime;
942 if (!(runtime->info & SNDRV_PCM_INFO_PAUSE)) 956 if (!(runtime->info & SNDRV_PCM_INFO_PAUSE))
943 return -ENOSYS; 957 return -ENOSYS;
944 if (push) { 958 if (push) {
@@ -950,7 +964,7 @@ static int snd_pcm_pre_pause(snd_pcm_substream_t *substream, int push)
950 return 0; 964 return 0;
951} 965}
952 966
953static int snd_pcm_do_pause(snd_pcm_substream_t *substream, int push) 967static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push)
954{ 968{
955 if (substream->runtime->trigger_master != substream) 969 if (substream->runtime->trigger_master != substream)
956 return 0; 970 return 0;
@@ -959,7 +973,7 @@ static int snd_pcm_do_pause(snd_pcm_substream_t *substream, int push)
959 SNDRV_PCM_TRIGGER_PAUSE_RELEASE); 973 SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
960} 974}
961 975
962static void snd_pcm_undo_pause(snd_pcm_substream_t *substream, int push) 976static void snd_pcm_undo_pause(struct snd_pcm_substream *substream, int push)
963{ 977{
964 if (substream->runtime->trigger_master == substream) 978 if (substream->runtime->trigger_master == substream)
965 substream->ops->trigger(substream, 979 substream->ops->trigger(substream,
@@ -967,14 +981,16 @@ static void snd_pcm_undo_pause(snd_pcm_substream_t *substream, int push)
967 SNDRV_PCM_TRIGGER_PAUSE_PUSH); 981 SNDRV_PCM_TRIGGER_PAUSE_PUSH);
968} 982}
969 983
970static void snd_pcm_post_pause(snd_pcm_substream_t *substream, int push) 984static void snd_pcm_post_pause(struct snd_pcm_substream *substream, int push)
971{ 985{
972 snd_pcm_runtime_t *runtime = substream->runtime; 986 struct snd_pcm_runtime *runtime = substream->runtime;
973 snd_pcm_trigger_tstamp(substream); 987 snd_pcm_trigger_tstamp(substream);
974 if (push) { 988 if (push) {
975 runtime->status->state = SNDRV_PCM_STATE_PAUSED; 989 runtime->status->state = SNDRV_PCM_STATE_PAUSED;
976 if (substream->timer) 990 if (substream->timer)
977 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MPAUSE, &runtime->trigger_tstamp); 991 snd_timer_notify(substream->timer,
992 SNDRV_TIMER_EVENT_MPAUSE,
993 &runtime->trigger_tstamp);
978 snd_pcm_tick_set(substream, 0); 994 snd_pcm_tick_set(substream, 0);
979 wake_up(&runtime->sleep); 995 wake_up(&runtime->sleep);
980 } else { 996 } else {
@@ -982,7 +998,9 @@ static void snd_pcm_post_pause(snd_pcm_substream_t *substream, int push)
982 if (runtime->sleep_min) 998 if (runtime->sleep_min)
983 snd_pcm_tick_prepare(substream); 999 snd_pcm_tick_prepare(substream);
984 if (substream->timer) 1000 if (substream->timer)
985 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MCONTINUE, &runtime->trigger_tstamp); 1001 snd_timer_notify(substream->timer,
1002 SNDRV_TIMER_EVENT_MCONTINUE,
1003 &runtime->trigger_tstamp);
986 } 1004 }
987} 1005}
988 1006
@@ -996,7 +1014,7 @@ static struct action_ops snd_pcm_action_pause = {
996/* 1014/*
997 * Push/release the pause for all linked streams. 1015 * Push/release the pause for all linked streams.
998 */ 1016 */
999static int snd_pcm_pause(snd_pcm_substream_t *substream, int push) 1017static int snd_pcm_pause(struct snd_pcm_substream *substream, int push)
1000{ 1018{
1001 return snd_pcm_action(&snd_pcm_action_pause, substream, push); 1019 return snd_pcm_action(&snd_pcm_action_pause, substream, push);
1002} 1020}
@@ -1004,18 +1022,18 @@ static int snd_pcm_pause(snd_pcm_substream_t *substream, int push)
1004#ifdef CONFIG_PM 1022#ifdef CONFIG_PM
1005/* suspend */ 1023/* suspend */
1006 1024
1007static int snd_pcm_pre_suspend(snd_pcm_substream_t *substream, int state) 1025static int snd_pcm_pre_suspend(struct snd_pcm_substream *substream, int state)
1008{ 1026{
1009 snd_pcm_runtime_t *runtime = substream->runtime; 1027 struct snd_pcm_runtime *runtime = substream->runtime;
1010 if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) 1028 if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)
1011 return -EBUSY; 1029 return -EBUSY;
1012 runtime->trigger_master = substream; 1030 runtime->trigger_master = substream;
1013 return 0; 1031 return 0;
1014} 1032}
1015 1033
1016static int snd_pcm_do_suspend(snd_pcm_substream_t *substream, int state) 1034static int snd_pcm_do_suspend(struct snd_pcm_substream *substream, int state)
1017{ 1035{
1018 snd_pcm_runtime_t *runtime = substream->runtime; 1036 struct snd_pcm_runtime *runtime = substream->runtime;
1019 if (runtime->trigger_master != substream) 1037 if (runtime->trigger_master != substream)
1020 return 0; 1038 return 0;
1021 if (! snd_pcm_running(substream)) 1039 if (! snd_pcm_running(substream))
@@ -1024,12 +1042,13 @@ static int snd_pcm_do_suspend(snd_pcm_substream_t *substream, int state)
1024 return 0; /* suspend unconditionally */ 1042 return 0; /* suspend unconditionally */
1025} 1043}
1026 1044
1027static void snd_pcm_post_suspend(snd_pcm_substream_t *substream, int state) 1045static void snd_pcm_post_suspend(struct snd_pcm_substream *substream, int state)
1028{ 1046{
1029 snd_pcm_runtime_t *runtime = substream->runtime; 1047 struct snd_pcm_runtime *runtime = substream->runtime;
1030 snd_pcm_trigger_tstamp(substream); 1048 snd_pcm_trigger_tstamp(substream);
1031 if (substream->timer) 1049 if (substream->timer)
1032 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSUSPEND, &runtime->trigger_tstamp); 1050 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSUSPEND,
1051 &runtime->trigger_tstamp);
1033 runtime->status->suspended_state = runtime->status->state; 1052 runtime->status->suspended_state = runtime->status->state;
1034 runtime->status->state = SNDRV_PCM_STATE_SUSPENDED; 1053 runtime->status->state = SNDRV_PCM_STATE_SUSPENDED;
1035 snd_pcm_tick_set(substream, 0); 1054 snd_pcm_tick_set(substream, 0);
@@ -1049,7 +1068,7 @@ static struct action_ops snd_pcm_action_suspend = {
1049 * Trigger SUSPEND to all linked streams. 1068 * Trigger SUSPEND to all linked streams.
1050 * After this call, all streams are changed to SUSPENDED state. 1069 * After this call, all streams are changed to SUSPENDED state.
1051 */ 1070 */
1052int snd_pcm_suspend(snd_pcm_substream_t *substream) 1071int snd_pcm_suspend(struct snd_pcm_substream *substream)
1053{ 1072{
1054 int err; 1073 int err;
1055 unsigned long flags; 1074 unsigned long flags;
@@ -1067,13 +1086,14 @@ int snd_pcm_suspend(snd_pcm_substream_t *substream)
1067 * Trigger SUSPEND to all substreams in the given pcm. 1086 * Trigger SUSPEND to all substreams in the given pcm.
1068 * After this call, all streams are changed to SUSPENDED state. 1087 * After this call, all streams are changed to SUSPENDED state.
1069 */ 1088 */
1070int snd_pcm_suspend_all(snd_pcm_t *pcm) 1089int snd_pcm_suspend_all(struct snd_pcm *pcm)
1071{ 1090{
1072 snd_pcm_substream_t *substream; 1091 struct snd_pcm_substream *substream;
1073 int stream, err = 0; 1092 int stream, err = 0;
1074 1093
1075 for (stream = 0; stream < 2; stream++) { 1094 for (stream = 0; stream < 2; stream++) {
1076 for (substream = pcm->streams[stream].substream; substream; substream = substream->next) { 1095 for (substream = pcm->streams[stream].substream;
1096 substream; substream = substream->next) {
1077 /* FIXME: the open/close code should lock this as well */ 1097 /* FIXME: the open/close code should lock this as well */
1078 if (substream->runtime == NULL) 1098 if (substream->runtime == NULL)
1079 continue; 1099 continue;
@@ -1087,18 +1107,18 @@ int snd_pcm_suspend_all(snd_pcm_t *pcm)
1087 1107
1088/* resume */ 1108/* resume */
1089 1109
1090static int snd_pcm_pre_resume(snd_pcm_substream_t *substream, int state) 1110static int snd_pcm_pre_resume(struct snd_pcm_substream *substream, int state)
1091{ 1111{
1092 snd_pcm_runtime_t *runtime = substream->runtime; 1112 struct snd_pcm_runtime *runtime = substream->runtime;
1093 if (!(runtime->info & SNDRV_PCM_INFO_RESUME)) 1113 if (!(runtime->info & SNDRV_PCM_INFO_RESUME))
1094 return -ENOSYS; 1114 return -ENOSYS;
1095 runtime->trigger_master = substream; 1115 runtime->trigger_master = substream;
1096 return 0; 1116 return 0;
1097} 1117}
1098 1118
1099static int snd_pcm_do_resume(snd_pcm_substream_t *substream, int state) 1119static int snd_pcm_do_resume(struct snd_pcm_substream *substream, int state)
1100{ 1120{
1101 snd_pcm_runtime_t *runtime = substream->runtime; 1121 struct snd_pcm_runtime *runtime = substream->runtime;
1102 if (runtime->trigger_master != substream) 1122 if (runtime->trigger_master != substream)
1103 return 0; 1123 return 0;
1104 /* DMA not running previously? */ 1124 /* DMA not running previously? */
@@ -1109,19 +1129,20 @@ static int snd_pcm_do_resume(snd_pcm_substream_t *substream, int state)
1109 return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_RESUME); 1129 return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_RESUME);
1110} 1130}
1111 1131
1112static void snd_pcm_undo_resume(snd_pcm_substream_t *substream, int state) 1132static void snd_pcm_undo_resume(struct snd_pcm_substream *substream, int state)
1113{ 1133{
1114 if (substream->runtime->trigger_master == substream && 1134 if (substream->runtime->trigger_master == substream &&
1115 snd_pcm_running(substream)) 1135 snd_pcm_running(substream))
1116 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_SUSPEND); 1136 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_SUSPEND);
1117} 1137}
1118 1138
1119static void snd_pcm_post_resume(snd_pcm_substream_t *substream, int state) 1139static void snd_pcm_post_resume(struct snd_pcm_substream *substream, int state)
1120{ 1140{
1121 snd_pcm_runtime_t *runtime = substream->runtime; 1141 struct snd_pcm_runtime *runtime = substream->runtime;
1122 snd_pcm_trigger_tstamp(substream); 1142 snd_pcm_trigger_tstamp(substream);
1123 if (substream->timer) 1143 if (substream->timer)
1124 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MRESUME, &runtime->trigger_tstamp); 1144 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MRESUME,
1145 &runtime->trigger_tstamp);
1125 runtime->status->state = runtime->status->suspended_state; 1146 runtime->status->state = runtime->status->suspended_state;
1126 if (runtime->sleep_min) 1147 if (runtime->sleep_min)
1127 snd_pcm_tick_prepare(substream); 1148 snd_pcm_tick_prepare(substream);
@@ -1134,9 +1155,9 @@ static struct action_ops snd_pcm_action_resume = {
1134 .post_action = snd_pcm_post_resume 1155 .post_action = snd_pcm_post_resume
1135}; 1156};
1136 1157
1137static int snd_pcm_resume(snd_pcm_substream_t *substream) 1158static int snd_pcm_resume(struct snd_pcm_substream *substream)
1138{ 1159{
1139 snd_card_t *card = substream->pcm->card; 1160 struct snd_card *card = substream->pcm->card;
1140 int res; 1161 int res;
1141 1162
1142 snd_power_lock(card); 1163 snd_power_lock(card);
@@ -1148,7 +1169,7 @@ static int snd_pcm_resume(snd_pcm_substream_t *substream)
1148 1169
1149#else 1170#else
1150 1171
1151static int snd_pcm_resume(snd_pcm_substream_t *substream) 1172static int snd_pcm_resume(struct snd_pcm_substream *substream)
1152{ 1173{
1153 return -ENOSYS; 1174 return -ENOSYS;
1154} 1175}
@@ -1160,10 +1181,10 @@ static int snd_pcm_resume(snd_pcm_substream_t *substream)
1160 * 1181 *
1161 * Change the RUNNING stream(s) to XRUN state. 1182 * Change the RUNNING stream(s) to XRUN state.
1162 */ 1183 */
1163static int snd_pcm_xrun(snd_pcm_substream_t *substream) 1184static int snd_pcm_xrun(struct snd_pcm_substream *substream)
1164{ 1185{
1165 snd_card_t *card = substream->pcm->card; 1186 struct snd_card *card = substream->pcm->card;
1166 snd_pcm_runtime_t *runtime = substream->runtime; 1187 struct snd_pcm_runtime *runtime = substream->runtime;
1167 int result; 1188 int result;
1168 1189
1169 snd_power_lock(card); 1190 snd_power_lock(card);
@@ -1193,9 +1214,9 @@ static int snd_pcm_xrun(snd_pcm_substream_t *substream)
1193/* 1214/*
1194 * reset ioctl 1215 * reset ioctl
1195 */ 1216 */
1196static int snd_pcm_pre_reset(snd_pcm_substream_t * substream, int state) 1217static int snd_pcm_pre_reset(struct snd_pcm_substream *substream, int state)
1197{ 1218{
1198 snd_pcm_runtime_t *runtime = substream->runtime; 1219 struct snd_pcm_runtime *runtime = substream->runtime;
1199 switch (runtime->status->state) { 1220 switch (runtime->status->state) {
1200 case SNDRV_PCM_STATE_RUNNING: 1221 case SNDRV_PCM_STATE_RUNNING:
1201 case SNDRV_PCM_STATE_PREPARED: 1222 case SNDRV_PCM_STATE_PREPARED:
@@ -1207,23 +1228,24 @@ static int snd_pcm_pre_reset(snd_pcm_substream_t * substream, int state)
1207 } 1228 }
1208} 1229}
1209 1230
1210static int snd_pcm_do_reset(snd_pcm_substream_t * substream, int state) 1231static int snd_pcm_do_reset(struct snd_pcm_substream *substream, int state)
1211{ 1232{
1212 snd_pcm_runtime_t *runtime = substream->runtime; 1233 struct snd_pcm_runtime *runtime = substream->runtime;
1213 int err = substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_RESET, NULL); 1234 int err = substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_RESET, NULL);
1214 if (err < 0) 1235 if (err < 0)
1215 return err; 1236 return err;
1216 // snd_assert(runtime->status->hw_ptr < runtime->buffer_size, ); 1237 // snd_assert(runtime->status->hw_ptr < runtime->buffer_size, );
1217 runtime->hw_ptr_base = 0; 1238 runtime->hw_ptr_base = 0;
1218 runtime->hw_ptr_interrupt = runtime->status->hw_ptr - runtime->status->hw_ptr % runtime->period_size; 1239 runtime->hw_ptr_interrupt = runtime->status->hw_ptr -
1240 runtime->status->hw_ptr % runtime->period_size;
1219 runtime->silence_start = runtime->status->hw_ptr; 1241 runtime->silence_start = runtime->status->hw_ptr;
1220 runtime->silence_filled = 0; 1242 runtime->silence_filled = 0;
1221 return 0; 1243 return 0;
1222} 1244}
1223 1245
1224static void snd_pcm_post_reset(snd_pcm_substream_t * substream, int state) 1246static void snd_pcm_post_reset(struct snd_pcm_substream *substream, int state)
1225{ 1247{
1226 snd_pcm_runtime_t *runtime = substream->runtime; 1248 struct snd_pcm_runtime *runtime = substream->runtime;
1227 runtime->control->appl_ptr = runtime->status->hw_ptr; 1249 runtime->control->appl_ptr = runtime->status->hw_ptr;
1228 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 1250 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
1229 runtime->silence_size > 0) 1251 runtime->silence_size > 0)
@@ -1236,7 +1258,7 @@ static struct action_ops snd_pcm_action_reset = {
1236 .post_action = snd_pcm_post_reset 1258 .post_action = snd_pcm_post_reset
1237}; 1259};
1238 1260
1239static int snd_pcm_reset(snd_pcm_substream_t *substream) 1261static int snd_pcm_reset(struct snd_pcm_substream *substream)
1240{ 1262{
1241 return snd_pcm_action_nonatomic(&snd_pcm_action_reset, substream, 0); 1263 return snd_pcm_action_nonatomic(&snd_pcm_action_reset, substream, 0);
1242} 1264}
@@ -1244,9 +1266,9 @@ static int snd_pcm_reset(snd_pcm_substream_t *substream)
1244/* 1266/*
1245 * prepare ioctl 1267 * prepare ioctl
1246 */ 1268 */
1247static int snd_pcm_pre_prepare(snd_pcm_substream_t * substream, int state) 1269static int snd_pcm_pre_prepare(struct snd_pcm_substream *substream, int state)
1248{ 1270{
1249 snd_pcm_runtime_t *runtime = substream->runtime; 1271 struct snd_pcm_runtime *runtime = substream->runtime;
1250 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 1272 if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
1251 return -EBADFD; 1273 return -EBADFD;
1252 if (snd_pcm_running(substream)) 1274 if (snd_pcm_running(substream))
@@ -1254,7 +1276,7 @@ static int snd_pcm_pre_prepare(snd_pcm_substream_t * substream, int state)
1254 return 0; 1276 return 0;
1255} 1277}
1256 1278
1257static int snd_pcm_do_prepare(snd_pcm_substream_t * substream, int state) 1279static int snd_pcm_do_prepare(struct snd_pcm_substream *substream, int state)
1258{ 1280{
1259 int err; 1281 int err;
1260 err = substream->ops->prepare(substream); 1282 err = substream->ops->prepare(substream);
@@ -1263,9 +1285,9 @@ static int snd_pcm_do_prepare(snd_pcm_substream_t * substream, int state)
1263 return snd_pcm_do_reset(substream, 0); 1285 return snd_pcm_do_reset(substream, 0);
1264} 1286}
1265 1287
1266static void snd_pcm_post_prepare(snd_pcm_substream_t * substream, int state) 1288static void snd_pcm_post_prepare(struct snd_pcm_substream *substream, int state)
1267{ 1289{
1268 snd_pcm_runtime_t *runtime = substream->runtime; 1290 struct snd_pcm_runtime *runtime = substream->runtime;
1269 runtime->control->appl_ptr = runtime->status->hw_ptr; 1291 runtime->control->appl_ptr = runtime->status->hw_ptr;
1270 runtime->status->state = SNDRV_PCM_STATE_PREPARED; 1292 runtime->status->state = SNDRV_PCM_STATE_PREPARED;
1271} 1293}
@@ -1282,10 +1304,10 @@ static struct action_ops snd_pcm_action_prepare = {
1282 * 1304 *
1283 * Prepare the PCM substream to be triggerable. 1305 * Prepare the PCM substream to be triggerable.
1284 */ 1306 */
1285int snd_pcm_prepare(snd_pcm_substream_t *substream) 1307int snd_pcm_prepare(struct snd_pcm_substream *substream)
1286{ 1308{
1287 int res; 1309 int res;
1288 snd_card_t *card = substream->pcm->card; 1310 struct snd_card *card = substream->pcm->card;
1289 1311
1290 snd_power_lock(card); 1312 snd_power_lock(card);
1291 if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile)) >= 0) 1313 if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile)) >= 0)
@@ -1298,7 +1320,7 @@ int snd_pcm_prepare(snd_pcm_substream_t *substream)
1298 * drain ioctl 1320 * drain ioctl
1299 */ 1321 */
1300 1322
1301static int snd_pcm_pre_drain_init(snd_pcm_substream_t * substream, int state) 1323static int snd_pcm_pre_drain_init(struct snd_pcm_substream *substream, int state)
1302{ 1324{
1303 if (substream->ffile->f_flags & O_NONBLOCK) 1325 if (substream->ffile->f_flags & O_NONBLOCK)
1304 return -EAGAIN; 1326 return -EAGAIN;
@@ -1306,9 +1328,9 @@ static int snd_pcm_pre_drain_init(snd_pcm_substream_t * substream, int state)
1306 return 0; 1328 return 0;
1307} 1329}
1308 1330
1309static int snd_pcm_do_drain_init(snd_pcm_substream_t * substream, int state) 1331static int snd_pcm_do_drain_init(struct snd_pcm_substream *substream, int state)
1310{ 1332{
1311 snd_pcm_runtime_t *runtime = substream->runtime; 1333 struct snd_pcm_runtime *runtime = substream->runtime;
1312 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 1334 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
1313 switch (runtime->status->state) { 1335 switch (runtime->status->state) {
1314 case SNDRV_PCM_STATE_PREPARED: 1336 case SNDRV_PCM_STATE_PREPARED:
@@ -1336,7 +1358,7 @@ static int snd_pcm_do_drain_init(snd_pcm_substream_t * substream, int state)
1336 return 0; 1358 return 0;
1337} 1359}
1338 1360
1339static void snd_pcm_post_drain_init(snd_pcm_substream_t * substream, int state) 1361static void snd_pcm_post_drain_init(struct snd_pcm_substream *substream, int state)
1340{ 1362{
1341} 1363}
1342 1364
@@ -1347,12 +1369,12 @@ static struct action_ops snd_pcm_action_drain_init = {
1347}; 1369};
1348 1370
1349struct drain_rec { 1371struct drain_rec {
1350 snd_pcm_substream_t *substream; 1372 struct snd_pcm_substream *substream;
1351 wait_queue_t wait; 1373 wait_queue_t wait;
1352 snd_pcm_uframes_t stop_threshold; 1374 snd_pcm_uframes_t stop_threshold;
1353}; 1375};
1354 1376
1355static int snd_pcm_drop(snd_pcm_substream_t *substream); 1377static int snd_pcm_drop(struct snd_pcm_substream *substream);
1356 1378
1357/* 1379/*
1358 * Drain the stream(s). 1380 * Drain the stream(s).
@@ -1361,10 +1383,10 @@ static int snd_pcm_drop(snd_pcm_substream_t *substream);
1361 * After this call, all streams are supposed to be either SETUP or DRAINING 1383 * After this call, all streams are supposed to be either SETUP or DRAINING
1362 * (capture only) state. 1384 * (capture only) state.
1363 */ 1385 */
1364static int snd_pcm_drain(snd_pcm_substream_t *substream) 1386static int snd_pcm_drain(struct snd_pcm_substream *substream)
1365{ 1387{
1366 snd_card_t *card; 1388 struct snd_card *card;
1367 snd_pcm_runtime_t *runtime; 1389 struct snd_pcm_runtime *runtime;
1368 struct list_head *pos; 1390 struct list_head *pos;
1369 int result = 0; 1391 int result = 0;
1370 int i, num_drecs; 1392 int i, num_drecs;
@@ -1401,7 +1423,7 @@ static int snd_pcm_drain(snd_pcm_substream_t *substream)
1401 /* count only playback streams */ 1423 /* count only playback streams */
1402 num_drecs = 0; 1424 num_drecs = 0;
1403 snd_pcm_group_for_each(pos, substream) { 1425 snd_pcm_group_for_each(pos, substream) {
1404 snd_pcm_substream_t *s = snd_pcm_group_substream_entry(pos); 1426 struct snd_pcm_substream *s = snd_pcm_group_substream_entry(pos);
1405 runtime = s->runtime; 1427 runtime = s->runtime;
1406 if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { 1428 if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) {
1407 d = &drec[num_drecs++]; 1429 d = &drec[num_drecs++];
@@ -1487,10 +1509,10 @@ static int snd_pcm_drain(snd_pcm_substream_t *substream)
1487 * 1509 *
1488 * Immediately put all linked substreams into SETUP state. 1510 * Immediately put all linked substreams into SETUP state.
1489 */ 1511 */
1490static int snd_pcm_drop(snd_pcm_substream_t *substream) 1512static int snd_pcm_drop(struct snd_pcm_substream *substream)
1491{ 1513{
1492 snd_pcm_runtime_t *runtime; 1514 struct snd_pcm_runtime *runtime;
1493 snd_card_t *card; 1515 struct snd_card *card;
1494 int result = 0; 1516 int result = 0;
1495 1517
1496 snd_assert(substream != NULL, return -ENXIO); 1518 snd_assert(substream != NULL, return -ENXIO);
@@ -1548,12 +1570,12 @@ static struct file *snd_pcm_file_fd(int fd)
1548/* 1570/*
1549 * PCM link handling 1571 * PCM link handling
1550 */ 1572 */
1551static int snd_pcm_link(snd_pcm_substream_t *substream, int fd) 1573static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
1552{ 1574{
1553 int res = 0; 1575 int res = 0;
1554 struct file *file; 1576 struct file *file;
1555 snd_pcm_file_t *pcm_file; 1577 struct snd_pcm_file *pcm_file;
1556 snd_pcm_substream_t *substream1; 1578 struct snd_pcm_substream *substream1;
1557 1579
1558 file = snd_pcm_file_fd(fd); 1580 file = snd_pcm_file_fd(fd);
1559 if (!file) 1581 if (!file)
@@ -1572,7 +1594,7 @@ static int snd_pcm_link(snd_pcm_substream_t *substream, int fd)
1572 goto _end; 1594 goto _end;
1573 } 1595 }
1574 if (!snd_pcm_stream_linked(substream)) { 1596 if (!snd_pcm_stream_linked(substream)) {
1575 substream->group = kmalloc(sizeof(snd_pcm_group_t), GFP_ATOMIC); 1597 substream->group = kmalloc(sizeof(struct snd_pcm_group), GFP_ATOMIC);
1576 if (substream->group == NULL) { 1598 if (substream->group == NULL) {
1577 res = -ENOMEM; 1599 res = -ENOMEM;
1578 goto _end; 1600 goto _end;
@@ -1592,14 +1614,14 @@ static int snd_pcm_link(snd_pcm_substream_t *substream, int fd)
1592 return res; 1614 return res;
1593} 1615}
1594 1616
1595static void relink_to_local(snd_pcm_substream_t *substream) 1617static void relink_to_local(struct snd_pcm_substream *substream)
1596{ 1618{
1597 substream->group = &substream->self_group; 1619 substream->group = &substream->self_group;
1598 INIT_LIST_HEAD(&substream->self_group.substreams); 1620 INIT_LIST_HEAD(&substream->self_group.substreams);
1599 list_add_tail(&substream->link_list, &substream->self_group.substreams); 1621 list_add_tail(&substream->link_list, &substream->self_group.substreams);
1600} 1622}
1601 1623
1602static int snd_pcm_unlink(snd_pcm_substream_t *substream) 1624static int snd_pcm_unlink(struct snd_pcm_substream *substream)
1603{ 1625{
1604 struct list_head *pos; 1626 struct list_head *pos;
1605 int res = 0; 1627 int res = 0;
@@ -1629,51 +1651,51 @@ static int snd_pcm_unlink(snd_pcm_substream_t *substream)
1629/* 1651/*
1630 * hw configurator 1652 * hw configurator
1631 */ 1653 */
1632static int snd_pcm_hw_rule_mul(snd_pcm_hw_params_t *params, 1654static int snd_pcm_hw_rule_mul(struct snd_pcm_hw_params *params,
1633 snd_pcm_hw_rule_t *rule) 1655 struct snd_pcm_hw_rule *rule)
1634{ 1656{
1635 snd_interval_t t; 1657 struct snd_interval t;
1636 snd_interval_mul(hw_param_interval_c(params, rule->deps[0]), 1658 snd_interval_mul(hw_param_interval_c(params, rule->deps[0]),
1637 hw_param_interval_c(params, rule->deps[1]), &t); 1659 hw_param_interval_c(params, rule->deps[1]), &t);
1638 return snd_interval_refine(hw_param_interval(params, rule->var), &t); 1660 return snd_interval_refine(hw_param_interval(params, rule->var), &t);
1639} 1661}
1640 1662
1641static int snd_pcm_hw_rule_div(snd_pcm_hw_params_t *params, 1663static int snd_pcm_hw_rule_div(struct snd_pcm_hw_params *params,
1642 snd_pcm_hw_rule_t *rule) 1664 struct snd_pcm_hw_rule *rule)
1643{ 1665{
1644 snd_interval_t t; 1666 struct snd_interval t;
1645 snd_interval_div(hw_param_interval_c(params, rule->deps[0]), 1667 snd_interval_div(hw_param_interval_c(params, rule->deps[0]),
1646 hw_param_interval_c(params, rule->deps[1]), &t); 1668 hw_param_interval_c(params, rule->deps[1]), &t);
1647 return snd_interval_refine(hw_param_interval(params, rule->var), &t); 1669 return snd_interval_refine(hw_param_interval(params, rule->var), &t);
1648} 1670}
1649 1671
1650static int snd_pcm_hw_rule_muldivk(snd_pcm_hw_params_t *params, 1672static int snd_pcm_hw_rule_muldivk(struct snd_pcm_hw_params *params,
1651 snd_pcm_hw_rule_t *rule) 1673 struct snd_pcm_hw_rule *rule)
1652{ 1674{
1653 snd_interval_t t; 1675 struct snd_interval t;
1654 snd_interval_muldivk(hw_param_interval_c(params, rule->deps[0]), 1676 snd_interval_muldivk(hw_param_interval_c(params, rule->deps[0]),
1655 hw_param_interval_c(params, rule->deps[1]), 1677 hw_param_interval_c(params, rule->deps[1]),
1656 (unsigned long) rule->private, &t); 1678 (unsigned long) rule->private, &t);
1657 return snd_interval_refine(hw_param_interval(params, rule->var), &t); 1679 return snd_interval_refine(hw_param_interval(params, rule->var), &t);
1658} 1680}
1659 1681
1660static int snd_pcm_hw_rule_mulkdiv(snd_pcm_hw_params_t *params, 1682static int snd_pcm_hw_rule_mulkdiv(struct snd_pcm_hw_params *params,
1661 snd_pcm_hw_rule_t *rule) 1683 struct snd_pcm_hw_rule *rule)
1662{ 1684{
1663 snd_interval_t t; 1685 struct snd_interval t;
1664 snd_interval_mulkdiv(hw_param_interval_c(params, rule->deps[0]), 1686 snd_interval_mulkdiv(hw_param_interval_c(params, rule->deps[0]),
1665 (unsigned long) rule->private, 1687 (unsigned long) rule->private,
1666 hw_param_interval_c(params, rule->deps[1]), &t); 1688 hw_param_interval_c(params, rule->deps[1]), &t);
1667 return snd_interval_refine(hw_param_interval(params, rule->var), &t); 1689 return snd_interval_refine(hw_param_interval(params, rule->var), &t);
1668} 1690}
1669 1691
1670static int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params, 1692static int snd_pcm_hw_rule_format(struct snd_pcm_hw_params *params,
1671 snd_pcm_hw_rule_t *rule) 1693 struct snd_pcm_hw_rule *rule)
1672{ 1694{
1673 unsigned int k; 1695 unsigned int k;
1674 snd_interval_t *i = hw_param_interval(params, rule->deps[0]); 1696 struct snd_interval *i = hw_param_interval(params, rule->deps[0]);
1675 snd_mask_t m; 1697 struct snd_mask m;
1676 snd_mask_t *mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 1698 struct snd_mask *mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
1677 snd_mask_any(&m); 1699 snd_mask_any(&m);
1678 for (k = 0; k <= SNDRV_PCM_FORMAT_LAST; ++k) { 1700 for (k = 0; k <= SNDRV_PCM_FORMAT_LAST; ++k) {
1679 int bits; 1701 int bits;
@@ -1688,10 +1710,10 @@ static int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
1688 return snd_mask_refine(mask, &m); 1710 return snd_mask_refine(mask, &m);
1689} 1711}
1690 1712
1691static int snd_pcm_hw_rule_sample_bits(snd_pcm_hw_params_t *params, 1713static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
1692 snd_pcm_hw_rule_t *rule) 1714 struct snd_pcm_hw_rule *rule)
1693{ 1715{
1694 snd_interval_t t; 1716 struct snd_interval t;
1695 unsigned int k; 1717 unsigned int k;
1696 t.min = UINT_MAX; 1718 t.min = UINT_MAX;
1697 t.max = 0; 1719 t.max = 0;
@@ -1720,19 +1742,19 @@ static int snd_pcm_hw_rule_sample_bits(snd_pcm_hw_params_t *params,
1720static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100, 1742static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
1721 48000, 64000, 88200, 96000, 176400, 192000 }; 1743 48000, 64000, 88200, 96000, 176400, 192000 };
1722 1744
1723static int snd_pcm_hw_rule_rate(snd_pcm_hw_params_t *params, 1745static int snd_pcm_hw_rule_rate(struct snd_pcm_hw_params *params,
1724 snd_pcm_hw_rule_t *rule) 1746 struct snd_pcm_hw_rule *rule)
1725{ 1747{
1726 snd_pcm_hardware_t *hw = rule->private; 1748 struct snd_pcm_hardware *hw = rule->private;
1727 return snd_interval_list(hw_param_interval(params, rule->var), 1749 return snd_interval_list(hw_param_interval(params, rule->var),
1728 ARRAY_SIZE(rates), rates, hw->rates); 1750 ARRAY_SIZE(rates), rates, hw->rates);
1729} 1751}
1730 1752
1731static int snd_pcm_hw_rule_buffer_bytes_max(snd_pcm_hw_params_t *params, 1753static int snd_pcm_hw_rule_buffer_bytes_max(struct snd_pcm_hw_params *params,
1732 snd_pcm_hw_rule_t *rule) 1754 struct snd_pcm_hw_rule *rule)
1733{ 1755{
1734 snd_interval_t t; 1756 struct snd_interval t;
1735 snd_pcm_substream_t *substream = rule->private; 1757 struct snd_pcm_substream *substream = rule->private;
1736 t.min = 0; 1758 t.min = 0;
1737 t.max = substream->buffer_bytes_max; 1759 t.max = substream->buffer_bytes_max;
1738 t.openmin = 0; 1760 t.openmin = 0;
@@ -1741,10 +1763,10 @@ static int snd_pcm_hw_rule_buffer_bytes_max(snd_pcm_hw_params_t *params,
1741 return snd_interval_refine(hw_param_interval(params, rule->var), &t); 1763 return snd_interval_refine(hw_param_interval(params, rule->var), &t);
1742} 1764}
1743 1765
1744int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream) 1766int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
1745{ 1767{
1746 snd_pcm_runtime_t *runtime = substream->runtime; 1768 struct snd_pcm_runtime *runtime = substream->runtime;
1747 snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; 1769 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
1748 int k, err; 1770 int k, err;
1749 1771
1750 for (k = SNDRV_PCM_HW_PARAM_FIRST_MASK; k <= SNDRV_PCM_HW_PARAM_LAST_MASK; k++) { 1772 for (k = SNDRV_PCM_HW_PARAM_FIRST_MASK; k <= SNDRV_PCM_HW_PARAM_LAST_MASK; k++) {
@@ -1865,10 +1887,10 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
1865 return 0; 1887 return 0;
1866} 1888}
1867 1889
1868int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream) 1890int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)
1869{ 1891{
1870 snd_pcm_runtime_t *runtime = substream->runtime; 1892 struct snd_pcm_runtime *runtime = substream->runtime;
1871 snd_pcm_hardware_t *hw = &runtime->hw; 1893 struct snd_pcm_hardware *hw = &runtime->hw;
1872 int err; 1894 int err;
1873 unsigned int mask = 0; 1895 unsigned int mask = 0;
1874 1896
@@ -1941,17 +1963,17 @@ int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream)
1941 return 0; 1963 return 0;
1942} 1964}
1943 1965
1944static void snd_pcm_add_file(snd_pcm_str_t *str, 1966static void snd_pcm_add_file(struct snd_pcm_str *str,
1945 snd_pcm_file_t *pcm_file) 1967 struct snd_pcm_file *pcm_file)
1946{ 1968{
1947 pcm_file->next = str->files; 1969 pcm_file->next = str->files;
1948 str->files = pcm_file; 1970 str->files = pcm_file;
1949} 1971}
1950 1972
1951static void snd_pcm_remove_file(snd_pcm_str_t *str, 1973static void snd_pcm_remove_file(struct snd_pcm_str *str,
1952 snd_pcm_file_t *pcm_file) 1974 struct snd_pcm_file *pcm_file)
1953{ 1975{
1954 snd_pcm_file_t * pcm_file1; 1976 struct snd_pcm_file * pcm_file1;
1955 if (str->files == pcm_file) { 1977 if (str->files == pcm_file) {
1956 str->files = pcm_file->next; 1978 str->files = pcm_file->next;
1957 } else { 1979 } else {
@@ -1963,11 +1985,11 @@ static void snd_pcm_remove_file(snd_pcm_str_t *str,
1963 } 1985 }
1964} 1986}
1965 1987
1966static int snd_pcm_release_file(snd_pcm_file_t * pcm_file) 1988static int snd_pcm_release_file(struct snd_pcm_file * pcm_file)
1967{ 1989{
1968 snd_pcm_substream_t *substream; 1990 struct snd_pcm_substream *substream;
1969 snd_pcm_runtime_t *runtime; 1991 struct snd_pcm_runtime *runtime;
1970 snd_pcm_str_t * str; 1992 struct snd_pcm_str * str;
1971 1993
1972 snd_assert(pcm_file != NULL, return -ENXIO); 1994 snd_assert(pcm_file != NULL, return -ENXIO);
1973 substream = pcm_file->substream; 1995 substream = pcm_file->substream;
@@ -1988,14 +2010,14 @@ static int snd_pcm_release_file(snd_pcm_file_t * pcm_file)
1988} 2010}
1989 2011
1990static int snd_pcm_open_file(struct file *file, 2012static int snd_pcm_open_file(struct file *file,
1991 snd_pcm_t *pcm, 2013 struct snd_pcm *pcm,
1992 int stream, 2014 int stream,
1993 snd_pcm_file_t **rpcm_file) 2015 struct snd_pcm_file **rpcm_file)
1994{ 2016{
1995 int err = 0; 2017 int err = 0;
1996 snd_pcm_file_t *pcm_file; 2018 struct snd_pcm_file *pcm_file;
1997 snd_pcm_substream_t *substream; 2019 struct snd_pcm_substream *substream;
1998 snd_pcm_str_t *str; 2020 struct snd_pcm_str *str;
1999 2021
2000 snd_assert(rpcm_file != NULL, return -EINVAL); 2022 snd_assert(rpcm_file != NULL, return -EINVAL);
2001 *rpcm_file = NULL; 2023 *rpcm_file = NULL;
@@ -2048,8 +2070,8 @@ static int snd_pcm_open(struct inode *inode, struct file *file)
2048 int cardnum = SNDRV_MINOR_CARD(iminor(inode)); 2070 int cardnum = SNDRV_MINOR_CARD(iminor(inode));
2049 int device = SNDRV_MINOR_DEVICE(iminor(inode)); 2071 int device = SNDRV_MINOR_DEVICE(iminor(inode));
2050 int err; 2072 int err;
2051 snd_pcm_t *pcm; 2073 struct snd_pcm *pcm;
2052 snd_pcm_file_t *pcm_file; 2074 struct snd_pcm_file *pcm_file;
2053 wait_queue_t wait; 2075 wait_queue_t wait;
2054 2076
2055 if (device < SNDRV_MINOR_PCM_PLAYBACK || device >= SNDRV_MINOR_DEVICES) 2077 if (device < SNDRV_MINOR_PCM_PLAYBACK || device >= SNDRV_MINOR_DEVICES)
@@ -2105,9 +2127,9 @@ static int snd_pcm_open(struct inode *inode, struct file *file)
2105 2127
2106static int snd_pcm_release(struct inode *inode, struct file *file) 2128static int snd_pcm_release(struct inode *inode, struct file *file)
2107{ 2129{
2108 snd_pcm_t *pcm; 2130 struct snd_pcm *pcm;
2109 snd_pcm_substream_t *substream; 2131 struct snd_pcm_substream *substream;
2110 snd_pcm_file_t *pcm_file; 2132 struct snd_pcm_file *pcm_file;
2111 2133
2112 pcm_file = file->private_data; 2134 pcm_file = file->private_data;
2113 substream = pcm_file->substream; 2135 substream = pcm_file->substream;
@@ -2125,9 +2147,10 @@ static int snd_pcm_release(struct inode *inode, struct file *file)
2125 return 0; 2147 return 0;
2126} 2148}
2127 2149
2128static snd_pcm_sframes_t snd_pcm_playback_rewind(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) 2150static snd_pcm_sframes_t snd_pcm_playback_rewind(struct snd_pcm_substream *substream,
2151 snd_pcm_uframes_t frames)
2129{ 2152{
2130 snd_pcm_runtime_t *runtime = substream->runtime; 2153 struct snd_pcm_runtime *runtime = substream->runtime;
2131 snd_pcm_sframes_t appl_ptr; 2154 snd_pcm_sframes_t appl_ptr;
2132 snd_pcm_sframes_t ret; 2155 snd_pcm_sframes_t ret;
2133 snd_pcm_sframes_t hw_avail; 2156 snd_pcm_sframes_t hw_avail;
@@ -2174,9 +2197,10 @@ static snd_pcm_sframes_t snd_pcm_playback_rewind(snd_pcm_substream_t *substream,
2174 return ret; 2197 return ret;
2175} 2198}
2176 2199
2177static snd_pcm_sframes_t snd_pcm_capture_rewind(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) 2200static snd_pcm_sframes_t snd_pcm_capture_rewind(struct snd_pcm_substream *substream,
2201 snd_pcm_uframes_t frames)
2178{ 2202{
2179 snd_pcm_runtime_t *runtime = substream->runtime; 2203 struct snd_pcm_runtime *runtime = substream->runtime;
2180 snd_pcm_sframes_t appl_ptr; 2204 snd_pcm_sframes_t appl_ptr;
2181 snd_pcm_sframes_t ret; 2205 snd_pcm_sframes_t ret;
2182 snd_pcm_sframes_t hw_avail; 2206 snd_pcm_sframes_t hw_avail;
@@ -2223,9 +2247,10 @@ static snd_pcm_sframes_t snd_pcm_capture_rewind(snd_pcm_substream_t *substream,
2223 return ret; 2247 return ret;
2224} 2248}
2225 2249
2226static snd_pcm_sframes_t snd_pcm_playback_forward(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) 2250static snd_pcm_sframes_t snd_pcm_playback_forward(struct snd_pcm_substream *substream,
2251 snd_pcm_uframes_t frames)
2227{ 2252{
2228 snd_pcm_runtime_t *runtime = substream->runtime; 2253 struct snd_pcm_runtime *runtime = substream->runtime;
2229 snd_pcm_sframes_t appl_ptr; 2254 snd_pcm_sframes_t appl_ptr;
2230 snd_pcm_sframes_t ret; 2255 snd_pcm_sframes_t ret;
2231 snd_pcm_sframes_t avail; 2256 snd_pcm_sframes_t avail;
@@ -2273,9 +2298,10 @@ static snd_pcm_sframes_t snd_pcm_playback_forward(snd_pcm_substream_t *substream
2273 return ret; 2298 return ret;
2274} 2299}
2275 2300
2276static snd_pcm_sframes_t snd_pcm_capture_forward(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) 2301static snd_pcm_sframes_t snd_pcm_capture_forward(struct snd_pcm_substream *substream,
2302 snd_pcm_uframes_t frames)
2277{ 2303{
2278 snd_pcm_runtime_t *runtime = substream->runtime; 2304 struct snd_pcm_runtime *runtime = substream->runtime;
2279 snd_pcm_sframes_t appl_ptr; 2305 snd_pcm_sframes_t appl_ptr;
2280 snd_pcm_sframes_t ret; 2306 snd_pcm_sframes_t ret;
2281 snd_pcm_sframes_t avail; 2307 snd_pcm_sframes_t avail;
@@ -2323,9 +2349,9 @@ static snd_pcm_sframes_t snd_pcm_capture_forward(snd_pcm_substream_t *substream,
2323 return ret; 2349 return ret;
2324} 2350}
2325 2351
2326static int snd_pcm_hwsync(snd_pcm_substream_t *substream) 2352static int snd_pcm_hwsync(struct snd_pcm_substream *substream)
2327{ 2353{
2328 snd_pcm_runtime_t *runtime = substream->runtime; 2354 struct snd_pcm_runtime *runtime = substream->runtime;
2329 int err; 2355 int err;
2330 2356
2331 snd_pcm_stream_lock_irq(substream); 2357 snd_pcm_stream_lock_irq(substream);
@@ -2353,9 +2379,10 @@ static int snd_pcm_hwsync(snd_pcm_substream_t *substream)
2353 return err; 2379 return err;
2354} 2380}
2355 2381
2356static int snd_pcm_delay(snd_pcm_substream_t *substream, snd_pcm_sframes_t __user *res) 2382static int snd_pcm_delay(struct snd_pcm_substream *substream,
2383 snd_pcm_sframes_t __user *res)
2357{ 2384{
2358 snd_pcm_runtime_t *runtime = substream->runtime; 2385 struct snd_pcm_runtime *runtime = substream->runtime;
2359 int err; 2386 int err;
2360 snd_pcm_sframes_t n = 0; 2387 snd_pcm_sframes_t n = 0;
2361 2388
@@ -2391,18 +2418,19 @@ static int snd_pcm_delay(snd_pcm_substream_t *substream, snd_pcm_sframes_t __use
2391 return err; 2418 return err;
2392} 2419}
2393 2420
2394static int snd_pcm_sync_ptr(snd_pcm_substream_t *substream, struct sndrv_pcm_sync_ptr __user *_sync_ptr) 2421static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream,
2422 struct snd_pcm_sync_ptr __user *_sync_ptr)
2395{ 2423{
2396 snd_pcm_runtime_t *runtime = substream->runtime; 2424 struct snd_pcm_runtime *runtime = substream->runtime;
2397 struct sndrv_pcm_sync_ptr sync_ptr; 2425 struct snd_pcm_sync_ptr sync_ptr;
2398 volatile struct sndrv_pcm_mmap_status *status; 2426 volatile struct snd_pcm_mmap_status *status;
2399 volatile struct sndrv_pcm_mmap_control *control; 2427 volatile struct snd_pcm_mmap_control *control;
2400 int err; 2428 int err;
2401 2429
2402 memset(&sync_ptr, 0, sizeof(sync_ptr)); 2430 memset(&sync_ptr, 0, sizeof(sync_ptr));
2403 if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags))) 2431 if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags)))
2404 return -EFAULT; 2432 return -EFAULT;
2405 if (copy_from_user(&sync_ptr.c.control, &(_sync_ptr->c.control), sizeof(struct sndrv_pcm_mmap_control))) 2433 if (copy_from_user(&sync_ptr.c.control, &(_sync_ptr->c.control), sizeof(struct snd_pcm_mmap_control)))
2406 return -EFAULT; 2434 return -EFAULT;
2407 status = runtime->status; 2435 status = runtime->status;
2408 control = runtime->control; 2436 control = runtime->control;
@@ -2430,12 +2458,12 @@ static int snd_pcm_sync_ptr(snd_pcm_substream_t *substream, struct sndrv_pcm_syn
2430 return 0; 2458 return 0;
2431} 2459}
2432 2460
2433static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream, 2461static int snd_pcm_playback_ioctl1(struct snd_pcm_substream *substream,
2434 unsigned int cmd, void __user *arg); 2462 unsigned int cmd, void __user *arg);
2435static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream, 2463static int snd_pcm_capture_ioctl1(struct snd_pcm_substream *substream,
2436 unsigned int cmd, void __user *arg); 2464 unsigned int cmd, void __user *arg);
2437 2465
2438static int snd_pcm_common_ioctl1(snd_pcm_substream_t *substream, 2466static int snd_pcm_common_ioctl1(struct snd_pcm_substream *substream,
2439 unsigned int cmd, void __user *arg) 2467 unsigned int cmd, void __user *arg)
2440{ 2468{
2441 snd_assert(substream != NULL, return -ENXIO); 2469 snd_assert(substream != NULL, return -ENXIO);
@@ -2492,7 +2520,7 @@ static int snd_pcm_common_ioctl1(snd_pcm_substream_t *substream,
2492 return -ENOTTY; 2520 return -ENOTTY;
2493} 2521}
2494 2522
2495static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream, 2523static int snd_pcm_playback_ioctl1(struct snd_pcm_substream *substream,
2496 unsigned int cmd, void __user *arg) 2524 unsigned int cmd, void __user *arg)
2497{ 2525{
2498 snd_assert(substream != NULL, return -ENXIO); 2526 snd_assert(substream != NULL, return -ENXIO);
@@ -2500,9 +2528,9 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
2500 switch (cmd) { 2528 switch (cmd) {
2501 case SNDRV_PCM_IOCTL_WRITEI_FRAMES: 2529 case SNDRV_PCM_IOCTL_WRITEI_FRAMES:
2502 { 2530 {
2503 snd_xferi_t xferi; 2531 struct snd_xferi xferi;
2504 snd_xferi_t __user *_xferi = arg; 2532 struct snd_xferi __user *_xferi = arg;
2505 snd_pcm_runtime_t *runtime = substream->runtime; 2533 struct snd_pcm_runtime *runtime = substream->runtime;
2506 snd_pcm_sframes_t result; 2534 snd_pcm_sframes_t result;
2507 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 2535 if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
2508 return -EBADFD; 2536 return -EBADFD;
@@ -2516,9 +2544,9 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
2516 } 2544 }
2517 case SNDRV_PCM_IOCTL_WRITEN_FRAMES: 2545 case SNDRV_PCM_IOCTL_WRITEN_FRAMES:
2518 { 2546 {
2519 snd_xfern_t xfern; 2547 struct snd_xfern xfern;
2520 snd_xfern_t __user *_xfern = arg; 2548 struct snd_xfern __user *_xfern = arg;
2521 snd_pcm_runtime_t *runtime = substream->runtime; 2549 struct snd_pcm_runtime *runtime = substream->runtime;
2522 void __user **bufs; 2550 void __user **bufs;
2523 snd_pcm_sframes_t result; 2551 snd_pcm_sframes_t result;
2524 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 2552 if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
@@ -2579,7 +2607,7 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
2579 return snd_pcm_common_ioctl1(substream, cmd, arg); 2607 return snd_pcm_common_ioctl1(substream, cmd, arg);
2580} 2608}
2581 2609
2582static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream, 2610static int snd_pcm_capture_ioctl1(struct snd_pcm_substream *substream,
2583 unsigned int cmd, void __user *arg) 2611 unsigned int cmd, void __user *arg)
2584{ 2612{
2585 snd_assert(substream != NULL, return -ENXIO); 2613 snd_assert(substream != NULL, return -ENXIO);
@@ -2587,9 +2615,9 @@ static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
2587 switch (cmd) { 2615 switch (cmd) {
2588 case SNDRV_PCM_IOCTL_READI_FRAMES: 2616 case SNDRV_PCM_IOCTL_READI_FRAMES:
2589 { 2617 {
2590 snd_xferi_t xferi; 2618 struct snd_xferi xferi;
2591 snd_xferi_t __user *_xferi = arg; 2619 struct snd_xferi __user *_xferi = arg;
2592 snd_pcm_runtime_t *runtime = substream->runtime; 2620 struct snd_pcm_runtime *runtime = substream->runtime;
2593 snd_pcm_sframes_t result; 2621 snd_pcm_sframes_t result;
2594 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 2622 if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
2595 return -EBADFD; 2623 return -EBADFD;
@@ -2603,9 +2631,9 @@ static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
2603 } 2631 }
2604 case SNDRV_PCM_IOCTL_READN_FRAMES: 2632 case SNDRV_PCM_IOCTL_READN_FRAMES:
2605 { 2633 {
2606 snd_xfern_t xfern; 2634 struct snd_xfern xfern;
2607 snd_xfern_t __user *_xfern = arg; 2635 struct snd_xfern __user *_xfern = arg;
2608 snd_pcm_runtime_t *runtime = substream->runtime; 2636 struct snd_pcm_runtime *runtime = substream->runtime;
2609 void *bufs; 2637 void *bufs;
2610 snd_pcm_sframes_t result; 2638 snd_pcm_sframes_t result;
2611 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) 2639 if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
@@ -2658,9 +2686,10 @@ static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
2658 return snd_pcm_common_ioctl1(substream, cmd, arg); 2686 return snd_pcm_common_ioctl1(substream, cmd, arg);
2659} 2687}
2660 2688
2661static long snd_pcm_playback_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 2689static long snd_pcm_playback_ioctl(struct file *file, unsigned int cmd,
2690 unsigned long arg)
2662{ 2691{
2663 snd_pcm_file_t *pcm_file; 2692 struct snd_pcm_file *pcm_file;
2664 2693
2665 pcm_file = file->private_data; 2694 pcm_file = file->private_data;
2666 2695
@@ -2670,9 +2699,10 @@ static long snd_pcm_playback_ioctl(struct file *file, unsigned int cmd, unsigned
2670 return snd_pcm_playback_ioctl1(pcm_file->substream, cmd, (void __user *)arg); 2699 return snd_pcm_playback_ioctl1(pcm_file->substream, cmd, (void __user *)arg);
2671} 2700}
2672 2701
2673static long snd_pcm_capture_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 2702static long snd_pcm_capture_ioctl(struct file *file, unsigned int cmd,
2703 unsigned long arg)
2674{ 2704{
2675 snd_pcm_file_t *pcm_file; 2705 struct snd_pcm_file *pcm_file;
2676 2706
2677 pcm_file = file->private_data; 2707 pcm_file = file->private_data;
2678 2708
@@ -2682,7 +2712,7 @@ static long snd_pcm_capture_ioctl(struct file *file, unsigned int cmd, unsigned
2682 return snd_pcm_capture_ioctl1(pcm_file->substream, cmd, (void __user *)arg); 2712 return snd_pcm_capture_ioctl1(pcm_file->substream, cmd, (void __user *)arg);
2683} 2713}
2684 2714
2685int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream, 2715int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream,
2686 unsigned int cmd, void *arg) 2716 unsigned int cmd, void *arg)
2687{ 2717{
2688 mm_segment_t fs; 2718 mm_segment_t fs;
@@ -2694,7 +2724,7 @@ int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream,
2694 return result; 2724 return result;
2695} 2725}
2696 2726
2697int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream, 2727int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream,
2698 unsigned int cmd, void *arg) 2728 unsigned int cmd, void *arg)
2699{ 2729{
2700 mm_segment_t fs; 2730 mm_segment_t fs;
@@ -2706,7 +2736,7 @@ int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream,
2706 return result; 2736 return result;
2707} 2737}
2708 2738
2709int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream, 2739int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
2710 unsigned int cmd, void *arg) 2740 unsigned int cmd, void *arg)
2711{ 2741{
2712 switch (substream->stream) { 2742 switch (substream->stream) {
@@ -2719,11 +2749,12 @@ int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream,
2719 } 2749 }
2720} 2750}
2721 2751
2722static ssize_t snd_pcm_read(struct file *file, char __user *buf, size_t count, loff_t * offset) 2752static ssize_t snd_pcm_read(struct file *file, char __user *buf, size_t count,
2753 loff_t * offset)
2723{ 2754{
2724 snd_pcm_file_t *pcm_file; 2755 struct snd_pcm_file *pcm_file;
2725 snd_pcm_substream_t *substream; 2756 struct snd_pcm_substream *substream;
2726 snd_pcm_runtime_t *runtime; 2757 struct snd_pcm_runtime *runtime;
2727 snd_pcm_sframes_t result; 2758 snd_pcm_sframes_t result;
2728 2759
2729 pcm_file = file->private_data; 2760 pcm_file = file->private_data;
@@ -2741,11 +2772,12 @@ static ssize_t snd_pcm_read(struct file *file, char __user *buf, size_t count, l
2741 return result; 2772 return result;
2742} 2773}
2743 2774
2744static ssize_t snd_pcm_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) 2775static ssize_t snd_pcm_write(struct file *file, const char __user *buf,
2776 size_t count, loff_t * offset)
2745{ 2777{
2746 snd_pcm_file_t *pcm_file; 2778 struct snd_pcm_file *pcm_file;
2747 snd_pcm_substream_t *substream; 2779 struct snd_pcm_substream *substream;
2748 snd_pcm_runtime_t *runtime; 2780 struct snd_pcm_runtime *runtime;
2749 snd_pcm_sframes_t result; 2781 snd_pcm_sframes_t result;
2750 2782
2751 pcm_file = file->private_data; 2783 pcm_file = file->private_data;
@@ -2772,9 +2804,9 @@ static ssize_t snd_pcm_readv(struct file *file, const struct iovec *_vector,
2772 unsigned long count, loff_t * offset) 2804 unsigned long count, loff_t * offset)
2773 2805
2774{ 2806{
2775 snd_pcm_file_t *pcm_file; 2807 struct snd_pcm_file *pcm_file;
2776 snd_pcm_substream_t *substream; 2808 struct snd_pcm_substream *substream;
2777 snd_pcm_runtime_t *runtime; 2809 struct snd_pcm_runtime *runtime;
2778 snd_pcm_sframes_t result; 2810 snd_pcm_sframes_t result;
2779 unsigned long i; 2811 unsigned long i;
2780 void __user **bufs; 2812 void __user **bufs;
@@ -2806,9 +2838,9 @@ static ssize_t snd_pcm_readv(struct file *file, const struct iovec *_vector,
2806static ssize_t snd_pcm_writev(struct file *file, const struct iovec *_vector, 2838static ssize_t snd_pcm_writev(struct file *file, const struct iovec *_vector,
2807 unsigned long count, loff_t * offset) 2839 unsigned long count, loff_t * offset)
2808{ 2840{
2809 snd_pcm_file_t *pcm_file; 2841 struct snd_pcm_file *pcm_file;
2810 snd_pcm_substream_t *substream; 2842 struct snd_pcm_substream *substream;
2811 snd_pcm_runtime_t *runtime; 2843 struct snd_pcm_runtime *runtime;
2812 snd_pcm_sframes_t result; 2844 snd_pcm_sframes_t result;
2813 unsigned long i; 2845 unsigned long i;
2814 void __user **bufs; 2846 void __user **bufs;
@@ -2843,9 +2875,9 @@ static ssize_t snd_pcm_writev(struct file *file, const struct iovec *_vector,
2843 2875
2844static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) 2876static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)
2845{ 2877{
2846 snd_pcm_file_t *pcm_file; 2878 struct snd_pcm_file *pcm_file;
2847 snd_pcm_substream_t *substream; 2879 struct snd_pcm_substream *substream;
2848 snd_pcm_runtime_t *runtime; 2880 struct snd_pcm_runtime *runtime;
2849 unsigned int mask; 2881 unsigned int mask;
2850 snd_pcm_uframes_t avail; 2882 snd_pcm_uframes_t avail;
2851 2883
@@ -2881,9 +2913,9 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)
2881 2913
2882static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait) 2914static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait)
2883{ 2915{
2884 snd_pcm_file_t *pcm_file; 2916 struct snd_pcm_file *pcm_file;
2885 snd_pcm_substream_t *substream; 2917 struct snd_pcm_substream *substream;
2886 snd_pcm_runtime_t *runtime; 2918 struct snd_pcm_runtime *runtime;
2887 unsigned int mask; 2919 unsigned int mask;
2888 snd_pcm_uframes_t avail; 2920 snd_pcm_uframes_t avail;
2889 2921
@@ -2933,10 +2965,11 @@ static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait)
2933/* 2965/*
2934 * mmap status record 2966 * mmap status record
2935 */ 2967 */
2936static struct page * snd_pcm_mmap_status_nopage(struct vm_area_struct *area, unsigned long address, int *type) 2968static struct page * snd_pcm_mmap_status_nopage(struct vm_area_struct *area,
2969 unsigned long address, int *type)
2937{ 2970{
2938 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; 2971 struct snd_pcm_substream *substream = area->vm_private_data;
2939 snd_pcm_runtime_t *runtime; 2972 struct snd_pcm_runtime *runtime;
2940 struct page * page; 2973 struct page * page;
2941 2974
2942 if (substream == NULL) 2975 if (substream == NULL)
@@ -2954,17 +2987,17 @@ static struct vm_operations_struct snd_pcm_vm_ops_status =
2954 .nopage = snd_pcm_mmap_status_nopage, 2987 .nopage = snd_pcm_mmap_status_nopage,
2955}; 2988};
2956 2989
2957static int snd_pcm_mmap_status(snd_pcm_substream_t *substream, struct file *file, 2990static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file,
2958 struct vm_area_struct *area) 2991 struct vm_area_struct *area)
2959{ 2992{
2960 snd_pcm_runtime_t *runtime; 2993 struct snd_pcm_runtime *runtime;
2961 long size; 2994 long size;
2962 if (!(area->vm_flags & VM_READ)) 2995 if (!(area->vm_flags & VM_READ))
2963 return -EINVAL; 2996 return -EINVAL;
2964 runtime = substream->runtime; 2997 runtime = substream->runtime;
2965 snd_assert(runtime != NULL, return -EAGAIN); 2998 snd_assert(runtime != NULL, return -EAGAIN);
2966 size = area->vm_end - area->vm_start; 2999 size = area->vm_end - area->vm_start;
2967 if (size != PAGE_ALIGN(sizeof(snd_pcm_mmap_status_t))) 3000 if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status)))
2968 return -EINVAL; 3001 return -EINVAL;
2969 area->vm_ops = &snd_pcm_vm_ops_status; 3002 area->vm_ops = &snd_pcm_vm_ops_status;
2970 area->vm_private_data = substream; 3003 area->vm_private_data = substream;
@@ -2975,10 +3008,11 @@ static int snd_pcm_mmap_status(snd_pcm_substream_t *substream, struct file *file
2975/* 3008/*
2976 * mmap control record 3009 * mmap control record
2977 */ 3010 */
2978static struct page * snd_pcm_mmap_control_nopage(struct vm_area_struct *area, unsigned long address, int *type) 3011static struct page * snd_pcm_mmap_control_nopage(struct vm_area_struct *area,
3012 unsigned long address, int *type)
2979{ 3013{
2980 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; 3014 struct snd_pcm_substream *substream = area->vm_private_data;
2981 snd_pcm_runtime_t *runtime; 3015 struct snd_pcm_runtime *runtime;
2982 struct page * page; 3016 struct page * page;
2983 3017
2984 if (substream == NULL) 3018 if (substream == NULL)
@@ -2996,17 +3030,17 @@ static struct vm_operations_struct snd_pcm_vm_ops_control =
2996 .nopage = snd_pcm_mmap_control_nopage, 3030 .nopage = snd_pcm_mmap_control_nopage,
2997}; 3031};
2998 3032
2999static int snd_pcm_mmap_control(snd_pcm_substream_t *substream, struct file *file, 3033static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file,
3000 struct vm_area_struct *area) 3034 struct vm_area_struct *area)
3001{ 3035{
3002 snd_pcm_runtime_t *runtime; 3036 struct snd_pcm_runtime *runtime;
3003 long size; 3037 long size;
3004 if (!(area->vm_flags & VM_READ)) 3038 if (!(area->vm_flags & VM_READ))
3005 return -EINVAL; 3039 return -EINVAL;
3006 runtime = substream->runtime; 3040 runtime = substream->runtime;
3007 snd_assert(runtime != NULL, return -EAGAIN); 3041 snd_assert(runtime != NULL, return -EAGAIN);
3008 size = area->vm_end - area->vm_start; 3042 size = area->vm_end - area->vm_start;
3009 if (size != PAGE_ALIGN(sizeof(snd_pcm_mmap_control_t))) 3043 if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)))
3010 return -EINVAL; 3044 return -EINVAL;
3011 area->vm_ops = &snd_pcm_vm_ops_control; 3045 area->vm_ops = &snd_pcm_vm_ops_control;
3012 area->vm_private_data = substream; 3046 area->vm_private_data = substream;
@@ -3017,12 +3051,12 @@ static int snd_pcm_mmap_control(snd_pcm_substream_t *substream, struct file *fil
3017/* 3051/*
3018 * don't support mmap for status and control records. 3052 * don't support mmap for status and control records.
3019 */ 3053 */
3020static int snd_pcm_mmap_status(snd_pcm_substream_t *substream, struct file *file, 3054static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file,
3021 struct vm_area_struct *area) 3055 struct vm_area_struct *area)
3022{ 3056{
3023 return -ENXIO; 3057 return -ENXIO;
3024} 3058}
3025static int snd_pcm_mmap_control(snd_pcm_substream_t *substream, struct file *file, 3059static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file,
3026 struct vm_area_struct *area) 3060 struct vm_area_struct *area)
3027{ 3061{
3028 return -ENXIO; 3062 return -ENXIO;
@@ -3032,10 +3066,11 @@ static int snd_pcm_mmap_control(snd_pcm_substream_t *substream, struct file *fil
3032/* 3066/*
3033 * nopage callback for mmapping a RAM page 3067 * nopage callback for mmapping a RAM page
3034 */ 3068 */
3035static struct page *snd_pcm_mmap_data_nopage(struct vm_area_struct *area, unsigned long address, int *type) 3069static struct page *snd_pcm_mmap_data_nopage(struct vm_area_struct *area,
3070 unsigned long address, int *type)
3036{ 3071{
3037 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; 3072 struct snd_pcm_substream *substream = area->vm_private_data;
3038 snd_pcm_runtime_t *runtime; 3073 struct snd_pcm_runtime *runtime;
3039 unsigned long offset; 3074 unsigned long offset;
3040 struct page * page; 3075 struct page * page;
3041 void *vaddr; 3076 void *vaddr;
@@ -3074,7 +3109,8 @@ static struct vm_operations_struct snd_pcm_vm_ops_data =
3074/* 3109/*
3075 * mmap the DMA buffer on RAM 3110 * mmap the DMA buffer on RAM
3076 */ 3111 */
3077static int snd_pcm_default_mmap(snd_pcm_substream_t *substream, struct vm_area_struct *area) 3112static int snd_pcm_default_mmap(struct snd_pcm_substream *substream,
3113 struct vm_area_struct *area)
3078{ 3114{
3079 area->vm_ops = &snd_pcm_vm_ops_data; 3115 area->vm_ops = &snd_pcm_vm_ops_data;
3080 area->vm_private_data = substream; 3116 area->vm_private_data = substream;
@@ -3093,7 +3129,8 @@ static struct vm_operations_struct snd_pcm_vm_ops_data_mmio =
3093 .close = snd_pcm_mmap_data_close, 3129 .close = snd_pcm_mmap_data_close,
3094}; 3130};
3095 3131
3096int snd_pcm_lib_mmap_iomem(snd_pcm_substream_t *substream, struct vm_area_struct *area) 3132int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream,
3133 struct vm_area_struct *area)
3097{ 3134{
3098 long size; 3135 long size;
3099 unsigned long offset; 3136 unsigned long offset;
@@ -3118,10 +3155,10 @@ int snd_pcm_lib_mmap_iomem(snd_pcm_substream_t *substream, struct vm_area_struct
3118/* 3155/*
3119 * mmap DMA buffer 3156 * mmap DMA buffer
3120 */ 3157 */
3121int snd_pcm_mmap_data(snd_pcm_substream_t *substream, struct file *file, 3158int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file,
3122 struct vm_area_struct *area) 3159 struct vm_area_struct *area)
3123{ 3160{
3124 snd_pcm_runtime_t *runtime; 3161 struct snd_pcm_runtime *runtime;
3125 long size; 3162 long size;
3126 unsigned long offset; 3163 unsigned long offset;
3127 size_t dma_bytes; 3164 size_t dma_bytes;
@@ -3158,8 +3195,8 @@ int snd_pcm_mmap_data(snd_pcm_substream_t *substream, struct file *file,
3158 3195
3159static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area) 3196static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area)
3160{ 3197{
3161 snd_pcm_file_t * pcm_file; 3198 struct snd_pcm_file * pcm_file;
3162 snd_pcm_substream_t *substream; 3199 struct snd_pcm_substream *substream;
3163 unsigned long offset; 3200 unsigned long offset;
3164 3201
3165 pcm_file = file->private_data; 3202 pcm_file = file->private_data;
@@ -3184,9 +3221,9 @@ static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area)
3184 3221
3185static int snd_pcm_fasync(int fd, struct file * file, int on) 3222static int snd_pcm_fasync(int fd, struct file * file, int on)
3186{ 3223{
3187 snd_pcm_file_t * pcm_file; 3224 struct snd_pcm_file * pcm_file;
3188 snd_pcm_substream_t *substream; 3225 struct snd_pcm_substream *substream;
3189 snd_pcm_runtime_t *runtime; 3226 struct snd_pcm_runtime *runtime;
3190 int err; 3227 int err;
3191 3228
3192 pcm_file = file->private_data; 3229 pcm_file = file->private_data;
@@ -3216,7 +3253,8 @@ static int snd_pcm_fasync(int fd, struct file * file, int on)
3216#define __OLD_TO_NEW_MASK(x) ((x&7)|((x&0x07fffff8)<<5)) 3253#define __OLD_TO_NEW_MASK(x) ((x&7)|((x&0x07fffff8)<<5))
3217#define __NEW_TO_OLD_MASK(x) ((x&7)|((x&0xffffff00)>>5)) 3254#define __NEW_TO_OLD_MASK(x) ((x&7)|((x&0xffffff00)>>5))
3218 3255
3219static void snd_pcm_hw_convert_from_old_params(snd_pcm_hw_params_t *params, struct sndrv_pcm_hw_params_old *oparams) 3256static void snd_pcm_hw_convert_from_old_params(struct snd_pcm_hw_params *params,
3257 struct snd_pcm_hw_params_old *oparams)
3220{ 3258{
3221 unsigned int i; 3259 unsigned int i;
3222 3260
@@ -3234,7 +3272,8 @@ static void snd_pcm_hw_convert_from_old_params(snd_pcm_hw_params_t *params, stru
3234 params->fifo_size = oparams->fifo_size; 3272 params->fifo_size = oparams->fifo_size;
3235} 3273}
3236 3274
3237static void snd_pcm_hw_convert_to_old_params(struct sndrv_pcm_hw_params_old *oparams, snd_pcm_hw_params_t *params) 3275static void snd_pcm_hw_convert_to_old_params(struct snd_pcm_hw_params_old *oparams,
3276 struct snd_pcm_hw_params *params)
3238{ 3277{
3239 unsigned int i; 3278 unsigned int i;
3240 3279
@@ -3252,10 +3291,11 @@ static void snd_pcm_hw_convert_to_old_params(struct sndrv_pcm_hw_params_old *opa
3252 oparams->fifo_size = params->fifo_size; 3291 oparams->fifo_size = params->fifo_size;
3253} 3292}
3254 3293
3255static int snd_pcm_hw_refine_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams) 3294static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
3295 struct snd_pcm_hw_params_old __user * _oparams)
3256{ 3296{
3257 snd_pcm_hw_params_t *params; 3297 struct snd_pcm_hw_params *params;
3258 struct sndrv_pcm_hw_params_old *oparams = NULL; 3298 struct snd_pcm_hw_params_old *oparams = NULL;
3259 int err; 3299 int err;
3260 3300
3261 params = kmalloc(sizeof(*params), GFP_KERNEL); 3301 params = kmalloc(sizeof(*params), GFP_KERNEL);
@@ -3286,10 +3326,11 @@ out:
3286 return err; 3326 return err;
3287} 3327}
3288 3328
3289static int snd_pcm_hw_params_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams) 3329static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
3330 struct snd_pcm_hw_params_old __user * _oparams)
3290{ 3331{
3291 snd_pcm_hw_params_t *params; 3332 struct snd_pcm_hw_params *params;
3292 struct sndrv_pcm_hw_params_old *oparams = NULL; 3333 struct snd_pcm_hw_params_old *oparams = NULL;
3293 int err; 3334 int err;
3294 3335
3295 params = kmalloc(sizeof(*params), GFP_KERNEL); 3336 params = kmalloc(sizeof(*params), GFP_KERNEL);
@@ -3349,7 +3390,7 @@ static struct file_operations snd_pcm_f_ops_capture = {
3349 .fasync = snd_pcm_fasync, 3390 .fasync = snd_pcm_fasync,
3350}; 3391};
3351 3392
3352snd_minor_t snd_pcm_reg[2] = 3393struct snd_minor snd_pcm_reg[2] =
3353{ 3394{
3354 { 3395 {
3355 .comment = "digital audio playback", 3396 .comment = "digital audio playback",
diff --git a/sound/core/pcm_timer.c b/sound/core/pcm_timer.c
index 884eaea31fec..d94ed16d21ea 100644
--- a/sound/core/pcm_timer.c
+++ b/sound/core/pcm_timer.c
@@ -45,10 +45,10 @@ static unsigned long gcd(unsigned long a, unsigned long b)
45 return b; 45 return b;
46} 46}
47 47
48void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream) 48void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream)
49{ 49{
50 unsigned long rate, mult, fsize, l, post; 50 unsigned long rate, mult, fsize, l, post;
51 snd_pcm_runtime_t *runtime = substream->runtime; 51 struct snd_pcm_runtime *runtime = substream->runtime;
52 52
53 mult = 1000000000; 53 mult = 1000000000;
54 rate = runtime->rate; 54 rate = runtime->rate;
@@ -74,18 +74,18 @@ void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream)
74 runtime->timer_resolution = (mult * fsize / rate) * post; 74 runtime->timer_resolution = (mult * fsize / rate) * post;
75} 75}
76 76
77static unsigned long snd_pcm_timer_resolution(snd_timer_t * timer) 77static unsigned long snd_pcm_timer_resolution(struct snd_timer * timer)
78{ 78{
79 snd_pcm_substream_t * substream; 79 struct snd_pcm_substream *substream;
80 80
81 substream = timer->private_data; 81 substream = timer->private_data;
82 return substream->runtime ? substream->runtime->timer_resolution : 0; 82 return substream->runtime ? substream->runtime->timer_resolution : 0;
83} 83}
84 84
85static int snd_pcm_timer_start(snd_timer_t * timer) 85static int snd_pcm_timer_start(struct snd_timer * timer)
86{ 86{
87 unsigned long flags; 87 unsigned long flags;
88 snd_pcm_substream_t * substream; 88 struct snd_pcm_substream *substream;
89 89
90 substream = snd_timer_chip(timer); 90 substream = snd_timer_chip(timer);
91 spin_lock_irqsave(&substream->timer_lock, flags); 91 spin_lock_irqsave(&substream->timer_lock, flags);
@@ -94,10 +94,10 @@ static int snd_pcm_timer_start(snd_timer_t * timer)
94 return 0; 94 return 0;
95} 95}
96 96
97static int snd_pcm_timer_stop(snd_timer_t * timer) 97static int snd_pcm_timer_stop(struct snd_timer * timer)
98{ 98{
99 unsigned long flags; 99 unsigned long flags;
100 snd_pcm_substream_t * substream; 100 struct snd_pcm_substream *substream;
101 101
102 substream = snd_timer_chip(timer); 102 substream = snd_timer_chip(timer);
103 spin_lock_irqsave(&substream->timer_lock, flags); 103 spin_lock_irqsave(&substream->timer_lock, flags);
@@ -106,7 +106,7 @@ static int snd_pcm_timer_stop(snd_timer_t * timer)
106 return 0; 106 return 0;
107} 107}
108 108
109static struct _snd_timer_hardware snd_pcm_timer = 109static struct snd_timer_hardware snd_pcm_timer =
110{ 110{
111 .flags = SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_SLAVE, 111 .flags = SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_SLAVE,
112 .resolution = 0, 112 .resolution = 0,
@@ -120,16 +120,16 @@ static struct _snd_timer_hardware snd_pcm_timer =
120 * Init functions 120 * Init functions
121 */ 121 */
122 122
123static void snd_pcm_timer_free(snd_timer_t *timer) 123static void snd_pcm_timer_free(struct snd_timer *timer)
124{ 124{
125 snd_pcm_substream_t *substream = timer->private_data; 125 struct snd_pcm_substream *substream = timer->private_data;
126 substream->timer = NULL; 126 substream->timer = NULL;
127} 127}
128 128
129void snd_pcm_timer_init(snd_pcm_substream_t *substream) 129void snd_pcm_timer_init(struct snd_pcm_substream *substream)
130{ 130{
131 snd_timer_id_t tid; 131 struct snd_timer_id tid;
132 snd_timer_t *timer; 132 struct snd_timer *timer;
133 133
134 tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE; 134 tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE;
135 tid.dev_class = SNDRV_TIMER_CLASS_PCM; 135 tid.dev_class = SNDRV_TIMER_CLASS_PCM;
@@ -152,7 +152,7 @@ void snd_pcm_timer_init(snd_pcm_substream_t *substream)
152 substream->timer = timer; 152 substream->timer = timer;
153} 153}
154 154
155void snd_pcm_timer_done(snd_pcm_substream_t *substream) 155void snd_pcm_timer_done(struct snd_pcm_substream *substream)
156{ 156{
157 if (substream->timer) { 157 if (substream->timer) {
158 snd_device_free(substream->pcm->card, substream->timer); 158 snd_device_free(substream->pcm->card, substream->timer);