aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs46xx
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:48:14 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:18:45 -0500
commit3d19f804ef5f1d15fe001fc8d1ed58fac9d591fb (patch)
treee3fd21398754a5c970a2c36f745a910c17db3794 /sound/pci/cs46xx
parentaf26367f69a474ed809e4a59abb5855b47daaff4 (diff)
[ALSA] Remove xxx_t typedefs: PCI CS46xx
Modules: CS46xx driver Remove xxx_t typedefs from the PCI CS46xx driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/cs46xx')
-rw-r--r--sound/pci/cs46xx/cs46xx.c4
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c584
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.h211
-rw-r--r--sound/pci/cs46xx/dsp_spos.c264
-rw-r--r--sound/pci/cs46xx/dsp_spos.h18
-rw-r--r--sound/pci/cs46xx/dsp_spos_scb_lib.c338
-rw-r--r--sound/pci/cs46xx/imgs/cwc4630.h6
-rw-r--r--sound/pci/cs46xx/imgs/cwcasync.h6
-rw-r--r--sound/pci/cs46xx/imgs/cwcbinhack.h6
-rw-r--r--sound/pci/cs46xx/imgs/cwcdma.h6
-rw-r--r--sound/pci/cs46xx/imgs/cwcemb80.h6
-rw-r--r--sound/pci/cs46xx/imgs/cwcsnoop.h6
12 files changed, 749 insertions, 706 deletions
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index b9fff4ee6f9d..7d6b29e5433a 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -78,8 +78,8 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci,
78 const struct pci_device_id *pci_id) 78 const struct pci_device_id *pci_id)
79{ 79{
80 static int dev; 80 static int dev;
81 snd_card_t *card; 81 struct snd_card *card;
82 cs46xx_t *chip; 82 struct snd_cs46xx *chip;
83 int err; 83 int err;
84 84
85 if (dev >= SNDRV_CARDS) 85 if (dev >= SNDRV_CARDS)
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 9a86148d7188..11d91d08a14c 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -66,23 +66,23 @@
66#include "cs46xx_lib.h" 66#include "cs46xx_lib.h"
67#include "dsp_spos.h" 67#include "dsp_spos.h"
68 68
69static void amp_voyetra(cs46xx_t *chip, int change); 69static void amp_voyetra(struct snd_cs46xx *chip, int change);
70 70
71#ifdef CONFIG_SND_CS46XX_NEW_DSP 71#ifdef CONFIG_SND_CS46XX_NEW_DSP
72static snd_pcm_ops_t snd_cs46xx_playback_rear_ops; 72static struct snd_pcm_ops snd_cs46xx_playback_rear_ops;
73static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops; 73static struct snd_pcm_ops snd_cs46xx_playback_indirect_rear_ops;
74static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops; 74static struct snd_pcm_ops snd_cs46xx_playback_clfe_ops;
75static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops; 75static struct snd_pcm_ops snd_cs46xx_playback_indirect_clfe_ops;
76static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops; 76static struct snd_pcm_ops snd_cs46xx_playback_iec958_ops;
77static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops; 77static struct snd_pcm_ops snd_cs46xx_playback_indirect_iec958_ops;
78#endif 78#endif
79 79
80static snd_pcm_ops_t snd_cs46xx_playback_ops; 80static struct snd_pcm_ops snd_cs46xx_playback_ops;
81static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops; 81static struct snd_pcm_ops snd_cs46xx_playback_indirect_ops;
82static snd_pcm_ops_t snd_cs46xx_capture_ops; 82static struct snd_pcm_ops snd_cs46xx_capture_ops;
83static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops; 83static struct snd_pcm_ops snd_cs46xx_capture_indirect_ops;
84 84
85static unsigned short snd_cs46xx_codec_read(cs46xx_t *chip, 85static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
86 unsigned short reg, 86 unsigned short reg,
87 int codec_index) 87 int codec_index)
88{ 88{
@@ -204,10 +204,10 @@ static unsigned short snd_cs46xx_codec_read(cs46xx_t *chip,
204 return result; 204 return result;
205} 205}
206 206
207static unsigned short snd_cs46xx_ac97_read(ac97_t * ac97, 207static unsigned short snd_cs46xx_ac97_read(struct snd_ac97 * ac97,
208 unsigned short reg) 208 unsigned short reg)
209{ 209{
210 cs46xx_t *chip = ac97->private_data; 210 struct snd_cs46xx *chip = ac97->private_data;
211 unsigned short val; 211 unsigned short val;
212 int codec_index = ac97->num; 212 int codec_index = ac97->num;
213 213
@@ -221,7 +221,7 @@ static unsigned short snd_cs46xx_ac97_read(ac97_t * ac97,
221} 221}
222 222
223 223
224static void snd_cs46xx_codec_write(cs46xx_t *chip, 224static void snd_cs46xx_codec_write(struct snd_cs46xx *chip,
225 unsigned short reg, 225 unsigned short reg,
226 unsigned short val, 226 unsigned short val,
227 int codec_index) 227 int codec_index)
@@ -286,11 +286,11 @@ static void snd_cs46xx_codec_write(cs46xx_t *chip,
286 chip->active_ctrl(chip, -1); 286 chip->active_ctrl(chip, -1);
287} 287}
288 288
289static void snd_cs46xx_ac97_write(ac97_t *ac97, 289static void snd_cs46xx_ac97_write(struct snd_ac97 *ac97,
290 unsigned short reg, 290 unsigned short reg,
291 unsigned short val) 291 unsigned short val)
292{ 292{
293 cs46xx_t *chip = ac97->private_data; 293 struct snd_cs46xx *chip = ac97->private_data;
294 int codec_index = ac97->num; 294 int codec_index = ac97->num;
295 295
296 snd_assert(codec_index == CS46XX_PRIMARY_CODEC_INDEX || 296 snd_assert(codec_index == CS46XX_PRIMARY_CODEC_INDEX ||
@@ -305,7 +305,7 @@ static void snd_cs46xx_ac97_write(ac97_t *ac97,
305 * Chip initialization 305 * Chip initialization
306 */ 306 */
307 307
308int snd_cs46xx_download(cs46xx_t *chip, 308int snd_cs46xx_download(struct snd_cs46xx *chip,
309 u32 *src, 309 u32 *src,
310 unsigned long offset, 310 unsigned long offset,
311 unsigned long len) 311 unsigned long len)
@@ -334,7 +334,7 @@ int snd_cs46xx_download(cs46xx_t *chip,
334#include "imgs/cwcbinhack.h" 334#include "imgs/cwcbinhack.h"
335#include "imgs/cwcdma.h" 335#include "imgs/cwcdma.h"
336 336
337int snd_cs46xx_clear_BA1(cs46xx_t *chip, 337int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip,
338 unsigned long offset, 338 unsigned long offset,
339 unsigned long len) 339 unsigned long len)
340{ 340{
@@ -358,7 +358,7 @@ int snd_cs46xx_clear_BA1(cs46xx_t *chip,
358 358
359#include "cs46xx_image.h" 359#include "cs46xx_image.h"
360 360
361int snd_cs46xx_download_image(cs46xx_t *chip) 361int snd_cs46xx_download_image(struct snd_cs46xx *chip)
362{ 362{
363 int idx, err; 363 int idx, err;
364 unsigned long offset = 0; 364 unsigned long offset = 0;
@@ -379,7 +379,7 @@ int snd_cs46xx_download_image(cs46xx_t *chip)
379 * Chip reset 379 * Chip reset
380 */ 380 */
381 381
382static void snd_cs46xx_reset(cs46xx_t *chip) 382static void snd_cs46xx_reset(struct snd_cs46xx *chip)
383{ 383{
384 int idx; 384 int idx;
385 385
@@ -408,7 +408,7 @@ static void snd_cs46xx_reset(cs46xx_t *chip)
408 snd_cs46xx_poke(chip, BA1_FRMT, 0xadf); 408 snd_cs46xx_poke(chip, BA1_FRMT, 0xadf);
409} 409}
410 410
411static int cs46xx_wait_for_fifo(cs46xx_t * chip,int retry_timeout) 411static int cs46xx_wait_for_fifo(struct snd_cs46xx * chip,int retry_timeout)
412{ 412{
413 u32 i, status = 0; 413 u32 i, status = 0;
414 /* 414 /*
@@ -432,7 +432,7 @@ static int cs46xx_wait_for_fifo(cs46xx_t * chip,int retry_timeout)
432 return 0; 432 return 0;
433} 433}
434 434
435static void snd_cs46xx_clear_serial_FIFOs(cs46xx_t *chip) 435static void snd_cs46xx_clear_serial_FIFOs(struct snd_cs46xx *chip)
436{ 436{
437 int idx, powerdown = 0; 437 int idx, powerdown = 0;
438 unsigned int tmp; 438 unsigned int tmp;
@@ -486,7 +486,7 @@ static void snd_cs46xx_clear_serial_FIFOs(cs46xx_t *chip)
486 snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp); 486 snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp);
487} 487}
488 488
489static void snd_cs46xx_proc_start(cs46xx_t *chip) 489static void snd_cs46xx_proc_start(struct snd_cs46xx *chip)
490{ 490{
491 int cnt; 491 int cnt;
492 492
@@ -513,7 +513,7 @@ static void snd_cs46xx_proc_start(cs46xx_t *chip)
513 snd_printk(KERN_ERR "SPCR_RUNFR never reset\n"); 513 snd_printk(KERN_ERR "SPCR_RUNFR never reset\n");
514} 514}
515 515
516static void snd_cs46xx_proc_stop(cs46xx_t *chip) 516static void snd_cs46xx_proc_stop(struct snd_cs46xx *chip)
517{ 517{
518 /* 518 /*
519 * Turn off the run, run at frame, and DMA enable bits in the local copy of 519 * Turn off the run, run at frame, and DMA enable bits in the local copy of
@@ -528,7 +528,7 @@ static void snd_cs46xx_proc_stop(cs46xx_t *chip)
528 528
529#define GOF_PER_SEC 200 529#define GOF_PER_SEC 200
530 530
531static void snd_cs46xx_set_play_sample_rate(cs46xx_t *chip, unsigned int rate) 531static void snd_cs46xx_set_play_sample_rate(struct snd_cs46xx *chip, unsigned int rate)
532{ 532{
533 unsigned long flags; 533 unsigned long flags;
534 unsigned int tmp1, tmp2; 534 unsigned int tmp1, tmp2;
@@ -574,7 +574,7 @@ static void snd_cs46xx_set_play_sample_rate(cs46xx_t *chip, unsigned int rate)
574 spin_unlock_irqrestore(&chip->reg_lock, flags); 574 spin_unlock_irqrestore(&chip->reg_lock, flags);
575} 575}
576 576
577static void snd_cs46xx_set_capture_sample_rate(cs46xx_t *chip, unsigned int rate) 577static void snd_cs46xx_set_capture_sample_rate(struct snd_cs46xx *chip, unsigned int rate)
578{ 578{
579 unsigned long flags; 579 unsigned long flags;
580 unsigned int phiIncr, coeffIncr, tmp1, tmp2; 580 unsigned int phiIncr, coeffIncr, tmp1, tmp2;
@@ -684,43 +684,43 @@ static void snd_cs46xx_set_capture_sample_rate(cs46xx_t *chip, unsigned int rate
684 * PCM part 684 * PCM part
685 */ 685 */
686 686
687static void snd_cs46xx_pb_trans_copy(snd_pcm_substream_t *substream, 687static void snd_cs46xx_pb_trans_copy(struct snd_pcm_substream *substream,
688 snd_pcm_indirect_t *rec, size_t bytes) 688 struct snd_pcm_indirect *rec, size_t bytes)
689{ 689{
690 snd_pcm_runtime_t *runtime = substream->runtime; 690 struct snd_pcm_runtime *runtime = substream->runtime;
691 cs46xx_pcm_t * cpcm = runtime->private_data; 691 struct snd_cs46xx_pcm * cpcm = runtime->private_data;
692 memcpy(cpcm->hw_buf.area + rec->hw_data, runtime->dma_area + rec->sw_data, bytes); 692 memcpy(cpcm->hw_buf.area + rec->hw_data, runtime->dma_area + rec->sw_data, bytes);
693} 693}
694 694
695static int snd_cs46xx_playback_transfer(snd_pcm_substream_t *substream) 695static int snd_cs46xx_playback_transfer(struct snd_pcm_substream *substream)
696{ 696{
697 snd_pcm_runtime_t *runtime = substream->runtime; 697 struct snd_pcm_runtime *runtime = substream->runtime;
698 cs46xx_pcm_t * cpcm = runtime->private_data; 698 struct snd_cs46xx_pcm * cpcm = runtime->private_data;
699 snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy); 699 snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy);
700 return 0; 700 return 0;
701} 701}
702 702
703static void snd_cs46xx_cp_trans_copy(snd_pcm_substream_t *substream, 703static void snd_cs46xx_cp_trans_copy(struct snd_pcm_substream *substream,
704 snd_pcm_indirect_t *rec, size_t bytes) 704 struct snd_pcm_indirect *rec, size_t bytes)
705{ 705{
706 cs46xx_t *chip = snd_pcm_substream_chip(substream); 706 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
707 snd_pcm_runtime_t *runtime = substream->runtime; 707 struct snd_pcm_runtime *runtime = substream->runtime;
708 memcpy(runtime->dma_area + rec->sw_data, 708 memcpy(runtime->dma_area + rec->sw_data,
709 chip->capt.hw_buf.area + rec->hw_data, bytes); 709 chip->capt.hw_buf.area + rec->hw_data, bytes);
710} 710}
711 711
712static int snd_cs46xx_capture_transfer(snd_pcm_substream_t *substream) 712static int snd_cs46xx_capture_transfer(struct snd_pcm_substream *substream)
713{ 713{
714 cs46xx_t *chip = snd_pcm_substream_chip(substream); 714 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
715 snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec, snd_cs46xx_cp_trans_copy); 715 snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec, snd_cs46xx_cp_trans_copy);
716 return 0; 716 return 0;
717} 717}
718 718
719static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(snd_pcm_substream_t * substream) 719static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(struct snd_pcm_substream *substream)
720{ 720{
721 cs46xx_t *chip = snd_pcm_substream_chip(substream); 721 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
722 size_t ptr; 722 size_t ptr;
723 cs46xx_pcm_t *cpcm = substream->runtime->private_data; 723 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
724 snd_assert (cpcm->pcm_channel,return -ENXIO); 724 snd_assert (cpcm->pcm_channel,return -ENXIO);
725 725
726#ifdef CONFIG_SND_CS46XX_NEW_DSP 726#ifdef CONFIG_SND_CS46XX_NEW_DSP
@@ -732,11 +732,11 @@ static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(snd_pcm_substream_t
732 return ptr >> cpcm->shift; 732 return ptr >> cpcm->shift;
733} 733}
734 734
735static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_t * substream) 735static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(struct snd_pcm_substream *substream)
736{ 736{
737 cs46xx_t *chip = snd_pcm_substream_chip(substream); 737 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
738 size_t ptr; 738 size_t ptr;
739 cs46xx_pcm_t *cpcm = substream->runtime->private_data; 739 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
740 740
741#ifdef CONFIG_SND_CS46XX_NEW_DSP 741#ifdef CONFIG_SND_CS46XX_NEW_DSP
742 snd_assert (cpcm->pcm_channel,return -ENXIO); 742 snd_assert (cpcm->pcm_channel,return -ENXIO);
@@ -748,29 +748,29 @@ static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_
748 return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr); 748 return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr);
749} 749}
750 750
751static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(snd_pcm_substream_t * substream) 751static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(struct snd_pcm_substream *substream)
752{ 752{
753 cs46xx_t *chip = snd_pcm_substream_chip(substream); 753 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
754 size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr; 754 size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr;
755 return ptr >> chip->capt.shift; 755 return ptr >> chip->capt.shift;
756} 756}
757 757
758static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(snd_pcm_substream_t * substream) 758static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(struct snd_pcm_substream *substream)
759{ 759{
760 cs46xx_t *chip = snd_pcm_substream_chip(substream); 760 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
761 size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr; 761 size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr;
762 return snd_pcm_indirect_capture_pointer(substream, &chip->capt.pcm_rec, ptr); 762 return snd_pcm_indirect_capture_pointer(substream, &chip->capt.pcm_rec, ptr);
763} 763}
764 764
765static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream, 765static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
766 int cmd) 766 int cmd)
767{ 767{
768 cs46xx_t *chip = snd_pcm_substream_chip(substream); 768 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
769 /*snd_pcm_runtime_t *runtime = substream->runtime;*/ 769 /*struct snd_pcm_runtime *runtime = substream->runtime;*/
770 int result = 0; 770 int result = 0;
771 771
772#ifdef CONFIG_SND_CS46XX_NEW_DSP 772#ifdef CONFIG_SND_CS46XX_NEW_DSP
773 cs46xx_pcm_t *cpcm = substream->runtime->private_data; 773 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
774 if (! cpcm->pcm_channel) { 774 if (! cpcm->pcm_channel) {
775 return -ENXIO; 775 return -ENXIO;
776 } 776 }
@@ -827,10 +827,10 @@ static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream,
827 return result; 827 return result;
828} 828}
829 829
830static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream, 830static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream,
831 int cmd) 831 int cmd)
832{ 832{
833 cs46xx_t *chip = snd_pcm_substream_chip(substream); 833 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
834 unsigned int tmp; 834 unsigned int tmp;
835 int result = 0; 835 int result = 0;
836 836
@@ -858,7 +858,7 @@ static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream,
858} 858}
859 859
860#ifdef CONFIG_SND_CS46XX_NEW_DSP 860#ifdef CONFIG_SND_CS46XX_NEW_DSP
861static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm, 861static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm,
862 int sample_rate) 862 int sample_rate)
863{ 863{
864 864
@@ -893,14 +893,14 @@ static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm,
893#endif 893#endif
894 894
895 895
896static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream, 896static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream,
897 snd_pcm_hw_params_t * hw_params) 897 struct snd_pcm_hw_params *hw_params)
898{ 898{
899 snd_pcm_runtime_t *runtime = substream->runtime; 899 struct snd_pcm_runtime *runtime = substream->runtime;
900 cs46xx_pcm_t *cpcm; 900 struct snd_cs46xx_pcm *cpcm;
901 int err; 901 int err;
902#ifdef CONFIG_SND_CS46XX_NEW_DSP 902#ifdef CONFIG_SND_CS46XX_NEW_DSP
903 cs46xx_t *chip = snd_pcm_substream_chip(substream); 903 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
904 int sample_rate = params_rate(hw_params); 904 int sample_rate = params_rate(hw_params);
905 int period_size = params_period_bytes(hw_params); 905 int period_size = params_period_bytes(hw_params);
906#endif 906#endif
@@ -995,11 +995,11 @@ static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream,
995 return 0; 995 return 0;
996} 996}
997 997
998static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream) 998static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream)
999{ 999{
1000 /*cs46xx_t *chip = snd_pcm_substream_chip(substream);*/ 1000 /*struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);*/
1001 snd_pcm_runtime_t *runtime = substream->runtime; 1001 struct snd_pcm_runtime *runtime = substream->runtime;
1002 cs46xx_pcm_t *cpcm; 1002 struct snd_cs46xx_pcm *cpcm;
1003 1003
1004 cpcm = runtime->private_data; 1004 cpcm = runtime->private_data;
1005 1005
@@ -1017,13 +1017,13 @@ static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream)
1017 return 0; 1017 return 0;
1018} 1018}
1019 1019
1020static int snd_cs46xx_playback_prepare(snd_pcm_substream_t * substream) 1020static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream)
1021{ 1021{
1022 unsigned int tmp; 1022 unsigned int tmp;
1023 unsigned int pfie; 1023 unsigned int pfie;
1024 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1024 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1025 snd_pcm_runtime_t *runtime = substream->runtime; 1025 struct snd_pcm_runtime *runtime = substream->runtime;
1026 cs46xx_pcm_t *cpcm; 1026 struct snd_cs46xx_pcm *cpcm;
1027 1027
1028 cpcm = runtime->private_data; 1028 cpcm = runtime->private_data;
1029 1029
@@ -1087,11 +1087,11 @@ static int snd_cs46xx_playback_prepare(snd_pcm_substream_t * substream)
1087 return 0; 1087 return 0;
1088} 1088}
1089 1089
1090static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream, 1090static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream,
1091 snd_pcm_hw_params_t * hw_params) 1091 struct snd_pcm_hw_params *hw_params)
1092{ 1092{
1093 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1093 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1094 snd_pcm_runtime_t *runtime = substream->runtime; 1094 struct snd_pcm_runtime *runtime = substream->runtime;
1095 int err; 1095 int err;
1096 1096
1097#ifdef CONFIG_SND_CS46XX_NEW_DSP 1097#ifdef CONFIG_SND_CS46XX_NEW_DSP
@@ -1118,10 +1118,10 @@ static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream,
1118 return 0; 1118 return 0;
1119} 1119}
1120 1120
1121static int snd_cs46xx_capture_hw_free(snd_pcm_substream_t * substream) 1121static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream)
1122{ 1122{
1123 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1123 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1124 snd_pcm_runtime_t *runtime = substream->runtime; 1124 struct snd_pcm_runtime *runtime = substream->runtime;
1125 1125
1126 if (runtime->dma_area != chip->capt.hw_buf.area) 1126 if (runtime->dma_area != chip->capt.hw_buf.area)
1127 snd_pcm_lib_free_pages(substream); 1127 snd_pcm_lib_free_pages(substream);
@@ -1132,10 +1132,10 @@ static int snd_cs46xx_capture_hw_free(snd_pcm_substream_t * substream)
1132 return 0; 1132 return 0;
1133} 1133}
1134 1134
1135static int snd_cs46xx_capture_prepare(snd_pcm_substream_t * substream) 1135static int snd_cs46xx_capture_prepare(struct snd_pcm_substream *substream)
1136{ 1136{
1137 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1137 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1138 snd_pcm_runtime_t *runtime = substream->runtime; 1138 struct snd_pcm_runtime *runtime = substream->runtime;
1139 1139
1140 snd_cs46xx_poke(chip, BA1_CBA, chip->capt.hw_buf.addr); 1140 snd_cs46xx_poke(chip, BA1_CBA, chip->capt.hw_buf.addr);
1141 chip->capt.shift = 2; 1141 chip->capt.shift = 2;
@@ -1149,13 +1149,13 @@ static int snd_cs46xx_capture_prepare(snd_pcm_substream_t * substream)
1149 1149
1150static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) 1150static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1151{ 1151{
1152 cs46xx_t *chip = dev_id; 1152 struct snd_cs46xx *chip = dev_id;
1153 u32 status1; 1153 u32 status1;
1154#ifdef CONFIG_SND_CS46XX_NEW_DSP 1154#ifdef CONFIG_SND_CS46XX_NEW_DSP
1155 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1155 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1156 u32 status2; 1156 u32 status2;
1157 int i; 1157 int i;
1158 cs46xx_pcm_t *cpcm = NULL; 1158 struct snd_cs46xx_pcm *cpcm = NULL;
1159#endif 1159#endif
1160 1160
1161 /* 1161 /*
@@ -1239,7 +1239,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *r
1239 return IRQ_HANDLED; 1239 return IRQ_HANDLED;
1240} 1240}
1241 1241
1242static snd_pcm_hardware_t snd_cs46xx_playback = 1242static struct snd_pcm_hardware snd_cs46xx_playback =
1243{ 1243{
1244 .info = (SNDRV_PCM_INFO_MMAP | 1244 .info = (SNDRV_PCM_INFO_MMAP |
1245 SNDRV_PCM_INFO_INTERLEAVED | 1245 SNDRV_PCM_INFO_INTERLEAVED |
@@ -1261,7 +1261,7 @@ static snd_pcm_hardware_t snd_cs46xx_playback =
1261 .fifo_size = 0, 1261 .fifo_size = 0,
1262}; 1262};
1263 1263
1264static snd_pcm_hardware_t snd_cs46xx_capture = 1264static struct snd_pcm_hardware snd_cs46xx_capture =
1265{ 1265{
1266 .info = (SNDRV_PCM_INFO_MMAP | 1266 .info = (SNDRV_PCM_INFO_MMAP |
1267 SNDRV_PCM_INFO_INTERLEAVED | 1267 SNDRV_PCM_INFO_INTERLEAVED |
@@ -1285,7 +1285,7 @@ static snd_pcm_hardware_t snd_cs46xx_capture =
1285 1285
1286static unsigned int period_sizes[] = { 32, 64, 128, 256, 512, 1024, 2048 }; 1286static unsigned int period_sizes[] = { 32, 64, 128, 256, 512, 1024, 2048 };
1287 1287
1288static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = { 1288static struct snd_pcm_hw_constraint_list hw_constraints_period_sizes = {
1289 .count = ARRAY_SIZE(period_sizes), 1289 .count = ARRAY_SIZE(period_sizes),
1290 .list = period_sizes, 1290 .list = period_sizes,
1291 .mask = 0 1291 .mask = 0
@@ -1293,16 +1293,16 @@ static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
1293 1293
1294#endif 1294#endif
1295 1295
1296static void snd_cs46xx_pcm_free_substream(snd_pcm_runtime_t *runtime) 1296static void snd_cs46xx_pcm_free_substream(struct snd_pcm_runtime *runtime)
1297{ 1297{
1298 kfree(runtime->private_data); 1298 kfree(runtime->private_data);
1299} 1299}
1300 1300
1301static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pcm_channel_id) 1301static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id)
1302{ 1302{
1303 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1303 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1304 cs46xx_pcm_t * cpcm; 1304 struct snd_cs46xx_pcm * cpcm;
1305 snd_pcm_runtime_t *runtime = substream->runtime; 1305 struct snd_pcm_runtime *runtime = substream->runtime;
1306 1306
1307 cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL); 1307 cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL);
1308 if (cpcm == NULL) 1308 if (cpcm == NULL)
@@ -1340,30 +1340,30 @@ static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pc
1340 return 0; 1340 return 0;
1341} 1341}
1342 1342
1343static int snd_cs46xx_playback_open(snd_pcm_substream_t * substream) 1343static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream)
1344{ 1344{
1345 snd_printdd("open front channel\n"); 1345 snd_printdd("open front channel\n");
1346 return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL); 1346 return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL);
1347} 1347}
1348 1348
1349#ifdef CONFIG_SND_CS46XX_NEW_DSP 1349#ifdef CONFIG_SND_CS46XX_NEW_DSP
1350static int snd_cs46xx_playback_open_rear(snd_pcm_substream_t * substream) 1350static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream)
1351{ 1351{
1352 snd_printdd("open rear channel\n"); 1352 snd_printdd("open rear channel\n");
1353 1353
1354 return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL); 1354 return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL);
1355} 1355}
1356 1356
1357static int snd_cs46xx_playback_open_clfe(snd_pcm_substream_t * substream) 1357static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream)
1358{ 1358{
1359 snd_printdd("open center - LFE channel\n"); 1359 snd_printdd("open center - LFE channel\n");
1360 1360
1361 return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL); 1361 return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL);
1362} 1362}
1363 1363
1364static int snd_cs46xx_playback_open_iec958(snd_pcm_substream_t * substream) 1364static int snd_cs46xx_playback_open_iec958(struct snd_pcm_substream *substream)
1365{ 1365{
1366 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1366 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1367 1367
1368 snd_printdd("open raw iec958 channel\n"); 1368 snd_printdd("open raw iec958 channel\n");
1369 1369
@@ -1374,12 +1374,12 @@ static int snd_cs46xx_playback_open_iec958(snd_pcm_substream_t * substream)
1374 return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL); 1374 return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL);
1375} 1375}
1376 1376
1377static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream); 1377static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream);
1378 1378
1379static int snd_cs46xx_playback_close_iec958(snd_pcm_substream_t * substream) 1379static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream)
1380{ 1380{
1381 int err; 1381 int err;
1382 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1382 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1383 1383
1384 snd_printdd("close raw iec958 channel\n"); 1384 snd_printdd("close raw iec958 channel\n");
1385 1385
@@ -1393,9 +1393,9 @@ static int snd_cs46xx_playback_close_iec958(snd_pcm_substream_t * substream)
1393} 1393}
1394#endif 1394#endif
1395 1395
1396static int snd_cs46xx_capture_open(snd_pcm_substream_t * substream) 1396static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream)
1397{ 1397{
1398 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1398 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1399 1399
1400 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), 1400 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
1401 PAGE_SIZE, &chip->capt.hw_buf) < 0) 1401 PAGE_SIZE, &chip->capt.hw_buf) < 0)
@@ -1416,11 +1416,11 @@ static int snd_cs46xx_capture_open(snd_pcm_substream_t * substream)
1416 return 0; 1416 return 0;
1417} 1417}
1418 1418
1419static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream) 1419static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream)
1420{ 1420{
1421 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1421 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1422 snd_pcm_runtime_t *runtime = substream->runtime; 1422 struct snd_pcm_runtime *runtime = substream->runtime;
1423 cs46xx_pcm_t * cpcm; 1423 struct snd_cs46xx_pcm * cpcm;
1424 1424
1425 cpcm = runtime->private_data; 1425 cpcm = runtime->private_data;
1426 1426
@@ -1445,9 +1445,9 @@ static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream)
1445 return 0; 1445 return 0;
1446} 1446}
1447 1447
1448static int snd_cs46xx_capture_close(snd_pcm_substream_t * substream) 1448static int snd_cs46xx_capture_close(struct snd_pcm_substream *substream)
1449{ 1449{
1450 cs46xx_t *chip = snd_pcm_substream_chip(substream); 1450 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1451 1451
1452 chip->capt.substream = NULL; 1452 chip->capt.substream = NULL;
1453 snd_dma_free_pages(&chip->capt.hw_buf); 1453 snd_dma_free_pages(&chip->capt.hw_buf);
@@ -1457,7 +1457,7 @@ static int snd_cs46xx_capture_close(snd_pcm_substream_t * substream)
1457} 1457}
1458 1458
1459#ifdef CONFIG_SND_CS46XX_NEW_DSP 1459#ifdef CONFIG_SND_CS46XX_NEW_DSP
1460static snd_pcm_ops_t snd_cs46xx_playback_rear_ops = { 1460static struct snd_pcm_ops snd_cs46xx_playback_rear_ops = {
1461 .open = snd_cs46xx_playback_open_rear, 1461 .open = snd_cs46xx_playback_open_rear,
1462 .close = snd_cs46xx_playback_close, 1462 .close = snd_cs46xx_playback_close,
1463 .ioctl = snd_pcm_lib_ioctl, 1463 .ioctl = snd_pcm_lib_ioctl,
@@ -1468,7 +1468,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_rear_ops = {
1468 .pointer = snd_cs46xx_playback_direct_pointer, 1468 .pointer = snd_cs46xx_playback_direct_pointer,
1469}; 1469};
1470 1470
1471static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops = { 1471static struct snd_pcm_ops snd_cs46xx_playback_indirect_rear_ops = {
1472 .open = snd_cs46xx_playback_open_rear, 1472 .open = snd_cs46xx_playback_open_rear,
1473 .close = snd_cs46xx_playback_close, 1473 .close = snd_cs46xx_playback_close,
1474 .ioctl = snd_pcm_lib_ioctl, 1474 .ioctl = snd_pcm_lib_ioctl,
@@ -1480,7 +1480,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops = {
1480 .ack = snd_cs46xx_playback_transfer, 1480 .ack = snd_cs46xx_playback_transfer,
1481}; 1481};
1482 1482
1483static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops = { 1483static struct snd_pcm_ops snd_cs46xx_playback_clfe_ops = {
1484 .open = snd_cs46xx_playback_open_clfe, 1484 .open = snd_cs46xx_playback_open_clfe,
1485 .close = snd_cs46xx_playback_close, 1485 .close = snd_cs46xx_playback_close,
1486 .ioctl = snd_pcm_lib_ioctl, 1486 .ioctl = snd_pcm_lib_ioctl,
@@ -1491,7 +1491,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops = {
1491 .pointer = snd_cs46xx_playback_direct_pointer, 1491 .pointer = snd_cs46xx_playback_direct_pointer,
1492}; 1492};
1493 1493
1494static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops = { 1494static struct snd_pcm_ops snd_cs46xx_playback_indirect_clfe_ops = {
1495 .open = snd_cs46xx_playback_open_clfe, 1495 .open = snd_cs46xx_playback_open_clfe,
1496 .close = snd_cs46xx_playback_close, 1496 .close = snd_cs46xx_playback_close,
1497 .ioctl = snd_pcm_lib_ioctl, 1497 .ioctl = snd_pcm_lib_ioctl,
@@ -1503,7 +1503,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops = {
1503 .ack = snd_cs46xx_playback_transfer, 1503 .ack = snd_cs46xx_playback_transfer,
1504}; 1504};
1505 1505
1506static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops = { 1506static struct snd_pcm_ops snd_cs46xx_playback_iec958_ops = {
1507 .open = snd_cs46xx_playback_open_iec958, 1507 .open = snd_cs46xx_playback_open_iec958,
1508 .close = snd_cs46xx_playback_close_iec958, 1508 .close = snd_cs46xx_playback_close_iec958,
1509 .ioctl = snd_pcm_lib_ioctl, 1509 .ioctl = snd_pcm_lib_ioctl,
@@ -1514,7 +1514,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops = {
1514 .pointer = snd_cs46xx_playback_direct_pointer, 1514 .pointer = snd_cs46xx_playback_direct_pointer,
1515}; 1515};
1516 1516
1517static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops = { 1517static struct snd_pcm_ops snd_cs46xx_playback_indirect_iec958_ops = {
1518 .open = snd_cs46xx_playback_open_iec958, 1518 .open = snd_cs46xx_playback_open_iec958,
1519 .close = snd_cs46xx_playback_close_iec958, 1519 .close = snd_cs46xx_playback_close_iec958,
1520 .ioctl = snd_pcm_lib_ioctl, 1520 .ioctl = snd_pcm_lib_ioctl,
@@ -1528,7 +1528,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops = {
1528 1528
1529#endif 1529#endif
1530 1530
1531static snd_pcm_ops_t snd_cs46xx_playback_ops = { 1531static struct snd_pcm_ops snd_cs46xx_playback_ops = {
1532 .open = snd_cs46xx_playback_open, 1532 .open = snd_cs46xx_playback_open,
1533 .close = snd_cs46xx_playback_close, 1533 .close = snd_cs46xx_playback_close,
1534 .ioctl = snd_pcm_lib_ioctl, 1534 .ioctl = snd_pcm_lib_ioctl,
@@ -1539,7 +1539,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_ops = {
1539 .pointer = snd_cs46xx_playback_direct_pointer, 1539 .pointer = snd_cs46xx_playback_direct_pointer,
1540}; 1540};
1541 1541
1542static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops = { 1542static struct snd_pcm_ops snd_cs46xx_playback_indirect_ops = {
1543 .open = snd_cs46xx_playback_open, 1543 .open = snd_cs46xx_playback_open,
1544 .close = snd_cs46xx_playback_close, 1544 .close = snd_cs46xx_playback_close,
1545 .ioctl = snd_pcm_lib_ioctl, 1545 .ioctl = snd_pcm_lib_ioctl,
@@ -1551,7 +1551,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops = {
1551 .ack = snd_cs46xx_playback_transfer, 1551 .ack = snd_cs46xx_playback_transfer,
1552}; 1552};
1553 1553
1554static snd_pcm_ops_t snd_cs46xx_capture_ops = { 1554static struct snd_pcm_ops snd_cs46xx_capture_ops = {
1555 .open = snd_cs46xx_capture_open, 1555 .open = snd_cs46xx_capture_open,
1556 .close = snd_cs46xx_capture_close, 1556 .close = snd_cs46xx_capture_close,
1557 .ioctl = snd_pcm_lib_ioctl, 1557 .ioctl = snd_pcm_lib_ioctl,
@@ -1562,7 +1562,7 @@ static snd_pcm_ops_t snd_cs46xx_capture_ops = {
1562 .pointer = snd_cs46xx_capture_direct_pointer, 1562 .pointer = snd_cs46xx_capture_direct_pointer,
1563}; 1563};
1564 1564
1565static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = { 1565static struct snd_pcm_ops snd_cs46xx_capture_indirect_ops = {
1566 .open = snd_cs46xx_capture_open, 1566 .open = snd_cs46xx_capture_open,
1567 .close = snd_cs46xx_capture_close, 1567 .close = snd_cs46xx_capture_close,
1568 .ioctl = snd_pcm_lib_ioctl, 1568 .ioctl = snd_pcm_lib_ioctl,
@@ -1580,9 +1580,9 @@ static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = {
1580#define MAX_PLAYBACK_CHANNELS 1 1580#define MAX_PLAYBACK_CHANNELS 1
1581#endif 1581#endif
1582 1582
1583int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) 1583int __devinit snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
1584{ 1584{
1585 snd_pcm_t *pcm; 1585 struct snd_pcm *pcm;
1586 int err; 1586 int err;
1587 1587
1588 if (rpcm) 1588 if (rpcm)
@@ -1611,9 +1611,9 @@ int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
1611 1611
1612 1612
1613#ifdef CONFIG_SND_CS46XX_NEW_DSP 1613#ifdef CONFIG_SND_CS46XX_NEW_DSP
1614int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) 1614int __devinit snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
1615{ 1615{
1616 snd_pcm_t *pcm; 1616 struct snd_pcm *pcm;
1617 int err; 1617 int err;
1618 1618
1619 if (rpcm) 1619 if (rpcm)
@@ -1640,9 +1640,9 @@ int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
1640 return 0; 1640 return 0;
1641} 1641}
1642 1642
1643int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) 1643int __devinit snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
1644{ 1644{
1645 snd_pcm_t *pcm; 1645 struct snd_pcm *pcm;
1646 int err; 1646 int err;
1647 1647
1648 if (rpcm) 1648 if (rpcm)
@@ -1669,9 +1669,9 @@ int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **
1669 return 0; 1669 return 0;
1670} 1670}
1671 1671
1672int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) 1672int __devinit snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
1673{ 1673{
1674 snd_pcm_t *pcm; 1674 struct snd_pcm *pcm;
1675 int err; 1675 int err;
1676 1676
1677 if (rpcm) 1677 if (rpcm)
@@ -1702,16 +1702,16 @@ int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpc
1702/* 1702/*
1703 * Mixer routines 1703 * Mixer routines
1704 */ 1704 */
1705static void snd_cs46xx_mixer_free_ac97_bus(ac97_bus_t *bus) 1705static void snd_cs46xx_mixer_free_ac97_bus(struct snd_ac97_bus *bus)
1706{ 1706{
1707 cs46xx_t *chip = bus->private_data; 1707 struct snd_cs46xx *chip = bus->private_data;
1708 1708
1709 chip->ac97_bus = NULL; 1709 chip->ac97_bus = NULL;
1710} 1710}
1711 1711
1712static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97) 1712static void snd_cs46xx_mixer_free_ac97(struct snd_ac97 *ac97)
1713{ 1713{
1714 cs46xx_t *chip = ac97->private_data; 1714 struct snd_cs46xx *chip = ac97->private_data;
1715 1715
1716 snd_assert ((ac97 == chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]) || 1716 snd_assert ((ac97 == chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]) ||
1717 (ac97 == chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]), 1717 (ac97 == chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]),
@@ -1725,8 +1725,8 @@ static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97)
1725 chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL; 1725 chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL;
1726} 1726}
1727 1727
1728static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol, 1728static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol,
1729 snd_ctl_elem_info_t *uinfo) 1729 struct snd_ctl_elem_info *uinfo)
1730{ 1730{
1731 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 1731 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1732 uinfo->count = 2; 1732 uinfo->count = 2;
@@ -1735,9 +1735,9 @@ static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol,
1735 return 0; 1735 return 0;
1736} 1736}
1737 1737
1738static int snd_cs46xx_vol_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1738static int snd_cs46xx_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1739{ 1739{
1740 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1740 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1741 int reg = kcontrol->private_value; 1741 int reg = kcontrol->private_value;
1742 unsigned int val = snd_cs46xx_peek(chip, reg); 1742 unsigned int val = snd_cs46xx_peek(chip, reg);
1743 ucontrol->value.integer.value[0] = 0xffff - (val >> 16); 1743 ucontrol->value.integer.value[0] = 0xffff - (val >> 16);
@@ -1745,9 +1745,9 @@ static int snd_cs46xx_vol_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
1745 return 0; 1745 return 0;
1746} 1746}
1747 1747
1748static int snd_cs46xx_vol_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1748static int snd_cs46xx_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1749{ 1749{
1750 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1750 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1751 int reg = kcontrol->private_value; 1751 int reg = kcontrol->private_value;
1752 unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 | 1752 unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 |
1753 (0xffff - ucontrol->value.integer.value[1])); 1753 (0xffff - ucontrol->value.integer.value[1]));
@@ -1763,9 +1763,9 @@ static int snd_cs46xx_vol_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
1763 1763
1764#ifdef CONFIG_SND_CS46XX_NEW_DSP 1764#ifdef CONFIG_SND_CS46XX_NEW_DSP
1765 1765
1766static int snd_cs46xx_vol_dac_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1766static int snd_cs46xx_vol_dac_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1767{ 1767{
1768 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1768 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1769 1769
1770 ucontrol->value.integer.value[0] = chip->dsp_spos_instance->dac_volume_left; 1770 ucontrol->value.integer.value[0] = chip->dsp_spos_instance->dac_volume_left;
1771 ucontrol->value.integer.value[1] = chip->dsp_spos_instance->dac_volume_right; 1771 ucontrol->value.integer.value[1] = chip->dsp_spos_instance->dac_volume_right;
@@ -1773,9 +1773,9 @@ static int snd_cs46xx_vol_dac_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
1773 return 0; 1773 return 0;
1774} 1774}
1775 1775
1776static int snd_cs46xx_vol_dac_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1776static int snd_cs46xx_vol_dac_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1777{ 1777{
1778 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1778 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1779 int change = 0; 1779 int change = 0;
1780 1780
1781 if (chip->dsp_spos_instance->dac_volume_right != ucontrol->value.integer.value[0] || 1781 if (chip->dsp_spos_instance->dac_volume_right != ucontrol->value.integer.value[0] ||
@@ -1790,18 +1790,18 @@ static int snd_cs46xx_vol_dac_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
1790} 1790}
1791 1791
1792#if 0 1792#if 0
1793static int snd_cs46xx_vol_iec958_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1793static int snd_cs46xx_vol_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1794{ 1794{
1795 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1795 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1796 1796
1797 ucontrol->value.integer.value[0] = chip->dsp_spos_instance->spdif_input_volume_left; 1797 ucontrol->value.integer.value[0] = chip->dsp_spos_instance->spdif_input_volume_left;
1798 ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_right; 1798 ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_right;
1799 return 0; 1799 return 0;
1800} 1800}
1801 1801
1802static int snd_cs46xx_vol_iec958_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1802static int snd_cs46xx_vol_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1803{ 1803{
1804 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1804 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1805 int change = 0; 1805 int change = 0;
1806 1806
1807 if (chip->dsp_spos_instance->spdif_input_volume_left != ucontrol->value.integer.value[0] || 1807 if (chip->dsp_spos_instance->spdif_input_volume_left != ucontrol->value.integer.value[0] ||
@@ -1816,8 +1816,8 @@ static int snd_cs46xx_vol_iec958_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_val
1816} 1816}
1817#endif 1817#endif
1818 1818
1819static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol, 1819static int snd_mixer_boolean_info(struct snd_kcontrol *kcontrol,
1820 snd_ctl_elem_info_t *uinfo) 1820 struct snd_ctl_elem_info *uinfo)
1821{ 1821{
1822 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1822 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1823 uinfo->count = 1; 1823 uinfo->count = 1;
@@ -1826,10 +1826,10 @@ static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol,
1826 return 0; 1826 return 0;
1827} 1827}
1828 1828
1829static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol, 1829static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
1830 snd_ctl_elem_value_t *ucontrol) 1830 struct snd_ctl_elem_value *ucontrol)
1831{ 1831{
1832 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1832 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1833 int reg = kcontrol->private_value; 1833 int reg = kcontrol->private_value;
1834 1834
1835 if (reg == CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT) 1835 if (reg == CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT)
@@ -1840,10 +1840,10 @@ static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol,
1840 return 0; 1840 return 0;
1841} 1841}
1842 1842
1843static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol, 1843static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
1844 snd_ctl_elem_value_t *ucontrol) 1844 struct snd_ctl_elem_value *ucontrol)
1845{ 1845{
1846 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1846 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1847 int change, res; 1847 int change, res;
1848 1848
1849 switch (kcontrol->private_value) { 1849 switch (kcontrol->private_value) {
@@ -1877,11 +1877,11 @@ static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol,
1877 return res; 1877 return res;
1878} 1878}
1879 1879
1880static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol, 1880static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol,
1881 snd_ctl_elem_value_t *ucontrol) 1881 struct snd_ctl_elem_value *ucontrol)
1882{ 1882{
1883 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1883 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1884 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1884 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1885 1885
1886 if (ins->adc_input != NULL) 1886 if (ins->adc_input != NULL)
1887 ucontrol->value.integer.value[0] = 1; 1887 ucontrol->value.integer.value[0] = 1;
@@ -1891,11 +1891,11 @@ static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol,
1891 return 0; 1891 return 0;
1892} 1892}
1893 1893
1894static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol, 1894static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
1895 snd_ctl_elem_value_t *ucontrol) 1895 struct snd_ctl_elem_value *ucontrol)
1896{ 1896{
1897 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1897 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1898 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1898 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1899 int change = 0; 1899 int change = 0;
1900 1900
1901 if (ucontrol->value.integer.value[0] && !ins->adc_input) { 1901 if (ucontrol->value.integer.value[0] && !ins->adc_input) {
@@ -1908,11 +1908,11 @@ static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol,
1908 return change; 1908 return change;
1909} 1909}
1910 1910
1911static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol, 1911static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol,
1912 snd_ctl_elem_value_t *ucontrol) 1912 struct snd_ctl_elem_value *ucontrol)
1913{ 1913{
1914 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1914 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1915 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1915 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1916 1916
1917 if (ins->pcm_input != NULL) 1917 if (ins->pcm_input != NULL)
1918 ucontrol->value.integer.value[0] = 1; 1918 ucontrol->value.integer.value[0] = 1;
@@ -1923,11 +1923,11 @@ static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol,
1923} 1923}
1924 1924
1925 1925
1926static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol, 1926static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
1927 snd_ctl_elem_value_t *ucontrol) 1927 struct snd_ctl_elem_value *ucontrol)
1928{ 1928{
1929 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1929 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1930 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1930 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1931 int change = 0; 1931 int change = 0;
1932 1932
1933 if (ucontrol->value.integer.value[0] && !ins->pcm_input) { 1933 if (ucontrol->value.integer.value[0] && !ins->pcm_input) {
@@ -1941,10 +1941,10 @@ static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol,
1941 return change; 1941 return change;
1942} 1942}
1943 1943
1944static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol, 1944static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
1945 snd_ctl_elem_value_t *ucontrol) 1945 struct snd_ctl_elem_value *ucontrol)
1946{ 1946{
1947 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1947 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1948 1948
1949 int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR); 1949 int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
1950 1950
@@ -1959,10 +1959,10 @@ static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol,
1959/* 1959/*
1960 * Game Theatre XP card - EGPIO[0] is used to select SPDIF input optical or coaxial. 1960 * Game Theatre XP card - EGPIO[0] is used to select SPDIF input optical or coaxial.
1961 */ 1961 */
1962static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol, 1962static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
1963 snd_ctl_elem_value_t *ucontrol) 1963 struct snd_ctl_elem_value *ucontrol)
1964{ 1964{
1965 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1965 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1966 int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR); 1966 int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
1967 int val2 = snd_cs46xx_peekBA0(chip, BA0_EGPIOPTR); 1967 int val2 = snd_cs46xx_peekBA0(chip, BA0_EGPIOPTR);
1968 1968
@@ -1984,18 +1984,18 @@ static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol,
1984} 1984}
1985 1985
1986 1986
1987static int snd_cs46xx_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1987static int snd_cs46xx_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1988{ 1988{
1989 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 1989 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
1990 uinfo->count = 1; 1990 uinfo->count = 1;
1991 return 0; 1991 return 0;
1992} 1992}
1993 1993
1994static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol, 1994static int snd_cs46xx_spdif_default_get(struct snd_kcontrol *kcontrol,
1995 snd_ctl_elem_value_t * ucontrol) 1995 struct snd_ctl_elem_value *ucontrol)
1996{ 1996{
1997 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 1997 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
1998 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1998 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1999 1999
2000 down (&chip->spos_mutex); 2000 down (&chip->spos_mutex);
2001 ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff); 2001 ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff);
@@ -2007,11 +2007,11 @@ static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol,
2007 return 0; 2007 return 0;
2008} 2008}
2009 2009
2010static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol, 2010static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol,
2011 snd_ctl_elem_value_t * ucontrol) 2011 struct snd_ctl_elem_value *ucontrol)
2012{ 2012{
2013 cs46xx_t * chip = snd_kcontrol_chip(kcontrol); 2013 struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
2014 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 2014 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
2015 unsigned int val; 2015 unsigned int val;
2016 int change; 2016 int change;
2017 2017
@@ -2034,8 +2034,8 @@ static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol,
2034 return change; 2034 return change;
2035} 2035}
2036 2036
2037static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol, 2037static int snd_cs46xx_spdif_mask_get(struct snd_kcontrol *kcontrol,
2038 snd_ctl_elem_value_t * ucontrol) 2038 struct snd_ctl_elem_value *ucontrol)
2039{ 2039{
2040 ucontrol->value.iec958.status[0] = 0xff; 2040 ucontrol->value.iec958.status[0] = 0xff;
2041 ucontrol->value.iec958.status[1] = 0xff; 2041 ucontrol->value.iec958.status[1] = 0xff;
@@ -2044,11 +2044,11 @@ static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol,
2044 return 0; 2044 return 0;
2045} 2045}
2046 2046
2047static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol, 2047static int snd_cs46xx_spdif_stream_get(struct snd_kcontrol *kcontrol,
2048 snd_ctl_elem_value_t * ucontrol) 2048 struct snd_ctl_elem_value *ucontrol)
2049{ 2049{
2050 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 2050 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
2051 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 2051 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
2052 2052
2053 down (&chip->spos_mutex); 2053 down (&chip->spos_mutex);
2054 ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff); 2054 ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff);
@@ -2060,11 +2060,11 @@ static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol,
2060 return 0; 2060 return 0;
2061} 2061}
2062 2062
2063static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol, 2063static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,
2064 snd_ctl_elem_value_t * ucontrol) 2064 struct snd_ctl_elem_value *ucontrol)
2065{ 2065{
2066 cs46xx_t * chip = snd_kcontrol_chip(kcontrol); 2066 struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
2067 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 2067 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
2068 unsigned int val; 2068 unsigned int val;
2069 int change; 2069 int change;
2070 2070
@@ -2091,8 +2091,8 @@ static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol,
2091 2091
2092 2092
2093#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO 2093#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
2094static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol, 2094static int snd_cs46xx_egpio_select_info(struct snd_kcontrol *kcontrol,
2095 snd_ctl_elem_info_t *uinfo) 2095 struct snd_ctl_elem_info *uinfo)
2096{ 2096{
2097 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2097 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2098 uinfo->count = 1; 2098 uinfo->count = 1;
@@ -2101,19 +2101,19 @@ static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol,
2101 return 0; 2101 return 0;
2102} 2102}
2103 2103
2104static int snd_cs46xx_egpio_select_get(snd_kcontrol_t *kcontrol, 2104static int snd_cs46xx_egpio_select_get(struct snd_kcontrol *kcontrol,
2105 snd_ctl_elem_value_t *ucontrol) 2105 struct snd_ctl_elem_value *ucontrol)
2106{ 2106{
2107 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 2107 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
2108 ucontrol->value.integer.value[0] = chip->current_gpio; 2108 ucontrol->value.integer.value[0] = chip->current_gpio;
2109 2109
2110 return 0; 2110 return 0;
2111} 2111}
2112 2112
2113static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol, 2113static int snd_cs46xx_egpio_select_put(struct snd_kcontrol *kcontrol,
2114 snd_ctl_elem_value_t *ucontrol) 2114 struct snd_ctl_elem_value *ucontrol)
2115{ 2115{
2116 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 2116 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
2117 int change = (chip->current_gpio != ucontrol->value.integer.value[0]); 2117 int change = (chip->current_gpio != ucontrol->value.integer.value[0]);
2118 chip->current_gpio = ucontrol->value.integer.value[0]; 2118 chip->current_gpio = ucontrol->value.integer.value[0];
2119 2119
@@ -2121,10 +2121,10 @@ static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol,
2121} 2121}
2122 2122
2123 2123
2124static int snd_cs46xx_egpio_get(snd_kcontrol_t *kcontrol, 2124static int snd_cs46xx_egpio_get(struct snd_kcontrol *kcontrol,
2125 snd_ctl_elem_value_t *ucontrol) 2125 struct snd_ctl_elem_value *ucontrol)
2126{ 2126{
2127 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 2127 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
2128 int reg = kcontrol->private_value; 2128 int reg = kcontrol->private_value;
2129 2129
2130 snd_printdd ("put: reg = %04x, gpio %02x\n",reg,chip->current_gpio); 2130 snd_printdd ("put: reg = %04x, gpio %02x\n",reg,chip->current_gpio);
@@ -2134,10 +2134,10 @@ static int snd_cs46xx_egpio_get(snd_kcontrol_t *kcontrol,
2134 return 0; 2134 return 0;
2135} 2135}
2136 2136
2137static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol, 2137static int snd_cs46xx_egpio_put(struct snd_kcontrol *kcontrol,
2138 snd_ctl_elem_value_t *ucontrol) 2138 struct snd_ctl_elem_value *ucontrol)
2139{ 2139{
2140 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 2140 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
2141 int reg = kcontrol->private_value; 2141 int reg = kcontrol->private_value;
2142 int val = snd_cs46xx_peekBA0(chip, reg); 2142 int val = snd_cs46xx_peekBA0(chip, reg);
2143 int oldval = val; 2143 int oldval = val;
@@ -2155,7 +2155,7 @@ static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol,
2155} 2155}
2156#endif /* CONFIG_SND_CS46XX_DEBUG_GPIO */ 2156#endif /* CONFIG_SND_CS46XX_DEBUG_GPIO */
2157 2157
2158static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = { 2158static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = {
2159{ 2159{
2160 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2160 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2161 .name = "DAC Volume", 2161 .name = "DAC Volume",
@@ -2285,26 +2285,26 @@ static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = {
2285 2285
2286#ifdef CONFIG_SND_CS46XX_NEW_DSP 2286#ifdef CONFIG_SND_CS46XX_NEW_DSP
2287/* set primary cs4294 codec into Extended Audio Mode */ 2287/* set primary cs4294 codec into Extended Audio Mode */
2288static int snd_cs46xx_front_dup_get(snd_kcontrol_t *kcontrol, 2288static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
2289 snd_ctl_elem_value_t *ucontrol) 2289 struct snd_ctl_elem_value *ucontrol)
2290{ 2290{
2291 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 2291 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
2292 unsigned short val; 2292 unsigned short val;
2293 val = snd_ac97_read(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], AC97_CSR_ACMODE); 2293 val = snd_ac97_read(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], AC97_CSR_ACMODE);
2294 ucontrol->value.integer.value[0] = (val & 0x200) ? 0 : 1; 2294 ucontrol->value.integer.value[0] = (val & 0x200) ? 0 : 1;
2295 return 0; 2295 return 0;
2296} 2296}
2297 2297
2298static int snd_cs46xx_front_dup_put(snd_kcontrol_t *kcontrol, 2298static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol,
2299 snd_ctl_elem_value_t *ucontrol) 2299 struct snd_ctl_elem_value *ucontrol)
2300{ 2300{
2301 cs46xx_t *chip = snd_kcontrol_chip(kcontrol); 2301 struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
2302 return snd_ac97_update_bits(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], 2302 return snd_ac97_update_bits(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX],
2303 AC97_CSR_ACMODE, 0x200, 2303 AC97_CSR_ACMODE, 0x200,
2304 ucontrol->value.integer.value[0] ? 0 : 0x200); 2304 ucontrol->value.integer.value[0] ? 0 : 0x200);
2305} 2305}
2306 2306
2307static snd_kcontrol_new_t snd_cs46xx_front_dup_ctl = { 2307static struct snd_kcontrol_new snd_cs46xx_front_dup_ctl = {
2308 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2308 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2309 .name = "Duplicate Front", 2309 .name = "Duplicate Front",
2310 .info = snd_mixer_boolean_info, 2310 .info = snd_mixer_boolean_info,
@@ -2315,7 +2315,7 @@ static snd_kcontrol_new_t snd_cs46xx_front_dup_ctl = {
2315 2315
2316#ifdef CONFIG_SND_CS46XX_NEW_DSP 2316#ifdef CONFIG_SND_CS46XX_NEW_DSP
2317/* Only available on the Hercules Game Theater XP soundcard */ 2317/* Only available on the Hercules Game Theater XP soundcard */
2318static snd_kcontrol_new_t snd_hercules_controls[] __devinitdata = { 2318static struct snd_kcontrol_new snd_hercules_controls[] __devinitdata = {
2319{ 2319{
2320 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2320 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2321 .name = "Optical/Coaxial SPDIF Input Switch", 2321 .name = "Optical/Coaxial SPDIF Input Switch",
@@ -2326,7 +2326,7 @@ static snd_kcontrol_new_t snd_hercules_controls[] __devinitdata = {
2326}; 2326};
2327 2327
2328 2328
2329static void snd_cs46xx_codec_reset (ac97_t * ac97) 2329static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
2330{ 2330{
2331 unsigned long end_time; 2331 unsigned long end_time;
2332 int err; 2332 int err;
@@ -2375,10 +2375,10 @@ static void snd_cs46xx_codec_reset (ac97_t * ac97)
2375} 2375}
2376#endif 2376#endif
2377 2377
2378static int __devinit cs46xx_detect_codec(cs46xx_t *chip, int codec) 2378static int __devinit cs46xx_detect_codec(struct snd_cs46xx *chip, int codec)
2379{ 2379{
2380 int idx, err; 2380 int idx, err;
2381 ac97_template_t ac97; 2381 struct snd_ac97_template ac97;
2382 2382
2383 memset(&ac97, 0, sizeof(ac97)); 2383 memset(&ac97, 0, sizeof(ac97));
2384 ac97.private_data = chip; 2384 ac97.private_data = chip;
@@ -2408,13 +2408,13 @@ static int __devinit cs46xx_detect_codec(cs46xx_t *chip, int codec)
2408 return -ENXIO; 2408 return -ENXIO;
2409} 2409}
2410 2410
2411int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device) 2411int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
2412{ 2412{
2413 snd_card_t *card = chip->card; 2413 struct snd_card *card = chip->card;
2414 snd_ctl_elem_id_t id; 2414 struct snd_ctl_elem_id id;
2415 int err; 2415 int err;
2416 unsigned int idx; 2416 unsigned int idx;
2417 static ac97_bus_ops_t ops = { 2417 static struct snd_ac97_bus_ops ops = {
2418#ifdef CONFIG_SND_CS46XX_NEW_DSP 2418#ifdef CONFIG_SND_CS46XX_NEW_DSP
2419 .reset = snd_cs46xx_codec_reset, 2419 .reset = snd_cs46xx_codec_reset,
2420#endif 2420#endif
@@ -2442,7 +2442,7 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device)
2442 2442
2443 /* add cs4630 mixer controls */ 2443 /* add cs4630 mixer controls */
2444 for (idx = 0; idx < ARRAY_SIZE(snd_cs46xx_controls); idx++) { 2444 for (idx = 0; idx < ARRAY_SIZE(snd_cs46xx_controls); idx++) {
2445 snd_kcontrol_t *kctl; 2445 struct snd_kcontrol *kctl;
2446 kctl = snd_ctl_new1(&snd_cs46xx_controls[idx], chip); 2446 kctl = snd_ctl_new1(&snd_cs46xx_controls[idx], chip);
2447 if (kctl && kctl->id.iface == SNDRV_CTL_ELEM_IFACE_PCM) 2447 if (kctl && kctl->id.iface == SNDRV_CTL_ELEM_IFACE_PCM)
2448 kctl->id.device = spdif_device; 2448 kctl->id.device = spdif_device;
@@ -2484,16 +2484,16 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device)
2484 * RawMIDI interface 2484 * RawMIDI interface
2485 */ 2485 */
2486 2486
2487static void snd_cs46xx_midi_reset(cs46xx_t *chip) 2487static void snd_cs46xx_midi_reset(struct snd_cs46xx *chip)
2488{ 2488{
2489 snd_cs46xx_pokeBA0(chip, BA0_MIDCR, MIDCR_MRST); 2489 snd_cs46xx_pokeBA0(chip, BA0_MIDCR, MIDCR_MRST);
2490 udelay(100); 2490 udelay(100);
2491 snd_cs46xx_pokeBA0(chip, BA0_MIDCR, chip->midcr); 2491 snd_cs46xx_pokeBA0(chip, BA0_MIDCR, chip->midcr);
2492} 2492}
2493 2493
2494static int snd_cs46xx_midi_input_open(snd_rawmidi_substream_t * substream) 2494static int snd_cs46xx_midi_input_open(struct snd_rawmidi_substream *substream)
2495{ 2495{
2496 cs46xx_t *chip = substream->rmidi->private_data; 2496 struct snd_cs46xx *chip = substream->rmidi->private_data;
2497 2497
2498 chip->active_ctrl(chip, 1); 2498 chip->active_ctrl(chip, 1);
2499 spin_lock_irq(&chip->reg_lock); 2499 spin_lock_irq(&chip->reg_lock);
@@ -2509,9 +2509,9 @@ static int snd_cs46xx_midi_input_open(snd_rawmidi_substream_t * substream)
2509 return 0; 2509 return 0;
2510} 2510}
2511 2511
2512static int snd_cs46xx_midi_input_close(snd_rawmidi_substream_t * substream) 2512static int snd_cs46xx_midi_input_close(struct snd_rawmidi_substream *substream)
2513{ 2513{
2514 cs46xx_t *chip = substream->rmidi->private_data; 2514 struct snd_cs46xx *chip = substream->rmidi->private_data;
2515 2515
2516 spin_lock_irq(&chip->reg_lock); 2516 spin_lock_irq(&chip->reg_lock);
2517 chip->midcr &= ~(MIDCR_RXE | MIDCR_RIE); 2517 chip->midcr &= ~(MIDCR_RXE | MIDCR_RIE);
@@ -2527,9 +2527,9 @@ static int snd_cs46xx_midi_input_close(snd_rawmidi_substream_t * substream)
2527 return 0; 2527 return 0;
2528} 2528}
2529 2529
2530static int snd_cs46xx_midi_output_open(snd_rawmidi_substream_t * substream) 2530static int snd_cs46xx_midi_output_open(struct snd_rawmidi_substream *substream)
2531{ 2531{
2532 cs46xx_t *chip = substream->rmidi->private_data; 2532 struct snd_cs46xx *chip = substream->rmidi->private_data;
2533 2533
2534 chip->active_ctrl(chip, 1); 2534 chip->active_ctrl(chip, 1);
2535 2535
@@ -2546,9 +2546,9 @@ static int snd_cs46xx_midi_output_open(snd_rawmidi_substream_t * substream)
2546 return 0; 2546 return 0;
2547} 2547}
2548 2548
2549static int snd_cs46xx_midi_output_close(snd_rawmidi_substream_t * substream) 2549static int snd_cs46xx_midi_output_close(struct snd_rawmidi_substream *substream)
2550{ 2550{
2551 cs46xx_t *chip = substream->rmidi->private_data; 2551 struct snd_cs46xx *chip = substream->rmidi->private_data;
2552 2552
2553 spin_lock_irq(&chip->reg_lock); 2553 spin_lock_irq(&chip->reg_lock);
2554 chip->midcr &= ~(MIDCR_TXE | MIDCR_TIE); 2554 chip->midcr &= ~(MIDCR_TXE | MIDCR_TIE);
@@ -2564,10 +2564,10 @@ static int snd_cs46xx_midi_output_close(snd_rawmidi_substream_t * substream)
2564 return 0; 2564 return 0;
2565} 2565}
2566 2566
2567static void snd_cs46xx_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) 2567static void snd_cs46xx_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
2568{ 2568{
2569 unsigned long flags; 2569 unsigned long flags;
2570 cs46xx_t *chip = substream->rmidi->private_data; 2570 struct snd_cs46xx *chip = substream->rmidi->private_data;
2571 2571
2572 spin_lock_irqsave(&chip->reg_lock, flags); 2572 spin_lock_irqsave(&chip->reg_lock, flags);
2573 if (up) { 2573 if (up) {
@@ -2584,10 +2584,10 @@ static void snd_cs46xx_midi_input_trigger(snd_rawmidi_substream_t * substream, i
2584 spin_unlock_irqrestore(&chip->reg_lock, flags); 2584 spin_unlock_irqrestore(&chip->reg_lock, flags);
2585} 2585}
2586 2586
2587static void snd_cs46xx_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) 2587static void snd_cs46xx_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
2588{ 2588{
2589 unsigned long flags; 2589 unsigned long flags;
2590 cs46xx_t *chip = substream->rmidi->private_data; 2590 struct snd_cs46xx *chip = substream->rmidi->private_data;
2591 unsigned char byte; 2591 unsigned char byte;
2592 2592
2593 spin_lock_irqsave(&chip->reg_lock, flags); 2593 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -2614,23 +2614,23 @@ static void snd_cs46xx_midi_output_trigger(snd_rawmidi_substream_t * substream,
2614 spin_unlock_irqrestore(&chip->reg_lock, flags); 2614 spin_unlock_irqrestore(&chip->reg_lock, flags);
2615} 2615}
2616 2616
2617static snd_rawmidi_ops_t snd_cs46xx_midi_output = 2617static struct snd_rawmidi_ops snd_cs46xx_midi_output =
2618{ 2618{
2619 .open = snd_cs46xx_midi_output_open, 2619 .open = snd_cs46xx_midi_output_open,
2620 .close = snd_cs46xx_midi_output_close, 2620 .close = snd_cs46xx_midi_output_close,
2621 .trigger = snd_cs46xx_midi_output_trigger, 2621 .trigger = snd_cs46xx_midi_output_trigger,
2622}; 2622};
2623 2623
2624static snd_rawmidi_ops_t snd_cs46xx_midi_input = 2624static struct snd_rawmidi_ops snd_cs46xx_midi_input =
2625{ 2625{
2626 .open = snd_cs46xx_midi_input_open, 2626 .open = snd_cs46xx_midi_input_open,
2627 .close = snd_cs46xx_midi_input_close, 2627 .close = snd_cs46xx_midi_input_close,
2628 .trigger = snd_cs46xx_midi_input_trigger, 2628 .trigger = snd_cs46xx_midi_input_trigger,
2629}; 2629};
2630 2630
2631int __devinit snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rrawmidi) 2631int __devinit snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rrawmidi)
2632{ 2632{
2633 snd_rawmidi_t *rmidi; 2633 struct snd_rawmidi *rmidi;
2634 int err; 2634 int err;
2635 2635
2636 if (rrawmidi) 2636 if (rrawmidi)
@@ -2657,7 +2657,7 @@ int __devinit snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rrawmi
2657 2657
2658static void snd_cs46xx_gameport_trigger(struct gameport *gameport) 2658static void snd_cs46xx_gameport_trigger(struct gameport *gameport)
2659{ 2659{
2660 cs46xx_t *chip = gameport_get_port_data(gameport); 2660 struct snd_cs46xx *chip = gameport_get_port_data(gameport);
2661 2661
2662 snd_assert(chip, return); 2662 snd_assert(chip, return);
2663 snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF); 2663 snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF);
@@ -2665,7 +2665,7 @@ static void snd_cs46xx_gameport_trigger(struct gameport *gameport)
2665 2665
2666static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport) 2666static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
2667{ 2667{
2668 cs46xx_t *chip = gameport_get_port_data(gameport); 2668 struct snd_cs46xx *chip = gameport_get_port_data(gameport);
2669 2669
2670 snd_assert(chip, return 0); 2670 snd_assert(chip, return 0);
2671 return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io); 2671 return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io);
@@ -2673,7 +2673,7 @@ static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
2673 2673
2674static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons) 2674static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
2675{ 2675{
2676 cs46xx_t *chip = gameport_get_port_data(gameport); 2676 struct snd_cs46xx *chip = gameport_get_port_data(gameport);
2677 unsigned js1, js2, jst; 2677 unsigned js1, js2, jst;
2678 2678
2679 snd_assert(chip, return 0); 2679 snd_assert(chip, return 0);
@@ -2707,7 +2707,7 @@ static int snd_cs46xx_gameport_open(struct gameport *gameport, int mode)
2707 return 0; 2707 return 0;
2708} 2708}
2709 2709
2710int __devinit snd_cs46xx_gameport(cs46xx_t *chip) 2710int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip)
2711{ 2711{
2712 struct gameport *gp; 2712 struct gameport *gp;
2713 2713
@@ -2735,7 +2735,7 @@ int __devinit snd_cs46xx_gameport(cs46xx_t *chip)
2735 return 0; 2735 return 0;
2736} 2736}
2737 2737
2738static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) 2738static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip)
2739{ 2739{
2740 if (chip->gameport) { 2740 if (chip->gameport) {
2741 gameport_unregister_port(chip->gameport); 2741 gameport_unregister_port(chip->gameport);
@@ -2743,20 +2743,20 @@ static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip)
2743 } 2743 }
2744} 2744}
2745#else 2745#else
2746int __devinit snd_cs46xx_gameport(cs46xx_t *chip) { return -ENOSYS; } 2746int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip) { return -ENOSYS; }
2747static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) { } 2747static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { }
2748#endif /* CONFIG_GAMEPORT */ 2748#endif /* CONFIG_GAMEPORT */
2749 2749
2750/* 2750/*
2751 * proc interface 2751 * proc interface
2752 */ 2752 */
2753 2753
2754static long snd_cs46xx_io_read(snd_info_entry_t *entry, void *file_private_data, 2754static long snd_cs46xx_io_read(struct snd_info_entry *entry, void *file_private_data,
2755 struct file *file, char __user *buf, 2755 struct file *file, char __user *buf,
2756 unsigned long count, unsigned long pos) 2756 unsigned long count, unsigned long pos)
2757{ 2757{
2758 long size; 2758 long size;
2759 snd_cs46xx_region_t *region = (snd_cs46xx_region_t *)entry->private_data; 2759 struct snd_cs46xx_region *region = entry->private_data;
2760 2760
2761 size = count; 2761 size = count;
2762 if (pos + (size_t)size > region->size) 2762 if (pos + (size_t)size > region->size)
@@ -2772,13 +2772,13 @@ static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = {
2772 .read = snd_cs46xx_io_read, 2772 .read = snd_cs46xx_io_read,
2773}; 2773};
2774 2774
2775static int __devinit snd_cs46xx_proc_init(snd_card_t * card, cs46xx_t *chip) 2775static int __devinit snd_cs46xx_proc_init(struct snd_card *card, struct snd_cs46xx *chip)
2776{ 2776{
2777 snd_info_entry_t *entry; 2777 struct snd_info_entry *entry;
2778 int idx; 2778 int idx;
2779 2779
2780 for (idx = 0; idx < 5; idx++) { 2780 for (idx = 0; idx < 5; idx++) {
2781 snd_cs46xx_region_t *region = &chip->region.idx[idx]; 2781 struct snd_cs46xx_region *region = &chip->region.idx[idx];
2782 if (! snd_card_proc_new(card, region->name, &entry)) { 2782 if (! snd_card_proc_new(card, region->name, &entry)) {
2783 entry->content = SNDRV_INFO_CONTENT_DATA; 2783 entry->content = SNDRV_INFO_CONTENT_DATA;
2784 entry->private_data = chip; 2784 entry->private_data = chip;
@@ -2793,7 +2793,7 @@ static int __devinit snd_cs46xx_proc_init(snd_card_t * card, cs46xx_t *chip)
2793 return 0; 2793 return 0;
2794} 2794}
2795 2795
2796static int snd_cs46xx_proc_done(cs46xx_t *chip) 2796static int snd_cs46xx_proc_done(struct snd_cs46xx *chip)
2797{ 2797{
2798#ifdef CONFIG_SND_CS46XX_NEW_DSP 2798#ifdef CONFIG_SND_CS46XX_NEW_DSP
2799 cs46xx_dsp_proc_done(chip); 2799 cs46xx_dsp_proc_done(chip);
@@ -2804,7 +2804,7 @@ static int snd_cs46xx_proc_done(cs46xx_t *chip)
2804/* 2804/*
2805 * stop the h/w 2805 * stop the h/w
2806 */ 2806 */
2807static void snd_cs46xx_hw_stop(cs46xx_t *chip) 2807static void snd_cs46xx_hw_stop(struct snd_cs46xx *chip)
2808{ 2808{
2809 unsigned int tmp; 2809 unsigned int tmp;
2810 2810
@@ -2851,7 +2851,7 @@ static void snd_cs46xx_hw_stop(cs46xx_t *chip)
2851} 2851}
2852 2852
2853 2853
2854static int snd_cs46xx_free(cs46xx_t *chip) 2854static int snd_cs46xx_free(struct snd_cs46xx *chip)
2855{ 2855{
2856 int idx; 2856 int idx;
2857 2857
@@ -2871,13 +2871,13 @@ static int snd_cs46xx_free(cs46xx_t *chip)
2871 snd_cs46xx_hw_stop(chip); 2871 snd_cs46xx_hw_stop(chip);
2872 2872
2873 for (idx = 0; idx < 5; idx++) { 2873 for (idx = 0; idx < 5; idx++) {
2874 snd_cs46xx_region_t *region = &chip->region.idx[idx]; 2874 struct snd_cs46xx_region *region = &chip->region.idx[idx];
2875 if (region->remap_addr) 2875 if (region->remap_addr)
2876 iounmap(region->remap_addr); 2876 iounmap(region->remap_addr);
2877 release_and_free_resource(region->resource); 2877 release_and_free_resource(region->resource);
2878 } 2878 }
2879 if (chip->irq >= 0) 2879 if (chip->irq >= 0)
2880 free_irq(chip->irq, (void *)chip); 2880 free_irq(chip->irq, chip);
2881 2881
2882 if (chip->active_ctrl) 2882 if (chip->active_ctrl)
2883 chip->active_ctrl(chip, -chip->amplifier); 2883 chip->active_ctrl(chip, -chip->amplifier);
@@ -2894,16 +2894,16 @@ static int snd_cs46xx_free(cs46xx_t *chip)
2894 return 0; 2894 return 0;
2895} 2895}
2896 2896
2897static int snd_cs46xx_dev_free(snd_device_t *device) 2897static int snd_cs46xx_dev_free(struct snd_device *device)
2898{ 2898{
2899 cs46xx_t *chip = device->device_data; 2899 struct snd_cs46xx *chip = device->device_data;
2900 return snd_cs46xx_free(chip); 2900 return snd_cs46xx_free(chip);
2901} 2901}
2902 2902
2903/* 2903/*
2904 * initialize chip 2904 * initialize chip
2905 */ 2905 */
2906static int snd_cs46xx_chip_init(cs46xx_t *chip) 2906static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
2907{ 2907{
2908 int timeout; 2908 int timeout;
2909 2909
@@ -3132,7 +3132,7 @@ static int snd_cs46xx_chip_init(cs46xx_t *chip)
3132/* 3132/*
3133 * start and load DSP 3133 * start and load DSP
3134 */ 3134 */
3135int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip) 3135int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
3136{ 3136{
3137 unsigned int tmp; 3137 unsigned int tmp;
3138 /* 3138 /*
@@ -3234,12 +3234,12 @@ int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip)
3234 * AMP control - null AMP 3234 * AMP control - null AMP
3235 */ 3235 */
3236 3236
3237static void amp_none(cs46xx_t *chip, int change) 3237static void amp_none(struct snd_cs46xx *chip, int change)
3238{ 3238{
3239} 3239}
3240 3240
3241#ifdef CONFIG_SND_CS46XX_NEW_DSP 3241#ifdef CONFIG_SND_CS46XX_NEW_DSP
3242static int voyetra_setup_eapd_slot(cs46xx_t *chip) 3242static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
3243{ 3243{
3244 3244
3245 u32 idx, valid_slots,tmp,powerdown = 0; 3245 u32 idx, valid_slots,tmp,powerdown = 0;
@@ -3359,7 +3359,7 @@ static int voyetra_setup_eapd_slot(cs46xx_t *chip)
3359 * Crystal EAPD mode 3359 * Crystal EAPD mode
3360 */ 3360 */
3361 3361
3362static void amp_voyetra(cs46xx_t *chip, int change) 3362static void amp_voyetra(struct snd_cs46xx *chip, int change)
3363{ 3363{
3364 /* Manage the EAPD bit on the Crystal 4297 3364 /* Manage the EAPD bit on the Crystal 4297
3365 and the Analog AD1885 */ 3365 and the Analog AD1885 */
@@ -3395,7 +3395,7 @@ static void amp_voyetra(cs46xx_t *chip, int change)
3395#endif 3395#endif
3396} 3396}
3397 3397
3398static void hercules_init(cs46xx_t *chip) 3398static void hercules_init(struct snd_cs46xx *chip)
3399{ 3399{
3400 /* default: AMP off, and SPDIF input optical */ 3400 /* default: AMP off, and SPDIF input optical */
3401 snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0); 3401 snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0);
@@ -3406,7 +3406,7 @@ static void hercules_init(cs46xx_t *chip)
3406/* 3406/*
3407 * Game Theatre XP card - EGPIO[2] is used to enable the external amp. 3407 * Game Theatre XP card - EGPIO[2] is used to enable the external amp.
3408 */ 3408 */
3409static void amp_hercules(cs46xx_t *chip, int change) 3409static void amp_hercules(struct snd_cs46xx *chip, int change)
3410{ 3410{
3411 int old = chip->amplifier; 3411 int old = chip->amplifier;
3412 int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR); 3412 int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
@@ -3427,7 +3427,7 @@ static void amp_hercules(cs46xx_t *chip, int change)
3427 } 3427 }
3428} 3428}
3429 3429
3430static void voyetra_mixer_init (cs46xx_t *chip) 3430static void voyetra_mixer_init (struct snd_cs46xx *chip)
3431{ 3431{
3432 snd_printdd ("initializing Voyetra mixer\n"); 3432 snd_printdd ("initializing Voyetra mixer\n");
3433 3433
@@ -3436,12 +3436,12 @@ static void voyetra_mixer_init (cs46xx_t *chip)
3436 snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, EGPIODR_GPOE0); 3436 snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, EGPIODR_GPOE0);
3437} 3437}
3438 3438
3439static void hercules_mixer_init (cs46xx_t *chip) 3439static void hercules_mixer_init (struct snd_cs46xx *chip)
3440{ 3440{
3441#ifdef CONFIG_SND_CS46XX_NEW_DSP 3441#ifdef CONFIG_SND_CS46XX_NEW_DSP
3442 unsigned int idx; 3442 unsigned int idx;
3443 int err; 3443 int err;
3444 snd_card_t *card = chip->card; 3444 struct snd_card *card = chip->card;
3445#endif 3445#endif
3446 3446
3447 /* set EGPIO to default */ 3447 /* set EGPIO to default */
@@ -3451,7 +3451,7 @@ static void hercules_mixer_init (cs46xx_t *chip)
3451 3451
3452#ifdef CONFIG_SND_CS46XX_NEW_DSP 3452#ifdef CONFIG_SND_CS46XX_NEW_DSP
3453 for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) { 3453 for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
3454 snd_kcontrol_t *kctl; 3454 struct snd_kcontrol *kctl;
3455 3455
3456 kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip); 3456 kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip);
3457 if ((err = snd_ctl_add(card, kctl)) < 0) { 3457 if ((err = snd_ctl_add(card, kctl)) < 0) {
@@ -3468,7 +3468,7 @@ static void hercules_mixer_init (cs46xx_t *chip)
3468 * Untested 3468 * Untested
3469 */ 3469 */
3470 3470
3471static void amp_voyetra_4294(cs46xx_t *chip, int change) 3471static void amp_voyetra_4294(struct snd_cs46xx *chip, int change)
3472{ 3472{
3473 chip->amplifier += change; 3473 chip->amplifier += change;
3474 3474
@@ -3498,7 +3498,7 @@ static void amp_voyetra_4294(cs46xx_t *chip, int change)
3498 * enough to make them useful. 3498 * enough to make them useful.
3499 */ 3499 */
3500 3500
3501static void clkrun_hack(cs46xx_t *chip, int change) 3501static void clkrun_hack(struct snd_cs46xx *chip, int change)
3502{ 3502{
3503 u16 control, nval; 3503 u16 control, nval;
3504 3504
@@ -3523,7 +3523,7 @@ static void clkrun_hack(cs46xx_t *chip, int change)
3523/* 3523/*
3524 * detect intel piix4 3524 * detect intel piix4
3525 */ 3525 */
3526static void clkrun_init(cs46xx_t *chip) 3526static void clkrun_init(struct snd_cs46xx *chip)
3527{ 3527{
3528 struct pci_dev *pdev; 3528 struct pci_dev *pdev;
3529 u8 pp; 3529 u8 pp;
@@ -3551,10 +3551,10 @@ struct cs_card_type
3551 u16 vendor; 3551 u16 vendor;
3552 u16 id; 3552 u16 id;
3553 char *name; 3553 char *name;
3554 void (*init)(cs46xx_t *); 3554 void (*init)(struct snd_cs46xx *);
3555 void (*amp)(cs46xx_t *, int); 3555 void (*amp)(struct snd_cs46xx *, int);
3556 void (*active)(cs46xx_t *, int); 3556 void (*active)(struct snd_cs46xx *, int);
3557 void (*mixer_init)(cs46xx_t *); 3557 void (*mixer_init)(struct snd_cs46xx *);
3558}; 3558};
3559 3559
3560static struct cs_card_type __devinitdata cards[] = { 3560static struct cs_card_type __devinitdata cards[] = {
@@ -3654,9 +3654,9 @@ static struct cs_card_type __devinitdata cards[] = {
3654 * APM support 3654 * APM support
3655 */ 3655 */
3656#ifdef CONFIG_PM 3656#ifdef CONFIG_PM
3657static int snd_cs46xx_suspend(snd_card_t *card, pm_message_t state) 3657static int snd_cs46xx_suspend(struct snd_card *card, pm_message_t state)
3658{ 3658{
3659 cs46xx_t *chip = card->pm_private_data; 3659 struct snd_cs46xx *chip = card->pm_private_data;
3660 int amp_saved; 3660 int amp_saved;
3661 3661
3662 snd_pcm_suspend_all(chip->pcm); 3662 snd_pcm_suspend_all(chip->pcm);
@@ -3678,9 +3678,9 @@ static int snd_cs46xx_suspend(snd_card_t *card, pm_message_t state)
3678 return 0; 3678 return 0;
3679} 3679}
3680 3680
3681static int snd_cs46xx_resume(snd_card_t *card) 3681static int snd_cs46xx_resume(struct snd_card *card)
3682{ 3682{
3683 cs46xx_t *chip = card->pm_private_data; 3683 struct snd_cs46xx *chip = card->pm_private_data;
3684 int amp_saved; 3684 int amp_saved;
3685 3685
3686 pci_enable_device(chip->pci); 3686 pci_enable_device(chip->pci);
@@ -3719,17 +3719,17 @@ static int snd_cs46xx_resume(snd_card_t *card)
3719/* 3719/*
3720 */ 3720 */
3721 3721
3722int __devinit snd_cs46xx_create(snd_card_t * card, 3722int __devinit snd_cs46xx_create(struct snd_card *card,
3723 struct pci_dev * pci, 3723 struct pci_dev * pci,
3724 int external_amp, int thinkpad, 3724 int external_amp, int thinkpad,
3725 cs46xx_t ** rchip) 3725 struct snd_cs46xx ** rchip)
3726{ 3726{
3727 cs46xx_t *chip; 3727 struct snd_cs46xx *chip;
3728 int err, idx; 3728 int err, idx;
3729 snd_cs46xx_region_t *region; 3729 struct snd_cs46xx_region *region;
3730 struct cs_card_type *cp; 3730 struct cs_card_type *cp;
3731 u16 ss_card, ss_vendor; 3731 u16 ss_card, ss_vendor;
3732 static snd_device_ops_t ops = { 3732 static struct snd_device_ops ops = {
3733 .dev_free = snd_cs46xx_dev_free, 3733 .dev_free = snd_cs46xx_dev_free,
3734 }; 3734 };
3735 3735
@@ -3755,7 +3755,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card,
3755 chip->ba1_addr = pci_resource_start(pci, 1); 3755 chip->ba1_addr = pci_resource_start(pci, 1);
3756 if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 || 3756 if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 ||
3757 chip->ba1_addr == 0 || chip->ba1_addr == (unsigned long)~0) { 3757 chip->ba1_addr == 0 || chip->ba1_addr == (unsigned long)~0) {
3758 snd_printk(KERN_ERR "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n", chip->ba0_addr, chip->ba1_addr); 3758 snd_printk(KERN_ERR "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n",
3759 chip->ba0_addr, chip->ba1_addr);
3759 snd_cs46xx_free(chip); 3760 snd_cs46xx_free(chip);
3760 return -ENOMEM; 3761 return -ENOMEM;
3761 } 3762 }
@@ -3825,8 +3826,10 @@ int __devinit snd_cs46xx_create(snd_card_t * card,
3825 3826
3826 for (idx = 0; idx < 5; idx++) { 3827 for (idx = 0; idx < 5; idx++) {
3827 region = &chip->region.idx[idx]; 3828 region = &chip->region.idx[idx];
3828 if ((region->resource = request_mem_region(region->base, region->size, region->name)) == NULL) { 3829 if ((region->resource = request_mem_region(region->base, region->size,
3829 snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n", region->base, region->base + region->size - 1); 3830 region->name)) == NULL) {
3831 snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n",
3832 region->base, region->base + region->size - 1);
3830 snd_cs46xx_free(chip); 3833 snd_cs46xx_free(chip);
3831 return -EBUSY; 3834 return -EBUSY;
3832 } 3835 }
@@ -3838,7 +3841,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card,
3838 } 3841 }
3839 } 3842 }
3840 3843
3841 if (request_irq(pci->irq, snd_cs46xx_interrupt, SA_INTERRUPT|SA_SHIRQ, "CS46XX", (void *) chip)) { 3844 if (request_irq(pci->irq, snd_cs46xx_interrupt, SA_INTERRUPT|SA_SHIRQ,
3845 "CS46XX", chip)) {
3842 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 3846 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
3843 snd_cs46xx_free(chip); 3847 snd_cs46xx_free(chip);
3844 return -EBUSY; 3848 return -EBUSY;
diff --git a/sound/pci/cs46xx/cs46xx_lib.h b/sound/pci/cs46xx/cs46xx_lib.h
index d7bec096d247..8b4a4aeaf85f 100644
--- a/sound/pci/cs46xx/cs46xx_lib.h
+++ b/sound/pci/cs46xx/cs46xx_lib.h
@@ -57,7 +57,7 @@
57 * common I/O routines 57 * common I/O routines
58 */ 58 */
59 59
60static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned int val) 60static inline void snd_cs46xx_poke(struct snd_cs46xx *chip, unsigned long reg, unsigned int val)
61{ 61{
62 unsigned int bank = reg >> 16; 62 unsigned int bank = reg >> 16;
63 unsigned int offset = reg & 0xffff; 63 unsigned int offset = reg & 0xffff;
@@ -66,117 +66,128 @@ static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned i
66 writel(val, chip->region.idx[bank+1].remap_addr + offset); 66 writel(val, chip->region.idx[bank+1].remap_addr + offset);
67} 67}
68 68
69static inline unsigned int snd_cs46xx_peek(cs46xx_t *chip, unsigned long reg) 69static inline unsigned int snd_cs46xx_peek(struct snd_cs46xx *chip, unsigned long reg)
70{ 70{
71 unsigned int bank = reg >> 16; 71 unsigned int bank = reg >> 16;
72 unsigned int offset = reg & 0xffff; 72 unsigned int offset = reg & 0xffff;
73 return readl(chip->region.idx[bank+1].remap_addr + offset); 73 return readl(chip->region.idx[bank+1].remap_addr + offset);
74} 74}
75 75
76static inline void snd_cs46xx_pokeBA0(cs46xx_t *chip, unsigned long offset, unsigned int val) 76static inline void snd_cs46xx_pokeBA0(struct snd_cs46xx *chip, unsigned long offset, unsigned int val)
77{ 77{
78 writel(val, chip->region.name.ba0.remap_addr + offset); 78 writel(val, chip->region.name.ba0.remap_addr + offset);
79} 79}
80 80
81static inline unsigned int snd_cs46xx_peekBA0(cs46xx_t *chip, unsigned long offset) 81static inline unsigned int snd_cs46xx_peekBA0(struct snd_cs46xx *chip, unsigned long offset)
82{ 82{
83 return readl(chip->region.name.ba0.remap_addr + offset); 83 return readl(chip->region.name.ba0.remap_addr + offset);
84} 84}
85 85
86dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip); 86struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip);
87void cs46xx_dsp_spos_destroy (cs46xx_t * chip); 87void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip);
88int cs46xx_dsp_load_module (cs46xx_t * chip,dsp_module_desc_t * module); 88int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module);
89symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip,char * symbol_name,int symbol_type); 89struct dsp_symbol_entry *cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name,
90int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip); 90 int symbol_type);
91int cs46xx_dsp_proc_done (cs46xx_t *chip); 91int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip);
92int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip); 92int cs46xx_dsp_proc_done (struct snd_cs46xx *chip);
93int snd_cs46xx_download (cs46xx_t *chip,u32 *src,unsigned long offset, 93int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip);
94 unsigned long len); 94int snd_cs46xx_download (struct snd_cs46xx *chip, u32 *src, unsigned long offset,
95int snd_cs46xx_clear_BA1(cs46xx_t *chip,unsigned long offset,unsigned long len); 95 unsigned long len);
96int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip); 96int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip, unsigned long offset, unsigned long len);
97int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip); 97int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip);
98int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip); 98int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip);
99int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip); 99int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip);
100int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip); 100int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip);
101int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip); 101int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip);
102int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip); 102int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip);
103int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip); 103int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip);
104int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip); 104int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip);
105int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data); 105int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip);
106dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest); 106int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data);
107void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb); 107struct dsp_scb_descriptor * cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name,
108void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb); 108 u32 * scb_data, u32 dest);
109dsp_scb_descriptor_t * cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip); 109void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb);
110dsp_scb_descriptor_t * cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, 110void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
111 u16 channel_disp,u16 fifo_addr, 111 struct dsp_scb_descriptor * scb);
112 u16 child_scb_addr, 112struct dsp_scb_descriptor * cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip);
113 u32 dest, 113struct dsp_scb_descriptor *
114 dsp_scb_descriptor_t * parent_scb, 114cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip,
115 int scb_child_type); 115 char * codec_name, u16 channel_disp, u16 fifo_addr,
116dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, 116 u16 child_scb_addr, u32 dest,
117 u16 channel_disp,u16 fifo_addr, 117 struct dsp_scb_descriptor * parent_scb,
118 u16 sample_buffer_addr, 118 int scb_child_type);
119 u32 dest, 119struct dsp_scb_descriptor *
120 dsp_scb_descriptor_t * parent_scb, 120cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
121 int scb_child_type); 121 u16 channel_disp, u16 fifo_addr,
122void cs46xx_dsp_remove_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb); 122 u16 sample_buffer_addr, u32 dest,
123dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, 123 struct dsp_scb_descriptor * parent_scb,
124 u16 channel_disp,u16 fifo_addr, 124 int scb_child_type);
125 u16 sample_buffer_addr, 125void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip,
126 u32 dest,dsp_scb_descriptor_t * parent_scb, 126 struct dsp_scb_descriptor * scb);
127 int scb_child_type); 127struct dsp_scb_descriptor *
128dsp_scb_descriptor_t * cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, 128cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
129 int sample_rate, 129 u16 channel_disp, u16 fifo_addr,
130 u16 src_buffer_addr, 130 u16 sample_buffer_addr, u32 dest,
131 u16 src_delay_buffer_addr,u32 dest, 131 struct dsp_scb_descriptor * parent_scb,
132 dsp_scb_descriptor_t * parent_scb, 132 int scb_child_type);
133 int scb_child_type, 133struct dsp_scb_descriptor *
134 int pass_through); 134cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
135dsp_scb_descriptor_t * cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, 135 int sample_rate, u16 src_buffer_addr,
136 u16 mix_buffer_addr,u32 dest, 136 u16 src_delay_buffer_addr, u32 dest,
137 dsp_scb_descriptor_t * parent_scb, 137 struct dsp_scb_descriptor * parent_scb,
138 int scb_child_type); 138 int scb_child_type, int pass_through);
139 139struct dsp_scb_descriptor *
140dsp_scb_descriptor_t * cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, 140cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
141 u16 vari_buffer_addr0, 141 u16 mix_buffer_addr, u32 dest,
142 u16 vari_buffer_addr1, 142 struct dsp_scb_descriptor * parent_scb,
143 u32 dest, 143 int scb_child_type);
144 dsp_scb_descriptor_t * parent_scb, 144
145 int scb_child_type); 145struct dsp_scb_descriptor *
146dsp_scb_descriptor_t * cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest, 146cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip, char * scb_name,
147 u16 hfg_scb_address, 147 u16 vari_buffer_addr0, u16 vari_buffer_addr1, u32 dest,
148 u16 asynch_buffer_address, 148 struct dsp_scb_descriptor * parent_scb,
149 dsp_scb_descriptor_t * parent_scb, 149 int scb_child_type);
150 int scb_child_type); 150struct dsp_scb_descriptor *
151dsp_scb_descriptor_t * cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, 151cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name,
152 dsp_scb_descriptor_t * parent_scb, 152 u32 dest, u16 hfg_scb_address, u16 asynch_buffer_address,
153 int scb_child_type); 153 struct dsp_scb_descriptor * parent_scb,
154dsp_scb_descriptor_t * cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, 154 int scb_child_type);
155 u16 mix_buffer_addr,u16 writeback_spb,u32 dest, 155struct dsp_scb_descriptor *
156 dsp_scb_descriptor_t * parent_scb, 156cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
157 int scb_child_type); 157 struct dsp_scb_descriptor * parent_scb,
158dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, 158 int scb_child_type);
159 u16 snoop_buffer_address, 159struct dsp_scb_descriptor *
160 dsp_scb_descriptor_t * snoop_scb, 160cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
161 dsp_scb_descriptor_t * parent_scb, 161 u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
162 int scb_child_type); 162 struct dsp_scb_descriptor * parent_scb,
163pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,u32 sample_rate, void * private_data, u32 hw_dma_addr, 163 int scb_child_type);
164 int pcm_channel_id); 164struct dsp_scb_descriptor *
165void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip, 165cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name,
166 pcm_channel_descriptor_t * pcm_channel); 166 u32 dest, u16 snoop_buffer_address,
167int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel); 167 struct dsp_scb_descriptor * snoop_scb,
168int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel); 168 struct dsp_scb_descriptor * parent_scb,
169dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source, 169 int scb_child_type);
170 u16 addr,char * scb_name); 170struct dsp_pcm_channel_descriptor *
171int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src); 171cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, u32 sample_rate,
172int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src); 172 void * private_data, u32 hw_dma_addr,
173int cs46xx_iec958_pre_open (cs46xx_t *chip); 173 int pcm_channel_id);
174int cs46xx_iec958_post_close (cs46xx_t *chip); 174void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
175int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip, 175 struct dsp_pcm_channel_descriptor * pcm_channel);
176 pcm_channel_descriptor_t * pcm_channel, 176int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
177 int period_size); 177 struct dsp_pcm_channel_descriptor * pcm_channel);
178int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip, 178int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
179 int period_size); 179 struct dsp_pcm_channel_descriptor * pcm_channel);
180int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right); 180struct dsp_scb_descriptor *
181int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right); 181cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
182 u16 addr, char * scb_name);
183int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src);
184int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src);
185int cs46xx_iec958_pre_open (struct snd_cs46xx *chip);
186int cs46xx_iec958_post_close (struct snd_cs46xx *chip);
187int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
188 struct dsp_pcm_channel_descriptor * pcm_channel,
189 int period_size);
190int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip, int period_size);
191int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right);
192int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right);
182#endif /* __CS46XX_LIB_H__ */ 193#endif /* __CS46XX_LIB_H__ */
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index b66304fc4e4a..ac98917a1475 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -37,9 +37,10 @@
37#include "cs46xx_lib.h" 37#include "cs46xx_lib.h"
38#include "dsp_spos.h" 38#include "dsp_spos.h"
39 39
40static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entry); 40static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
41 struct dsp_scb_descriptor * fg_entry);
41 42
42static wide_opcode_t wide_opcodes[] = { 43static enum wide_opcode wide_opcodes[] = {
43 WIDE_FOR_BEGIN_LOOP, 44 WIDE_FOR_BEGIN_LOOP,
44 WIDE_FOR_BEGIN_LOOP2, 45 WIDE_FOR_BEGIN_LOOP2,
45 WIDE_COND_GOTO_ADDR, 46 WIDE_COND_GOTO_ADDR,
@@ -54,12 +55,13 @@ static wide_opcode_t wide_opcodes[] = {
54 WIDE_TBEQ_NCOND_CALL1_ADDR 55 WIDE_TBEQ_NCOND_CALL1_ADDR
55}; 56};
56 57
57static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32 overlay_begin_address) 58static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 size,
59 u32 overlay_begin_address)
58{ 60{
59 unsigned int i = 0, j, nreallocated = 0; 61 unsigned int i = 0, j, nreallocated = 0;
60 u32 hival,loval,address; 62 u32 hival,loval,address;
61 u32 mop_operands,mop_type,wide_op; 63 u32 mop_operands,mop_type,wide_op;
62 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 64 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
63 65
64 snd_assert( ((size % 2) == 0), return -EINVAL); 66 snd_assert( ((size % 2) == 0), return -EINVAL);
65 67
@@ -114,7 +116,7 @@ static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32
114 return nreallocated; 116 return nreallocated;
115} 117}
116 118
117static segment_desc_t * get_segment_desc (dsp_module_desc_t * module, int seg_type) 119static struct dsp_segment_desc * get_segment_desc (struct dsp_module_desc * module, int seg_type)
118{ 120{
119 int i; 121 int i;
120 for (i = 0;i < module->nsegments; ++i) { 122 for (i = 0;i < module->nsegments; ++i) {
@@ -126,7 +128,7 @@ static segment_desc_t * get_segment_desc (dsp_module_desc_t * module, int seg_ty
126 return NULL; 128 return NULL;
127}; 129};
128 130
129static int find_free_symbol_index (dsp_spos_instance_t * ins) 131static int find_free_symbol_index (struct dsp_spos_instance * ins)
130{ 132{
131 int index = ins->symbol_table.nsymbols,i; 133 int index = ins->symbol_table.nsymbols,i;
132 134
@@ -140,10 +142,10 @@ static int find_free_symbol_index (dsp_spos_instance_t * ins)
140 return index; 142 return index;
141} 143}
142 144
143static int add_symbols (cs46xx_t * chip, dsp_module_desc_t * module) 145static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * module)
144{ 146{
145 int i; 147 int i;
146 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 148 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
147 149
148 if (module->symbol_table.nsymbols > 0) { 150 if (module->symbol_table.nsymbols > 0) {
149 if (!strcmp(module->symbol_table.symbols[0].symbol_name, "OVERLAYBEGINADDRESS") && 151 if (!strcmp(module->symbol_table.symbols[0].symbol_name, "OVERLAYBEGINADDRESS") &&
@@ -181,10 +183,11 @@ static int add_symbols (cs46xx_t * chip, dsp_module_desc_t * module)
181 return 0; 183 return 0;
182} 184}
183 185
184static symbol_entry_t * add_symbol (cs46xx_t * chip, char * symbol_name, u32 address, int type) 186static struct dsp_symbol_entry *
187add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
185{ 188{
186 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 189 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
187 symbol_entry_t * symbol = NULL; 190 struct dsp_symbol_entry * symbol = NULL;
188 int index; 191 int index;
189 192
190 if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) { 193 if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) {
@@ -217,17 +220,17 @@ static symbol_entry_t * add_symbol (cs46xx_t * chip, char * symbol_name, u32 add
217 return symbol; 220 return symbol;
218} 221}
219 222
220dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip) 223struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
221{ 224{
222 dsp_spos_instance_t * ins = kmalloc(sizeof(dsp_spos_instance_t), GFP_KERNEL); 225 struct dsp_spos_instance * ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL);
223 226
224 if (ins == NULL) 227 if (ins == NULL)
225 return NULL; 228 return NULL;
226 memset(ins, 0, sizeof(*ins));
227 229
228 /* better to use vmalloc for this big table */ 230 /* better to use vmalloc for this big table */
229 ins->symbol_table.nsymbols = 0; 231 ins->symbol_table.nsymbols = 0;
230 ins->symbol_table.symbols = vmalloc(sizeof(symbol_entry_t) * DSP_MAX_SYMBOLS); 232 ins->symbol_table.symbols = vmalloc(sizeof(struct dsp_symbol_entry) *
233 DSP_MAX_SYMBOLS);
231 ins->symbol_table.highest_frag_index = 0; 234 ins->symbol_table.highest_frag_index = 0;
232 235
233 if (ins->symbol_table.symbols == NULL) { 236 if (ins->symbol_table.symbols == NULL) {
@@ -248,7 +251,7 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
248 ins->ntask = 0; 251 ins->ntask = 0;
249 252
250 ins->nmodules = 0; 253 ins->nmodules = 0;
251 ins->modules = kmalloc(sizeof(dsp_module_desc_t) * DSP_MAX_MODULES, GFP_KERNEL); 254 ins->modules = kmalloc(sizeof(struct dsp_module_desc) * DSP_MAX_MODULES, GFP_KERNEL);
252 255
253 if (ins->modules == NULL) { 256 if (ins->modules == NULL) {
254 cs46xx_dsp_spos_destroy(chip); 257 cs46xx_dsp_spos_destroy(chip);
@@ -277,10 +280,10 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
277 return ins; 280 return ins;
278} 281}
279 282
280void cs46xx_dsp_spos_destroy (cs46xx_t * chip) 283void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
281{ 284{
282 int i; 285 int i;
283 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 286 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
284 287
285 snd_assert(ins != NULL, return); 288 snd_assert(ins != NULL, return);
286 289
@@ -298,12 +301,12 @@ void cs46xx_dsp_spos_destroy (cs46xx_t * chip)
298 up(&chip->spos_mutex); 301 up(&chip->spos_mutex);
299} 302}
300 303
301int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module) 304int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module)
302{ 305{
303 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 306 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
304 segment_desc_t * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM); 307 struct dsp_segment_desc * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
305 segment_desc_t * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER); 308 struct dsp_segment_desc * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER);
306 segment_desc_t * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE); 309 struct dsp_segment_desc * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE);
307 u32 doffset, dsize; 310 u32 doffset, dsize;
308 311
309 if (ins->nmodules == DSP_MAX_MODULES - 1) { 312 if (ins->nmodules == DSP_MAX_MODULES - 1) {
@@ -410,10 +413,11 @@ int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module)
410 return 0; 413 return 0;
411} 414}
412 415
413symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name, int symbol_type) 416struct dsp_symbol_entry *
417cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symbol_type)
414{ 418{
415 int i; 419 int i;
416 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 420 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
417 421
418 for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) { 422 for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
419 423
@@ -435,10 +439,11 @@ symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name,
435} 439}
436 440
437 441
438static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 address, int symbol_type) 442static struct dsp_symbol_entry *
443cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type)
439{ 444{
440 int i; 445 int i;
441 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 446 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
442 447
443 for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) { 448 for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
444 449
@@ -456,10 +461,11 @@ static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 addr
456} 461}
457 462
458 463
459static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) 464static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry,
465 struct snd_info_buffer *buffer)
460{ 466{
461 cs46xx_t *chip = entry->private_data; 467 struct snd_cs46xx *chip = entry->private_data;
462 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 468 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
463 int i; 469 int i;
464 470
465 snd_iprintf(buffer, "SYMBOLS:\n"); 471 snd_iprintf(buffer, "SYMBOLS:\n");
@@ -483,10 +489,11 @@ static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info
483} 489}
484 490
485 491
486static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) 492static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry,
493 struct snd_info_buffer *buffer)
487{ 494{
488 cs46xx_t *chip = entry->private_data; 495 struct snd_cs46xx *chip = entry->private_data;
489 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 496 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
490 int i,j; 497 int i,j;
491 498
492 down(&chip->spos_mutex); 499 down(&chip->spos_mutex);
@@ -497,7 +504,7 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff
497 snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups); 504 snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups);
498 505
499 for (j = 0; j < ins->modules[i].nsegments; ++ j) { 506 for (j = 0; j < ins->modules[i].nsegments; ++ j) {
500 segment_desc_t * desc = (ins->modules[i].segments + j); 507 struct dsp_segment_desc * desc = (ins->modules[i].segments + j);
501 snd_iprintf(buffer, " segment %02x offset %08x size %08x\n", 508 snd_iprintf(buffer, " segment %02x offset %08x size %08x\n",
502 desc->segment_type,desc->offset, desc->size); 509 desc->segment_type,desc->offset, desc->size);
503 } 510 }
@@ -505,11 +512,12 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff
505 up(&chip->spos_mutex); 512 up(&chip->spos_mutex);
506} 513}
507 514
508static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) 515static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry,
516 struct snd_info_buffer *buffer)
509{ 517{
510 cs46xx_t *chip = entry->private_data; 518 struct snd_cs46xx *chip = entry->private_data;
511 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 519 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
512 int i,j,col; 520 int i, j, col;
513 void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; 521 void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
514 522
515 down(&chip->spos_mutex); 523 down(&chip->spos_mutex);
@@ -532,10 +540,11 @@ static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_bu
532 up(&chip->spos_mutex); 540 up(&chip->spos_mutex);
533} 541}
534 542
535static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) 543static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry,
544 struct snd_info_buffer *buffer)
536{ 545{
537 cs46xx_t *chip = entry->private_data; 546 struct snd_cs46xx *chip = entry->private_data;
538 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 547 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
539 int i; 548 int i;
540 549
541 down(&chip->spos_mutex); 550 down(&chip->spos_mutex);
@@ -564,13 +573,14 @@ static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t
564 up(&chip->spos_mutex); 573 up(&chip->spos_mutex);
565} 574}
566 575
567static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) 576static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry,
577 struct snd_info_buffer *buffer)
568{ 578{
569 cs46xx_t *chip = entry->private_data; 579 struct snd_cs46xx *chip = entry->private_data;
570 /*dsp_spos_instance_t * ins = chip->dsp_spos_instance; */ 580 /*struct dsp_spos_instance * ins = chip->dsp_spos_instance; */
571 unsigned int i,col = 0; 581 unsigned int i, col = 0;
572 void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; 582 void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
573 symbol_entry_t * symbol; 583 struct dsp_symbol_entry * symbol;
574 584
575 for (i = 0;i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32),col ++) { 585 for (i = 0;i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32),col ++) {
576 if (col == 4) { 586 if (col == 4) {
@@ -591,9 +601,10 @@ static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_in
591 } 601 }
592} 602}
593 603
594static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) 604static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
605 struct snd_info_buffer *buffer)
595{ 606{
596 cs46xx_t *chip = entry->private_data; 607 struct snd_cs46xx *chip = entry->private_data;
597 int i,col = 0; 608 int i,col = 0;
598 void __iomem *dst = chip->region.idx[2].remap_addr; 609 void __iomem *dst = chip->region.idx[2].remap_addr;
599 610
@@ -738,10 +749,10 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
738 snd_iprintf(buffer,"\n"); 749 snd_iprintf(buffer,"\n");
739} 750}
740 751
741int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip) 752int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
742{ 753{
743 snd_info_entry_t *entry; 754 struct snd_info_entry *entry;
744 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 755 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
745 int i; 756 int i;
746 757
747 ins->snd_card = card; 758 ins->snd_card = card;
@@ -852,9 +863,9 @@ int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip)
852 return 0; 863 return 0;
853} 864}
854 865
855int cs46xx_dsp_proc_done (cs46xx_t *chip) 866int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
856{ 867{
857 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 868 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
858 int i; 869 int i;
859 870
860 if (ins->proc_sym_info_entry) { 871 if (ins->proc_sym_info_entry) {
@@ -903,7 +914,8 @@ int cs46xx_dsp_proc_done (cs46xx_t *chip)
903} 914}
904 915
905static int debug_tree; 916static int debug_tree;
906static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, int size) 917static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data,
918 u32 dest, int size)
907{ 919{
908 void __iomem *spdst = chip->region.idx[1].remap_addr + 920 void __iomem *spdst = chip->region.idx[1].remap_addr +
909 DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32); 921 DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
@@ -917,7 +929,7 @@ static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, in
917} 929}
918 930
919static int debug_scb; 931static int debug_scb;
920static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest) 932static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest)
921{ 933{
922 void __iomem *spdst = chip->region.idx[1].remap_addr + 934 void __iomem *spdst = chip->region.idx[1].remap_addr +
923 DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32); 935 DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
@@ -930,7 +942,7 @@ static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest)
930 } 942 }
931} 943}
932 944
933static int find_free_scb_index (dsp_spos_instance_t * ins) 945static int find_free_scb_index (struct dsp_spos_instance * ins)
934{ 946{
935 int index = ins->nscb, i; 947 int index = ins->nscb, i;
936 948
@@ -944,10 +956,10 @@ static int find_free_scb_index (dsp_spos_instance_t * ins)
944 return index; 956 return index;
945} 957}
946 958
947static dsp_scb_descriptor_t * _map_scb (cs46xx_t *chip,char * name,u32 dest) 959static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * name, u32 dest)
948{ 960{
949 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 961 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
950 dsp_scb_descriptor_t * desc = NULL; 962 struct dsp_scb_descriptor * desc = NULL;
951 int index; 963 int index;
952 964
953 if (ins->nscb == DSP_MAX_SCB_DESC - 1) { 965 if (ins->nscb == DSP_MAX_SCB_DESC - 1) {
@@ -977,10 +989,11 @@ static dsp_scb_descriptor_t * _map_scb (cs46xx_t *chip,char * name,u32 dest)
977 return desc; 989 return desc;
978} 990}
979 991
980static dsp_task_descriptor_t * _map_task_tree (cs46xx_t *chip,char * name,u32 dest,u32 size) 992static struct dsp_task_descriptor *
993_map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size)
981{ 994{
982 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 995 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
983 dsp_task_descriptor_t * desc = NULL; 996 struct dsp_task_descriptor * desc = NULL;
984 997
985 if (ins->ntask == DSP_MAX_TASK_DESC - 1) { 998 if (ins->ntask == DSP_MAX_TASK_DESC - 1) {
986 snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n"); 999 snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n");
@@ -1000,9 +1013,10 @@ static dsp_task_descriptor_t * _map_task_tree (cs46xx_t *chip,char * name,u32 de
1000 return desc; 1013 return desc;
1001} 1014}
1002 1015
1003dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest) 1016struct dsp_scb_descriptor *
1017cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest)
1004{ 1018{
1005 dsp_scb_descriptor_t * desc; 1019 struct dsp_scb_descriptor * desc;
1006 1020
1007 desc = _map_scb (chip,name,dest); 1021 desc = _map_scb (chip,name,dest);
1008 if (desc) { 1022 if (desc) {
@@ -1015,9 +1029,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 *
1015} 1029}
1016 1030
1017 1031
1018static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char * name, u32 * task_data,u32 dest,int size) 1032static struct dsp_task_descriptor *
1033cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_data,
1034 u32 dest, int size)
1019{ 1035{
1020 dsp_task_descriptor_t * desc; 1036 struct dsp_task_descriptor * desc;
1021 1037
1022 desc = _map_task_tree (chip,name,dest,size); 1038 desc = _map_task_tree (chip,name,dest,size);
1023 if (desc) { 1039 if (desc) {
@@ -1029,31 +1045,31 @@ static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char
1029 return desc; 1045 return desc;
1030} 1046}
1031 1047
1032int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) 1048int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
1033{ 1049{
1034 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1050 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1035 symbol_entry_t * fg_task_tree_header_code; 1051 struct dsp_symbol_entry * fg_task_tree_header_code;
1036 symbol_entry_t * task_tree_header_code; 1052 struct dsp_symbol_entry * task_tree_header_code;
1037 symbol_entry_t * task_tree_thread; 1053 struct dsp_symbol_entry * task_tree_thread;
1038 symbol_entry_t * null_algorithm; 1054 struct dsp_symbol_entry * null_algorithm;
1039 symbol_entry_t * magic_snoop_task; 1055 struct dsp_symbol_entry * magic_snoop_task;
1040 1056
1041 dsp_scb_descriptor_t * timing_master_scb; 1057 struct dsp_scb_descriptor * timing_master_scb;
1042 dsp_scb_descriptor_t * codec_out_scb; 1058 struct dsp_scb_descriptor * codec_out_scb;
1043 dsp_scb_descriptor_t * codec_in_scb; 1059 struct dsp_scb_descriptor * codec_in_scb;
1044 dsp_scb_descriptor_t * src_task_scb; 1060 struct dsp_scb_descriptor * src_task_scb;
1045 dsp_scb_descriptor_t * master_mix_scb; 1061 struct dsp_scb_descriptor * master_mix_scb;
1046 dsp_scb_descriptor_t * rear_mix_scb; 1062 struct dsp_scb_descriptor * rear_mix_scb;
1047 dsp_scb_descriptor_t * record_mix_scb; 1063 struct dsp_scb_descriptor * record_mix_scb;
1048 dsp_scb_descriptor_t * write_back_scb; 1064 struct dsp_scb_descriptor * write_back_scb;
1049 dsp_scb_descriptor_t * vari_decimate_scb; 1065 struct dsp_scb_descriptor * vari_decimate_scb;
1050 dsp_scb_descriptor_t * rear_codec_out_scb; 1066 struct dsp_scb_descriptor * rear_codec_out_scb;
1051 dsp_scb_descriptor_t * clfe_codec_out_scb; 1067 struct dsp_scb_descriptor * clfe_codec_out_scb;
1052 dsp_scb_descriptor_t * magic_snoop_scb; 1068 struct dsp_scb_descriptor * magic_snoop_scb;
1053 1069
1054 int fifo_addr,fifo_span,valid_slots; 1070 int fifo_addr, fifo_span, valid_slots;
1055 1071
1056 static spos_control_block_t sposcb = { 1072 static struct dsp_spos_control_block sposcb = {
1057 /* 0 */ HFG_TREE_SCB,HFG_STACK, 1073 /* 0 */ HFG_TREE_SCB,HFG_STACK,
1058 /* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR, 1074 /* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR,
1059 /* 2 */ DSP_SPOS_DC,0, 1075 /* 2 */ DSP_SPOS_DC,0,
@@ -1106,7 +1122,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
1106 1122
1107 { 1123 {
1108 /* create the null SCB */ 1124 /* create the null SCB */
1109 static generic_scb_t null_scb = { 1125 static struct dsp_generic_scb null_scb = {
1110 { 0, 0, 0, 0 }, 1126 { 0, 0, 0, 0 },
1111 { 0, 0, 0, 0, 0 }, 1127 { 0, 0, 0, 0, 0 },
1112 NULL_SCB_ADDR, NULL_SCB_ADDR, 1128 NULL_SCB_ADDR, NULL_SCB_ADDR,
@@ -1128,7 +1144,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
1128 1144
1129 { 1145 {
1130 /* setup foreground task tree */ 1146 /* setup foreground task tree */
1131 static task_tree_control_block_t fg_task_tree_hdr = { 1147 static struct dsp_task_tree_control_block fg_task_tree_hdr = {
1132 { FG_TASK_HEADER_ADDR | (DSP_SPOS_DC << 0x10), 1148 { FG_TASK_HEADER_ADDR | (DSP_SPOS_DC << 0x10),
1133 DSP_SPOS_DC_DC, 1149 DSP_SPOS_DC_DC,
1134 DSP_SPOS_DC_DC, 1150 DSP_SPOS_DC_DC,
@@ -1204,7 +1220,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
1204 1220
1205 { 1221 {
1206 /* setup foreground task tree */ 1222 /* setup foreground task tree */
1207 static task_tree_control_block_t bg_task_tree_hdr = { 1223 static struct dsp_task_tree_control_block bg_task_tree_hdr = {
1208 { DSP_SPOS_DC_DC, 1224 { DSP_SPOS_DC_DC,
1209 DSP_SPOS_DC_DC, 1225 DSP_SPOS_DC_DC,
1210 DSP_SPOS_DC_DC, 1226 DSP_SPOS_DC_DC,
@@ -1313,7 +1329,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
1313 if (!write_back_scb) goto _fail_end; 1329 if (!write_back_scb) goto _fail_end;
1314 1330
1315 { 1331 {
1316 static mix2_ostream_spb_t mix2_ostream_spb = { 1332 static struct dsp_mix2_ostream_spb mix2_ostream_spb = {
1317 0x00020000, 1333 0x00020000,
1318 0x0000ffff 1334 0x0000ffff
1319 }; 1335 };
@@ -1448,13 +1464,14 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
1448 return -EINVAL; 1464 return -EINVAL;
1449} 1465}
1450 1466
1451static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entry) 1467static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
1468 struct dsp_scb_descriptor * fg_entry)
1452{ 1469{
1453 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1470 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1454 symbol_entry_t * s16_async_codec_input_task; 1471 struct dsp_symbol_entry * s16_async_codec_input_task;
1455 symbol_entry_t * spdifo_task; 1472 struct dsp_symbol_entry * spdifo_task;
1456 symbol_entry_t * spdifi_task; 1473 struct dsp_symbol_entry * spdifi_task;
1457 dsp_scb_descriptor_t * spdifi_scb_desc,* spdifo_scb_desc,* async_codec_scb_desc; 1474 struct dsp_scb_descriptor * spdifi_scb_desc, * spdifo_scb_desc, * async_codec_scb_desc;
1458 1475
1459 s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE); 1476 s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE);
1460 if (s16_async_codec_input_task == NULL) { 1477 if (s16_async_codec_input_task == NULL) {
@@ -1475,7 +1492,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
1475 1492
1476 { 1493 {
1477 /* 0xBC0 */ 1494 /* 0xBC0 */
1478 spdifoscb_t spdifo_scb = { 1495 struct dsp_spdifoscb spdifo_scb = {
1479 /* 0 */ DSP_SPOS_UUUU, 1496 /* 0 */ DSP_SPOS_UUUU,
1480 { 1497 {
1481 /* 1 */ 0xb0, 1498 /* 1 */ 0xb0,
@@ -1504,7 +1521,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
1504 }; 1521 };
1505 1522
1506 /* 0xBB0 */ 1523 /* 0xBB0 */
1507 spdifiscb_t spdifi_scb = { 1524 struct dsp_spdifiscb spdifi_scb = {
1508 /* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI, 1525 /* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI,
1509 /* 1 */ 0, 1526 /* 1 */ 0,
1510 /* 2 */ 0, 1527 /* 2 */ 0,
@@ -1529,7 +1546,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
1529 }; 1546 };
1530 1547
1531 /* 0xBA0 */ 1548 /* 0xBA0 */
1532 async_codec_input_scb_t async_codec_input_scb = { 1549 struct dsp_async_codec_input_scb async_codec_input_scb = {
1533 /* 0 */ DSP_SPOS_UUUU, 1550 /* 0 */ DSP_SPOS_UUUU,
1534 /* 1 */ 0, 1551 /* 1 */ 0,
1535 /* 2 */ 0, 1552 /* 2 */ 0,
@@ -1620,9 +1637,9 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
1620} 1637}
1621 1638
1622 1639
1623static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip) 1640static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip)
1624{ 1641{
1625 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1642 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1626 1643
1627 /* set SPDIF output FIFO slot */ 1644 /* set SPDIF output FIFO slot */
1628 snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0); 1645 snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0);
@@ -1641,9 +1658,9 @@ static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip)
1641 ins->spdif_status_out &= ~DSP_SPDIF_STATUS_HW_ENABLED; 1658 ins->spdif_status_out &= ~DSP_SPDIF_STATUS_HW_ENABLED;
1642} 1659}
1643 1660
1644int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip) 1661int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip)
1645{ 1662{
1646 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1663 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1647 1664
1648 /* if hw-ctrl already enabled, turn off to reset logic ... */ 1665 /* if hw-ctrl already enabled, turn off to reset logic ... */
1649 cs46xx_dsp_disable_spdif_hw (chip); 1666 cs46xx_dsp_disable_spdif_hw (chip);
@@ -1664,9 +1681,9 @@ int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip)
1664 return 0; 1681 return 0;
1665} 1682}
1666 1683
1667int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip) 1684int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
1668{ 1685{
1669 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1686 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1670 1687
1671 /* turn on amplifier */ 1688 /* turn on amplifier */
1672 chip->active_ctrl(chip, 1); 1689 chip->active_ctrl(chip, 1);
@@ -1724,9 +1741,9 @@ int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip)
1724 return 0; 1741 return 0;
1725} 1742}
1726 1743
1727int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip) 1744int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip)
1728{ 1745{
1729 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1746 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1730 1747
1731 snd_assert (ins->asynch_rx_scb != NULL, return -EINVAL); 1748 snd_assert (ins->asynch_rx_scb != NULL, return -EINVAL);
1732 snd_assert (ins->spdif_in_src != NULL,return -EINVAL); 1749 snd_assert (ins->spdif_in_src != NULL,return -EINVAL);
@@ -1750,9 +1767,9 @@ int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip)
1750 return 0; 1767 return 0;
1751} 1768}
1752 1769
1753int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip) 1770int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip)
1754{ 1771{
1755 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1772 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1756 1773
1757 snd_assert (ins->pcm_input == NULL,return -EINVAL); 1774 snd_assert (ins->pcm_input == NULL,return -EINVAL);
1758 snd_assert (ins->ref_snoop_scb != NULL,return -EINVAL); 1775 snd_assert (ins->ref_snoop_scb != NULL,return -EINVAL);
@@ -1765,9 +1782,9 @@ int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip)
1765 return 0; 1782 return 0;
1766} 1783}
1767 1784
1768int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip) 1785int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip)
1769{ 1786{
1770 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1787 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1771 1788
1772 snd_assert (ins->pcm_input != NULL,return -EINVAL); 1789 snd_assert (ins->pcm_input != NULL,return -EINVAL);
1773 1790
@@ -1779,9 +1796,9 @@ int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip)
1779 return 0; 1796 return 0;
1780} 1797}
1781 1798
1782int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip) 1799int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip)
1783{ 1800{
1784 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1801 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1785 1802
1786 snd_assert (ins->adc_input == NULL,return -EINVAL); 1803 snd_assert (ins->adc_input == NULL,return -EINVAL);
1787 snd_assert (ins->codec_in_scb != NULL,return -EINVAL); 1804 snd_assert (ins->codec_in_scb != NULL,return -EINVAL);
@@ -1794,9 +1811,9 @@ int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip)
1794 return 0; 1811 return 0;
1795} 1812}
1796 1813
1797int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip) 1814int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip)
1798{ 1815{
1799 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1816 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1800 1817
1801 snd_assert (ins->adc_input != NULL,return -EINVAL); 1818 snd_assert (ins->adc_input != NULL,return -EINVAL);
1802 1819
@@ -1808,7 +1825,7 @@ int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip)
1808 return 0; 1825 return 0;
1809} 1826}
1810 1827
1811int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data) 1828int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
1812{ 1829{
1813 u32 temp; 1830 u32 temp;
1814 int i; 1831 int i;
@@ -1845,10 +1862,10 @@ int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data)
1845 return 0; 1862 return 0;
1846} 1863}
1847 1864
1848int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right) 1865int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right)
1849{ 1866{
1850 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1867 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1851 dsp_scb_descriptor_t * scb; 1868 struct dsp_scb_descriptor * scb;
1852 1869
1853 down(&chip->spos_mutex); 1870 down(&chip->spos_mutex);
1854 1871
@@ -1874,8 +1891,9 @@ int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right)
1874 return 0; 1891 return 0;
1875} 1892}
1876 1893
1877int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right) { 1894int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right)
1878 dsp_spos_instance_t * ins = chip->dsp_spos_instance; 1895{
1896 struct dsp_spos_instance * ins = chip->dsp_spos_instance;
1879 1897
1880 down(&chip->spos_mutex); 1898 down(&chip->spos_mutex);
1881 1899
diff --git a/sound/pci/cs46xx/dsp_spos.h b/sound/pci/cs46xx/dsp_spos.h
index 90871bf9762f..0d246bca4184 100644
--- a/sound/pci/cs46xx/dsp_spos.h
+++ b/sound/pci/cs46xx/dsp_spos.h
@@ -43,7 +43,7 @@
43/* this instruction types 43/* this instruction types
44 needs to be reallocated when load 44 needs to be reallocated when load
45 code into DSP */ 45 code into DSP */
46typedef enum { 46enum wide_opcode {
47 WIDE_FOR_BEGIN_LOOP = 0x20, 47 WIDE_FOR_BEGIN_LOOP = 0x20,
48 WIDE_FOR_BEGIN_LOOP2, 48 WIDE_FOR_BEGIN_LOOP2,
49 49
@@ -58,7 +58,7 @@ typedef enum {
58 WIDE_TBEQ_COND_CALL1_ADDR, 58 WIDE_TBEQ_COND_CALL1_ADDR,
59 WIDE_TBEQ_NCOND_GOTOI_ADDR, 59 WIDE_TBEQ_NCOND_GOTOI_ADDR,
60 WIDE_TBEQ_NCOND_CALL1_ADDR, 60 WIDE_TBEQ_NCOND_CALL1_ADDR,
61} wide_opcode_t; 61};
62 62
63/* SAMPLE segment */ 63/* SAMPLE segment */
64#define VARI_DECIMATE_BUF1 0x0000 64#define VARI_DECIMATE_BUF1 0x0000
@@ -186,7 +186,8 @@ typedef enum {
186#define SP_SPDOUT_CONTROL 0x804D 186#define SP_SPDOUT_CONTROL 0x804D
187#define SP_SPDOUT_CSUV 0x808E 187#define SP_SPDOUT_CSUV 0x808E
188 188
189static inline u8 _wrap_all_bits (u8 val) { 189static inline u8 _wrap_all_bits (u8 val)
190{
190 u8 wrapped; 191 u8 wrapped;
191 192
192 /* wrap all 8 bits */ 193 /* wrap all 8 bits */
@@ -201,11 +202,10 @@ static inline u8 _wrap_all_bits (u8 val) {
201 ((val & 0x80) >> 7); 202 ((val & 0x80) >> 7);
202 203
203 return wrapped; 204 return wrapped;
204
205} 205}
206 206
207 207static inline void cs46xx_dsp_spos_update_scb (struct snd_cs46xx * chip,
208static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descriptor_t * scb) 208 struct dsp_scb_descriptor * scb)
209{ 209{
210 /* update nextSCB and subListPtr in SCB */ 210 /* update nextSCB and subListPtr in SCB */
211 snd_cs46xx_poke(chip, 211 snd_cs46xx_poke(chip,
@@ -214,8 +214,10 @@ static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descripto
214 (scb->next_scb_ptr->address)); 214 (scb->next_scb_ptr->address));
215} 215}
216 216
217static inline void cs46xx_dsp_scb_set_volume (cs46xx_t * chip,dsp_scb_descriptor_t * scb, 217static inline void cs46xx_dsp_scb_set_volume (struct snd_cs46xx * chip,
218 u16 left,u16 right) { 218 struct dsp_scb_descriptor * scb,
219 u16 left, u16 right)
220{
219 unsigned int val = ((0xffff - left) << 16 | (0xffff - right)); 221 unsigned int val = ((0xffff - left) << 16 | (0xffff - right));
220 222
221 snd_cs46xx_poke(chip, (scb->address + SCBVolumeCtrl) << 2, val); 223 snd_cs46xx_poke(chip, (scb->address + SCBVolumeCtrl) << 2, val);
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index 92849e1340bb..6e865005b269 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
diff --git a/sound/pci/cs46xx/imgs/cwc4630.h b/sound/pci/cs46xx/imgs/cwc4630.h
index 8bed07f9996e..37c4f1318dc5 100644
--- a/sound/pci/cs46xx/imgs/cwc4630.h
+++ b/sound/pci/cs46xx/imgs/cwc4630.h
@@ -3,7 +3,7 @@
3#ifndef __HEADER_cwc4630_H__ 3#ifndef __HEADER_cwc4630_H__
4#define __HEADER_cwc4630_H__ 4#define __HEADER_cwc4630_H__
5 5
6static symbol_entry_t cwc4630_symbols[] = { 6static struct dsp_symbol_entry cwc4630_symbols[] = {
7 { 0x0000, "BEGINADDRESS",0x00 }, 7 { 0x0000, "BEGINADDRESS",0x00 },
8 { 0x8000, "EXECCHILD",0x03 }, 8 { 0x8000, "EXECCHILD",0x03 },
9 { 0x8001, "EXECCHILD_98",0x03 }, 9 { 0x8001, "EXECCHILD_98",0x03 },
@@ -302,12 +302,12 @@ static u32 cwc4630_parameter[] = {
302}; /* #PARAMETER_END */ 302}; /* #PARAMETER_END */
303 303
304 304
305static segment_desc_t cwc4630_segments[] = { 305static struct dsp_segment_desc cwc4630_segments[] = {
306 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000328, cwc4630_code }, 306 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000328, cwc4630_code },
307 { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000080, cwc4630_parameter }, 307 { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000080, cwc4630_parameter },
308}; 308};
309 309
310static dsp_module_desc_t cwc4630_module = { 310static struct dsp_module_desc cwc4630_module = {
311 "cwc4630", 311 "cwc4630",
312 { 312 {
313 38, 313 38,
diff --git a/sound/pci/cs46xx/imgs/cwcasync.h b/sound/pci/cs46xx/imgs/cwcasync.h
index e01a7b66c4ff..70e63e13c2b3 100644
--- a/sound/pci/cs46xx/imgs/cwcasync.h
+++ b/sound/pci/cs46xx/imgs/cwcasync.h
@@ -3,7 +3,7 @@
3#ifndef __HEADER_cwcasync_H__ 3#ifndef __HEADER_cwcasync_H__
4#define __HEADER_cwcasync_H__ 4#define __HEADER_cwcasync_H__
5 5
6static symbol_entry_t cwcasync_symbols[] = { 6static struct dsp_symbol_entry cwcasync_symbols[] = {
7 { 0x8000, "EXECCHILD",0x03 }, 7 { 0x8000, "EXECCHILD",0x03 },
8 { 0x8001, "EXECCHILD_98",0x03 }, 8 { 0x8001, "EXECCHILD_98",0x03 },
9 { 0x8003, "EXECCHILD_PUSH1IND",0x03 }, 9 { 0x8003, "EXECCHILD_PUSH1IND",0x03 },
@@ -159,11 +159,11 @@ static u32 cwcasync_code[] = {
159}; 159};
160/* #CODE_END */ 160/* #CODE_END */
161 161
162static segment_desc_t cwcasync_segments[] = { 162static struct dsp_segment_desc cwcasync_segments[] = {
163 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x000001b6, cwcasync_code }, 163 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x000001b6, cwcasync_code },
164}; 164};
165 165
166static dsp_module_desc_t cwcasync_module = { 166static struct dsp_module_desc cwcasync_module = {
167 "cwcasync", 167 "cwcasync",
168 { 168 {
169 32, 169 32,
diff --git a/sound/pci/cs46xx/imgs/cwcbinhack.h b/sound/pci/cs46xx/imgs/cwcbinhack.h
index 436b38bd246c..f4d93689cd49 100644
--- a/sound/pci/cs46xx/imgs/cwcbinhack.h
+++ b/sound/pci/cs46xx/imgs/cwcbinhack.h
@@ -4,7 +4,7 @@
4#ifndef __HEADER_cwcbinhack_H__ 4#ifndef __HEADER_cwcbinhack_H__
5#define __HEADER_cwcbinhack_H__ 5#define __HEADER_cwcbinhack_H__
6 6
7static symbol_entry_t cwcbinhack_symbols[] = { 7static struct dsp_symbol_entry cwcbinhack_symbols[] = {
8 { 0x02c8, "OVERLAYBEGINADDRESS",0x00 }, 8 { 0x02c8, "OVERLAYBEGINADDRESS",0x00 },
9 { 0x02c8, "MAGICSNOOPTASK",0x03 }, 9 { 0x02c8, "MAGICSNOOPTASK",0x03 },
10 { 0x0308, "#CODE_END",0x00 }, 10 { 0x0308, "#CODE_END",0x00 },
@@ -31,11 +31,11 @@ static u32 cwcbinhack_code[] = {
31}; 31};
32/* #CODE_END */ 32/* #CODE_END */
33 33
34static segment_desc_t cwcbinhack_segments[] = { 34static struct dsp_segment_desc cwcbinhack_segments[] = {
35 { SEGTYPE_SP_PROGRAM, 0x00000000, 64, cwcbinhack_code }, 35 { SEGTYPE_SP_PROGRAM, 0x00000000, 64, cwcbinhack_code },
36}; 36};
37 37
38static dsp_module_desc_t cwcbinhack_module = { 38static struct dsp_module_desc cwcbinhack_module = {
39 "cwcbinhack", 39 "cwcbinhack",
40 { 40 {
41 3, 41 3,
diff --git a/sound/pci/cs46xx/imgs/cwcdma.h b/sound/pci/cs46xx/imgs/cwcdma.h
index 92860435beed..7ff0d4587161 100644
--- a/sound/pci/cs46xx/imgs/cwcdma.h
+++ b/sound/pci/cs46xx/imgs/cwcdma.h
@@ -3,7 +3,7 @@
3#ifndef __HEADER_cwcdma_H__ 3#ifndef __HEADER_cwcdma_H__
4#define __HEADER_cwcdma_H__ 4#define __HEADER_cwcdma_H__
5 5
6static symbol_entry_t cwcdma_symbols[] = { 6static struct dsp_symbol_entry cwcdma_symbols[] = {
7 { 0x8000, "EXECCHILD",0x03 }, 7 { 0x8000, "EXECCHILD",0x03 },
8 { 0x8001, "EXECCHILD_98",0x03 }, 8 { 0x8001, "EXECCHILD_98",0x03 },
9 { 0x8003, "EXECCHILD_PUSH1IND",0x03 }, 9 { 0x8003, "EXECCHILD_PUSH1IND",0x03 },
@@ -51,11 +51,11 @@ static u32 cwcdma_code[] = {
51 51
52/* #CODE_END */ 52/* #CODE_END */
53 53
54static segment_desc_t cwcdma_segments[] = { 54static struct dsp_segment_desc cwcdma_segments[] = {
55 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000030, cwcdma_code }, 55 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000030, cwcdma_code },
56}; 56};
57 57
58static dsp_module_desc_t cwcdma_module = { 58static struct dsp_module_desc cwcdma_module = {
59 "cwcdma", 59 "cwcdma",
60 { 60 {
61 27, 61 27,
diff --git a/sound/pci/cs46xx/imgs/cwcemb80.h b/sound/pci/cs46xx/imgs/cwcemb80.h
index 4b13551eae41..a64c6ff9983a 100644
--- a/sound/pci/cs46xx/imgs/cwcemb80.h
+++ b/sound/pci/cs46xx/imgs/cwcemb80.h
@@ -3,7 +3,7 @@
3#ifndef __HEADER_cwcemb80_H__ 3#ifndef __HEADER_cwcemb80_H__
4#define __HEADER_cwcemb80_H__ 4#define __HEADER_cwcemb80_H__
5 5
6static symbol_entry_t cwcemb80_symbols[] = { 6static struct dsp_symbol_entry cwcemb80_symbols[] = {
7 { 0x0000, "BEGINADDRESS",0x00 }, 7 { 0x0000, "BEGINADDRESS",0x00 },
8 { 0x8000, "EXECCHILD",0x03 }, 8 { 0x8000, "EXECCHILD",0x03 },
9 { 0x8001, "EXECCHILD_98",0x03 }, 9 { 0x8001, "EXECCHILD_98",0x03 },
@@ -1588,13 +1588,13 @@ static u32 cwcemb80_sample[] = {
1588}; /* #SAMPLE_END */ 1588}; /* #SAMPLE_END */
1589 1589
1590 1590
1591static segment_desc_t cwcemb80_segments[] = { 1591static struct dsp_segment_desc cwcemb80_segments[] = {
1592 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000031c, cwcemb80_code }, 1592 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000031c, cwcemb80_code },
1593 { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000697, cwcemb80_parameter }, 1593 { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000697, cwcemb80_parameter },
1594 { SEGTYPE_SP_SAMPLE, 0x00000000, 0x00000e00, cwcemb80_sample }, 1594 { SEGTYPE_SP_SAMPLE, 0x00000000, 0x00000e00, cwcemb80_sample },
1595}; 1595};
1596 1596
1597static dsp_module_desc_t cwcemb80_module = { 1597static struct dsp_module_desc cwcemb80_module = {
1598 "cwcemb80", 1598 "cwcemb80",
1599 { 1599 {
1600 38, 1600 38,
diff --git a/sound/pci/cs46xx/imgs/cwcsnoop.h b/sound/pci/cs46xx/imgs/cwcsnoop.h
index be1162bbcb45..6929d0a5a3f3 100644
--- a/sound/pci/cs46xx/imgs/cwcsnoop.h
+++ b/sound/pci/cs46xx/imgs/cwcsnoop.h
@@ -3,7 +3,7 @@
3#ifndef __HEADER_cwcsnoop_H__ 3#ifndef __HEADER_cwcsnoop_H__
4#define __HEADER_cwcsnoop_H__ 4#define __HEADER_cwcsnoop_H__
5 5
6static symbol_entry_t cwcsnoop_symbols[] = { 6static struct dsp_symbol_entry cwcsnoop_symbols[] = {
7 { 0x0500, "OVERLAYBEGINADDRESS",0x00 }, 7 { 0x0500, "OVERLAYBEGINADDRESS",0x00 },
8 { 0x0500, "OUTPUTSNOOP",0x03 }, 8 { 0x0500, "OUTPUTSNOOP",0x03 },
9 { 0x051f, "#CODE_END",0x00 }, 9 { 0x051f, "#CODE_END",0x00 },
@@ -29,11 +29,11 @@ static u32 cwcsnoop_code[] = {
29}; 29};
30/* #CODE_END */ 30/* #CODE_END */
31 31
32static segment_desc_t cwcsnoop_segments[] = { 32static struct dsp_segment_desc cwcsnoop_segments[] = {
33 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000003e, cwcsnoop_code }, 33 { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000003e, cwcsnoop_code },
34}; 34};
35 35
36static dsp_module_desc_t cwcsnoop_module = { 36static struct dsp_module_desc cwcsnoop_module = {
37 "cwcsnoop", 37 "cwcsnoop",
38 { 38 {
39 3, 39 3,