aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/mixart/mixart.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 09:01:08 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:19:16 -0500
commit67b48b880062ba1775f424c2dd2c68bc30ec180f (patch)
tree32a39285a55e57cecb773ee92bff82322faaf33a /sound/pci/mixart/mixart.c
parentfcfd3332e3bf5f63116044c168110820996cd1fe (diff)
[ALSA] Remove xxx_t typedefs: PCI miXart
Modules: MIXART driver Remove xxx_t typedefs from the PCI miXart driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/mixart/mixart.c')
-rw-r--r--sound/pci/mixart/mixart.c211
1 files changed, 109 insertions, 102 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index b3090a13eda..b218e1d20c7 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -66,11 +66,12 @@ static struct pci_device_id snd_mixart_ids[] = {
66MODULE_DEVICE_TABLE(pci, snd_mixart_ids); 66MODULE_DEVICE_TABLE(pci, snd_mixart_ids);
67 67
68 68
69static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int start) 69static int mixart_set_pipe_state(struct mixart_mgr *mgr,
70 struct mixart_pipe *pipe, int start)
70{ 71{
71 mixart_group_state_req_t group_state; 72 struct mixart_group_state_req group_state;
72 mixart_group_state_resp_t group_state_resp; 73 struct mixart_group_state_resp group_state_resp;
73 mixart_msg_t request; 74 struct mixart_msg request;
74 int err; 75 int err;
75 u32 system_msg_uid; 76 u32 system_msg_uid;
76 77
@@ -92,7 +93,7 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
92 /* wait on the last MSG_SYSTEM_SEND_SYNCHRO_CMD command to be really finished */ 93 /* wait on the last MSG_SYSTEM_SEND_SYNCHRO_CMD command to be really finished */
93 94
94 request.message_id = MSG_SYSTEM_WAIT_SYNCHRO_CMD; 95 request.message_id = MSG_SYSTEM_WAIT_SYNCHRO_CMD;
95 request.uid = (mixart_uid_t){0,0}; 96 request.uid = (struct mixart_uid){0,0};
96 request.data = &system_msg_uid; 97 request.data = &system_msg_uid;
97 request.size = sizeof(system_msg_uid); 98 request.size = sizeof(system_msg_uid);
98 99
@@ -113,7 +114,7 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
113 else 114 else
114 request.message_id = MSG_STREAM_STOP_STREAM_GRP_PACKET; 115 request.message_id = MSG_STREAM_STOP_STREAM_GRP_PACKET;
115 116
116 request.uid = pipe->group_uid; /*(mixart_uid_t){0,0};*/ 117 request.uid = pipe->group_uid; /*(struct mixart_uid){0,0};*/
117 request.data = &group_state; 118 request.data = &group_state;
118 request.size = sizeof(group_state); 119 request.size = sizeof(group_state);
119 120
@@ -137,7 +138,7 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
137 /* in case of start send a synchro top */ 138 /* in case of start send a synchro top */
138 139
139 request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD; 140 request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD;
140 request.uid = (mixart_uid_t){0,0}; 141 request.uid = (struct mixart_uid){0,0};
141 request.data = NULL; 142 request.data = NULL;
142 request.size = 0; 143 request.size = 0;
143 144
@@ -156,11 +157,12 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
156} 157}
157 158
158 159
159static int mixart_set_clock(mixart_mgr_t *mgr, mixart_pipe_t *pipe, unsigned int rate) 160static int mixart_set_clock(struct mixart_mgr *mgr,
161 struct mixart_pipe *pipe, unsigned int rate)
160{ 162{
161 mixart_msg_t request; 163 struct mixart_msg request;
162 mixart_clock_properties_t clock_properties; 164 struct mixart_clock_properties clock_properties;
163 mixart_clock_properties_resp_t clock_prop_resp; 165 struct mixart_clock_properties_resp clock_prop_resp;
164 int err; 166 int err;
165 167
166 switch(pipe->status) { 168 switch(pipe->status) {
@@ -208,11 +210,13 @@ static int mixart_set_clock(mixart_mgr_t *mgr, mixart_pipe_t *pipe, unsigned int
208/* 210/*
209 * Allocate or reference output pipe for analog IOs (pcmp0/1) 211 * Allocate or reference output pipe for analog IOs (pcmp0/1)
210 */ 212 */
211mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capture, int monitoring) 213struct mixart_pipe *
214snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
215 int monitoring)
212{ 216{
213 int stream_count; 217 int stream_count;
214 mixart_pipe_t *pipe; 218 struct mixart_pipe *pipe;
215 mixart_msg_t request; 219 struct mixart_msg request;
216 220
217 if(capture) { 221 if(capture) {
218 if (pcm_number == MIXART_PCM_ANALOG) { 222 if (pcm_number == MIXART_PCM_ANALOG) {
@@ -241,8 +245,8 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
241 if( pipe->status == PIPE_UNDEFINED ) { 245 if( pipe->status == PIPE_UNDEFINED ) {
242 int err, i; 246 int err, i;
243 struct { 247 struct {
244 mixart_streaming_group_req_t sgroup_req; 248 struct mixart_streaming_group_req sgroup_req;
245 mixart_streaming_group_t sgroup_resp; 249 struct mixart_streaming_group sgroup_resp;
246 } *buf; 250 } *buf;
247 251
248 snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number); 252 snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number);
@@ -251,7 +255,7 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
251 if (!buf) 255 if (!buf)
252 return NULL; 256 return NULL;
253 257
254 request.uid = (mixart_uid_t){0,0}; /* should be StreamManagerUID, but zero is OK if there is only one ! */ 258 request.uid = (struct mixart_uid){0,0}; /* should be StreamManagerUID, but zero is OK if there is only one ! */
255 request.data = &buf->sgroup_req; 259 request.data = &buf->sgroup_req;
256 request.size = sizeof(buf->sgroup_req); 260 request.size = sizeof(buf->sgroup_req);
257 261
@@ -279,7 +283,7 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
279 buf->sgroup_req.flow_entry[i] = j; 283 buf->sgroup_req.flow_entry[i] = j;
280 284
281 flowinfo = (struct mixart_flowinfo *)chip->mgr->flowinfo.area; 285 flowinfo = (struct mixart_flowinfo *)chip->mgr->flowinfo.area;
282 flowinfo[j].bufferinfo_array_phy_address = (u32)chip->mgr->bufferinfo.addr + (j * sizeof(mixart_bufferinfo_t)); 286 flowinfo[j].bufferinfo_array_phy_address = (u32)chip->mgr->bufferinfo.addr + (j * sizeof(struct mixart_bufferinfo));
283 flowinfo[j].bufferinfo_count = 1; /* 1 will set the miXart to ring-buffer mode ! */ 287 flowinfo[j].bufferinfo_count = 1; /* 1 will set the miXart to ring-buffer mode ! */
284 288
285 bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area; 289 bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area;
@@ -315,7 +319,8 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
315} 319}
316 320
317 321
318int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monitoring) 322int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
323 struct mixart_pipe *pipe, int monitoring)
319{ 324{
320 int err = 0; 325 int err = 0;
321 326
@@ -329,8 +334,8 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
329 334
330 if((pipe->references <= 0) && (pipe->monitoring == 0)) { 335 if((pipe->references <= 0) && (pipe->monitoring == 0)) {
331 336
332 mixart_msg_t request; 337 struct mixart_msg request;
333 mixart_delete_group_resp_t delete_resp; 338 struct mixart_delete_group_resp delete_resp;
334 339
335 /* release the clock */ 340 /* release the clock */
336 err = mixart_set_clock( mgr, pipe, 0); 341 err = mixart_set_clock( mgr, pipe, 0);
@@ -345,7 +350,7 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
345 } 350 }
346 351
347 request.message_id = MSG_STREAM_DELETE_GROUP; 352 request.message_id = MSG_STREAM_DELETE_GROUP;
348 request.uid = (mixart_uid_t){0,0}; 353 request.uid = (struct mixart_uid){0,0};
349 request.data = &pipe->group_uid; /* the streaming group ! */ 354 request.data = &pipe->group_uid; /* the streaming group ! */
350 request.size = sizeof(pipe->group_uid); 355 request.size = sizeof(pipe->group_uid);
351 356
@@ -355,7 +360,7 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
355 snd_printk(KERN_ERR "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", err, delete_resp.status); 360 snd_printk(KERN_ERR "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", err, delete_resp.status);
356 } 361 }
357 362
358 pipe->group_uid = (mixart_uid_t){0,0}; 363 pipe->group_uid = (struct mixart_uid){0,0};
359 pipe->stream_count = 0; 364 pipe->stream_count = 0;
360 pipe->status = PIPE_UNDEFINED; 365 pipe->status = PIPE_UNDEFINED;
361 } 366 }
@@ -363,11 +368,11 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
363 return err; 368 return err;
364} 369}
365 370
366static int mixart_set_stream_state(mixart_stream_t *stream, int start) 371static int mixart_set_stream_state(struct mixart_stream *stream, int start)
367{ 372{
368 mixart_t *chip; 373 struct snd_mixart *chip;
369 mixart_stream_state_req_t stream_state_req; 374 struct mixart_stream_state_req stream_state_req;
370 mixart_msg_t request; 375 struct mixart_msg request;
371 376
372 if(!stream->substream) 377 if(!stream->substream)
373 return -EINVAL; 378 return -EINVAL;
@@ -382,7 +387,7 @@ static int mixart_set_stream_state(mixart_stream_t *stream, int start)
382 else 387 else
383 request.message_id = start ? MSG_STREAM_START_OUTPUT_STAGE_PACKET : MSG_STREAM_STOP_OUTPUT_STAGE_PACKET; 388 request.message_id = start ? MSG_STREAM_START_OUTPUT_STAGE_PACKET : MSG_STREAM_STOP_OUTPUT_STAGE_PACKET;
384 389
385 request.uid = (mixart_uid_t){0,0}; 390 request.uid = (struct mixart_uid){0,0};
386 request.data = &stream_state_req; 391 request.data = &stream_state_req;
387 request.size = sizeof(stream_state_req); 392 request.size = sizeof(stream_state_req);
388 393
@@ -399,9 +404,9 @@ static int mixart_set_stream_state(mixart_stream_t *stream, int start)
399 * Trigger callback 404 * Trigger callback
400 */ 405 */
401 406
402static int snd_mixart_trigger(snd_pcm_substream_t *subs, int cmd) 407static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
403{ 408{
404 mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; 409 struct mixart_stream *stream = subs->runtime->private_data;
405 410
406 switch (cmd) { 411 switch (cmd) {
407 case SNDRV_PCM_TRIGGER_START: 412 case SNDRV_PCM_TRIGGER_START:
@@ -443,7 +448,7 @@ static int snd_mixart_trigger(snd_pcm_substream_t *subs, int cmd)
443 return 0; 448 return 0;
444} 449}
445 450
446static int mixart_sync_nonblock_events(mixart_mgr_t *mgr) 451static int mixart_sync_nonblock_events(struct mixart_mgr *mgr)
447{ 452{
448 unsigned long timeout = jiffies + HZ; 453 unsigned long timeout = jiffies + HZ;
449 while (atomic_read(&mgr->msg_processed) > 0) { 454 while (atomic_read(&mgr->msg_processed) > 0) {
@@ -459,10 +464,10 @@ static int mixart_sync_nonblock_events(mixart_mgr_t *mgr)
459/* 464/*
460 * prepare callback for all pcms 465 * prepare callback for all pcms
461 */ 466 */
462static int snd_mixart_prepare(snd_pcm_substream_t *subs) 467static int snd_mixart_prepare(struct snd_pcm_substream *subs)
463{ 468{
464 mixart_t *chip = snd_pcm_substream_chip(subs); 469 struct snd_mixart *chip = snd_pcm_substream_chip(subs);
465 mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; 470 struct mixart_stream *stream = subs->runtime->private_data;
466 471
467 /* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */ 472 /* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */
468 473
@@ -485,13 +490,13 @@ static int snd_mixart_prepare(snd_pcm_substream_t *subs)
485} 490}
486 491
487 492
488static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format) 493static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t format)
489{ 494{
490 int err; 495 int err;
491 mixart_t *chip; 496 struct snd_mixart *chip;
492 mixart_msg_t request; 497 struct mixart_msg request;
493 mixart_stream_param_desc_t stream_param; 498 struct mixart_stream_param_desc stream_param;
494 mixart_return_uid_t resp; 499 struct mixart_return_uid resp;
495 500
496 chip = snd_pcm_substream_chip(stream->substream); 501 chip = snd_pcm_substream_chip(stream->substream);
497 502
@@ -552,7 +557,7 @@ static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format)
552 stream_param.stream_desc[0].stream_idx = stream->substream->number; 557 stream_param.stream_desc[0].stream_idx = stream->substream->number;
553 558
554 request.message_id = MSG_STREAM_SET_INPUT_STAGE_PARAM; 559 request.message_id = MSG_STREAM_SET_INPUT_STAGE_PARAM;
555 request.uid = (mixart_uid_t){0,0}; 560 request.uid = (struct mixart_uid){0,0};
556 request.data = &stream_param; 561 request.data = &stream_param;
557 request.size = sizeof(stream_param); 562 request.size = sizeof(stream_param);
558 563
@@ -568,12 +573,12 @@ static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format)
568/* 573/*
569 * HW_PARAMS callback for all pcms 574 * HW_PARAMS callback for all pcms
570 */ 575 */
571static int snd_mixart_hw_params(snd_pcm_substream_t *subs, 576static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
572 snd_pcm_hw_params_t *hw) 577 struct snd_pcm_hw_params *hw)
573{ 578{
574 mixart_t *chip = snd_pcm_substream_chip(subs); 579 struct snd_mixart *chip = snd_pcm_substream_chip(subs);
575 mixart_mgr_t *mgr = chip->mgr; 580 struct mixart_mgr *mgr = chip->mgr;
576 mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; 581 struct mixart_stream *stream = subs->runtime->private_data;
577 snd_pcm_format_t format; 582 snd_pcm_format_t format;
578 int err; 583 int err;
579 int channels; 584 int channels;
@@ -628,9 +633,9 @@ static int snd_mixart_hw_params(snd_pcm_substream_t *subs,
628 return err; 633 return err;
629} 634}
630 635
631static int snd_mixart_hw_free(snd_pcm_substream_t *subs) 636static int snd_mixart_hw_free(struct snd_pcm_substream *subs)
632{ 637{
633 mixart_t *chip = snd_pcm_substream_chip(subs); 638 struct snd_mixart *chip = snd_pcm_substream_chip(subs);
634 snd_pcm_lib_free_pages(subs); 639 snd_pcm_lib_free_pages(subs);
635 mixart_sync_nonblock_events(chip->mgr); 640 mixart_sync_nonblock_events(chip->mgr);
636 return 0; 641 return 0;
@@ -641,7 +646,7 @@ static int snd_mixart_hw_free(snd_pcm_substream_t *subs)
641/* 646/*
642 * TODO CONFIGURATION SPACE for all pcms, mono pcm must update channels_max 647 * TODO CONFIGURATION SPACE for all pcms, mono pcm must update channels_max
643 */ 648 */
644static snd_pcm_hardware_t snd_mixart_analog_caps = 649static struct snd_pcm_hardware snd_mixart_analog_caps =
645{ 650{
646 .info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 651 .info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
647 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | 652 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START |
@@ -662,7 +667,7 @@ static snd_pcm_hardware_t snd_mixart_analog_caps =
662 .periods_max = (32*1024/256), 667 .periods_max = (32*1024/256),
663}; 668};
664 669
665static snd_pcm_hardware_t snd_mixart_digital_caps = 670static struct snd_pcm_hardware snd_mixart_digital_caps =
666{ 671{
667 .info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 672 .info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
668 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | 673 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START |
@@ -684,14 +689,14 @@ static snd_pcm_hardware_t snd_mixart_digital_caps =
684}; 689};
685 690
686 691
687static int snd_mixart_playback_open(snd_pcm_substream_t *subs) 692static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
688{ 693{
689 mixart_t *chip = snd_pcm_substream_chip(subs); 694 struct snd_mixart *chip = snd_pcm_substream_chip(subs);
690 mixart_mgr_t *mgr = chip->mgr; 695 struct mixart_mgr *mgr = chip->mgr;
691 snd_pcm_runtime_t *runtime = subs->runtime; 696 struct snd_pcm_runtime *runtime = subs->runtime;
692 snd_pcm_t *pcm = subs->pcm; 697 struct snd_pcm *pcm = subs->pcm;
693 mixart_stream_t *stream; 698 struct mixart_stream *stream;
694 mixart_pipe_t *pipe; 699 struct mixart_pipe *pipe;
695 int err = 0; 700 int err = 0;
696 int pcm_number; 701 int pcm_number;
697 702
@@ -759,14 +764,14 @@ static int snd_mixart_playback_open(snd_pcm_substream_t *subs)
759} 764}
760 765
761 766
762static int snd_mixart_capture_open(snd_pcm_substream_t *subs) 767static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
763{ 768{
764 mixart_t *chip = snd_pcm_substream_chip(subs); 769 struct snd_mixart *chip = snd_pcm_substream_chip(subs);
765 mixart_mgr_t *mgr = chip->mgr; 770 struct mixart_mgr *mgr = chip->mgr;
766 snd_pcm_runtime_t *runtime = subs->runtime; 771 struct snd_pcm_runtime *runtime = subs->runtime;
767 snd_pcm_t *pcm = subs->pcm; 772 struct snd_pcm *pcm = subs->pcm;
768 mixart_stream_t *stream; 773 struct mixart_stream *stream;
769 mixart_pipe_t *pipe; 774 struct mixart_pipe *pipe;
770 int err = 0; 775 int err = 0;
771 int pcm_number; 776 int pcm_number;
772 777
@@ -838,11 +843,11 @@ static int snd_mixart_capture_open(snd_pcm_substream_t *subs)
838 843
839 844
840 845
841static int snd_mixart_close(snd_pcm_substream_t *subs) 846static int snd_mixart_close(struct snd_pcm_substream *subs)
842{ 847{
843 mixart_t *chip = snd_pcm_substream_chip(subs); 848 struct snd_mixart *chip = snd_pcm_substream_chip(subs);
844 mixart_mgr_t *mgr = chip->mgr; 849 struct mixart_mgr *mgr = chip->mgr;
845 mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; 850 struct mixart_stream *stream = subs->runtime->private_data;
846 851
847 down(&mgr->setup_mutex); 852 down(&mgr->setup_mutex);
848 853
@@ -868,17 +873,17 @@ static int snd_mixart_close(snd_pcm_substream_t *subs)
868} 873}
869 874
870 875
871static snd_pcm_uframes_t snd_mixart_stream_pointer(snd_pcm_substream_t * subs) 876static snd_pcm_uframes_t snd_mixart_stream_pointer(struct snd_pcm_substream *subs)
872{ 877{
873 snd_pcm_runtime_t *runtime = subs->runtime; 878 struct snd_pcm_runtime *runtime = subs->runtime;
874 mixart_stream_t *stream = (mixart_stream_t*)runtime->private_data; 879 struct mixart_stream *stream = runtime->private_data;
875 880
876 return (snd_pcm_uframes_t)((stream->buf_periods * runtime->period_size) + stream->buf_period_frag); 881 return (snd_pcm_uframes_t)((stream->buf_periods * runtime->period_size) + stream->buf_period_frag);
877} 882}
878 883
879 884
880 885
881static snd_pcm_ops_t snd_mixart_playback_ops = { 886static struct snd_pcm_ops snd_mixart_playback_ops = {
882 .open = snd_mixart_playback_open, 887 .open = snd_mixart_playback_open,
883 .close = snd_mixart_close, 888 .close = snd_mixart_close,
884 .ioctl = snd_pcm_lib_ioctl, 889 .ioctl = snd_pcm_lib_ioctl,
@@ -889,7 +894,7 @@ static snd_pcm_ops_t snd_mixart_playback_ops = {
889 .pointer = snd_mixart_stream_pointer, 894 .pointer = snd_mixart_stream_pointer,
890}; 895};
891 896
892static snd_pcm_ops_t snd_mixart_capture_ops = { 897static struct snd_pcm_ops snd_mixart_capture_ops = {
893 .open = snd_mixart_capture_open, 898 .open = snd_mixart_capture_open,
894 .close = snd_mixart_close, 899 .close = snd_mixart_close,
895 .ioctl = snd_pcm_lib_ioctl, 900 .ioctl = snd_pcm_lib_ioctl,
@@ -900,10 +905,10 @@ static snd_pcm_ops_t snd_mixart_capture_ops = {
900 .pointer = snd_mixart_stream_pointer, 905 .pointer = snd_mixart_stream_pointer,
901}; 906};
902 907
903static void preallocate_buffers(mixart_t *chip, snd_pcm_t *pcm) 908static void preallocate_buffers(struct snd_mixart *chip, struct snd_pcm *pcm)
904{ 909{
905#if 0 910#if 0
906 snd_pcm_substream_t *subs; 911 struct snd_pcm_substream *subs;
907 int stream; 912 int stream;
908 913
909 for (stream = 0; stream < 2; stream++) { 914 for (stream = 0; stream < 2; stream++) {
@@ -921,10 +926,10 @@ static void preallocate_buffers(mixart_t *chip, snd_pcm_t *pcm)
921 926
922/* 927/*
923 */ 928 */
924static int snd_mixart_pcm_analog(mixart_t *chip) 929static int snd_mixart_pcm_analog(struct snd_mixart *chip)
925{ 930{
926 int err; 931 int err;
927 snd_pcm_t *pcm; 932 struct snd_pcm *pcm;
928 char name[32]; 933 char name[32];
929 934
930 sprintf(name, "miXart analog %d", chip->chip_idx); 935 sprintf(name, "miXart analog %d", chip->chip_idx);
@@ -952,10 +957,10 @@ static int snd_mixart_pcm_analog(mixart_t *chip)
952 957
953/* 958/*
954 */ 959 */
955static int snd_mixart_pcm_digital(mixart_t *chip) 960static int snd_mixart_pcm_digital(struct snd_mixart *chip)
956{ 961{
957 int err; 962 int err;
958 snd_pcm_t *pcm; 963 struct snd_pcm *pcm;
959 char name[32]; 964 char name[32];
960 965
961 sprintf(name, "miXart AES/EBU %d", chip->chip_idx); 966 sprintf(name, "miXart AES/EBU %d", chip->chip_idx);
@@ -980,26 +985,26 @@ static int snd_mixart_pcm_digital(mixart_t *chip)
980 return 0; 985 return 0;
981} 986}
982 987
983static int snd_mixart_chip_free(mixart_t *chip) 988static int snd_mixart_chip_free(struct snd_mixart *chip)
984{ 989{
985 kfree(chip); 990 kfree(chip);
986 return 0; 991 return 0;
987} 992}
988 993
989static int snd_mixart_chip_dev_free(snd_device_t *device) 994static int snd_mixart_chip_dev_free(struct snd_device *device)
990{ 995{
991 mixart_t *chip = device->device_data; 996 struct snd_mixart *chip = device->device_data;
992 return snd_mixart_chip_free(chip); 997 return snd_mixart_chip_free(chip);
993} 998}
994 999
995 1000
996/* 1001/*
997 */ 1002 */
998static int __devinit snd_mixart_create(mixart_mgr_t *mgr, snd_card_t *card, int idx) 1003static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int idx)
999{ 1004{
1000 int err; 1005 int err;
1001 mixart_t *chip; 1006 struct snd_mixart *chip;
1002 static snd_device_ops_t ops = { 1007 static struct snd_device_ops ops = {
1003 .dev_free = snd_mixart_chip_dev_free, 1008 .dev_free = snd_mixart_chip_dev_free,
1004 }; 1009 };
1005 1010
@@ -1023,7 +1028,7 @@ static int __devinit snd_mixart_create(mixart_mgr_t *mgr, snd_card_t *card, int
1023 return 0; 1028 return 0;
1024} 1029}
1025 1030
1026int snd_mixart_create_pcm(mixart_t* chip) 1031int snd_mixart_create_pcm(struct snd_mixart* chip)
1027{ 1032{
1028 int err; 1033 int err;
1029 1034
@@ -1044,7 +1049,7 @@ int snd_mixart_create_pcm(mixart_t* chip)
1044/* 1049/*
1045 * release all the cards assigned to a manager instance 1050 * release all the cards assigned to a manager instance
1046 */ 1051 */
1047static int snd_mixart_free(mixart_mgr_t *mgr) 1052static int snd_mixart_free(struct mixart_mgr *mgr)
1048{ 1053{
1049 unsigned int i; 1054 unsigned int i;
1050 1055
@@ -1092,7 +1097,7 @@ static int snd_mixart_free(mixart_mgr_t *mgr)
1092/* 1097/*
1093 * proc interface 1098 * proc interface
1094 */ 1099 */
1095static long long snd_mixart_BA0_llseek(snd_info_entry_t *entry, 1100static long long snd_mixart_BA0_llseek(struct snd_info_entry *entry,
1096 void *private_file_data, 1101 void *private_file_data,
1097 struct file *file, 1102 struct file *file,
1098 long long offset, 1103 long long offset,
@@ -1118,7 +1123,7 @@ static long long snd_mixart_BA0_llseek(snd_info_entry_t *entry,
1118 return file->f_pos; 1123 return file->f_pos;
1119} 1124}
1120 1125
1121static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry, 1126static long long snd_mixart_BA1_llseek(struct snd_info_entry *entry,
1122 void *private_file_data, 1127 void *private_file_data,
1123 struct file *file, 1128 struct file *file,
1124 long long offset, 1129 long long offset,
@@ -1147,11 +1152,11 @@ static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry,
1147/* 1152/*
1148 mixart_BA0 proc interface for BAR 0 - read callback 1153 mixart_BA0 proc interface for BAR 0 - read callback
1149 */ 1154 */
1150static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data, 1155static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private_data,
1151 struct file *file, char __user *buf, 1156 struct file *file, char __user *buf,
1152 unsigned long count, unsigned long pos) 1157 unsigned long count, unsigned long pos)
1153{ 1158{
1154 mixart_mgr_t *mgr = entry->private_data; 1159 struct mixart_mgr *mgr = entry->private_data;
1155 1160
1156 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ 1161 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
1157 if(count <= 0) 1162 if(count <= 0)
@@ -1166,11 +1171,11 @@ static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data
1166/* 1171/*
1167 mixart_BA1 proc interface for BAR 1 - read callback 1172 mixart_BA1 proc interface for BAR 1 - read callback
1168 */ 1173 */
1169static long snd_mixart_BA1_read(snd_info_entry_t *entry, void *file_private_data, 1174static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private_data,
1170 struct file *file, char __user *buf, 1175 struct file *file, char __user *buf,
1171 unsigned long count, unsigned long pos) 1176 unsigned long count, unsigned long pos)
1172{ 1177{
1173 mixart_mgr_t *mgr = entry->private_data; 1178 struct mixart_mgr *mgr = entry->private_data;
1174 1179
1175 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ 1180 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
1176 if(count <= 0) 1181 if(count <= 0)
@@ -1193,10 +1198,10 @@ static struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = {
1193}; 1198};
1194 1199
1195 1200
1196static void snd_mixart_proc_read(snd_info_entry_t *entry, 1201static void snd_mixart_proc_read(struct snd_info_entry *entry,
1197 snd_info_buffer_t * buffer) 1202 struct snd_info_buffer *buffer)
1198{ 1203{
1199 mixart_t *chip = entry->private_data; 1204 struct snd_mixart *chip = entry->private_data;
1200 u32 ref; 1205 u32 ref;
1201 1206
1202 snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx); 1207 snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx);
@@ -1229,9 +1234,9 @@ static void snd_mixart_proc_read(snd_info_entry_t *entry,
1229 } /* endif elf loaded */ 1234 } /* endif elf loaded */
1230} 1235}
1231 1236
1232static void __devinit snd_mixart_proc_init(mixart_t *chip) 1237static void __devinit snd_mixart_proc_init(struct snd_mixart *chip)
1233{ 1238{
1234 snd_info_entry_t *entry; 1239 struct snd_info_entry *entry;
1235 1240
1236 /* text interface to read perf and temp meters */ 1241 /* text interface to read perf and temp meters */
1237 if (! snd_card_proc_new(chip->card, "board_info", &entry)) { 1242 if (! snd_card_proc_new(chip->card, "board_info", &entry)) {
@@ -1263,7 +1268,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1263 const struct pci_device_id *pci_id) 1268 const struct pci_device_id *pci_id)
1264{ 1269{
1265 static int dev; 1270 static int dev;
1266 mixart_mgr_t *mgr; 1271 struct mixart_mgr *mgr;
1267 unsigned int i; 1272 unsigned int i;
1268 int err; 1273 int err;
1269 size_t size; 1274 size_t size;
@@ -1338,12 +1343,12 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1338 init_MUTEX(&mgr->setup_mutex); 1343 init_MUTEX(&mgr->setup_mutex);
1339 1344
1340 /* init message taslket */ 1345 /* init message taslket */
1341 tasklet_init( &mgr->msg_taskq, snd_mixart_msg_tasklet, (unsigned long) mgr); 1346 tasklet_init(&mgr->msg_taskq, snd_mixart_msg_tasklet, (unsigned long) mgr);
1342 1347
1343 /* card assignment */ 1348 /* card assignment */
1344 mgr->num_cards = MIXART_MAX_CARDS; /* 4 FIXME: configurable? */ 1349 mgr->num_cards = MIXART_MAX_CARDS; /* 4 FIXME: configurable? */
1345 for (i = 0; i < mgr->num_cards; i++) { 1350 for (i = 0; i < mgr->num_cards; i++) {
1346 snd_card_t *card; 1351 struct snd_card *card;
1347 char tmpid[16]; 1352 char tmpid[16];
1348 int idx; 1353 int idx;
1349 1354
@@ -1384,7 +1389,8 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1384 mgr->board_type = MIXART_DAUGHTER_TYPE_NONE; 1389 mgr->board_type = MIXART_DAUGHTER_TYPE_NONE;
1385 1390
1386 /* create array of streaminfo */ 1391 /* create array of streaminfo */
1387 size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS * sizeof(mixart_flowinfo_t)) ); 1392 size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
1393 sizeof(struct mixart_flowinfo)) );
1388 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1394 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
1389 size, &mgr->flowinfo) < 0) { 1395 size, &mgr->flowinfo) < 0) {
1390 snd_mixart_free(mgr); 1396 snd_mixart_free(mgr);
@@ -1394,7 +1400,8 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1394 memset(mgr->flowinfo.area, 0, size); 1400 memset(mgr->flowinfo.area, 0, size);
1395 1401
1396 /* create array of bufferinfo */ 1402 /* create array of bufferinfo */
1397 size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS * sizeof(mixart_bufferinfo_t)) ); 1403 size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
1404 sizeof(struct mixart_bufferinfo)) );
1398 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1405 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
1399 size, &mgr->bufferinfo) < 0) { 1406 size, &mgr->bufferinfo) < 0) {
1400 snd_mixart_free(mgr); 1407 snd_mixart_free(mgr);