aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs46xx/dsp_spos_scb_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/cs46xx/dsp_spos_scb_lib.c')
-rw-r--r--sound/pci/cs46xx/dsp_spos_scb_lib.c338
1 files changed, 173 insertions, 165 deletions
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index 92849e1340b..6e865005b26 100644
--- a/sound/pci/cs46xx/dsp_spos_scb_lib.c
+++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c
@@ -36,14 +36,14 @@
36#include "cs46xx_lib.h" 36#include "cs46xx_lib.h"
37#include "dsp_spos.h" 37#include "dsp_spos.h"
38 38
39typedef struct _proc_scb_info_t { 39struct proc_scb_info {
40 dsp_scb_descriptor_t * scb_desc; 40 struct dsp_scb_descriptor * scb_desc;
41 cs46xx_t *chip; 41 struct snd_cs46xx *chip;
42} proc_scb_info_t; 42};
43 43
44static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol) 44static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * symbol)
45{ 45{
46 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 46 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
47 int symbol_index = (int)(symbol - ins->symbol_table.symbols); 47 int symbol_index = (int)(symbol - ins->symbol_table.symbols);
48 48
49 snd_assert(ins->symbol_table.nsymbols > 0,return); 49 snd_assert(ins->symbol_table.nsymbols > 0,return);
@@ -64,12 +64,13 @@ static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol)
64 64
65} 65}
66 66
67static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) 67static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
68 struct snd_info_buffer *buffer)
68{ 69{
69 proc_scb_info_t * scb_info = (proc_scb_info_t *)entry->private_data; 70 struct proc_scb_info * scb_info = entry->private_data;
70 dsp_scb_descriptor_t * scb = scb_info->scb_desc; 71 struct dsp_scb_descriptor * scb = scb_info->scb_desc;
71 dsp_spos_instance_t * ins; 72 struct dsp_spos_instance * ins;
72 cs46xx_t *chip = scb_info->chip; 73 struct snd_cs46xx *chip = scb_info->chip;
73 int j,col; 74 int j,col;
74 void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; 75 void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
75 76
@@ -106,9 +107,9 @@ static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buf
106 up(&chip->spos_mutex); 107 up(&chip->spos_mutex);
107} 108}
108 109
109static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb) 110static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
110{ 111{
111 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 112 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
112 unsigned long flags; 113 unsigned long flags;
113 114
114 if ( scb->parent_scb_ptr ) { 115 if ( scb->parent_scb_ptr ) {
@@ -160,7 +161,8 @@ static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb)
160 } 161 }
161} 162}
162 163
163static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, int dword_count) 164static void _dsp_clear_sample_buffer (struct snd_cs46xx *chip, u32 sample_buffer_addr,
165 int dword_count)
164{ 166{
165 void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr; 167 void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr;
166 int i; 168 int i;
@@ -171,9 +173,9 @@ static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, in
171 } 173 }
172} 174}
173 175
174void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb) 176void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
175{ 177{
176 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 178 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
177 179
178 /* check integrety */ 180 /* check integrety */
179 snd_assert ( (scb->index >= 0 && 181 snd_assert ( (scb->index >= 0 &&
@@ -218,10 +220,10 @@ void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb)
218} 220}
219 221
220 222
221void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb) 223void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
222{ 224{
223 if (scb->proc_info) { 225 if (scb->proc_info) {
224 proc_scb_info_t * scb_info = (proc_scb_info_t *)scb->proc_info->private_data; 226 struct proc_scb_info * scb_info = scb->proc_info->private_data;
225 227
226 snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name); 228 snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name);
227 229
@@ -233,11 +235,12 @@ void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb)
233 } 235 }
234} 236}
235 237
236void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb) 238void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
239 struct dsp_scb_descriptor * scb)
237{ 240{
238 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 241 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
239 snd_info_entry_t * entry; 242 struct snd_info_entry * entry;
240 proc_scb_info_t * scb_info; 243 struct proc_scb_info * scb_info;
241 244
242 /* register to proc */ 245 /* register to proc */
243 if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL && 246 if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL &&
@@ -245,7 +248,7 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
245 248
246 if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, 249 if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
247 ins->proc_dsp_dir)) != NULL) { 250 ins->proc_dsp_dir)) != NULL) {
248 scb_info = kmalloc(sizeof(proc_scb_info_t), GFP_KERNEL); 251 scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL);
249 if (!scb_info) { 252 if (!scb_info) {
250 snd_info_free_entry(entry); 253 snd_info_free_entry(entry);
251 entry = NULL; 254 entry = NULL;
@@ -273,14 +276,14 @@ out:
273 } 276 }
274} 277}
275 278
276static dsp_scb_descriptor_t * 279static struct dsp_scb_descriptor *
277_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, 280_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest,
278 symbol_entry_t * task_entry, 281 struct dsp_symbol_entry * task_entry,
279 dsp_scb_descriptor_t * parent_scb, 282 struct dsp_scb_descriptor * parent_scb,
280 int scb_child_type) 283 int scb_child_type)
281{ 284{
282 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 285 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
283 dsp_scb_descriptor_t * scb; 286 struct dsp_scb_descriptor * scb;
284 287
285 unsigned long flags; 288 unsigned long flags;
286 289
@@ -342,13 +345,13 @@ _dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest,
342 return scb; 345 return scb;
343} 346}
344 347
345static dsp_scb_descriptor_t * 348static struct dsp_scb_descriptor *
346cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, 349cs46xx_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data,
347 char * task_entry_name, 350 u32 dest, char * task_entry_name,
348 dsp_scb_descriptor_t * parent_scb, 351 struct dsp_scb_descriptor * parent_scb,
349 int scb_child_type) 352 int scb_child_type)
350{ 353{
351 symbol_entry_t * task_entry; 354 struct dsp_symbol_entry * task_entry;
352 355
353 task_entry = cs46xx_dsp_lookup_symbol (chip,task_entry_name, 356 task_entry = cs46xx_dsp_lookup_symbol (chip,task_entry_name,
354 SYMBOL_CODE); 357 SYMBOL_CODE);
@@ -362,12 +365,12 @@ cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 de
362 parent_scb,scb_child_type); 365 parent_scb,scb_child_type);
363} 366}
364 367
365dsp_scb_descriptor_t * 368struct dsp_scb_descriptor *
366cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip) 369cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
367{ 370{
368 dsp_scb_descriptor_t * scb; 371 struct dsp_scb_descriptor * scb;
369 372
370 timing_master_scb_t timing_master_scb = { 373 struct dsp_timing_master_scb timing_master_scb = {
371 { 0, 374 { 0,
372 0, 375 0,
373 0, 376 0,
@@ -396,16 +399,15 @@ cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip)
396} 399}
397 400
398 401
399dsp_scb_descriptor_t * 402struct dsp_scb_descriptor *
400cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, 403cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name,
401 u16 channel_disp,u16 fifo_addr, 404 u16 channel_disp, u16 fifo_addr, u16 child_scb_addr,
402 u16 child_scb_addr, 405 u32 dest, struct dsp_scb_descriptor * parent_scb,
403 u32 dest,dsp_scb_descriptor_t * parent_scb,
404 int scb_child_type) 406 int scb_child_type)
405{ 407{
406 dsp_scb_descriptor_t * scb; 408 struct dsp_scb_descriptor * scb;
407 409
408 codec_output_scb_t codec_out_scb = { 410 struct dsp_codec_output_scb codec_out_scb = {
409 { 0, 411 { 0,
410 0, 412 0,
411 0, 413 0,
@@ -435,16 +437,15 @@ cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name,
435 return scb; 437 return scb;
436} 438}
437 439
438dsp_scb_descriptor_t * 440struct dsp_scb_descriptor *
439cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, 441cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
440 u16 channel_disp,u16 fifo_addr, 442 u16 channel_disp, u16 fifo_addr, u16 sample_buffer_addr,
441 u16 sample_buffer_addr, 443 u32 dest, struct dsp_scb_descriptor * parent_scb,
442 u32 dest,dsp_scb_descriptor_t * parent_scb, 444 int scb_child_type)
443 int scb_child_type)
444{ 445{
445 446
446 dsp_scb_descriptor_t * scb; 447 struct dsp_scb_descriptor * scb;
447 codec_input_scb_t codec_input_scb = { 448 struct dsp_codec_input_scb codec_input_scb = {
448 { 0, 449 { 0,
449 0, 450 0,
450 0, 451 0,
@@ -481,17 +482,17 @@ cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name,
481} 482}
482 483
483 484
484static dsp_scb_descriptor_t * 485static struct dsp_scb_descriptor *
485cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name, 486cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
486 u16 sample_buffer_addr,u32 dest, 487 u16 sample_buffer_addr, u32 dest,
487 int virtual_channel, u32 playback_hw_addr, 488 int virtual_channel, u32 playback_hw_addr,
488 dsp_scb_descriptor_t * parent_scb, 489 struct dsp_scb_descriptor * parent_scb,
489 int scb_child_type) 490 int scb_child_type)
490{ 491{
491 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 492 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
492 dsp_scb_descriptor_t * scb; 493 struct dsp_scb_descriptor * scb;
493 494
494 generic_scb_t pcm_reader_scb = { 495 struct dsp_generic_scb pcm_reader_scb = {
495 496
496 /* 497 /*
497 Play DMA Task xfers data from host buffer to SP buffer 498 Play DMA Task xfers data from host buffer to SP buffer
@@ -584,18 +585,18 @@ cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name,
584 585
585#define GOF_PER_SEC 200 586#define GOF_PER_SEC 200
586 587
587dsp_scb_descriptor_t * 588struct dsp_scb_descriptor *
588cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, 589cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
589 int rate, 590 int rate,
590 u16 src_buffer_addr, 591 u16 src_buffer_addr,
591 u16 src_delay_buffer_addr,u32 dest, 592 u16 src_delay_buffer_addr, u32 dest,
592 dsp_scb_descriptor_t * parent_scb, 593 struct dsp_scb_descriptor * parent_scb,
593 int scb_child_type, 594 int scb_child_type,
594 int pass_through) 595 int pass_through)
595{ 596{
596 597
597 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 598 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
598 dsp_scb_descriptor_t * scb; 599 struct dsp_scb_descriptor * scb;
599 unsigned int tmp1, tmp2; 600 unsigned int tmp1, tmp2;
600 unsigned int phiIncr; 601 unsigned int phiIncr;
601 unsigned int correctionPerGOF, correctionPerSec; 602 unsigned int correctionPerGOF, correctionPerSec;
@@ -632,7 +633,7 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
632 correctionPerSec = tmp1; 633 correctionPerSec = tmp1;
633 634
634 { 635 {
635 src_task_scb_t src_task_scb = { 636 struct dsp_src_task_scb src_task_scb = {
636 0x0028,0x00c8, 637 0x0028,0x00c8,
637 0x5555,0x0000, 638 0x5555,0x0000,
638 0x0000,0x0000, 639 0x0000,0x0000,
@@ -688,14 +689,14 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
688} 689}
689 690
690#if 0 /* not used */ 691#if 0 /* not used */
691dsp_scb_descriptor_t * 692struct dsp_scb_descriptor *
692cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name, 693cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
693 u16 buffer_addr,u32 dest, 694 u16 buffer_addr, u32 dest,
694 dsp_scb_descriptor_t * parent_scb, 695 struct dsp_scb_descriptor * parent_scb,
695 int scb_child_type) { 696 int scb_child_type) {
696 dsp_scb_descriptor_t * scb; 697 struct dsp_scb_descriptor * scb;
697 698
698 filter_scb_t filter_scb = { 699 struct dsp_filter_scb filter_scb = {
699 .a0_right = 0x41a9, 700 .a0_right = 0x41a9,
700 .a0_left = 0x41a9, 701 .a0_left = 0x41a9,
701 .a1_right = 0xb8e4, 702 .a1_right = 0xb8e4,
@@ -738,15 +739,15 @@ cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name,
738} 739}
739#endif /* not used */ 740#endif /* not used */
740 741
741dsp_scb_descriptor_t * 742struct dsp_scb_descriptor *
742cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, 743cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
743 u16 mix_buffer_addr,u32 dest, 744 u16 mix_buffer_addr, u32 dest,
744 dsp_scb_descriptor_t * parent_scb, 745 struct dsp_scb_descriptor * parent_scb,
745 int scb_child_type) 746 int scb_child_type)
746{ 747{
747 dsp_scb_descriptor_t * scb; 748 struct dsp_scb_descriptor * scb;
748 749
749 mix_only_scb_t master_mix_scb = { 750 struct dsp_mix_only_scb master_mix_scb = {
750 /* 0 */ { 0, 751 /* 0 */ { 0,
751 /* 1 */ 0, 752 /* 1 */ 0,
752 /* 2 */ mix_buffer_addr, 753 /* 2 */ mix_buffer_addr,
@@ -778,15 +779,15 @@ cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name,
778} 779}
779 780
780 781
781dsp_scb_descriptor_t * 782struct dsp_scb_descriptor *
782cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, 783cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
783 u16 mix_buffer_addr,u16 writeback_spb,u32 dest, 784 u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
784 dsp_scb_descriptor_t * parent_scb, 785 struct dsp_scb_descriptor * parent_scb,
785 int scb_child_type) 786 int scb_child_type)
786{ 787{
787 dsp_scb_descriptor_t * scb; 788 struct dsp_scb_descriptor * scb;
788 789
789 mix2_ostream_scb_t mix2_ostream_scb = { 790 struct dsp_mix2_ostream_scb mix2_ostream_scb = {
790 /* Basic (non scatter/gather) DMA requestor (4 ints) */ 791 /* Basic (non scatter/gather) DMA requestor (4 ints) */
791 { 792 {
792 DMA_RQ_C1_SOURCE_MOD64 + 793 DMA_RQ_C1_SOURCE_MOD64 +
@@ -832,18 +833,18 @@ cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name,
832} 833}
833 834
834 835
835dsp_scb_descriptor_t * 836struct dsp_scb_descriptor *
836cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, 837cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name,
837 u16 vari_buffer_addr0, 838 u16 vari_buffer_addr0,
838 u16 vari_buffer_addr1, 839 u16 vari_buffer_addr1,
839 u32 dest, 840 u32 dest,
840 dsp_scb_descriptor_t * parent_scb, 841 struct dsp_scb_descriptor * parent_scb,
841 int scb_child_type) 842 int scb_child_type)
842{ 843{
843 844
844 dsp_scb_descriptor_t * scb; 845 struct dsp_scb_descriptor * scb;
845 846
846 vari_decimate_scb_t vari_decimate_scb = { 847 struct dsp_vari_decimate_scb vari_decimate_scb = {
847 0x0028,0x00c8, 848 0x0028,0x00c8,
848 0x5555,0x0000, 849 0x5555,0x0000,
849 0x0000,0x0000, 850 0x0000,0x0000,
@@ -876,17 +877,17 @@ cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name,
876} 877}
877 878
878 879
879static dsp_scb_descriptor_t * 880static struct dsp_scb_descriptor *
880cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest, 881cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
881 dsp_scb_descriptor_t * input_scb, 882 struct dsp_scb_descriptor * input_scb,
882 dsp_scb_descriptor_t * parent_scb, 883 struct dsp_scb_descriptor * parent_scb,
883 int scb_child_type) 884 int scb_child_type)
884{ 885{
885 886
886 dsp_scb_descriptor_t * scb; 887 struct dsp_scb_descriptor * scb;
887 888
888 889
889 pcm_serial_input_scb_t pcm_serial_input_scb = { 890 struct dsp_pcm_serial_input_scb pcm_serial_input_scb = {
890 { 0, 891 { 0,
891 0, 892 0,
892 0, 893 0,
@@ -919,17 +920,17 @@ cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest,
919} 920}
920 921
921 922
922static dsp_scb_descriptor_t * 923static struct dsp_scb_descriptor *
923cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest, 924cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
924 u16 hfg_scb_address, 925 u16 hfg_scb_address,
925 u16 asynch_buffer_address, 926 u16 asynch_buffer_address,
926 dsp_scb_descriptor_t * parent_scb, 927 struct dsp_scb_descriptor * parent_scb,
927 int scb_child_type) 928 int scb_child_type)
928{ 929{
929 930
930 dsp_scb_descriptor_t * scb; 931 struct dsp_scb_descriptor * scb;
931 932
932 asynch_fg_tx_scb_t asynch_fg_tx_scb = { 933 struct dsp_asynch_fg_tx_scb asynch_fg_tx_scb = {
933 0xfc00,0x03ff, /* Prototype sample buffer size of 256 dwords */ 934 0xfc00,0x03ff, /* Prototype sample buffer size of 256 dwords */
934 0x0058,0x0028, /* Min Delta 7 dwords == 28 bytes */ 935 0x0058,0x0028, /* Min Delta 7 dwords == 28 bytes */
935 /* : Max delta 25 dwords == 100 bytes */ 936 /* : Max delta 25 dwords == 100 bytes */
@@ -966,17 +967,17 @@ cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
966} 967}
967 968
968 969
969dsp_scb_descriptor_t * 970struct dsp_scb_descriptor *
970cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest, 971cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
971 u16 hfg_scb_address, 972 u16 hfg_scb_address,
972 u16 asynch_buffer_address, 973 u16 asynch_buffer_address,
973 dsp_scb_descriptor_t * parent_scb, 974 struct dsp_scb_descriptor * parent_scb,
974 int scb_child_type) 975 int scb_child_type)
975{ 976{
976 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 977 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
977 dsp_scb_descriptor_t * scb; 978 struct dsp_scb_descriptor * scb;
978 979
979 asynch_fg_rx_scb_t asynch_fg_rx_scb = { 980 struct dsp_asynch_fg_rx_scb asynch_fg_rx_scb = {
980 0xfe00,0x01ff, /* Prototype sample buffer size of 128 dwords */ 981 0xfe00,0x01ff, /* Prototype sample buffer size of 128 dwords */
981 0x0064,0x001c, /* Min Delta 7 dwords == 28 bytes */ 982 0x0064,0x001c, /* Min Delta 7 dwords == 28 bytes */
982 /* : Max delta 25 dwords == 100 bytes */ 983 /* : Max delta 25 dwords == 100 bytes */
@@ -1016,17 +1017,17 @@ cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
1016 1017
1017 1018
1018#if 0 /* not used */ 1019#if 0 /* not used */
1019dsp_scb_descriptor_t * 1020struct dsp_scb_descriptor *
1020cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, 1021cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
1021 u16 snoop_buffer_address, 1022 u16 snoop_buffer_address,
1022 dsp_scb_descriptor_t * snoop_scb, 1023 struct dsp_scb_descriptor * snoop_scb,
1023 dsp_scb_descriptor_t * parent_scb, 1024 struct dsp_scb_descriptor * parent_scb,
1024 int scb_child_type) 1025 int scb_child_type)
1025{ 1026{
1026 1027
1027 dsp_scb_descriptor_t * scb; 1028 struct dsp_scb_descriptor * scb;
1028 1029
1029 output_snoop_scb_t output_snoop_scb = { 1030 struct dsp_output_snoop_scb output_snoop_scb = {
1030 { 0, /* not used. Zero */ 1031 { 0, /* not used. Zero */
1031 0, 1032 0,
1032 0, 1033 0,
@@ -1058,14 +1059,14 @@ cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest,
1058#endif /* not used */ 1059#endif /* not used */
1059 1060
1060 1061
1061dsp_scb_descriptor_t * 1062struct dsp_scb_descriptor *
1062cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, 1063cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
1063 dsp_scb_descriptor_t * parent_scb, 1064 struct dsp_scb_descriptor * parent_scb,
1064 int scb_child_type) 1065 int scb_child_type)
1065{ 1066{
1066 dsp_scb_descriptor_t * scb; 1067 struct dsp_scb_descriptor * scb;
1067 1068
1068 spio_write_scb_t spio_write_scb = { 1069 struct dsp_spio_write_scb spio_write_scb = {
1069 0,0, /* SPIOWAddress2:SPIOWAddress1; */ 1070 0,0, /* SPIOWAddress2:SPIOWAddress1; */
1070 0, /* SPIOWData1; */ 1071 0, /* SPIOWData1; */
1071 0, /* SPIOWData2; */ 1072 0, /* SPIOWData2; */
@@ -1094,15 +1095,16 @@ cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest,
1094 return scb; 1095 return scb;
1095} 1096}
1096 1097
1097dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, 1098struct dsp_scb_descriptor *
1098 u16 snoop_buffer_address, 1099cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
1099 dsp_scb_descriptor_t * snoop_scb, 1100 u16 snoop_buffer_address,
1100 dsp_scb_descriptor_t * parent_scb, 1101 struct dsp_scb_descriptor * snoop_scb,
1101 int scb_child_type) 1102 struct dsp_scb_descriptor * parent_scb,
1103 int scb_child_type)
1102{ 1104{
1103 dsp_scb_descriptor_t * scb; 1105 struct dsp_scb_descriptor * scb;
1104 1106
1105 magic_snoop_task_t magic_snoop_scb = { 1107 struct dsp_magic_snoop_task magic_snoop_scb = {
1106 /* 0 */ 0, /* i0 */ 1108 /* 0 */ 0, /* i0 */
1107 /* 1 */ 0, /* i1 */ 1109 /* 1 */ 0, /* i1 */
1108 /* 2 */ snoop_buffer_address << 0x10, 1110 /* 2 */ snoop_buffer_address << 0x10,
@@ -1129,10 +1131,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char *
1129 return scb; 1131 return scb;
1130} 1132}
1131 1133
1132static dsp_scb_descriptor_t * find_next_free_scb (cs46xx_t * chip,dsp_scb_descriptor_t * from) 1134static struct dsp_scb_descriptor *
1135find_next_free_scb (struct snd_cs46xx * chip, struct dsp_scb_descriptor * from)
1133{ 1136{
1134 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1137 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1135 dsp_scb_descriptor_t * scb = from; 1138 struct dsp_scb_descriptor * scb = from;
1136 1139
1137 while (scb->next_scb_ptr != ins->the_null_scb) { 1140 while (scb->next_scb_ptr != ins->the_null_scb) {
1138 snd_assert (scb->next_scb_ptr != NULL, return NULL); 1141 snd_assert (scb->next_scb_ptr != NULL, return NULL);
@@ -1212,18 +1215,19 @@ static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = {
1212 0x2B00 1215 0x2B00
1213}; 1216};
1214 1217
1215pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip, 1218struct dsp_pcm_channel_descriptor *
1216 u32 sample_rate, void * private_data, 1219cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
1217 u32 hw_dma_addr, 1220 u32 sample_rate, void * private_data,
1218 int pcm_channel_id) 1221 u32 hw_dma_addr,
1222 int pcm_channel_id)
1219{ 1223{
1220 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1224 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1221 dsp_scb_descriptor_t * src_scb = NULL,* pcm_scb, * mixer_scb = NULL; 1225 struct dsp_scb_descriptor * src_scb = NULL, * pcm_scb, * mixer_scb = NULL;
1222 dsp_scb_descriptor_t * src_parent_scb = NULL; 1226 struct dsp_scb_descriptor * src_parent_scb = NULL;
1223 1227
1224 /* dsp_scb_descriptor_t * pcm_parent_scb; */ 1228 /* struct dsp_scb_descriptor * pcm_parent_scb; */
1225 char scb_name[DSP_MAX_SCB_NAME]; 1229 char scb_name[DSP_MAX_SCB_NAME];
1226 int i,pcm_index = -1, insert_point, src_index = -1,pass_through = 0; 1230 int i, pcm_index = -1, insert_point, src_index = -1, pass_through = 0;
1227 unsigned long flags; 1231 unsigned long flags;
1228 1232
1229 switch (pcm_channel_id) { 1233 switch (pcm_channel_id) {
@@ -1371,8 +1375,8 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
1371 return (ins->pcm_channels + pcm_index); 1375 return (ins->pcm_channels + pcm_index);
1372} 1376}
1373 1377
1374int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip, 1378int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
1375 pcm_channel_descriptor_t * pcm_channel, 1379 struct dsp_pcm_channel_descriptor * pcm_channel,
1376 int period_size) 1380 int period_size)
1377{ 1381{
1378 u32 temp = snd_cs46xx_peek (chip,pcm_channel->pcm_reader_scb->address << 2); 1382 u32 temp = snd_cs46xx_peek (chip,pcm_channel->pcm_reader_scb->address << 2);
@@ -1410,7 +1414,7 @@ int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip,
1410 return 0; 1414 return 0;
1411} 1415}
1412 1416
1413int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip, 1417int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
1414 int period_size) 1418 int period_size)
1415{ 1419{
1416 u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2); 1420 u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2);
@@ -1448,9 +1452,10 @@ int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip,
1448 return 0; 1452 return 0;
1449} 1453}
1450 1454
1451void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) 1455void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
1456 struct dsp_pcm_channel_descriptor * pcm_channel)
1452{ 1457{
1453 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1458 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1454 unsigned long flags; 1459 unsigned long flags;
1455 1460
1456 snd_assert(pcm_channel->active, return ); 1461 snd_assert(pcm_channel->active, return );
@@ -1478,9 +1483,10 @@ void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t *
1478 } 1483 }
1479} 1484}
1480 1485
1481int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) 1486int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
1487 struct dsp_pcm_channel_descriptor * pcm_channel)
1482{ 1488{
1483 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1489 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1484 unsigned long flags; 1490 unsigned long flags;
1485 1491
1486 snd_assert(pcm_channel->active,return -EIO); 1492 snd_assert(pcm_channel->active,return -EIO);
@@ -1503,11 +1509,12 @@ int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channe
1503 return 0; 1509 return 0;
1504} 1510}
1505 1511
1506int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) 1512int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
1513 struct dsp_pcm_channel_descriptor * pcm_channel)
1507{ 1514{
1508 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1515 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1509 dsp_scb_descriptor_t * parent_scb; 1516 struct dsp_scb_descriptor * parent_scb;
1510 dsp_scb_descriptor_t * src_scb = pcm_channel->src_scb; 1517 struct dsp_scb_descriptor * src_scb = pcm_channel->src_scb;
1511 unsigned long flags; 1518 unsigned long flags;
1512 1519
1513 spin_lock(&pcm_channel->src_scb->lock); 1520 spin_lock(&pcm_channel->src_scb->lock);
@@ -1544,12 +1551,13 @@ int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel)
1544 return 0; 1551 return 0;
1545} 1552}
1546 1553
1547dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source, 1554struct dsp_scb_descriptor *
1548 u16 addr,char * scb_name) 1555cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
1556 u16 addr, char * scb_name)
1549{ 1557{
1550 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1558 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1551 dsp_scb_descriptor_t * parent; 1559 struct dsp_scb_descriptor * parent;
1552 dsp_scb_descriptor_t * pcm_input; 1560 struct dsp_scb_descriptor * pcm_input;
1553 int insert_point; 1561 int insert_point;
1554 1562
1555 snd_assert (ins->record_mixer_scb != NULL,return NULL); 1563 snd_assert (ins->record_mixer_scb != NULL,return NULL);
@@ -1569,7 +1577,7 @@ dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descript
1569 return pcm_input; 1577 return pcm_input;
1570} 1578}
1571 1579
1572int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src) 1580int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
1573{ 1581{
1574 snd_assert (src->parent_scb_ptr != NULL, return -EINVAL ); 1582 snd_assert (src->parent_scb_ptr != NULL, return -EINVAL );
1575 1583
@@ -1581,10 +1589,10 @@ int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src)
1581 return 0; 1589 return 0;
1582} 1590}
1583 1591
1584int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src) 1592int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
1585{ 1593{
1586 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1594 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1587 dsp_scb_descriptor_t * parent_scb; 1595 struct dsp_scb_descriptor * parent_scb;
1588 1596
1589 snd_assert (src->parent_scb_ptr == NULL, return -EINVAL ); 1597 snd_assert (src->parent_scb_ptr == NULL, return -EINVAL );
1590 snd_assert(ins->master_mix_scb !=NULL, return -EINVAL ); 1598 snd_assert(ins->master_mix_scb !=NULL, return -EINVAL );
@@ -1605,9 +1613,9 @@ int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src)
1605 return 0; 1613 return 0;
1606} 1614}
1607 1615
1608int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip) 1616int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
1609{ 1617{
1610 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1618 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1611 1619
1612 if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) { 1620 if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) {
1613 cs46xx_dsp_enable_spdif_hw (chip); 1621 cs46xx_dsp_enable_spdif_hw (chip);
@@ -1653,9 +1661,9 @@ int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip)
1653 return 0; 1661 return 0;
1654} 1662}
1655 1663
1656int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip) 1664int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip)
1657{ 1665{
1658 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1666 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1659 1667
1660 /* dont touch anything if SPDIF is open */ 1668 /* dont touch anything if SPDIF is open */
1661 if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) { 1669 if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
@@ -1685,9 +1693,9 @@ int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip)
1685 return 0; 1693 return 0;
1686} 1694}
1687 1695
1688int cs46xx_iec958_pre_open (cs46xx_t *chip) 1696int cs46xx_iec958_pre_open (struct snd_cs46xx *chip)
1689{ 1697{
1690 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1698 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1691 1699
1692 if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) { 1700 if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
1693 /* remove AsynchFGTxSCB and and PCMSerialInput_II */ 1701 /* remove AsynchFGTxSCB and and PCMSerialInput_II */
@@ -1718,9 +1726,9 @@ int cs46xx_iec958_pre_open (cs46xx_t *chip)
1718 return 0; 1726 return 0;
1719} 1727}
1720 1728
1721int cs46xx_iec958_post_close (cs46xx_t *chip) 1729int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
1722{ 1730{
1723 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1731 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1724 1732
1725 snd_assert (ins->asynch_tx_scb != NULL, return -EINVAL); 1733 snd_assert (ins->asynch_tx_scb != NULL, return -EINVAL);
1726 1734