aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm.c
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/core/pcm.c
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/core/pcm.c')
-rw-r--r--sound/core/pcm.c214
1 files changed, 114 insertions, 100 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;