diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 09:01:08 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:19:16 -0500 |
commit | 67b48b880062ba1775f424c2dd2c68bc30ec180f (patch) | |
tree | 32a39285a55e57cecb773ee92bff82322faaf33a /sound/pci | |
parent | fcfd3332e3bf5f63116044c168110820996cd1fe (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')
-rw-r--r-- | sound/pci/mixart/mixart.c | 211 | ||||
-rw-r--r-- | sound/pci/mixart/mixart.h | 69 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_core.c | 49 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_core.h | 120 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_hwdep.c | 76 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_hwdep.h | 2 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_mixer.c | 108 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_mixer.h | 6 |
8 files changed, 300 insertions, 341 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index b3090a13edab..b218e1d20c78 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[] = { | |||
66 | MODULE_DEVICE_TABLE(pci, snd_mixart_ids); | 66 | MODULE_DEVICE_TABLE(pci, snd_mixart_ids); |
67 | 67 | ||
68 | 68 | ||
69 | static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int start) | 69 | static 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 | ||
159 | static int mixart_set_clock(mixart_mgr_t *mgr, mixart_pipe_t *pipe, unsigned int rate) | 160 | static 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 | */ |
211 | mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capture, int monitoring) | 213 | struct mixart_pipe * |
214 | snd_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 | ||
318 | int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monitoring) | 322 | int 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 | ||
366 | static int mixart_set_stream_state(mixart_stream_t *stream, int start) | 371 | static 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 | ||
402 | static int snd_mixart_trigger(snd_pcm_substream_t *subs, int cmd) | 407 | static 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 | ||
446 | static int mixart_sync_nonblock_events(mixart_mgr_t *mgr) | 451 | static 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 | */ |
462 | static int snd_mixart_prepare(snd_pcm_substream_t *subs) | 467 | static 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 | ||
488 | static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format) | 493 | static 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 | */ |
571 | static int snd_mixart_hw_params(snd_pcm_substream_t *subs, | 576 | static 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 | ||
631 | static int snd_mixart_hw_free(snd_pcm_substream_t *subs) | 636 | static 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 | */ |
644 | static snd_pcm_hardware_t snd_mixart_analog_caps = | 649 | static 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 | ||
665 | static snd_pcm_hardware_t snd_mixart_digital_caps = | 670 | static 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 | ||
687 | static int snd_mixart_playback_open(snd_pcm_substream_t *subs) | 692 | static 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 | ||
762 | static int snd_mixart_capture_open(snd_pcm_substream_t *subs) | 767 | static 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 | ||
841 | static int snd_mixart_close(snd_pcm_substream_t *subs) | 846 | static 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 | ||
871 | static snd_pcm_uframes_t snd_mixart_stream_pointer(snd_pcm_substream_t * subs) | 876 | static 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 | ||
881 | static snd_pcm_ops_t snd_mixart_playback_ops = { | 886 | static 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 | ||
892 | static snd_pcm_ops_t snd_mixart_capture_ops = { | 897 | static 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 | ||
903 | static void preallocate_buffers(mixart_t *chip, snd_pcm_t *pcm) | 908 | static 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 | */ |
924 | static int snd_mixart_pcm_analog(mixart_t *chip) | 929 | static 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 | */ |
955 | static int snd_mixart_pcm_digital(mixart_t *chip) | 960 | static 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 | ||
983 | static int snd_mixart_chip_free(mixart_t *chip) | 988 | static 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 | ||
989 | static int snd_mixart_chip_dev_free(snd_device_t *device) | 994 | static 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 | */ |
998 | static int __devinit snd_mixart_create(mixart_mgr_t *mgr, snd_card_t *card, int idx) | 1003 | static 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 | ||
1026 | int snd_mixart_create_pcm(mixart_t* chip) | 1031 | int 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 | */ |
1047 | static int snd_mixart_free(mixart_mgr_t *mgr) | 1052 | static 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 | */ |
1095 | static long long snd_mixart_BA0_llseek(snd_info_entry_t *entry, | 1100 | static 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 | ||
1121 | static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry, | 1126 | static 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 | */ |
1150 | static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data, | 1155 | static 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 | */ |
1169 | static long snd_mixart_BA1_read(snd_info_entry_t *entry, void *file_private_data, | 1174 | static 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 | ||
1196 | static void snd_mixart_proc_read(snd_info_entry_t *entry, | 1201 | static 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 | ||
1232 | static void __devinit snd_mixart_proc_init(mixart_t *chip) | 1237 | static 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); |
diff --git a/sound/pci/mixart/mixart.h b/sound/pci/mixart/mixart.h index f87152f94c0e..3e84863ca02c 100644 --- a/sound/pci/mixart/mixart.h +++ b/sound/pci/mixart/mixart.h | |||
@@ -32,21 +32,7 @@ | |||
32 | /* | 32 | /* |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #define mixart_t_magic 0xa17a3e01 | 35 | struct mixart_uid { |
36 | #define mixart_mgr_t_magic 0xa17a3e02 | ||
37 | |||
38 | typedef struct snd_mixart mixart_t; | ||
39 | typedef struct snd_mixart_mgr mixart_mgr_t; | ||
40 | |||
41 | typedef struct snd_mixart_stream mixart_stream_t; | ||
42 | typedef struct snd_mixart_pipe mixart_pipe_t; | ||
43 | |||
44 | typedef struct mixart_bufferinfo mixart_bufferinfo_t; | ||
45 | typedef struct mixart_flowinfo mixart_flowinfo_t; | ||
46 | typedef struct mixart_uid mixart_uid_t; | ||
47 | |||
48 | struct mixart_uid | ||
49 | { | ||
50 | u32 object_id; | 36 | u32 object_id; |
51 | u32 desc; | 37 | u32 desc; |
52 | }; | 38 | }; |
@@ -58,7 +44,6 @@ struct mem_area { | |||
58 | }; | 44 | }; |
59 | 45 | ||
60 | 46 | ||
61 | typedef struct mixart_route mixart_route_t; | ||
62 | struct mixart_route { | 47 | struct mixart_route { |
63 | unsigned char connected; | 48 | unsigned char connected; |
64 | unsigned char phase_inv; | 49 | unsigned char phase_inv; |
@@ -77,9 +62,9 @@ struct mixart_route { | |||
77 | 62 | ||
78 | #define MIXART_MAX_PHYS_CONNECTORS (MIXART_MAX_CARDS * 2 * 2) /* 4 * stereo * (analog+digital) */ | 63 | #define MIXART_MAX_PHYS_CONNECTORS (MIXART_MAX_CARDS * 2 * 2) /* 4 * stereo * (analog+digital) */ |
79 | 64 | ||
80 | struct snd_mixart_mgr { | 65 | struct mixart_mgr { |
81 | unsigned int num_cards; | 66 | unsigned int num_cards; |
82 | mixart_t *chip[MIXART_MAX_CARDS]; | 67 | struct snd_mixart *chip[MIXART_MAX_CARDS]; |
83 | 68 | ||
84 | struct pci_dev *pci; | 69 | struct pci_dev *pci; |
85 | 70 | ||
@@ -118,7 +103,7 @@ struct snd_mixart_mgr { | |||
118 | struct snd_dma_buffer flowinfo; | 103 | struct snd_dma_buffer flowinfo; |
119 | struct snd_dma_buffer bufferinfo; | 104 | struct snd_dma_buffer bufferinfo; |
120 | 105 | ||
121 | mixart_uid_t uid_console_manager; | 106 | struct mixart_uid uid_console_manager; |
122 | int sample_rate; | 107 | int sample_rate; |
123 | int ref_count_rate; | 108 | int ref_count_rate; |
124 | 109 | ||
@@ -151,9 +136,9 @@ struct snd_mixart_mgr { | |||
151 | #define MIXART_NOTIFY_SUBS_MASK 0x007F | 136 | #define MIXART_NOTIFY_SUBS_MASK 0x007F |
152 | 137 | ||
153 | 138 | ||
154 | struct snd_mixart_stream { | 139 | struct mixart_stream { |
155 | snd_pcm_substream_t *substream; | 140 | struct snd_pcm_substream *substream; |
156 | mixart_pipe_t *pipe; | 141 | struct mixart_pipe *pipe; |
157 | int pcm_number; | 142 | int pcm_number; |
158 | 143 | ||
159 | int status; /* nothing, running, draining */ | 144 | int status; /* nothing, running, draining */ |
@@ -173,11 +158,11 @@ enum mixart_pipe_status { | |||
173 | PIPE_CLOCK_SET | 158 | PIPE_CLOCK_SET |
174 | }; | 159 | }; |
175 | 160 | ||
176 | struct snd_mixart_pipe { | 161 | struct mixart_pipe { |
177 | mixart_uid_t group_uid; /* id of the pipe, as returned by embedded */ | 162 | struct mixart_uid group_uid; /* id of the pipe, as returned by embedded */ |
178 | int stream_count; | 163 | int stream_count; |
179 | mixart_uid_t uid_left_connector; /* UID's for the audio connectors */ | 164 | struct mixart_uid uid_left_connector; /* UID's for the audio connectors */ |
180 | mixart_uid_t uid_right_connector; | 165 | struct mixart_uid uid_right_connector; |
181 | enum mixart_pipe_status status; | 166 | enum mixart_pipe_status status; |
182 | int references; /* number of subs openned */ | 167 | int references; /* number of subs openned */ |
183 | int monitoring; /* pipe used for monitoring issue */ | 168 | int monitoring; /* pipe used for monitoring issue */ |
@@ -185,28 +170,28 @@ struct snd_mixart_pipe { | |||
185 | 170 | ||
186 | 171 | ||
187 | struct snd_mixart { | 172 | struct snd_mixart { |
188 | snd_card_t *card; | 173 | struct snd_card *card; |
189 | mixart_mgr_t *mgr; | 174 | struct mixart_mgr *mgr; |
190 | int chip_idx; /* zero based */ | 175 | int chip_idx; /* zero based */ |
191 | snd_hwdep_t *hwdep; /* DSP loader, only for the first card */ | 176 | struct snd_hwdep *hwdep; /* DSP loader, only for the first card */ |
192 | 177 | ||
193 | snd_pcm_t *pcm; /* PCM analog i/o */ | 178 | struct snd_pcm *pcm; /* PCM analog i/o */ |
194 | snd_pcm_t *pcm_dig; /* PCM digital i/o */ | 179 | struct snd_pcm *pcm_dig; /* PCM digital i/o */ |
195 | 180 | ||
196 | /* allocate stereo pipe for instance */ | 181 | /* allocate stereo pipe for instance */ |
197 | mixart_pipe_t pipe_in_ana; | 182 | struct mixart_pipe pipe_in_ana; |
198 | mixart_pipe_t pipe_out_ana; | 183 | struct mixart_pipe pipe_out_ana; |
199 | 184 | ||
200 | /* if AES/EBU daughter board is available, additional pipes possible on pcm_dig */ | 185 | /* if AES/EBU daughter board is available, additional pipes possible on pcm_dig */ |
201 | mixart_pipe_t pipe_in_dig; | 186 | struct mixart_pipe pipe_in_dig; |
202 | mixart_pipe_t pipe_out_dig; | 187 | struct mixart_pipe pipe_out_dig; |
203 | 188 | ||
204 | mixart_stream_t playback_stream[MIXART_PCM_TOTAL][MIXART_PLAYBACK_STREAMS]; /* 0 = pcm, 1 = pcm_dig */ | 189 | struct mixart_stream playback_stream[MIXART_PCM_TOTAL][MIXART_PLAYBACK_STREAMS]; /* 0 = pcm, 1 = pcm_dig */ |
205 | mixart_stream_t capture_stream[MIXART_PCM_TOTAL]; /* 0 = pcm, 1 = pcm_dig */ | 190 | struct mixart_stream capture_stream[MIXART_PCM_TOTAL]; /* 0 = pcm, 1 = pcm_dig */ |
206 | 191 | ||
207 | /* UID's for the physical io's */ | 192 | /* UID's for the physical io's */ |
208 | mixart_uid_t uid_out_analog_physio; | 193 | struct mixart_uid uid_out_analog_physio; |
209 | mixart_uid_t uid_in_analog_physio; | 194 | struct mixart_uid uid_in_analog_physio; |
210 | 195 | ||
211 | int analog_playback_active[2]; /* Mixer : Master Playback active (!mute) */ | 196 | int analog_playback_active[2]; /* Mixer : Master Playback active (!mute) */ |
212 | int analog_playback_volume[2]; /* Mixer : Master Playback Volume */ | 197 | int analog_playback_volume[2]; /* Mixer : Master Playback Volume */ |
@@ -235,8 +220,8 @@ struct mixart_flowinfo | |||
235 | }; | 220 | }; |
236 | 221 | ||
237 | /* exported */ | 222 | /* exported */ |
238 | int snd_mixart_create_pcm(mixart_t* chip); | 223 | int snd_mixart_create_pcm(struct snd_mixart * chip); |
239 | mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capture, int monitoring); | 224 | struct mixart_pipe *snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture, int monitoring); |
240 | int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monitoring); | 225 | int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, struct mixart_pipe *pipe, int monitoring); |
241 | 226 | ||
242 | #endif /* __SOUND_MIXART_H */ | 227 | #endif /* __SOUND_MIXART_H */ |
diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c index ba0027f50944..07c707d7ebbf 100644 --- a/sound/pci/mixart/mixart_core.c +++ b/sound/pci/mixart/mixart_core.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #define MSG_CANCEL_NOTIFY_MASK 0x80000000 /* this bit is set for a notification that has been canceled */ | 44 | #define MSG_CANCEL_NOTIFY_MASK 0x80000000 /* this bit is set for a notification that has been canceled */ |
45 | 45 | ||
46 | 46 | ||
47 | static int retrieve_msg_frame(mixart_mgr_t *mgr, u32 *msg_frame) | 47 | static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame) |
48 | { | 48 | { |
49 | /* read the message frame fifo */ | 49 | /* read the message frame fifo */ |
50 | u32 headptr, tailptr; | 50 | u32 headptr, tailptr; |
@@ -69,7 +69,8 @@ static int retrieve_msg_frame(mixart_mgr_t *mgr, u32 *msg_frame) | |||
69 | return 1; | 69 | return 1; |
70 | } | 70 | } |
71 | 71 | ||
72 | static int get_msg(mixart_mgr_t *mgr, mixart_msg_t *resp, u32 msg_frame_address ) | 72 | static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp, |
73 | u32 msg_frame_address ) | ||
73 | { | 74 | { |
74 | unsigned long flags; | 75 | unsigned long flags; |
75 | u32 headptr; | 76 | u32 headptr; |
@@ -137,8 +138,8 @@ static int get_msg(mixart_mgr_t *mgr, mixart_msg_t *resp, u32 msg_frame_address | |||
137 | * send a message to miXart. return: the msg_frame used for this message | 138 | * send a message to miXart. return: the msg_frame used for this message |
138 | */ | 139 | */ |
139 | /* call with mgr->msg_lock held! */ | 140 | /* call with mgr->msg_lock held! */ |
140 | static int send_msg( mixart_mgr_t *mgr, | 141 | static int send_msg( struct mixart_mgr *mgr, |
141 | mixart_msg_t *msg, | 142 | struct mixart_msg *msg, |
142 | int max_answersize, | 143 | int max_answersize, |
143 | int mark_pending, | 144 | int mark_pending, |
144 | u32 *msg_event) | 145 | u32 *msg_event) |
@@ -230,9 +231,9 @@ static int send_msg( mixart_mgr_t *mgr, | |||
230 | } | 231 | } |
231 | 232 | ||
232 | 233 | ||
233 | int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_size, void *resp_data) | 234 | int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int max_resp_size, void *resp_data) |
234 | { | 235 | { |
235 | mixart_msg_t resp; | 236 | struct mixart_msg resp; |
236 | u32 msg_frame = 0; /* set to 0, so it's no notification to wait for, but the answer */ | 237 | u32 msg_frame = 0; /* set to 0, so it's no notification to wait for, but the answer */ |
237 | int err; | 238 | int err; |
238 | wait_queue_t wait; | 239 | wait_queue_t wait; |
@@ -264,9 +265,9 @@ int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_s | |||
264 | return -EIO; | 265 | return -EIO; |
265 | } | 266 | } |
266 | 267 | ||
267 | /* retrieve the answer into the same mixart_msg_t */ | 268 | /* retrieve the answer into the same struct mixart_msg */ |
268 | resp.message_id = 0; | 269 | resp.message_id = 0; |
269 | resp.uid = (mixart_uid_t){0,0}; | 270 | resp.uid = (struct mixart_uid){0,0}; |
270 | resp.data = resp_data; | 271 | resp.data = resp_data; |
271 | resp.size = max_resp_size; | 272 | resp.size = max_resp_size; |
272 | 273 | ||
@@ -280,7 +281,8 @@ int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_s | |||
280 | } | 281 | } |
281 | 282 | ||
282 | 283 | ||
283 | int snd_mixart_send_msg_wait_notif(mixart_mgr_t *mgr, mixart_msg_t *request, u32 notif_event) | 284 | int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, |
285 | struct mixart_msg *request, u32 notif_event) | ||
284 | { | 286 | { |
285 | int err; | 287 | int err; |
286 | wait_queue_t wait; | 288 | wait_queue_t wait; |
@@ -321,7 +323,7 @@ int snd_mixart_send_msg_wait_notif(mixart_mgr_t *mgr, mixart_msg_t *request, u32 | |||
321 | } | 323 | } |
322 | 324 | ||
323 | 325 | ||
324 | int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request) | 326 | int snd_mixart_send_msg_nonblock(struct mixart_mgr *mgr, struct mixart_msg *request) |
325 | { | 327 | { |
326 | u32 message_frame; | 328 | u32 message_frame; |
327 | unsigned long flags; | 329 | unsigned long flags; |
@@ -332,7 +334,7 @@ int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request) | |||
332 | err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 0, &message_frame); | 334 | err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 0, &message_frame); |
333 | spin_unlock_irqrestore(&mgr->msg_lock, flags); | 335 | spin_unlock_irqrestore(&mgr->msg_lock, flags); |
334 | 336 | ||
335 | /* the answer will be handled by snd_mixart_msg_tasklet() */ | 337 | /* the answer will be handled by snd_struct mixart_msgasklet() */ |
336 | atomic_inc(&mgr->msg_processed); | 338 | atomic_inc(&mgr->msg_processed); |
337 | 339 | ||
338 | return err; | 340 | return err; |
@@ -343,10 +345,10 @@ int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request) | |||
343 | static u32 mixart_msg_data[MSG_DEFAULT_SIZE / 4]; | 345 | static u32 mixart_msg_data[MSG_DEFAULT_SIZE / 4]; |
344 | 346 | ||
345 | 347 | ||
346 | void snd_mixart_msg_tasklet( unsigned long arg) | 348 | void snd_mixart_msg_tasklet(unsigned long arg) |
347 | { | 349 | { |
348 | mixart_mgr_t *mgr = ( mixart_mgr_t*)(arg); | 350 | struct mixart_mgr *mgr = ( struct mixart_mgr*)(arg); |
349 | mixart_msg_t resp; | 351 | struct mixart_msg resp; |
350 | u32 msg, addr, type; | 352 | u32 msg, addr, type; |
351 | int err; | 353 | int err; |
352 | 354 | ||
@@ -406,9 +408,9 @@ void snd_mixart_msg_tasklet( unsigned long arg) | |||
406 | 408 | ||
407 | irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 409 | irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
408 | { | 410 | { |
409 | mixart_mgr_t *mgr = dev_id; | 411 | struct mixart_mgr *mgr = dev_id; |
410 | int err; | 412 | int err; |
411 | mixart_msg_t resp; | 413 | struct mixart_msg resp; |
412 | 414 | ||
413 | u32 msg; | 415 | u32 msg; |
414 | u32 it_reg; | 416 | u32 it_reg; |
@@ -448,7 +450,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
448 | 450 | ||
449 | if(resp.message_id == MSG_SERVICES_TIMER_NOTIFY) { | 451 | if(resp.message_id == MSG_SERVICES_TIMER_NOTIFY) { |
450 | int i; | 452 | int i; |
451 | mixart_timer_notify_t *notify = (mixart_timer_notify_t*)mixart_msg_data; | 453 | struct mixart_timer_notify *notify; |
454 | notify = (struct mixart_timer_notify *)mixart_msg_data; | ||
452 | 455 | ||
453 | for(i=0; i<notify->stream_count; i++) { | 456 | for(i=0; i<notify->stream_count; i++) { |
454 | 457 | ||
@@ -458,8 +461,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
458 | unsigned int sub_number = buffer_id & MIXART_NOTIFY_SUBS_MASK; /* 0 to MIXART_PLAYBACK_STREAMS */ | 461 | unsigned int sub_number = buffer_id & MIXART_NOTIFY_SUBS_MASK; /* 0 to MIXART_PLAYBACK_STREAMS */ |
459 | unsigned int is_capture = ((buffer_id & MIXART_NOTIFY_CAPT_MASK) != 0); /* playback == 0 / capture == 1 */ | 462 | unsigned int is_capture = ((buffer_id & MIXART_NOTIFY_CAPT_MASK) != 0); /* playback == 0 / capture == 1 */ |
460 | 463 | ||
461 | mixart_t *chip = mgr->chip[chip_number]; | 464 | struct snd_mixart *chip = mgr->chip[chip_number]; |
462 | mixart_stream_t *stream; | 465 | struct mixart_stream *stream; |
463 | 466 | ||
464 | if ((chip_number >= mgr->num_cards) || (pcm_number >= MIXART_PCM_TOTAL) || (sub_number >= MIXART_PLAYBACK_STREAMS)) { | 467 | if ((chip_number >= mgr->num_cards) || (pcm_number >= MIXART_PCM_TOTAL) || (sub_number >= MIXART_PLAYBACK_STREAMS)) { |
465 | snd_printk(KERN_ERR "error MSG_SERVICES_TIMER_NOTIFY buffer_id (%x) pos(%d)\n", | 468 | snd_printk(KERN_ERR "error MSG_SERVICES_TIMER_NOTIFY buffer_id (%x) pos(%d)\n", |
@@ -473,7 +476,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
473 | stream = &chip->playback_stream[pcm_number][sub_number]; | 476 | stream = &chip->playback_stream[pcm_number][sub_number]; |
474 | 477 | ||
475 | if (stream->substream && (stream->status == MIXART_STREAM_STATUS_RUNNING)) { | 478 | if (stream->substream && (stream->status == MIXART_STREAM_STATUS_RUNNING)) { |
476 | snd_pcm_runtime_t *runtime = stream->substream->runtime; | 479 | struct snd_pcm_runtime *runtime = stream->substream->runtime; |
477 | int elapsed = 0; | 480 | int elapsed = 0; |
478 | u64 sample_count = ((u64)notify->streams[i].sample_pos_high_part) << 32; | 481 | u64 sample_count = ((u64)notify->streams[i].sample_pos_high_part) << 32; |
479 | sample_count |= notify->streams[i].sample_pos_low_part; | 482 | sample_count |= notify->streams[i].sample_pos_low_part; |
@@ -561,7 +564,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
561 | } | 564 | } |
562 | 565 | ||
563 | 566 | ||
564 | void snd_mixart_init_mailbox(mixart_mgr_t *mgr) | 567 | void snd_mixart_init_mailbox(struct mixart_mgr *mgr) |
565 | { | 568 | { |
566 | writel( 0, MIXART_MEM( mgr, MSG_HOST_RSC_PROTECTION ) ); | 569 | writel( 0, MIXART_MEM( mgr, MSG_HOST_RSC_PROTECTION ) ); |
567 | writel( 0, MIXART_MEM( mgr, MSG_AGENT_RSC_PROTECTION ) ); | 570 | writel( 0, MIXART_MEM( mgr, MSG_AGENT_RSC_PROTECTION ) ); |
@@ -573,14 +576,14 @@ void snd_mixart_init_mailbox(mixart_mgr_t *mgr) | |||
573 | return; | 576 | return; |
574 | } | 577 | } |
575 | 578 | ||
576 | void snd_mixart_exit_mailbox(mixart_mgr_t *mgr) | 579 | void snd_mixart_exit_mailbox(struct mixart_mgr *mgr) |
577 | { | 580 | { |
578 | /* no more interrupts on outbound messagebox */ | 581 | /* no more interrupts on outbound messagebox */ |
579 | writel_le( MIXART_HOST_ALL_INTERRUPT_MASKED, MIXART_REG( mgr, MIXART_PCI_OMIMR_OFFSET)); | 582 | writel_le( MIXART_HOST_ALL_INTERRUPT_MASKED, MIXART_REG( mgr, MIXART_PCI_OMIMR_OFFSET)); |
580 | return; | 583 | return; |
581 | } | 584 | } |
582 | 585 | ||
583 | void snd_mixart_reset_board(mixart_mgr_t *mgr) | 586 | void snd_mixart_reset_board(struct mixart_mgr *mgr) |
584 | { | 587 | { |
585 | /* reset miXart */ | 588 | /* reset miXart */ |
586 | writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET) ); | 589 | writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET) ); |
diff --git a/sound/pci/mixart/mixart_core.h b/sound/pci/mixart/mixart_core.h index 99450eba15c0..1fe2bcfcc57c 100644 --- a/sound/pci/mixart/mixart_core.h +++ b/sound/pci/mixart/mixart_core.h | |||
@@ -63,25 +63,23 @@ enum mixart_message_id { | |||
63 | }; | 63 | }; |
64 | 64 | ||
65 | 65 | ||
66 | typedef struct mixart_msg mixart_msg_t; | ||
67 | struct mixart_msg | 66 | struct mixart_msg |
68 | { | 67 | { |
69 | u32 message_id; | 68 | u32 message_id; |
70 | mixart_uid_t uid; | 69 | struct mixart_uid uid; |
71 | void* data; | 70 | void* data; |
72 | size_t size; | 71 | size_t size; |
73 | }; | 72 | }; |
74 | 73 | ||
75 | /* structs used to communicate with miXart */ | 74 | /* structs used to communicate with miXart */ |
76 | 75 | ||
77 | typedef struct mixart_enum_connector_resp mixart_enum_connector_resp_t; | ||
78 | struct mixart_enum_connector_resp | 76 | struct mixart_enum_connector_resp |
79 | { | 77 | { |
80 | u32 error_code; | 78 | u32 error_code; |
81 | u32 first_uid_offset; | 79 | u32 first_uid_offset; |
82 | u32 uid_count; | 80 | u32 uid_count; |
83 | u32 current_uid_index; | 81 | u32 current_uid_index; |
84 | mixart_uid_t uid[MIXART_MAX_PHYS_CONNECTORS]; | 82 | struct mixart_uid uid[MIXART_MAX_PHYS_CONNECTORS]; |
85 | } __attribute__((packed)); | 83 | } __attribute__((packed)); |
86 | 84 | ||
87 | 85 | ||
@@ -90,7 +88,6 @@ struct mixart_enum_connector_resp | |||
90 | #define MIXART_FLOAT_M_20_0_TO_HEX 0xc1a00000 /* -20.0f */ | 88 | #define MIXART_FLOAT_M_20_0_TO_HEX 0xc1a00000 /* -20.0f */ |
91 | #define MIXART_FLOAT____0_0_TO_HEX 0x00000000 /* 0.0f */ | 89 | #define MIXART_FLOAT____0_0_TO_HEX 0x00000000 /* 0.0f */ |
92 | 90 | ||
93 | typedef struct mixart_audio_info_req mixart_audio_info_req_t; | ||
94 | struct mixart_audio_info_req | 91 | struct mixart_audio_info_req |
95 | { | 92 | { |
96 | u32 line_max_level; /* float */ | 93 | u32 line_max_level; /* float */ |
@@ -98,7 +95,6 @@ struct mixart_audio_info_req | |||
98 | u32 cd_max_level; /* float */ | 95 | u32 cd_max_level; /* float */ |
99 | } __attribute__((packed)); | 96 | } __attribute__((packed)); |
100 | 97 | ||
101 | typedef struct mixart_analog_hw_info mixart_analog_hw_info_t; | ||
102 | struct mixart_analog_hw_info | 98 | struct mixart_analog_hw_info |
103 | { | 99 | { |
104 | u32 is_present; | 100 | u32 is_present; |
@@ -111,7 +107,6 @@ struct mixart_analog_hw_info | |||
111 | u32 zero_var; /* float */ | 107 | u32 zero_var; /* float */ |
112 | } __attribute__((packed)); | 108 | } __attribute__((packed)); |
113 | 109 | ||
114 | typedef struct mixart_digital_hw_info mixart_digital_hw_info_t; | ||
115 | struct mixart_digital_hw_info | 110 | struct mixart_digital_hw_info |
116 | { | 111 | { |
117 | u32 hw_connection_type; | 112 | u32 hw_connection_type; |
@@ -120,37 +115,33 @@ struct mixart_digital_hw_info | |||
120 | u32 reserved; | 115 | u32 reserved; |
121 | } __attribute__((packed)); | 116 | } __attribute__((packed)); |
122 | 117 | ||
123 | typedef struct mixart_analog_info mixart_analog_info_t; | ||
124 | struct mixart_analog_info | 118 | struct mixart_analog_info |
125 | { | 119 | { |
126 | u32 type_mask; | 120 | u32 type_mask; |
127 | mixart_analog_hw_info_t micro_info; | 121 | struct mixart_analog_hw_info micro_info; |
128 | mixart_analog_hw_info_t line_info; | 122 | struct mixart_analog_hw_info line_info; |
129 | mixart_analog_hw_info_t cd_info; | 123 | struct mixart_analog_hw_info cd_info; |
130 | u32 analog_level_present; | 124 | u32 analog_level_present; |
131 | } __attribute__((packed)); | 125 | } __attribute__((packed)); |
132 | 126 | ||
133 | typedef struct mixart_digital_info mixart_digital_info_t; | ||
134 | struct mixart_digital_info | 127 | struct mixart_digital_info |
135 | { | 128 | { |
136 | u32 type_mask; | 129 | u32 type_mask; |
137 | mixart_digital_hw_info_t aes_info; | 130 | struct mixart_digital_hw_info aes_info; |
138 | mixart_digital_hw_info_t adat_info; | 131 | struct mixart_digital_hw_info adat_info; |
139 | } __attribute__((packed)); | 132 | } __attribute__((packed)); |
140 | 133 | ||
141 | typedef struct mixart_audio_info mixart_audio_info_t; | ||
142 | struct mixart_audio_info | 134 | struct mixart_audio_info |
143 | { | 135 | { |
144 | u32 clock_type_mask; | 136 | u32 clock_type_mask; |
145 | mixart_analog_info_t analog_info; | 137 | struct mixart_analog_info analog_info; |
146 | mixart_digital_info_t digital_info; | 138 | struct mixart_digital_info digital_info; |
147 | } __attribute__((packed)); | 139 | } __attribute__((packed)); |
148 | 140 | ||
149 | typedef struct mixart_audio_info_resp mixart_audio_info_resp_t; | ||
150 | struct mixart_audio_info_resp | 141 | struct mixart_audio_info_resp |
151 | { | 142 | { |
152 | u32 txx_status; | 143 | u32 txx_status; |
153 | mixart_audio_info_t info; | 144 | struct mixart_audio_info info; |
154 | } __attribute__((packed)); | 145 | } __attribute__((packed)); |
155 | 146 | ||
156 | 147 | ||
@@ -158,7 +149,6 @@ struct mixart_audio_info_resp | |||
158 | #define MIXART_FLOAT_P__4_0_TO_HEX 0x40800000 /* +4.0f */ | 149 | #define MIXART_FLOAT_P__4_0_TO_HEX 0x40800000 /* +4.0f */ |
159 | #define MIXART_FLOAT_P__8_0_TO_HEX 0x41000000 /* +8.0f */ | 150 | #define MIXART_FLOAT_P__8_0_TO_HEX 0x41000000 /* +8.0f */ |
160 | 151 | ||
161 | typedef struct mixart_stream_info mixart_stream_info_t; | ||
162 | struct mixart_stream_info | 152 | struct mixart_stream_info |
163 | { | 153 | { |
164 | u32 size_max_byte_frame; | 154 | u32 size_max_byte_frame; |
@@ -169,7 +159,6 @@ struct mixart_stream_info | |||
169 | /* MSG_STREAM_ADD_INPUT_GROUP */ | 159 | /* MSG_STREAM_ADD_INPUT_GROUP */ |
170 | /* MSG_STREAM_ADD_OUTPUT_GROUP */ | 160 | /* MSG_STREAM_ADD_OUTPUT_GROUP */ |
171 | 161 | ||
172 | typedef struct mixart_streaming_group_req mixart_streaming_group_req_t; | ||
173 | struct mixart_streaming_group_req | 162 | struct mixart_streaming_group_req |
174 | { | 163 | { |
175 | u32 stream_count; | 164 | u32 stream_count; |
@@ -177,33 +166,30 @@ struct mixart_streaming_group_req | |||
177 | u32 user_grp_number; | 166 | u32 user_grp_number; |
178 | u32 first_phys_audio; | 167 | u32 first_phys_audio; |
179 | u32 latency; | 168 | u32 latency; |
180 | mixart_stream_info_t stream_info[32]; | 169 | struct mixart_stream_info stream_info[32]; |
181 | mixart_uid_t connector; | 170 | struct mixart_uid connector; |
182 | u32 flow_entry[32]; | 171 | u32 flow_entry[32]; |
183 | } __attribute__((packed)); | 172 | } __attribute__((packed)); |
184 | 173 | ||
185 | typedef struct mixart_stream_desc mixart_stream_desc_t; | ||
186 | struct mixart_stream_desc | 174 | struct mixart_stream_desc |
187 | { | 175 | { |
188 | mixart_uid_t stream_uid; | 176 | struct mixart_uid stream_uid; |
189 | u32 stream_desc; | 177 | u32 stream_desc; |
190 | } __attribute__((packed)); | 178 | } __attribute__((packed)); |
191 | 179 | ||
192 | typedef struct mixart_streaming_group mixart_streaming_group_t; | ||
193 | struct mixart_streaming_group | 180 | struct mixart_streaming_group |
194 | { | 181 | { |
195 | u32 status; | 182 | u32 status; |
196 | mixart_uid_t group; | 183 | struct mixart_uid group; |
197 | u32 pipe_desc; | 184 | u32 pipe_desc; |
198 | u32 stream_count; | 185 | u32 stream_count; |
199 | mixart_stream_desc_t stream[32]; | 186 | struct mixart_stream_desc stream[32]; |
200 | } __attribute__((packed)); | 187 | } __attribute__((packed)); |
201 | 188 | ||
202 | /* MSG_STREAM_DELETE_GROUP */ | 189 | /* MSG_STREAM_DELETE_GROUP */ |
203 | 190 | ||
204 | /* request : mixart_uid_t group */ | 191 | /* request : mixart_uid_t group */ |
205 | 192 | ||
206 | typedef struct mixart_delete_group_resp mixart_delete_group_resp_t; | ||
207 | struct mixart_delete_group_resp | 193 | struct mixart_delete_group_resp |
208 | { | 194 | { |
209 | u32 status; | 195 | u32 status; |
@@ -217,55 +203,49 @@ struct mixart_delete_group_resp | |||
217 | MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x130000 + 11, | 203 | MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x130000 + 11, |
218 | */ | 204 | */ |
219 | 205 | ||
220 | typedef struct mixart_fx_couple_uid mixart_fx_couple_uid_t; | ||
221 | struct mixart_fx_couple_uid | 206 | struct mixart_fx_couple_uid |
222 | { | 207 | { |
223 | mixart_uid_t uid_fx_code; | 208 | struct mixart_uid uid_fx_code; |
224 | mixart_uid_t uid_fx_data; | 209 | struct mixart_uid uid_fx_data; |
225 | } __attribute__((packed)); | 210 | } __attribute__((packed)); |
226 | 211 | ||
227 | typedef struct mixart_txx_stream_desc mixart_txx_stream_desc_t; | ||
228 | struct mixart_txx_stream_desc | 212 | struct mixart_txx_stream_desc |
229 | { | 213 | { |
230 | mixart_uid_t uid_pipe; | 214 | struct mixart_uid uid_pipe; |
231 | u32 stream_idx; | 215 | u32 stream_idx; |
232 | u32 fx_number; | 216 | u32 fx_number; |
233 | mixart_fx_couple_uid_t uid_fx[4]; | 217 | struct mixart_fx_couple_uid uid_fx[4]; |
234 | } __attribute__((packed)); | 218 | } __attribute__((packed)); |
235 | 219 | ||
236 | typedef struct mixart_flow_info mixart_flow_info_t; | ||
237 | struct mixart_flow_info | 220 | struct mixart_flow_info |
238 | { | 221 | { |
239 | mixart_txx_stream_desc_t stream_desc; | 222 | struct mixart_txx_stream_desc stream_desc; |
240 | u32 flow_entry; | 223 | u32 flow_entry; |
241 | u32 flow_phy_addr; | 224 | u32 flow_phy_addr; |
242 | } __attribute__((packed)); | 225 | } __attribute__((packed)); |
243 | 226 | ||
244 | typedef struct mixart_stream_state_req mixart_stream_state_req_t; | ||
245 | struct mixart_stream_state_req | 227 | struct mixart_stream_state_req |
246 | { | 228 | { |
247 | u32 delayed; | 229 | u32 delayed; |
248 | u64 scheduler; | 230 | u64 scheduler; |
249 | u32 reserved4np[3]; | 231 | u32 reserved4np[3]; |
250 | u32 stream_count; /* set to 1 for instance */ | 232 | u32 stream_count; /* set to 1 for instance */ |
251 | mixart_flow_info_t stream_info; /* could be an array[stream_count] */ | 233 | struct mixart_flow_info stream_info; /* could be an array[stream_count] */ |
252 | } __attribute__((packed)); | 234 | } __attribute__((packed)); |
253 | 235 | ||
254 | /* MSG_STREAM_START_STREAM_GRP_PACKET = 0x130000 + 6 | 236 | /* MSG_STREAM_START_STREAM_GRP_PACKET = 0x130000 + 6 |
255 | MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130000 + 9 | 237 | MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130000 + 9 |
256 | */ | 238 | */ |
257 | 239 | ||
258 | typedef struct mixart_group_state_req mixart_group_state_req_t; | ||
259 | struct mixart_group_state_req | 240 | struct mixart_group_state_req |
260 | { | 241 | { |
261 | u32 delayed; | 242 | u32 delayed; |
262 | u64 scheduler; | 243 | u64 scheduler; |
263 | u32 reserved4np[2]; | 244 | u32 reserved4np[2]; |
264 | u32 pipe_count; /* set to 1 for instance */ | 245 | u32 pipe_count; /* set to 1 for instance */ |
265 | mixart_uid_t pipe_uid[1]; /* could be an array[pipe_count] */ | 246 | struct mixart_uid pipe_uid[1]; /* could be an array[pipe_count] */ |
266 | } __attribute__((packed)); | 247 | } __attribute__((packed)); |
267 | 248 | ||
268 | typedef struct mixart_group_state_resp mixart_group_state_resp_t; | ||
269 | struct mixart_group_state_resp | 249 | struct mixart_group_state_resp |
270 | { | 250 | { |
271 | u32 txx_status; | 251 | u32 txx_status; |
@@ -276,7 +256,6 @@ struct mixart_group_state_resp | |||
276 | 256 | ||
277 | /* Structures used by the MSG_SERVICES_TIMER_NOTIFY command */ | 257 | /* Structures used by the MSG_SERVICES_TIMER_NOTIFY command */ |
278 | 258 | ||
279 | typedef struct mixart_sample_pos mixart_sample_pos_t; | ||
280 | struct mixart_sample_pos | 259 | struct mixart_sample_pos |
281 | { | 260 | { |
282 | u32 buffer_id; | 261 | u32 buffer_id; |
@@ -285,11 +264,10 @@ struct mixart_sample_pos | |||
285 | u32 sample_pos_low_part; | 264 | u32 sample_pos_low_part; |
286 | } __attribute__((packed)); | 265 | } __attribute__((packed)); |
287 | 266 | ||
288 | typedef struct mixart_timer_notify mixart_timer_notify_t; | ||
289 | struct mixart_timer_notify | 267 | struct mixart_timer_notify |
290 | { | 268 | { |
291 | u32 stream_count; | 269 | u32 stream_count; |
292 | mixart_sample_pos_t streams[MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS]; | 270 | struct mixart_sample_pos streams[MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS]; |
293 | } __attribute__((packed)); | 271 | } __attribute__((packed)); |
294 | 272 | ||
295 | 273 | ||
@@ -298,11 +276,10 @@ struct mixart_timer_notify | |||
298 | 276 | ||
299 | /* request is a uid with desc = MSG_CONSOLE_MANAGER | cardindex */ | 277 | /* request is a uid with desc = MSG_CONSOLE_MANAGER | cardindex */ |
300 | 278 | ||
301 | typedef struct mixart_return_uid mixart_return_uid_t; | ||
302 | struct mixart_return_uid | 279 | struct mixart_return_uid |
303 | { | 280 | { |
304 | u32 error_code; | 281 | u32 error_code; |
305 | mixart_uid_t uid; | 282 | struct mixart_uid uid; |
306 | } __attribute__((packed)); | 283 | } __attribute__((packed)); |
307 | 284 | ||
308 | /* MSG_CLOCK_CHECK_PROPERTIES = 0x200001, | 285 | /* MSG_CLOCK_CHECK_PROPERTIES = 0x200001, |
@@ -327,7 +304,6 @@ enum mixart_clock_mode { | |||
327 | }; | 304 | }; |
328 | 305 | ||
329 | 306 | ||
330 | typedef struct mixart_clock_properties mixart_clock_properties_t; | ||
331 | struct mixart_clock_properties | 307 | struct mixart_clock_properties |
332 | { | 308 | { |
333 | u32 error_code; | 309 | u32 error_code; |
@@ -336,17 +312,16 @@ struct mixart_clock_properties | |||
336 | u32 reference_frequency; | 312 | u32 reference_frequency; |
337 | u32 clock_generic_type; | 313 | u32 clock_generic_type; |
338 | u32 clock_mode; | 314 | u32 clock_mode; |
339 | mixart_uid_t uid_clock_source; | 315 | struct mixart_uid uid_clock_source; |
340 | mixart_uid_t uid_event_source; | 316 | struct mixart_uid uid_event_source; |
341 | u32 event_mode; | 317 | u32 event_mode; |
342 | u32 synchro_signal_presence; | 318 | u32 synchro_signal_presence; |
343 | u32 format; | 319 | u32 format; |
344 | u32 board_mask; | 320 | u32 board_mask; |
345 | u32 nb_callers; /* set to 1 (see below) */ | 321 | u32 nb_callers; /* set to 1 (see below) */ |
346 | mixart_uid_t uid_caller[1]; | 322 | struct mixart_uid uid_caller[1]; |
347 | } __attribute__((packed)); | 323 | } __attribute__((packed)); |
348 | 324 | ||
349 | typedef struct mixart_clock_properties_resp mixart_clock_properties_resp_t; | ||
350 | struct mixart_clock_properties_resp | 325 | struct mixart_clock_properties_resp |
351 | { | 326 | { |
352 | u32 status; | 327 | u32 status; |
@@ -388,7 +363,6 @@ enum mixart_sample_type { | |||
388 | ST_INTEGER_32LE | 363 | ST_INTEGER_32LE |
389 | }; | 364 | }; |
390 | 365 | ||
391 | typedef struct mixart_stream_param_desc mixart_stream_param_desc_t; | ||
392 | struct mixart_stream_param_desc | 366 | struct mixart_stream_param_desc |
393 | { | 367 | { |
394 | u32 coding_type; /* use enum mixart_coding_type */ | 368 | u32 coding_type; /* use enum mixart_coding_type */ |
@@ -432,7 +406,7 @@ struct mixart_stream_param_desc | |||
432 | u32 reserved4np[3]; | 406 | u32 reserved4np[3]; |
433 | u32 pipe_count; /* set to 1 (array size !) */ | 407 | u32 pipe_count; /* set to 1 (array size !) */ |
434 | u32 stream_count; /* set to 1 (array size !) */ | 408 | u32 stream_count; /* set to 1 (array size !) */ |
435 | mixart_txx_stream_desc_t stream_desc[1]; /* only one stream per command, but this could be an array */ | 409 | struct mixart_txx_stream_desc stream_desc[1]; /* only one stream per command, but this could be an array */ |
436 | 410 | ||
437 | } __attribute__((packed)); | 411 | } __attribute__((packed)); |
438 | 412 | ||
@@ -441,7 +415,6 @@ struct mixart_stream_param_desc | |||
441 | */ | 415 | */ |
442 | 416 | ||
443 | 417 | ||
444 | typedef struct mixart_get_out_audio_level mixart_get_out_audio_level_t; | ||
445 | struct mixart_get_out_audio_level | 418 | struct mixart_get_out_audio_level |
446 | { | 419 | { |
447 | u32 txx_status; | 420 | u32 txx_status; |
@@ -465,7 +438,6 @@ struct mixart_get_out_audio_level | |||
465 | #define MIXART_AUDIO_LEVEL_MUTE_M1_MASK 0x10 | 438 | #define MIXART_AUDIO_LEVEL_MUTE_M1_MASK 0x10 |
466 | #define MIXART_AUDIO_LEVEL_MUTE_M2_MASK 0x20 | 439 | #define MIXART_AUDIO_LEVEL_MUTE_M2_MASK 0x20 |
467 | 440 | ||
468 | typedef struct mixart_set_out_audio_level mixart_set_out_audio_level_t; | ||
469 | struct mixart_set_out_audio_level | 441 | struct mixart_set_out_audio_level |
470 | { | 442 | { |
471 | u32 delayed; | 443 | u32 delayed; |
@@ -487,14 +459,13 @@ struct mixart_set_out_audio_level | |||
487 | 459 | ||
488 | #define MIXART_MAX_PHYS_IO (MIXART_MAX_CARDS * 2 * 2) /* 4 * (analog+digital) * (playback+capture) */ | 460 | #define MIXART_MAX_PHYS_IO (MIXART_MAX_CARDS * 2 * 2) /* 4 * (analog+digital) * (playback+capture) */ |
489 | 461 | ||
490 | typedef struct mixart_uid_enumeration mixart_uid_enumeration_t; | ||
491 | struct mixart_uid_enumeration | 462 | struct mixart_uid_enumeration |
492 | { | 463 | { |
493 | u32 error_code; | 464 | u32 error_code; |
494 | u32 first_uid_offset; | 465 | u32 first_uid_offset; |
495 | u32 nb_uid; | 466 | u32 nb_uid; |
496 | u32 current_uid_index; | 467 | u32 current_uid_index; |
497 | mixart_uid_t uid[MIXART_MAX_PHYS_IO]; | 468 | struct mixart_uid uid[MIXART_MAX_PHYS_IO]; |
498 | } __attribute__((packed)); | 469 | } __attribute__((packed)); |
499 | 470 | ||
500 | 471 | ||
@@ -502,42 +473,38 @@ struct mixart_uid_enumeration | |||
502 | MSG_PHYSICALIO_GET_LEVEL = 0x0F000C, | 473 | MSG_PHYSICALIO_GET_LEVEL = 0x0F000C, |
503 | */ | 474 | */ |
504 | 475 | ||
505 | typedef struct mixart_io_channel_level mixart_io_channel_level_t; | ||
506 | struct mixart_io_channel_level | 476 | struct mixart_io_channel_level |
507 | { | 477 | { |
508 | u32 analog_level; /* float */ | 478 | u32 analog_level; /* float */ |
509 | u32 unused[2]; | 479 | u32 unused[2]; |
510 | } __attribute__((packed)); | 480 | } __attribute__((packed)); |
511 | 481 | ||
512 | typedef struct mixart_io_level mixart_io_level_t; | ||
513 | struct mixart_io_level | 482 | struct mixart_io_level |
514 | { | 483 | { |
515 | s32 channel; /* 0=left, 1=right, -1=both, -2=both same */ | 484 | s32 channel; /* 0=left, 1=right, -1=both, -2=both same */ |
516 | mixart_io_channel_level_t level[2]; | 485 | struct mixart_io_channel_level level[2]; |
517 | } __attribute__((packed)); | 486 | } __attribute__((packed)); |
518 | 487 | ||
519 | 488 | ||
520 | /* MSG_STREAM_SET_IN_AUDIO_LEVEL = 0x130015, | 489 | /* MSG_STREAM_SET_IN_AUDIO_LEVEL = 0x130015, |
521 | */ | 490 | */ |
522 | 491 | ||
523 | typedef struct mixart_in_audio_level_info mixart_in_audio_level_info_t; | ||
524 | struct mixart_in_audio_level_info | 492 | struct mixart_in_audio_level_info |
525 | { | 493 | { |
526 | mixart_uid_t connector; | 494 | struct mixart_uid connector; |
527 | u32 valid_mask1; | 495 | u32 valid_mask1; |
528 | u32 valid_mask2; | 496 | u32 valid_mask2; |
529 | u32 digital_level; | 497 | u32 digital_level; |
530 | u32 analog_level; | 498 | u32 analog_level; |
531 | } __attribute__((packed)); | 499 | } __attribute__((packed)); |
532 | 500 | ||
533 | typedef struct mixart_set_in_audio_level_req mixart_set_in_audio_level_req_t; | ||
534 | struct mixart_set_in_audio_level_req | 501 | struct mixart_set_in_audio_level_req |
535 | { | 502 | { |
536 | u32 delayed; | 503 | u32 delayed; |
537 | u64 scheduler; | 504 | u64 scheduler; |
538 | u32 audio_count; /* set to <= 2 */ | 505 | u32 audio_count; /* set to <= 2 */ |
539 | u32 reserved4np; | 506 | u32 reserved4np; |
540 | mixart_in_audio_level_info_t level[2]; | 507 | struct mixart_in_audio_level_info level[2]; |
541 | } __attribute__((packed)); | 508 | } __attribute__((packed)); |
542 | 509 | ||
543 | /* response is a 32 bit status */ | 510 | /* response is a 32 bit status */ |
@@ -556,7 +523,6 @@ struct mixart_set_in_audio_level_req | |||
556 | #define MIXART_OUT_STREAM_SET_LEVEL_MUTE_1 0x40 | 523 | #define MIXART_OUT_STREAM_SET_LEVEL_MUTE_1 0x40 |
557 | #define MIXART_OUT_STREAM_SET_LEVEL_MUTE_2 0x80 | 524 | #define MIXART_OUT_STREAM_SET_LEVEL_MUTE_2 0x80 |
558 | 525 | ||
559 | typedef struct mixart_out_stream_level_info mixart_out_stream_level_info_t; | ||
560 | struct mixart_out_stream_level_info | 526 | struct mixart_out_stream_level_info |
561 | { | 527 | { |
562 | u32 valid_mask1; | 528 | u32 valid_mask1; |
@@ -571,37 +537,35 @@ struct mixart_out_stream_level_info | |||
571 | u32 mute2; | 537 | u32 mute2; |
572 | } __attribute__((packed)); | 538 | } __attribute__((packed)); |
573 | 539 | ||
574 | typedef struct mixart_set_out_stream_level mixart_set_out_stream_level_t; | ||
575 | struct mixart_set_out_stream_level | 540 | struct mixart_set_out_stream_level |
576 | { | 541 | { |
577 | mixart_txx_stream_desc_t desc; | 542 | struct mixart_txx_stream_desc desc; |
578 | mixart_out_stream_level_info_t out_level; | 543 | struct mixart_out_stream_level_info out_level; |
579 | } __attribute__((packed)); | 544 | } __attribute__((packed)); |
580 | 545 | ||
581 | typedef struct mixart_set_out_stream_level_req mixart_set_out_stream_level_req_t; | ||
582 | struct mixart_set_out_stream_level_req | 546 | struct mixart_set_out_stream_level_req |
583 | { | 547 | { |
584 | u32 delayed; | 548 | u32 delayed; |
585 | u64 scheduler; | 549 | u64 scheduler; |
586 | u32 reserved4np[2]; | 550 | u32 reserved4np[2]; |
587 | u32 nb_of_stream; /* set to 1 */ | 551 | u32 nb_of_stream; /* set to 1 */ |
588 | mixart_set_out_stream_level_t stream_level; /* could be an array */ | 552 | struct mixart_set_out_stream_level stream_level; /* could be an array */ |
589 | } __attribute__((packed)); | 553 | } __attribute__((packed)); |
590 | 554 | ||
591 | /* response to this request is a u32 status value */ | 555 | /* response to this request is a u32 status value */ |
592 | 556 | ||
593 | 557 | ||
594 | /* exported */ | 558 | /* exported */ |
595 | void snd_mixart_init_mailbox(mixart_mgr_t *mgr); | 559 | void snd_mixart_init_mailbox(struct mixart_mgr *mgr); |
596 | void snd_mixart_exit_mailbox(mixart_mgr_t *mgr); | 560 | void snd_mixart_exit_mailbox(struct mixart_mgr *mgr); |
597 | 561 | ||
598 | int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_size, void *resp_data); | 562 | int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int max_resp_size, void *resp_data); |
599 | int snd_mixart_send_msg_wait_notif(mixart_mgr_t *mgr, mixart_msg_t *request, u32 notif_event); | 563 | int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, struct mixart_msg *request, u32 notif_event); |
600 | int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request); | 564 | int snd_mixart_send_msg_nonblock(struct mixart_mgr *mgr, struct mixart_msg *request); |
601 | 565 | ||
602 | irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs); | 566 | irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs); |
603 | void snd_mixart_msg_tasklet( unsigned long arg); | 567 | void snd_mixart_msg_tasklet(unsigned long arg); |
604 | 568 | ||
605 | void snd_mixart_reset_board(mixart_mgr_t *mgr); | 569 | void snd_mixart_reset_board(struct mixart_mgr *mgr); |
606 | 570 | ||
607 | #endif /* __SOUND_MIXART_CORE_H */ | 571 | #endif /* __SOUND_MIXART_CORE_H */ |
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c index edd1599fe45e..ca05075c67c6 100644 --- a/sound/pci/mixart/mixart_hwdep.c +++ b/sound/pci/mixart/mixart_hwdep.c | |||
@@ -40,7 +40,9 @@ | |||
40 | * @param value value | 40 | * @param value value |
41 | * @param timeout timeout in centisenconds | 41 | * @param timeout timeout in centisenconds |
42 | */ | 42 | */ |
43 | static int mixart_wait_nice_for_register_value(mixart_mgr_t *mgr, u32 offset, int is_egal, u32 value, unsigned long timeout) | 43 | static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr, |
44 | u32 offset, int is_egal, | ||
45 | u32 value, unsigned long timeout) | ||
44 | { | 46 | { |
45 | unsigned long end_time = jiffies + (timeout * HZ / 100); | 47 | unsigned long end_time = jiffies + (timeout * HZ / 100); |
46 | u32 read; | 48 | u32 read; |
@@ -66,8 +68,6 @@ static int mixart_wait_nice_for_register_value(mixart_mgr_t *mgr, u32 offset, in | |||
66 | /* | 68 | /* |
67 | structures needed to upload elf code packets | 69 | structures needed to upload elf code packets |
68 | */ | 70 | */ |
69 | typedef struct snd_mixart_elf32_ehdr snd_mixart_elf32_ehdr_t; | ||
70 | |||
71 | struct snd_mixart_elf32_ehdr { | 71 | struct snd_mixart_elf32_ehdr { |
72 | u8 e_ident[16]; | 72 | u8 e_ident[16]; |
73 | u16 e_type; | 73 | u16 e_type; |
@@ -85,8 +85,6 @@ struct snd_mixart_elf32_ehdr { | |||
85 | u16 e_shstrndx; | 85 | u16 e_shstrndx; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | typedef struct snd_mixart_elf32_phdr snd_mixart_elf32_phdr_t; | ||
89 | |||
90 | struct snd_mixart_elf32_phdr { | 88 | struct snd_mixart_elf32_phdr { |
91 | u32 p_type; | 89 | u32 p_type; |
92 | u32 p_offset; | 90 | u32 p_offset; |
@@ -98,19 +96,19 @@ struct snd_mixart_elf32_phdr { | |||
98 | u32 p_align; | 96 | u32 p_align; |
99 | }; | 97 | }; |
100 | 98 | ||
101 | static int mixart_load_elf(mixart_mgr_t *mgr, const struct firmware *dsp ) | 99 | static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp ) |
102 | { | 100 | { |
103 | char elf32_magic_number[4] = {0x7f,'E','L','F'}; | 101 | char elf32_magic_number[4] = {0x7f,'E','L','F'}; |
104 | snd_mixart_elf32_ehdr_t *elf_header; | 102 | struct snd_mixart_elf32_ehdr *elf_header; |
105 | int i; | 103 | int i; |
106 | 104 | ||
107 | elf_header = (snd_mixart_elf32_ehdr_t *)dsp->data; | 105 | elf_header = (struct snd_mixart_elf32_ehdr *)dsp->data; |
108 | for( i=0; i<4; i++ ) | 106 | for( i=0; i<4; i++ ) |
109 | if ( elf32_magic_number[i] != elf_header->e_ident[i] ) | 107 | if ( elf32_magic_number[i] != elf_header->e_ident[i] ) |
110 | return -EINVAL; | 108 | return -EINVAL; |
111 | 109 | ||
112 | if( elf_header->e_phoff != 0 ) { | 110 | if( elf_header->e_phoff != 0 ) { |
113 | snd_mixart_elf32_phdr_t elf_programheader; | 111 | struct snd_mixart_elf32_phdr elf_programheader; |
114 | 112 | ||
115 | for( i=0; i < be16_to_cpu(elf_header->e_phnum); i++ ) { | 113 | for( i=0; i < be16_to_cpu(elf_header->e_phnum); i++ ) { |
116 | u32 pos = be32_to_cpu(elf_header->e_phoff) + (u32)(i * be16_to_cpu(elf_header->e_phentsize)); | 114 | u32 pos = be32_to_cpu(elf_header->e_phoff) + (u32)(i * be16_to_cpu(elf_header->e_phentsize)); |
@@ -137,14 +135,14 @@ static int mixart_load_elf(mixart_mgr_t *mgr, const struct firmware *dsp ) | |||
137 | #define MIXART_FIRST_ANA_AUDIO_ID 0 | 135 | #define MIXART_FIRST_ANA_AUDIO_ID 0 |
138 | #define MIXART_FIRST_DIG_AUDIO_ID 8 | 136 | #define MIXART_FIRST_DIG_AUDIO_ID 8 |
139 | 137 | ||
140 | static int mixart_enum_connectors(mixart_mgr_t *mgr) | 138 | static int mixart_enum_connectors(struct mixart_mgr *mgr) |
141 | { | 139 | { |
142 | u32 k; | 140 | u32 k; |
143 | int err; | 141 | int err; |
144 | mixart_msg_t request; | 142 | struct mixart_msg request; |
145 | mixart_enum_connector_resp_t *connector; | 143 | struct mixart_enum_connector_resp *connector; |
146 | mixart_audio_info_req_t *audio_info_req; | 144 | struct mixart_audio_info_req *audio_info_req; |
147 | mixart_audio_info_resp_t *audio_info; | 145 | struct mixart_audio_info_resp *audio_info; |
148 | 146 | ||
149 | connector = kmalloc(sizeof(*connector), GFP_KERNEL); | 147 | connector = kmalloc(sizeof(*connector), GFP_KERNEL); |
150 | audio_info_req = kmalloc(sizeof(*audio_info_req), GFP_KERNEL); | 148 | audio_info_req = kmalloc(sizeof(*audio_info_req), GFP_KERNEL); |
@@ -159,7 +157,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr) | |||
159 | audio_info_req->cd_max_level = MIXART_FLOAT____0_0_TO_HEX; | 157 | audio_info_req->cd_max_level = MIXART_FLOAT____0_0_TO_HEX; |
160 | 158 | ||
161 | request.message_id = MSG_SYSTEM_ENUM_PLAY_CONNECTOR; | 159 | request.message_id = MSG_SYSTEM_ENUM_PLAY_CONNECTOR; |
162 | request.uid = (mixart_uid_t){0,0}; /* board num = 0 */ | 160 | request.uid = (struct mixart_uid){0,0}; /* board num = 0 */ |
163 | request.data = NULL; | 161 | request.data = NULL; |
164 | request.size = 0; | 162 | request.size = 0; |
165 | 163 | ||
@@ -171,7 +169,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr) | |||
171 | } | 169 | } |
172 | 170 | ||
173 | for(k=0; k < connector->uid_count; k++) { | 171 | for(k=0; k < connector->uid_count; k++) { |
174 | mixart_pipe_t* pipe; | 172 | struct mixart_pipe *pipe; |
175 | 173 | ||
176 | if(k < MIXART_FIRST_DIG_AUDIO_ID) { | 174 | if(k < MIXART_FIRST_DIG_AUDIO_ID) { |
177 | pipe = &mgr->chip[k/2]->pipe_out_ana; | 175 | pipe = &mgr->chip[k/2]->pipe_out_ana; |
@@ -201,7 +199,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr) | |||
201 | } | 199 | } |
202 | 200 | ||
203 | request.message_id = MSG_SYSTEM_ENUM_RECORD_CONNECTOR; | 201 | request.message_id = MSG_SYSTEM_ENUM_RECORD_CONNECTOR; |
204 | request.uid = (mixart_uid_t){0,0}; /* board num = 0 */ | 202 | request.uid = (struct mixart_uid){0,0}; /* board num = 0 */ |
205 | request.data = NULL; | 203 | request.data = NULL; |
206 | request.size = 0; | 204 | request.size = 0; |
207 | 205 | ||
@@ -213,7 +211,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr) | |||
213 | } | 211 | } |
214 | 212 | ||
215 | for(k=0; k < connector->uid_count; k++) { | 213 | for(k=0; k < connector->uid_count; k++) { |
216 | mixart_pipe_t* pipe; | 214 | struct mixart_pipe *pipe; |
217 | 215 | ||
218 | if(k < MIXART_FIRST_DIG_AUDIO_ID) { | 216 | if(k < MIXART_FIRST_DIG_AUDIO_ID) { |
219 | pipe = &mgr->chip[k/2]->pipe_in_ana; | 217 | pipe = &mgr->chip[k/2]->pipe_in_ana; |
@@ -251,14 +249,14 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr) | |||
251 | return err; | 249 | return err; |
252 | } | 250 | } |
253 | 251 | ||
254 | static int mixart_enum_physio(mixart_mgr_t *mgr) | 252 | static int mixart_enum_physio(struct mixart_mgr *mgr) |
255 | { | 253 | { |
256 | u32 k; | 254 | u32 k; |
257 | int err; | 255 | int err; |
258 | mixart_msg_t request; | 256 | struct mixart_msg request; |
259 | mixart_uid_t get_console_mgr; | 257 | struct mixart_uid get_console_mgr; |
260 | mixart_return_uid_t console_mgr; | 258 | struct mixart_return_uid console_mgr; |
261 | mixart_uid_enumeration_t phys_io; | 259 | struct mixart_uid_enumeration phys_io; |
262 | 260 | ||
263 | /* get the uid for the console manager */ | 261 | /* get the uid for the console manager */ |
264 | get_console_mgr.object_id = 0; | 262 | get_console_mgr.object_id = 0; |
@@ -280,7 +278,7 @@ static int mixart_enum_physio(mixart_mgr_t *mgr) | |||
280 | mgr->uid_console_manager = console_mgr.uid; | 278 | mgr->uid_console_manager = console_mgr.uid; |
281 | 279 | ||
282 | request.message_id = MSG_SYSTEM_ENUM_PHYSICAL_IO; | 280 | request.message_id = MSG_SYSTEM_ENUM_PHYSICAL_IO; |
283 | request.uid = (mixart_uid_t){0,0}; | 281 | request.uid = (struct mixart_uid){0,0}; |
284 | request.data = &console_mgr.uid; | 282 | request.data = &console_mgr.uid; |
285 | request.size = sizeof(console_mgr.uid); | 283 | request.size = sizeof(console_mgr.uid); |
286 | 284 | ||
@@ -301,11 +299,11 @@ static int mixart_enum_physio(mixart_mgr_t *mgr) | |||
301 | } | 299 | } |
302 | 300 | ||
303 | 301 | ||
304 | static int mixart_first_init(mixart_mgr_t *mgr) | 302 | static int mixart_first_init(struct mixart_mgr *mgr) |
305 | { | 303 | { |
306 | u32 k; | 304 | u32 k; |
307 | int err; | 305 | int err; |
308 | mixart_msg_t request; | 306 | struct mixart_msg request; |
309 | 307 | ||
310 | if((err = mixart_enum_connectors(mgr)) < 0) return err; | 308 | if((err = mixart_enum_connectors(mgr)) < 0) return err; |
311 | 309 | ||
@@ -314,7 +312,7 @@ static int mixart_first_init(mixart_mgr_t *mgr) | |||
314 | /* send a synchro command to card (necessary to do this before first MSG_STREAM_START_STREAM_GRP_PACKET) */ | 312 | /* send a synchro command to card (necessary to do this before first MSG_STREAM_START_STREAM_GRP_PACKET) */ |
315 | /* though why not here */ | 313 | /* though why not here */ |
316 | request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD; | 314 | request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD; |
317 | request.uid = (mixart_uid_t){0,0}; | 315 | request.uid = (struct mixart_uid){0,0}; |
318 | request.data = NULL; | 316 | request.data = NULL; |
319 | request.size = 0; | 317 | request.size = 0; |
320 | /* this command has no data. response is a 32 bit status */ | 318 | /* this command has no data. response is a 32 bit status */ |
@@ -331,7 +329,7 @@ static int mixart_first_init(mixart_mgr_t *mgr) | |||
331 | /* firmware base addresses (when hard coded) */ | 329 | /* firmware base addresses (when hard coded) */ |
332 | #define MIXART_MOTHERBOARD_XLX_BASE_ADDRESS 0x00600000 | 330 | #define MIXART_MOTHERBOARD_XLX_BASE_ADDRESS 0x00600000 |
333 | 331 | ||
334 | static int mixart_dsp_load(mixart_mgr_t* mgr, int index, const struct firmware *dsp) | 332 | static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmware *dsp) |
335 | { | 333 | { |
336 | int err, card_index; | 334 | int err, card_index; |
337 | u32 status_xilinx, status_elf, status_daught; | 335 | u32 status_xilinx, status_elf, status_daught; |
@@ -513,7 +511,7 @@ static int mixart_dsp_load(mixart_mgr_t* mgr, int index, const struct firmware * | |||
513 | 511 | ||
514 | /* create devices and mixer in accordance with HW options*/ | 512 | /* create devices and mixer in accordance with HW options*/ |
515 | for (card_index = 0; card_index < mgr->num_cards; card_index++) { | 513 | for (card_index = 0; card_index < mgr->num_cards; card_index++) { |
516 | mixart_t *chip = mgr->chip[card_index]; | 514 | struct snd_mixart *chip = mgr->chip[card_index]; |
517 | 515 | ||
518 | if ((err = snd_mixart_create_pcm(chip)) < 0) | 516 | if ((err = snd_mixart_create_pcm(chip)) < 0) |
519 | return err; | 517 | return err; |
@@ -541,7 +539,7 @@ static int mixart_dsp_load(mixart_mgr_t* mgr, int index, const struct firmware * | |||
541 | 539 | ||
542 | #ifdef SND_MIXART_FW_LOADER | 540 | #ifdef SND_MIXART_FW_LOADER |
543 | 541 | ||
544 | int snd_mixart_setup_firmware(mixart_mgr_t *mgr) | 542 | int snd_mixart_setup_firmware(struct mixart_mgr *mgr) |
545 | { | 543 | { |
546 | static char *fw_files[3] = { | 544 | static char *fw_files[3] = { |
547 | "miXart8.xlx", "miXart8.elf", "miXart8AES.xlx" | 545 | "miXart8.xlx", "miXart8.elf", "miXart8AES.xlx" |
@@ -573,19 +571,20 @@ int snd_mixart_setup_firmware(mixart_mgr_t *mgr) | |||
573 | /* miXart hwdep interface id string */ | 571 | /* miXart hwdep interface id string */ |
574 | #define SND_MIXART_HWDEP_ID "miXart Loader" | 572 | #define SND_MIXART_HWDEP_ID "miXart Loader" |
575 | 573 | ||
576 | static int mixart_hwdep_open(snd_hwdep_t *hw, struct file *file) | 574 | static int mixart_hwdep_open(struct snd_hwdep *hw, struct file *file) |
577 | { | 575 | { |
578 | return 0; | 576 | return 0; |
579 | } | 577 | } |
580 | 578 | ||
581 | static int mixart_hwdep_release(snd_hwdep_t *hw, struct file *file) | 579 | static int mixart_hwdep_release(struct snd_hwdep *hw, struct file *file) |
582 | { | 580 | { |
583 | return 0; | 581 | return 0; |
584 | } | 582 | } |
585 | 583 | ||
586 | static int mixart_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info) | 584 | static int mixart_hwdep_dsp_status(struct snd_hwdep *hw, |
585 | struct snd_hwdep_dsp_status *info) | ||
587 | { | 586 | { |
588 | mixart_mgr_t *mgr = hw->private_data; | 587 | struct mixart_mgr *mgr = hw->private_data; |
589 | 588 | ||
590 | strcpy(info->id, "miXart"); | 589 | strcpy(info->id, "miXart"); |
591 | info->num_dsps = MIXART_HARDW_FILES_MAX_INDEX; | 590 | info->num_dsps = MIXART_HARDW_FILES_MAX_INDEX; |
@@ -597,9 +596,10 @@ static int mixart_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info | |||
597 | return 0; | 596 | return 0; |
598 | } | 597 | } |
599 | 598 | ||
600 | static int mixart_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | 599 | static int mixart_hwdep_dsp_load(struct snd_hwdep *hw, |
600 | struct snd_hwdep_dsp_image *dsp) | ||
601 | { | 601 | { |
602 | mixart_mgr_t* mgr = hw->private_data; | 602 | struct mixart_mgr* mgr = hw->private_data; |
603 | struct firmware fw; | 603 | struct firmware fw; |
604 | int err; | 604 | int err; |
605 | 605 | ||
@@ -622,10 +622,10 @@ static int mixart_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | |||
622 | return err; | 622 | return err; |
623 | } | 623 | } |
624 | 624 | ||
625 | int snd_mixart_setup_firmware(mixart_mgr_t *mgr) | 625 | int snd_mixart_setup_firmware(struct mixart_mgr *mgr) |
626 | { | 626 | { |
627 | int err; | 627 | int err; |
628 | snd_hwdep_t *hw; | 628 | struct snd_hwdep *hw; |
629 | 629 | ||
630 | /* only create hwdep interface for first cardX (see "index" module parameter)*/ | 630 | /* only create hwdep interface for first cardX (see "index" module parameter)*/ |
631 | if ((err = snd_hwdep_new(mgr->chip[0]->card, SND_MIXART_HWDEP_ID, 0, &hw)) < 0) | 631 | if ((err = snd_hwdep_new(mgr->chip[0]->card, SND_MIXART_HWDEP_ID, 0, &hw)) < 0) |
diff --git a/sound/pci/mixart/mixart_hwdep.h b/sound/pci/mixart/mixart_hwdep.h index 25190cc88cf8..a46f5083db99 100644 --- a/sound/pci/mixart/mixart_hwdep.h +++ b/sound/pci/mixart/mixart_hwdep.h | |||
@@ -140,6 +140,6 @@ | |||
140 | #define MIXART_OIDI 0x008 /* 0000 0000 1000 */ | 140 | #define MIXART_OIDI 0x008 /* 0000 0000 1000 */ |
141 | 141 | ||
142 | 142 | ||
143 | int snd_mixart_setup_firmware(mixart_mgr_t *mgr); | 143 | int snd_mixart_setup_firmware(struct mixart_mgr *mgr); |
144 | 144 | ||
145 | #endif /* __SOUND_MIXART_HWDEP_H */ | 145 | #endif /* __SOUND_MIXART_HWDEP_H */ |
diff --git a/sound/pci/mixart/mixart_mixer.c b/sound/pci/mixart/mixart_mixer.c index 39c15416fc80..36a7e9ddfb15 100644 --- a/sound/pci/mixart/mixart_mixer.c +++ b/sound/pci/mixart/mixart_mixer.c | |||
@@ -298,12 +298,12 @@ static u32 mixart_analog_level[256] = { | |||
298 | #define MIXART_ANALOG_PLAYBACK_LEVEL_MAX 192 /* 0.0 dB + 1.5 dB = 1.5 dB */ | 298 | #define MIXART_ANALOG_PLAYBACK_LEVEL_MAX 192 /* 0.0 dB + 1.5 dB = 1.5 dB */ |
299 | #define MIXART_ANALOG_PLAYBACK_ZERO_LEVEL 189 /* -1.5 dB + 1.5 dB = 0.0 dB */ | 299 | #define MIXART_ANALOG_PLAYBACK_ZERO_LEVEL 189 /* -1.5 dB + 1.5 dB = 0.0 dB */ |
300 | 300 | ||
301 | static int mixart_update_analog_audio_level(mixart_t* chip, int is_capture) | 301 | static int mixart_update_analog_audio_level(struct snd_mixart* chip, int is_capture) |
302 | { | 302 | { |
303 | int i, err; | 303 | int i, err; |
304 | mixart_msg_t request; | 304 | struct mixart_msg request; |
305 | mixart_io_level_t io_level; | 305 | struct mixart_io_level io_level; |
306 | mixart_return_uid_t resp; | 306 | struct mixart_return_uid resp; |
307 | 307 | ||
308 | memset(&io_level, 0, sizeof(io_level)); | 308 | memset(&io_level, 0, sizeof(io_level)); |
309 | io_level.channel = -1; /* left and right */ | 309 | io_level.channel = -1; /* left and right */ |
@@ -336,7 +336,7 @@ static int mixart_update_analog_audio_level(mixart_t* chip, int is_capture) | |||
336 | /* | 336 | /* |
337 | * analog level control | 337 | * analog level control |
338 | */ | 338 | */ |
339 | static int mixart_analog_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 339 | static int mixart_analog_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
340 | { | 340 | { |
341 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 341 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
342 | uinfo->count = 2; | 342 | uinfo->count = 2; |
@@ -350,9 +350,9 @@ static int mixart_analog_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
350 | return 0; | 350 | return 0; |
351 | } | 351 | } |
352 | 352 | ||
353 | static int mixart_analog_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 353 | static int mixart_analog_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
354 | { | 354 | { |
355 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 355 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
356 | down(&chip->mgr->mixer_mutex); | 356 | down(&chip->mgr->mixer_mutex); |
357 | if(kcontrol->private_value == 0) { /* playback */ | 357 | if(kcontrol->private_value == 0) { /* playback */ |
358 | ucontrol->value.integer.value[0] = chip->analog_playback_volume[0]; | 358 | ucontrol->value.integer.value[0] = chip->analog_playback_volume[0]; |
@@ -365,9 +365,9 @@ static int mixart_analog_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
365 | return 0; | 365 | return 0; |
366 | } | 366 | } |
367 | 367 | ||
368 | static int mixart_analog_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 368 | static int mixart_analog_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
369 | { | 369 | { |
370 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 370 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
371 | int changed = 0; | 371 | int changed = 0; |
372 | int is_capture, i; | 372 | int is_capture, i; |
373 | 373 | ||
@@ -386,7 +386,7 @@ static int mixart_analog_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
386 | return changed; | 386 | return changed; |
387 | } | 387 | } |
388 | 388 | ||
389 | static snd_kcontrol_new_t mixart_control_analog_level = { | 389 | static struct snd_kcontrol_new mixart_control_analog_level = { |
390 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 390 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
391 | /* name will be filled later */ | 391 | /* name will be filled later */ |
392 | .info = mixart_analog_vol_info, | 392 | .info = mixart_analog_vol_info, |
@@ -395,7 +395,7 @@ static snd_kcontrol_new_t mixart_control_analog_level = { | |||
395 | }; | 395 | }; |
396 | 396 | ||
397 | /* shared */ | 397 | /* shared */ |
398 | static int mixart_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 398 | static int mixart_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
399 | { | 399 | { |
400 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 400 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
401 | uinfo->count = 2; | 401 | uinfo->count = 2; |
@@ -404,9 +404,9 @@ static int mixart_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | |||
404 | return 0; | 404 | return 0; |
405 | } | 405 | } |
406 | 406 | ||
407 | static int mixart_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 407 | static int mixart_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
408 | { | 408 | { |
409 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 409 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
410 | 410 | ||
411 | down(&chip->mgr->mixer_mutex); | 411 | down(&chip->mgr->mixer_mutex); |
412 | ucontrol->value.integer.value[0] = chip->analog_playback_active[0]; | 412 | ucontrol->value.integer.value[0] = chip->analog_playback_active[0]; |
@@ -415,9 +415,9 @@ static int mixart_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u | |||
415 | return 0; | 415 | return 0; |
416 | } | 416 | } |
417 | 417 | ||
418 | static int mixart_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 418 | static int mixart_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
419 | { | 419 | { |
420 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 420 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
421 | int i, changed = 0; | 421 | int i, changed = 0; |
422 | down(&chip->mgr->mixer_mutex); | 422 | down(&chip->mgr->mixer_mutex); |
423 | for(i=0; i<2; i++) { | 423 | for(i=0; i<2; i++) { |
@@ -431,7 +431,7 @@ static int mixart_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u | |||
431 | return changed; | 431 | return changed; |
432 | } | 432 | } |
433 | 433 | ||
434 | static snd_kcontrol_new_t mixart_control_output_switch = { | 434 | static struct snd_kcontrol_new mixart_control_output_switch = { |
435 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 435 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
436 | .name = "Master Playback Switch", | 436 | .name = "Master Playback Switch", |
437 | .info = mixart_sw_info, /* shared */ | 437 | .info = mixart_sw_info, /* shared */ |
@@ -703,14 +703,14 @@ static u32 mixart_digital_level[256] = { | |||
703 | #define MIXART_DIGITAL_ZERO_LEVEL 219 /* 0.0 dB */ | 703 | #define MIXART_DIGITAL_ZERO_LEVEL 219 /* 0.0 dB */ |
704 | 704 | ||
705 | 705 | ||
706 | int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx) | 706 | int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int idx) |
707 | { | 707 | { |
708 | int err, i; | 708 | int err, i; |
709 | int volume[2]; | 709 | int volume[2]; |
710 | mixart_msg_t request; | 710 | struct mixart_msg request; |
711 | mixart_set_out_stream_level_req_t set_level; | 711 | struct mixart_set_out_stream_level_req set_level; |
712 | u32 status; | 712 | u32 status; |
713 | mixart_pipe_t *pipe; | 713 | struct mixart_pipe *pipe; |
714 | 714 | ||
715 | memset(&set_level, 0, sizeof(set_level)); | 715 | memset(&set_level, 0, sizeof(set_level)); |
716 | set_level.nb_of_stream = 1; | 716 | set_level.nb_of_stream = 1; |
@@ -741,7 +741,7 @@ int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx) | |||
741 | set_level.stream_level.out_level.right_to_out2_level = mixart_digital_level[volume[1]]; | 741 | set_level.stream_level.out_level.right_to_out2_level = mixart_digital_level[volume[1]]; |
742 | 742 | ||
743 | request.message_id = MSG_STREAM_SET_OUT_STREAM_LEVEL; | 743 | request.message_id = MSG_STREAM_SET_OUT_STREAM_LEVEL; |
744 | request.uid = (mixart_uid_t){0,0}; | 744 | request.uid = (struct mixart_uid){0,0}; |
745 | request.data = &set_level; | 745 | request.data = &set_level; |
746 | request.size = sizeof(set_level); | 746 | request.size = sizeof(set_level); |
747 | 747 | ||
@@ -753,12 +753,12 @@ int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx) | |||
753 | return 0; | 753 | return 0; |
754 | } | 754 | } |
755 | 755 | ||
756 | int mixart_update_capture_stream_level(mixart_t* chip, int is_aes) | 756 | int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes) |
757 | { | 757 | { |
758 | int err, i, idx; | 758 | int err, i, idx; |
759 | mixart_pipe_t* pipe; | 759 | struct mixart_pipe *pipe; |
760 | mixart_msg_t request; | 760 | struct mixart_msg request; |
761 | mixart_set_in_audio_level_req_t set_level; | 761 | struct mixart_set_in_audio_level_req set_level; |
762 | u32 status; | 762 | u32 status; |
763 | 763 | ||
764 | if(is_aes) { | 764 | if(is_aes) { |
@@ -784,7 +784,7 @@ int mixart_update_capture_stream_level(mixart_t* chip, int is_aes) | |||
784 | } | 784 | } |
785 | 785 | ||
786 | request.message_id = MSG_STREAM_SET_IN_AUDIO_LEVEL; | 786 | request.message_id = MSG_STREAM_SET_IN_AUDIO_LEVEL; |
787 | request.uid = (mixart_uid_t){0,0}; | 787 | request.uid = (struct mixart_uid){0,0}; |
788 | request.data = &set_level; | 788 | request.data = &set_level; |
789 | request.size = sizeof(set_level); | 789 | request.size = sizeof(set_level); |
790 | 790 | ||
@@ -798,7 +798,7 @@ int mixart_update_capture_stream_level(mixart_t* chip, int is_aes) | |||
798 | 798 | ||
799 | 799 | ||
800 | /* shared */ | 800 | /* shared */ |
801 | static int mixart_digital_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 801 | static int mixart_digital_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
802 | { | 802 | { |
803 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 803 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
804 | uinfo->count = 2; | 804 | uinfo->count = 2; |
@@ -810,9 +810,9 @@ static int mixart_digital_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
810 | #define MIXART_VOL_REC_MASK 1 | 810 | #define MIXART_VOL_REC_MASK 1 |
811 | #define MIXART_VOL_AES_MASK 2 | 811 | #define MIXART_VOL_AES_MASK 2 |
812 | 812 | ||
813 | static int mixart_pcm_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 813 | static int mixart_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
814 | { | 814 | { |
815 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 815 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
816 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ | 816 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ |
817 | int *stored_volume; | 817 | int *stored_volume; |
818 | int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK; | 818 | int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK; |
@@ -832,9 +832,9 @@ static int mixart_pcm_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc | |||
832 | return 0; | 832 | return 0; |
833 | } | 833 | } |
834 | 834 | ||
835 | static int mixart_pcm_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 835 | static int mixart_pcm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
836 | { | 836 | { |
837 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 837 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
838 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ | 838 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ |
839 | int changed = 0; | 839 | int changed = 0; |
840 | int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK; | 840 | int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK; |
@@ -864,7 +864,7 @@ static int mixart_pcm_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc | |||
864 | return changed; | 864 | return changed; |
865 | } | 865 | } |
866 | 866 | ||
867 | static snd_kcontrol_new_t snd_mixart_pcm_vol = | 867 | static struct snd_kcontrol_new snd_mixart_pcm_vol = |
868 | { | 868 | { |
869 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 869 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
870 | /* name will be filled later */ | 870 | /* name will be filled later */ |
@@ -875,9 +875,9 @@ static snd_kcontrol_new_t snd_mixart_pcm_vol = | |||
875 | }; | 875 | }; |
876 | 876 | ||
877 | 877 | ||
878 | static int mixart_pcm_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 878 | static int mixart_pcm_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
879 | { | 879 | { |
880 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 880 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
881 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ | 881 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ |
882 | snd_assert ( idx < MIXART_PLAYBACK_STREAMS ); | 882 | snd_assert ( idx < MIXART_PLAYBACK_STREAMS ); |
883 | down(&chip->mgr->mixer_mutex); | 883 | down(&chip->mgr->mixer_mutex); |
@@ -889,9 +889,9 @@ static int mixart_pcm_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco | |||
889 | return 0; | 889 | return 0; |
890 | } | 890 | } |
891 | 891 | ||
892 | static int mixart_pcm_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 892 | static int mixart_pcm_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
893 | { | 893 | { |
894 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 894 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
895 | int changed = 0; | 895 | int changed = 0; |
896 | int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK; | 896 | int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK; |
897 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ | 897 | int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ |
@@ -911,7 +911,7 @@ static int mixart_pcm_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco | |||
911 | return changed; | 911 | return changed; |
912 | } | 912 | } |
913 | 913 | ||
914 | static snd_kcontrol_new_t mixart_control_pcm_switch = { | 914 | static struct snd_kcontrol_new mixart_control_pcm_switch = { |
915 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 915 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
916 | /* name will be filled later */ | 916 | /* name will be filled later */ |
917 | .count = MIXART_PLAYBACK_STREAMS, | 917 | .count = MIXART_PLAYBACK_STREAMS, |
@@ -920,11 +920,11 @@ static snd_kcontrol_new_t mixart_control_pcm_switch = { | |||
920 | .put = mixart_pcm_sw_put | 920 | .put = mixart_pcm_sw_put |
921 | }; | 921 | }; |
922 | 922 | ||
923 | static int mixart_update_monitoring(mixart_t* chip, int channel) | 923 | static int mixart_update_monitoring(struct snd_mixart* chip, int channel) |
924 | { | 924 | { |
925 | int err; | 925 | int err; |
926 | mixart_msg_t request; | 926 | struct mixart_msg request; |
927 | mixart_set_out_audio_level_t audio_level; | 927 | struct mixart_set_out_audio_level audio_level; |
928 | u32 resp; | 928 | u32 resp; |
929 | 929 | ||
930 | if(chip->pipe_out_ana.status == PIPE_UNDEFINED) | 930 | if(chip->pipe_out_ana.status == PIPE_UNDEFINED) |
@@ -953,9 +953,9 @@ static int mixart_update_monitoring(mixart_t* chip, int channel) | |||
953 | * monitoring level control | 953 | * monitoring level control |
954 | */ | 954 | */ |
955 | 955 | ||
956 | static int mixart_monitor_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 956 | static int mixart_monitor_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
957 | { | 957 | { |
958 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 958 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
959 | down(&chip->mgr->mixer_mutex); | 959 | down(&chip->mgr->mixer_mutex); |
960 | ucontrol->value.integer.value[0] = chip->monitoring_volume[0]; | 960 | ucontrol->value.integer.value[0] = chip->monitoring_volume[0]; |
961 | ucontrol->value.integer.value[1] = chip->monitoring_volume[1]; | 961 | ucontrol->value.integer.value[1] = chip->monitoring_volume[1]; |
@@ -963,9 +963,9 @@ static int mixart_monitor_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
963 | return 0; | 963 | return 0; |
964 | } | 964 | } |
965 | 965 | ||
966 | static int mixart_monitor_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 966 | static int mixart_monitor_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
967 | { | 967 | { |
968 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 968 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
969 | int changed = 0; | 969 | int changed = 0; |
970 | int i; | 970 | int i; |
971 | down(&chip->mgr->mixer_mutex); | 971 | down(&chip->mgr->mixer_mutex); |
@@ -980,7 +980,7 @@ static int mixart_monitor_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
980 | return changed; | 980 | return changed; |
981 | } | 981 | } |
982 | 982 | ||
983 | static snd_kcontrol_new_t mixart_control_monitor_vol = { | 983 | static struct snd_kcontrol_new mixart_control_monitor_vol = { |
984 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 984 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
985 | .name = "Monitoring Volume", | 985 | .name = "Monitoring Volume", |
986 | .info = mixart_digital_vol_info, /* shared */ | 986 | .info = mixart_digital_vol_info, /* shared */ |
@@ -992,9 +992,9 @@ static snd_kcontrol_new_t mixart_control_monitor_vol = { | |||
992 | * monitoring switch control | 992 | * monitoring switch control |
993 | */ | 993 | */ |
994 | 994 | ||
995 | static int mixart_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 995 | static int mixart_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
996 | { | 996 | { |
997 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 997 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
998 | down(&chip->mgr->mixer_mutex); | 998 | down(&chip->mgr->mixer_mutex); |
999 | ucontrol->value.integer.value[0] = chip->monitoring_active[0]; | 999 | ucontrol->value.integer.value[0] = chip->monitoring_active[0]; |
1000 | ucontrol->value.integer.value[1] = chip->monitoring_active[1]; | 1000 | ucontrol->value.integer.value[1] = chip->monitoring_active[1]; |
@@ -1002,9 +1002,9 @@ static int mixart_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1002 | return 0; | 1002 | return 0; |
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | static int mixart_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1005 | static int mixart_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1006 | { | 1006 | { |
1007 | mixart_t *chip = snd_kcontrol_chip(kcontrol); | 1007 | struct snd_mixart *chip = snd_kcontrol_chip(kcontrol); |
1008 | int changed = 0; | 1008 | int changed = 0; |
1009 | int i; | 1009 | int i; |
1010 | down(&chip->mgr->mixer_mutex); | 1010 | down(&chip->mgr->mixer_mutex); |
@@ -1033,7 +1033,7 @@ static int mixart_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1033 | return (changed != 0); | 1033 | return (changed != 0); |
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | static snd_kcontrol_new_t mixart_control_monitor_sw = { | 1036 | static struct snd_kcontrol_new mixart_control_monitor_sw = { |
1037 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1037 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1038 | .name = "Monitoring Switch", | 1038 | .name = "Monitoring Switch", |
1039 | .info = mixart_sw_info, /* shared */ | 1039 | .info = mixart_sw_info, /* shared */ |
@@ -1042,7 +1042,7 @@ static snd_kcontrol_new_t mixart_control_monitor_sw = { | |||
1042 | }; | 1042 | }; |
1043 | 1043 | ||
1044 | 1044 | ||
1045 | static void mixart_reset_audio_levels(mixart_t *chip) | 1045 | static void mixart_reset_audio_levels(struct snd_mixart *chip) |
1046 | { | 1046 | { |
1047 | /* analog volumes can be set even if there is no pipe */ | 1047 | /* analog volumes can be set even if there is no pipe */ |
1048 | mixart_update_analog_audio_level(chip, 0); | 1048 | mixart_update_analog_audio_level(chip, 0); |
@@ -1054,15 +1054,15 @@ static void mixart_reset_audio_levels(mixart_t *chip) | |||
1054 | } | 1054 | } |
1055 | 1055 | ||
1056 | 1056 | ||
1057 | int snd_mixart_create_mixer(mixart_mgr_t *mgr) | 1057 | int snd_mixart_create_mixer(struct mixart_mgr *mgr) |
1058 | { | 1058 | { |
1059 | mixart_t *chip; | 1059 | struct snd_mixart *chip; |
1060 | int err, i; | 1060 | int err, i; |
1061 | 1061 | ||
1062 | init_MUTEX(&mgr->mixer_mutex); /* can be in another place */ | 1062 | init_MUTEX(&mgr->mixer_mutex); /* can be in another place */ |
1063 | 1063 | ||
1064 | for(i=0; i<mgr->num_cards; i++) { | 1064 | for(i=0; i<mgr->num_cards; i++) { |
1065 | snd_kcontrol_new_t temp; | 1065 | struct snd_kcontrol_new temp; |
1066 | chip = mgr->chip[i]; | 1066 | chip = mgr->chip[i]; |
1067 | 1067 | ||
1068 | /* analog output level control */ | 1068 | /* analog output level control */ |
diff --git a/sound/pci/mixart/mixart_mixer.h b/sound/pci/mixart/mixart_mixer.h index b4d9535087c4..04aa24e35c3f 100644 --- a/sound/pci/mixart/mixart_mixer.h +++ b/sound/pci/mixart/mixart_mixer.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #define __SOUND_MIXART_MIXER_H | 24 | #define __SOUND_MIXART_MIXER_H |
25 | 25 | ||
26 | /* exported */ | 26 | /* exported */ |
27 | int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx); | 27 | int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int idx); |
28 | int mixart_update_capture_stream_level(mixart_t* chip, int is_aes); | 28 | int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes); |
29 | int snd_mixart_create_mixer(mixart_mgr_t* mgr); | 29 | int snd_mixart_create_mixer(struct mixart_mgr* mgr); |
30 | 30 | ||
31 | #endif /* __SOUND_MIXART_MIXER_H */ | 31 | #endif /* __SOUND_MIXART_MIXER_H */ |