diff options
Diffstat (limited to 'sound/pci/cs46xx')
-rw-r--r-- | sound/pci/cs46xx/cs46xx.c | 4 | ||||
-rw-r--r-- | sound/pci/cs46xx/cs46xx_lib.c | 584 | ||||
-rw-r--r-- | sound/pci/cs46xx/cs46xx_lib.h | 211 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos.c | 264 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos.h | 18 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos_scb_lib.c | 338 | ||||
-rw-r--r-- | sound/pci/cs46xx/imgs/cwc4630.h | 6 | ||||
-rw-r--r-- | sound/pci/cs46xx/imgs/cwcasync.h | 6 | ||||
-rw-r--r-- | sound/pci/cs46xx/imgs/cwcbinhack.h | 6 | ||||
-rw-r--r-- | sound/pci/cs46xx/imgs/cwcdma.h | 6 | ||||
-rw-r--r-- | sound/pci/cs46xx/imgs/cwcemb80.h | 6 | ||||
-rw-r--r-- | sound/pci/cs46xx/imgs/cwcsnoop.h | 6 |
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, const struct pci_device_id *pci_id) { static int dev; - snd_card_t *card; - cs46xx_t *chip; + struct snd_card *card; + struct snd_cs46xx *chip; int err; 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 @@ #include "cs46xx_lib.h" #include "dsp_spos.h" -static void amp_voyetra(cs46xx_t *chip, int change); +static void amp_voyetra(struct snd_cs46xx *chip, int change); #ifdef CONFIG_SND_CS46XX_NEW_DSP -static snd_pcm_ops_t snd_cs46xx_playback_rear_ops; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops; -static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops; -static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops; +static struct snd_pcm_ops snd_cs46xx_playback_rear_ops; +static struct snd_pcm_ops snd_cs46xx_playback_indirect_rear_ops; +static struct snd_pcm_ops snd_cs46xx_playback_clfe_ops; +static struct snd_pcm_ops snd_cs46xx_playback_indirect_clfe_ops; +static struct snd_pcm_ops snd_cs46xx_playback_iec958_ops; +static struct snd_pcm_ops snd_cs46xx_playback_indirect_iec958_ops; #endif -static snd_pcm_ops_t snd_cs46xx_playback_ops; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops; -static snd_pcm_ops_t snd_cs46xx_capture_ops; -static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops; +static struct snd_pcm_ops snd_cs46xx_playback_ops; +static struct snd_pcm_ops snd_cs46xx_playback_indirect_ops; +static struct snd_pcm_ops snd_cs46xx_capture_ops; +static struct snd_pcm_ops snd_cs46xx_capture_indirect_ops; -static unsigned short snd_cs46xx_codec_read(cs46xx_t *chip, +static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip, unsigned short reg, int codec_index) { @@ -204,10 +204,10 @@ static unsigned short snd_cs46xx_codec_read(cs46xx_t *chip, return result; } -static unsigned short snd_cs46xx_ac97_read(ac97_t * ac97, +static unsigned short snd_cs46xx_ac97_read(struct snd_ac97 * ac97, unsigned short reg) { - cs46xx_t *chip = ac97->private_data; + struct snd_cs46xx *chip = ac97->private_data; unsigned short val; int codec_index = ac97->num; @@ -221,7 +221,7 @@ static unsigned short snd_cs46xx_ac97_read(ac97_t * ac97, } -static void snd_cs46xx_codec_write(cs46xx_t *chip, +static void snd_cs46xx_codec_write(struct snd_cs46xx *chip, unsigned short reg, unsigned short val, int codec_index) @@ -286,11 +286,11 @@ static void snd_cs46xx_codec_write(cs46xx_t *chip, chip->active_ctrl(chip, -1); } -static void snd_cs46xx_ac97_write(ac97_t *ac97, +static void snd_cs46xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { - cs46xx_t *chip = ac97->private_data; + struct snd_cs46xx *chip = ac97->private_data; int codec_index = ac97->num; snd_assert(codec_index == CS46XX_PRIMARY_CODEC_INDEX || @@ -305,7 +305,7 @@ static void snd_cs46xx_ac97_write(ac97_t *ac97, * Chip initialization */ -int snd_cs46xx_download(cs46xx_t *chip, +int snd_cs46xx_download(struct snd_cs46xx *chip, u32 *src, unsigned long offset, unsigned long len) @@ -334,7 +334,7 @@ int snd_cs46xx_download(cs46xx_t *chip, #include "imgs/cwcbinhack.h" #include "imgs/cwcdma.h" -int snd_cs46xx_clear_BA1(cs46xx_t *chip, +int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip, unsigned long offset, unsigned long len) { @@ -358,7 +358,7 @@ int snd_cs46xx_clear_BA1(cs46xx_t *chip, #include "cs46xx_image.h" -int snd_cs46xx_download_image(cs46xx_t *chip) +int snd_cs46xx_download_image(struct snd_cs46xx *chip) { int idx, err; unsigned long offset = 0; @@ -379,7 +379,7 @@ int snd_cs46xx_download_image(cs46xx_t *chip) * Chip reset */ -static void snd_cs46xx_reset(cs46xx_t *chip) +static void snd_cs46xx_reset(struct snd_cs46xx *chip) { int idx; @@ -408,7 +408,7 @@ static void snd_cs46xx_reset(cs46xx_t *chip) snd_cs46xx_poke(chip, BA1_FRMT, 0xadf); } -static int cs46xx_wait_for_fifo(cs46xx_t * chip,int retry_timeout) +static int cs46xx_wait_for_fifo(struct snd_cs46xx * chip,int retry_timeout) { u32 i, status = 0; /* @@ -432,7 +432,7 @@ static int cs46xx_wait_for_fifo(cs46xx_t * chip,int retry_timeout) return 0; } -static void snd_cs46xx_clear_serial_FIFOs(cs46xx_t *chip) +static void snd_cs46xx_clear_serial_FIFOs(struct snd_cs46xx *chip) { int idx, powerdown = 0; unsigned int tmp; @@ -486,7 +486,7 @@ static void snd_cs46xx_clear_serial_FIFOs(cs46xx_t *chip) snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp); } -static void snd_cs46xx_proc_start(cs46xx_t *chip) +static void snd_cs46xx_proc_start(struct snd_cs46xx *chip) { int cnt; @@ -513,7 +513,7 @@ static void snd_cs46xx_proc_start(cs46xx_t *chip) snd_printk(KERN_ERR "SPCR_RUNFR never reset\n"); } -static void snd_cs46xx_proc_stop(cs46xx_t *chip) +static void snd_cs46xx_proc_stop(struct snd_cs46xx *chip) { /* * 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) #define GOF_PER_SEC 200 -static void snd_cs46xx_set_play_sample_rate(cs46xx_t *chip, unsigned int rate) +static void snd_cs46xx_set_play_sample_rate(struct snd_cs46xx *chip, unsigned int rate) { unsigned long flags; unsigned int tmp1, tmp2; @@ -574,7 +574,7 @@ static void snd_cs46xx_set_play_sample_rate(cs46xx_t *chip, unsigned int rate) spin_unlock_irqrestore(&chip->reg_lock, flags); } -static void snd_cs46xx_set_capture_sample_rate(cs46xx_t *chip, unsigned int rate) +static void snd_cs46xx_set_capture_sample_rate(struct snd_cs46xx *chip, unsigned int rate) { unsigned long flags; unsigned int phiIncr, coeffIncr, tmp1, tmp2; @@ -684,43 +684,43 @@ static void snd_cs46xx_set_capture_sample_rate(cs46xx_t *chip, unsigned int rate * PCM part */ -static void snd_cs46xx_pb_trans_copy(snd_pcm_substream_t *substream, - snd_pcm_indirect_t *rec, size_t bytes) +static void snd_cs46xx_pb_trans_copy(struct snd_pcm_substream *substream, + struct snd_pcm_indirect *rec, size_t bytes) { - snd_pcm_runtime_t *runtime = substream->runtime; - cs46xx_pcm_t * cpcm = runtime->private_data; + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_cs46xx_pcm * cpcm = runtime->private_data; memcpy(cpcm->hw_buf.area + rec->hw_data, runtime->dma_area + rec->sw_data, bytes); } -static int snd_cs46xx_playback_transfer(snd_pcm_substream_t *substream) +static int snd_cs46xx_playback_transfer(struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; - cs46xx_pcm_t * cpcm = runtime->private_data; + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_cs46xx_pcm * cpcm = runtime->private_data; snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy); return 0; } -static void snd_cs46xx_cp_trans_copy(snd_pcm_substream_t *substream, - snd_pcm_indirect_t *rec, size_t bytes) +static void snd_cs46xx_cp_trans_copy(struct snd_pcm_substream *substream, + struct snd_pcm_indirect *rec, size_t bytes) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; memcpy(runtime->dma_area + rec->sw_data, chip->capt.hw_buf.area + rec->hw_data, bytes); } -static int snd_cs46xx_capture_transfer(snd_pcm_substream_t *substream) +static int snd_cs46xx_capture_transfer(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec, snd_cs46xx_cp_trans_copy); return 0; } -static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); size_t ptr; - cs46xx_pcm_t *cpcm = substream->runtime->private_data; + struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; snd_assert (cpcm->pcm_channel,return -ENXIO); #ifdef CONFIG_SND_CS46XX_NEW_DSP @@ -732,11 +732,11 @@ static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(snd_pcm_substream_t return ptr >> cpcm->shift; } -static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); size_t ptr; - cs46xx_pcm_t *cpcm = substream->runtime->private_data; + struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; #ifdef CONFIG_SND_CS46XX_NEW_DSP snd_assert (cpcm->pcm_channel,return -ENXIO); @@ -748,29 +748,29 @@ static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_ return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr); } -static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr; return ptr >> chip->capt.shift; } -static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr; return snd_pcm_indirect_capture_pointer(substream, &chip->capt.pcm_rec, ptr); } -static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream, +static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream, int cmd) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); - /*snd_pcm_runtime_t *runtime = substream->runtime;*/ + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + /*struct snd_pcm_runtime *runtime = substream->runtime;*/ int result = 0; #ifdef CONFIG_SND_CS46XX_NEW_DSP - cs46xx_pcm_t *cpcm = substream->runtime->private_data; + struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; if (! cpcm->pcm_channel) { return -ENXIO; } @@ -827,10 +827,10 @@ static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream, return result; } -static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream, +static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream, int cmd) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); unsigned int tmp; int result = 0; @@ -858,7 +858,7 @@ static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream, } #ifdef CONFIG_SND_CS46XX_NEW_DSP -static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm, +static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm, int sample_rate) { @@ -893,14 +893,14 @@ static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm, #endif -static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { - snd_pcm_runtime_t *runtime = substream->runtime; - cs46xx_pcm_t *cpcm; + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_cs46xx_pcm *cpcm; int err; #ifdef CONFIG_SND_CS46XX_NEW_DSP - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); int sample_rate = params_rate(hw_params); int period_size = params_period_bytes(hw_params); #endif @@ -995,11 +995,11 @@ static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream, return 0; } -static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream) { - /*cs46xx_t *chip = snd_pcm_substream_chip(substream);*/ - snd_pcm_runtime_t *runtime = substream->runtime; - cs46xx_pcm_t *cpcm; + /*struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);*/ + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_cs46xx_pcm *cpcm; cpcm = runtime->private_data; @@ -1017,13 +1017,13 @@ static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream) return 0; } -static int snd_cs46xx_playback_prepare(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream) { unsigned int tmp; unsigned int pfie; - cs46xx_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - cs46xx_pcm_t *cpcm; + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_cs46xx_pcm *cpcm; cpcm = runtime->private_data; @@ -1087,11 +1087,11 @@ static int snd_cs46xx_playback_prepare(snd_pcm_substream_t * substream) return 0; } -static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int err; #ifdef CONFIG_SND_CS46XX_NEW_DSP @@ -1118,10 +1118,10 @@ static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream, return 0; } -static int snd_cs46xx_capture_hw_free(snd_pcm_substream_t * substream) +static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; if (runtime->dma_area != chip->capt.hw_buf.area) snd_pcm_lib_free_pages(substream); @@ -1132,10 +1132,10 @@ static int snd_cs46xx_capture_hw_free(snd_pcm_substream_t * substream) return 0; } -static int snd_cs46xx_capture_prepare(snd_pcm_substream_t * substream) +static int snd_cs46xx_capture_prepare(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_poke(chip, BA1_CBA, chip->capt.hw_buf.addr); chip->capt.shift = 2; @@ -1149,13 +1149,13 @@ static int snd_cs46xx_capture_prepare(snd_pcm_substream_t * substream) static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - cs46xx_t *chip = dev_id; + struct snd_cs46xx *chip = dev_id; u32 status1; #ifdef CONFIG_SND_CS46XX_NEW_DSP - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; u32 status2; int i; - cs46xx_pcm_t *cpcm = NULL; + struct snd_cs46xx_pcm *cpcm = NULL; #endif /* @@ -1239,7 +1239,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *r return IRQ_HANDLED; } -static snd_pcm_hardware_t snd_cs46xx_playback = +static struct snd_pcm_hardware snd_cs46xx_playback = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | @@ -1261,7 +1261,7 @@ static snd_pcm_hardware_t snd_cs46xx_playback = .fifo_size = 0, }; -static snd_pcm_hardware_t snd_cs46xx_capture = +static struct snd_pcm_hardware snd_cs46xx_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | @@ -1285,7 +1285,7 @@ static snd_pcm_hardware_t snd_cs46xx_capture = static unsigned int period_sizes[] = { 32, 64, 128, 256, 512, 1024, 2048 }; -static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = { +static struct snd_pcm_hw_constraint_list hw_constraints_period_sizes = { .count = ARRAY_SIZE(period_sizes), .list = period_sizes, .mask = 0 @@ -1293,16 +1293,16 @@ static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = { #endif -static void snd_cs46xx_pcm_free_substream(snd_pcm_runtime_t *runtime) +static void snd_cs46xx_pcm_free_substream(struct snd_pcm_runtime *runtime) { kfree(runtime->private_data); } -static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pcm_channel_id) +static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); - cs46xx_pcm_t * cpcm; - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx_pcm * cpcm; + struct snd_pcm_runtime *runtime = substream->runtime; cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL); if (cpcm == NULL) @@ -1340,30 +1340,30 @@ static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pc return 0; } -static int snd_cs46xx_playback_open(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream) { snd_printdd("open front channel\n"); return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL); } #ifdef CONFIG_SND_CS46XX_NEW_DSP -static int snd_cs46xx_playback_open_rear(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream) { snd_printdd("open rear channel\n"); return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL); } -static int snd_cs46xx_playback_open_clfe(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream) { snd_printdd("open center - LFE channel\n"); return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL); } -static int snd_cs46xx_playback_open_iec958(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_open_iec958(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_printdd("open raw iec958 channel\n"); @@ -1374,12 +1374,12 @@ static int snd_cs46xx_playback_open_iec958(snd_pcm_substream_t * substream) return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL); } -static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream); +static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream); -static int snd_cs46xx_playback_close_iec958(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream) { int err; - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_printdd("close raw iec958 channel\n"); @@ -1393,9 +1393,9 @@ static int snd_cs46xx_playback_close_iec958(snd_pcm_substream_t * substream) } #endif -static int snd_cs46xx_capture_open(snd_pcm_substream_t * substream) +static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), PAGE_SIZE, &chip->capt.hw_buf) < 0) @@ -1416,11 +1416,11 @@ static int snd_cs46xx_capture_open(snd_pcm_substream_t * substream) return 0; } -static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream) +static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - cs46xx_pcm_t * cpcm; + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_cs46xx_pcm * cpcm; cpcm = runtime->private_data; @@ -1445,9 +1445,9 @@ static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream) return 0; } -static int snd_cs46xx_capture_close(snd_pcm_substream_t * substream) +static int snd_cs46xx_capture_close(struct snd_pcm_substream *substream) { - cs46xx_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); chip->capt.substream = NULL; snd_dma_free_pages(&chip->capt.hw_buf); @@ -1457,7 +1457,7 @@ static int snd_cs46xx_capture_close(snd_pcm_substream_t * substream) } #ifdef CONFIG_SND_CS46XX_NEW_DSP -static snd_pcm_ops_t snd_cs46xx_playback_rear_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_rear_ops = { .open = snd_cs46xx_playback_open_rear, .close = snd_cs46xx_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1468,7 +1468,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_rear_ops = { .pointer = snd_cs46xx_playback_direct_pointer, }; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_indirect_rear_ops = { .open = snd_cs46xx_playback_open_rear, .close = snd_cs46xx_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1480,7 +1480,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops = { .ack = snd_cs46xx_playback_transfer, }; -static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_clfe_ops = { .open = snd_cs46xx_playback_open_clfe, .close = snd_cs46xx_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1491,7 +1491,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops = { .pointer = snd_cs46xx_playback_direct_pointer, }; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_indirect_clfe_ops = { .open = snd_cs46xx_playback_open_clfe, .close = snd_cs46xx_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1503,7 +1503,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops = { .ack = snd_cs46xx_playback_transfer, }; -static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_iec958_ops = { .open = snd_cs46xx_playback_open_iec958, .close = snd_cs46xx_playback_close_iec958, .ioctl = snd_pcm_lib_ioctl, @@ -1514,7 +1514,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops = { .pointer = snd_cs46xx_playback_direct_pointer, }; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_indirect_iec958_ops = { .open = snd_cs46xx_playback_open_iec958, .close = snd_cs46xx_playback_close_iec958, .ioctl = snd_pcm_lib_ioctl, @@ -1528,7 +1528,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops = { #endif -static snd_pcm_ops_t snd_cs46xx_playback_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_ops = { .open = snd_cs46xx_playback_open, .close = snd_cs46xx_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1539,7 +1539,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_ops = { .pointer = snd_cs46xx_playback_direct_pointer, }; -static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops = { +static struct snd_pcm_ops snd_cs46xx_playback_indirect_ops = { .open = snd_cs46xx_playback_open, .close = snd_cs46xx_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1551,7 +1551,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops = { .ack = snd_cs46xx_playback_transfer, }; -static snd_pcm_ops_t snd_cs46xx_capture_ops = { +static struct snd_pcm_ops snd_cs46xx_capture_ops = { .open = snd_cs46xx_capture_open, .close = snd_cs46xx_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -1562,7 +1562,7 @@ static snd_pcm_ops_t snd_cs46xx_capture_ops = { .pointer = snd_cs46xx_capture_direct_pointer, }; -static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = { +static struct snd_pcm_ops snd_cs46xx_capture_indirect_ops = { .open = snd_cs46xx_capture_open, .close = snd_cs46xx_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -1580,9 +1580,9 @@ static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = { #define MAX_PLAYBACK_CHANNELS 1 #endif -int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) +int __devinit snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if (rpcm) @@ -1611,9 +1611,9 @@ int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) #ifdef CONFIG_SND_CS46XX_NEW_DSP -int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) +int __devinit snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if (rpcm) @@ -1640,9 +1640,9 @@ int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) return 0; } -int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) +int __devinit snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if (rpcm) @@ -1669,9 +1669,9 @@ int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t ** return 0; } -int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) +int __devinit snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if (rpcm) @@ -1702,16 +1702,16 @@ int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpc /* * Mixer routines */ -static void snd_cs46xx_mixer_free_ac97_bus(ac97_bus_t *bus) +static void snd_cs46xx_mixer_free_ac97_bus(struct snd_ac97_bus *bus) { - cs46xx_t *chip = bus->private_data; + struct snd_cs46xx *chip = bus->private_data; chip->ac97_bus = NULL; } -static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97) +static void snd_cs46xx_mixer_free_ac97(struct snd_ac97 *ac97) { - cs46xx_t *chip = ac97->private_data; + struct snd_cs46xx *chip = ac97->private_data; snd_assert ((ac97 == chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]) || (ac97 == chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]), @@ -1725,8 +1725,8 @@ static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97) chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL; } -static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol, - snd_ctl_elem_info_t *uinfo) +static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -1735,9 +1735,9 @@ static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol, return 0; } -static int snd_cs46xx_vol_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int reg = kcontrol->private_value; unsigned int val = snd_cs46xx_peek(chip, reg); 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 * return 0; } -static int snd_cs46xx_vol_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int reg = kcontrol->private_value; unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 | (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 * #ifdef CONFIG_SND_CS46XX_NEW_DSP -static int snd_cs46xx_vol_dac_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_vol_dac_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.integer.value[0] = chip->dsp_spos_instance->dac_volume_left; 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_ return 0; } -static int snd_cs46xx_vol_dac_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_vol_dac_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int change = 0; 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_ } #if 0 -static int snd_cs46xx_vol_iec958_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_vol_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.integer.value[0] = chip->dsp_spos_instance->spdif_input_volume_left; ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_right; return 0; } -static int snd_cs46xx_vol_iec958_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_vol_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int change = 0; 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 } #endif -static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol, - snd_ctl_elem_info_t *uinfo) +static int snd_mixer_boolean_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 1; @@ -1826,10 +1826,10 @@ static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol, return 0; } -static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int reg = kcontrol->private_value; if (reg == CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT) @@ -1840,10 +1840,10 @@ static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol, return 0; } -static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int change, res; switch (kcontrol->private_value) { @@ -1877,11 +1877,11 @@ static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol, return res; } -static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; if (ins->adc_input != NULL) ucontrol->value.integer.value[0] = 1; @@ -1891,11 +1891,11 @@ static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol, return 0; } -static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int change = 0; if (ucontrol->value.integer.value[0] && !ins->adc_input) { @@ -1908,11 +1908,11 @@ static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol, return change; } -static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; if (ins->pcm_input != NULL) ucontrol->value.integer.value[0] = 1; @@ -1923,11 +1923,11 @@ static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol, } -static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int change = 0; if (ucontrol->value.integer.value[0] && !ins->pcm_input) { @@ -1941,10 +1941,10 @@ static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol, return change; } -static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR); @@ -1959,10 +1959,10 @@ static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol, /* * Game Theatre XP card - EGPIO[0] is used to select SPDIF input optical or coaxial. */ -static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR); int val2 = snd_cs46xx_peekBA0(chip, BA0_EGPIOPTR); @@ -1984,18 +1984,18 @@ static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol, } -static int snd_cs46xx_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_cs46xx_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; return 0; } -static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_spdif_default_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; down (&chip->spos_mutex); 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, return 0; } -static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t * chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; unsigned int val; int change; @@ -2034,8 +2034,8 @@ static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol, return change; } -static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_spdif_mask_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { ucontrol->value.iec958.status[0] = 0xff; ucontrol->value.iec958.status[1] = 0xff; @@ -2044,11 +2044,11 @@ static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol, return 0; } -static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_spdif_stream_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; down (&chip->spos_mutex); 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, return 0; } -static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t * chip = snd_kcontrol_chip(kcontrol); - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; unsigned int val; int change; @@ -2091,8 +2091,8 @@ static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol, #ifdef CONFIG_SND_CS46XX_DEBUG_GPIO -static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol, - snd_ctl_elem_info_t *uinfo) +static int snd_cs46xx_egpio_select_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 1; @@ -2101,19 +2101,19 @@ static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol, return 0; } -static int snd_cs46xx_egpio_select_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_egpio_select_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.integer.value[0] = chip->current_gpio; return 0; } -static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_egpio_select_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int change = (chip->current_gpio != ucontrol->value.integer.value[0]); chip->current_gpio = ucontrol->value.integer.value[0]; @@ -2121,10 +2121,10 @@ static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol, } -static int snd_cs46xx_egpio_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_egpio_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int reg = kcontrol->private_value; 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, return 0; } -static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_egpio_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); int reg = kcontrol->private_value; int val = snd_cs46xx_peekBA0(chip, reg); int oldval = val; @@ -2155,7 +2155,7 @@ static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol, } #endif /* CONFIG_SND_CS46XX_DEBUG_GPIO */ -static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = { +static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "DAC Volume", @@ -2285,26 +2285,26 @@ static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = { #ifdef CONFIG_SND_CS46XX_NEW_DSP /* set primary cs4294 codec into Extended Audio Mode */ -static int snd_cs46xx_front_dup_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); unsigned short val; val = snd_ac97_read(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], AC97_CSR_ACMODE); ucontrol->value.integer.value[0] = (val & 0x200) ? 0 : 1; return 0; } -static int snd_cs46xx_front_dup_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *ucontrol) +static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs46xx_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); return snd_ac97_update_bits(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], AC97_CSR_ACMODE, 0x200, ucontrol->value.integer.value[0] ? 0 : 0x200); } -static snd_kcontrol_new_t snd_cs46xx_front_dup_ctl = { +static struct snd_kcontrol_new snd_cs46xx_front_dup_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Duplicate Front", .info = snd_mixer_boolean_info, @@ -2315,7 +2315,7 @@ static snd_kcontrol_new_t snd_cs46xx_front_dup_ctl = { #ifdef CONFIG_SND_CS46XX_NEW_DSP /* Only available on the Hercules Game Theater XP soundcard */ -static snd_kcontrol_new_t snd_hercules_controls[] __devinitdata = { +static struct snd_kcontrol_new snd_hercules_controls[] __devinitdata = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Optical/Coaxial SPDIF Input Switch", @@ -2326,7 +2326,7 @@ static snd_kcontrol_new_t snd_hercules_controls[] __devinitdata = { }; -static void snd_cs46xx_codec_reset (ac97_t * ac97) +static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97) { unsigned long end_time; int err; @@ -2375,10 +2375,10 @@ static void snd_cs46xx_codec_reset (ac97_t * ac97) } #endif -static int __devinit cs46xx_detect_codec(cs46xx_t *chip, int codec) +static int __devinit cs46xx_detect_codec(struct snd_cs46xx *chip, int codec) { int idx, err; - ac97_template_t ac97; + struct snd_ac97_template ac97; memset(&ac97, 0, sizeof(ac97)); ac97.private_data = chip; @@ -2408,13 +2408,13 @@ static int __devinit cs46xx_detect_codec(cs46xx_t *chip, int codec) return -ENXIO; } -int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device) +int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device) { - snd_card_t *card = chip->card; - snd_ctl_elem_id_t id; + struct snd_card *card = chip->card; + struct snd_ctl_elem_id id; int err; unsigned int idx; - static ac97_bus_ops_t ops = { + static struct snd_ac97_bus_ops ops = { #ifdef CONFIG_SND_CS46XX_NEW_DSP .reset = snd_cs46xx_codec_reset, #endif @@ -2442,7 +2442,7 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device) /* add cs4630 mixer controls */ for (idx = 0; idx < ARRAY_SIZE(snd_cs46xx_controls); idx++) { - snd_kcontrol_t *kctl; + struct snd_kcontrol *kctl; kctl = snd_ctl_new1(&snd_cs46xx_controls[idx], chip); if (kctl && kctl->id.iface == SNDRV_CTL_ELEM_IFACE_PCM) kctl->id.device = spdif_device; @@ -2484,16 +2484,16 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device) * RawMIDI interface */ -static void snd_cs46xx_midi_reset(cs46xx_t *chip) +static void snd_cs46xx_midi_reset(struct snd_cs46xx *chip) { snd_cs46xx_pokeBA0(chip, BA0_MIDCR, MIDCR_MRST); udelay(100); snd_cs46xx_pokeBA0(chip, BA0_MIDCR, chip->midcr); } -static int snd_cs46xx_midi_input_open(snd_rawmidi_substream_t * substream) +static int snd_cs46xx_midi_input_open(struct snd_rawmidi_substream *substream) { - cs46xx_t *chip = substream->rmidi->private_data; + struct snd_cs46xx *chip = substream->rmidi->private_data; chip->active_ctrl(chip, 1); spin_lock_irq(&chip->reg_lock); @@ -2509,9 +2509,9 @@ static int snd_cs46xx_midi_input_open(snd_rawmidi_substream_t * substream) return 0; } -static int snd_cs46xx_midi_input_close(snd_rawmidi_substream_t * substream) +static int snd_cs46xx_midi_input_close(struct snd_rawmidi_substream *substream) { - cs46xx_t *chip = substream->rmidi->private_data; + struct snd_cs46xx *chip = substream->rmidi->private_data; spin_lock_irq(&chip->reg_lock); chip->midcr &= ~(MIDCR_RXE | MIDCR_RIE); @@ -2527,9 +2527,9 @@ static int snd_cs46xx_midi_input_close(snd_rawmidi_substream_t * substream) return 0; } -static int snd_cs46xx_midi_output_open(snd_rawmidi_substream_t * substream) +static int snd_cs46xx_midi_output_open(struct snd_rawmidi_substream *substream) { - cs46xx_t *chip = substream->rmidi->private_data; + struct snd_cs46xx *chip = substream->rmidi->private_data; chip->active_ctrl(chip, 1); @@ -2546,9 +2546,9 @@ static int snd_cs46xx_midi_output_open(snd_rawmidi_substream_t * substream) return 0; } -static int snd_cs46xx_midi_output_close(snd_rawmidi_substream_t * substream) +static int snd_cs46xx_midi_output_close(struct snd_rawmidi_substream *substream) { - cs46xx_t *chip = substream->rmidi->private_data; + struct snd_cs46xx *chip = substream->rmidi->private_data; spin_lock_irq(&chip->reg_lock); chip->midcr &= ~(MIDCR_TXE | MIDCR_TIE); @@ -2564,10 +2564,10 @@ static int snd_cs46xx_midi_output_close(snd_rawmidi_substream_t * substream) return 0; } -static void snd_cs46xx_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) +static void snd_cs46xx_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) { unsigned long flags; - cs46xx_t *chip = substream->rmidi->private_data; + struct snd_cs46xx *chip = substream->rmidi->private_data; spin_lock_irqsave(&chip->reg_lock, flags); if (up) { @@ -2584,10 +2584,10 @@ static void snd_cs46xx_midi_input_trigger(snd_rawmidi_substream_t * substream, i spin_unlock_irqrestore(&chip->reg_lock, flags); } -static void snd_cs46xx_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) +static void snd_cs46xx_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) { unsigned long flags; - cs46xx_t *chip = substream->rmidi->private_data; + struct snd_cs46xx *chip = substream->rmidi->private_data; unsigned char byte; spin_lock_irqsave(&chip->reg_lock, flags); @@ -2614,23 +2614,23 @@ static void snd_cs46xx_midi_output_trigger(snd_rawmidi_substream_t * substream, spin_unlock_irqrestore(&chip->reg_lock, flags); } -static snd_rawmidi_ops_t snd_cs46xx_midi_output = +static struct snd_rawmidi_ops snd_cs46xx_midi_output = { .open = snd_cs46xx_midi_output_open, .close = snd_cs46xx_midi_output_close, .trigger = snd_cs46xx_midi_output_trigger, }; -static snd_rawmidi_ops_t snd_cs46xx_midi_input = +static struct snd_rawmidi_ops snd_cs46xx_midi_input = { .open = snd_cs46xx_midi_input_open, .close = snd_cs46xx_midi_input_close, .trigger = snd_cs46xx_midi_input_trigger, }; -int __devinit snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rrawmidi) +int __devinit snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rrawmidi) { - snd_rawmidi_t *rmidi; + struct snd_rawmidi *rmidi; int err; if (rrawmidi) @@ -2657,7 +2657,7 @@ int __devinit snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rrawmi static void snd_cs46xx_gameport_trigger(struct gameport *gameport) { - cs46xx_t *chip = gameport_get_port_data(gameport); + struct snd_cs46xx *chip = gameport_get_port_data(gameport); snd_assert(chip, return); snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF); @@ -2665,7 +2665,7 @@ static void snd_cs46xx_gameport_trigger(struct gameport *gameport) static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport) { - cs46xx_t *chip = gameport_get_port_data(gameport); + struct snd_cs46xx *chip = gameport_get_port_data(gameport); snd_assert(chip, return 0); return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io); @@ -2673,7 +2673,7 @@ static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport) static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons) { - cs46xx_t *chip = gameport_get_port_data(gameport); + struct snd_cs46xx *chip = gameport_get_port_data(gameport); unsigned js1, js2, jst; snd_assert(chip, return 0); @@ -2707,7 +2707,7 @@ static int snd_cs46xx_gameport_open(struct gameport *gameport, int mode) return 0; } -int __devinit snd_cs46xx_gameport(cs46xx_t *chip) +int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip) { struct gameport *gp; @@ -2735,7 +2735,7 @@ int __devinit snd_cs46xx_gameport(cs46xx_t *chip) return 0; } -static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) +static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { if (chip->gameport) { gameport_unregister_port(chip->gameport); @@ -2743,20 +2743,20 @@ static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) } } #else -int __devinit snd_cs46xx_gameport(cs46xx_t *chip) { return -ENOSYS; } -static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) { } +int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip) { return -ENOSYS; } +static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { } #endif /* CONFIG_GAMEPORT */ /* * proc interface */ -static long snd_cs46xx_io_read(snd_info_entry_t *entry, void *file_private_data, +static long snd_cs46xx_io_read(struct snd_info_entry *entry, void *file_private_data, struct file *file, char __user *buf, unsigned long count, unsigned long pos) { long size; - snd_cs46xx_region_t *region = (snd_cs46xx_region_t *)entry->private_data; + struct snd_cs46xx_region *region = entry->private_data; size = count; if (pos + (size_t)size > region->size) @@ -2772,13 +2772,13 @@ static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { .read = snd_cs46xx_io_read, }; -static int __devinit snd_cs46xx_proc_init(snd_card_t * card, cs46xx_t *chip) +static int __devinit snd_cs46xx_proc_init(struct snd_card *card, struct snd_cs46xx *chip) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; int idx; for (idx = 0; idx < 5; idx++) { - snd_cs46xx_region_t *region = &chip->region.idx[idx]; + struct snd_cs46xx_region *region = &chip->region.idx[idx]; if (! snd_card_proc_new(card, region->name, &entry)) { entry->content = SNDRV_INFO_CONTENT_DATA; entry->private_data = chip; @@ -2793,7 +2793,7 @@ static int __devinit snd_cs46xx_proc_init(snd_card_t * card, cs46xx_t *chip) return 0; } -static int snd_cs46xx_proc_done(cs46xx_t *chip) +static int snd_cs46xx_proc_done(struct snd_cs46xx *chip) { #ifdef CONFIG_SND_CS46XX_NEW_DSP cs46xx_dsp_proc_done(chip); @@ -2804,7 +2804,7 @@ static int snd_cs46xx_proc_done(cs46xx_t *chip) /* * stop the h/w */ -static void snd_cs46xx_hw_stop(cs46xx_t *chip) +static void snd_cs46xx_hw_stop(struct snd_cs46xx *chip) { unsigned int tmp; @@ -2851,7 +2851,7 @@ static void snd_cs46xx_hw_stop(cs46xx_t *chip) } -static int snd_cs46xx_free(cs46xx_t *chip) +static int snd_cs46xx_free(struct snd_cs46xx *chip) { int idx; @@ -2871,13 +2871,13 @@ static int snd_cs46xx_free(cs46xx_t *chip) snd_cs46xx_hw_stop(chip); for (idx = 0; idx < 5; idx++) { - snd_cs46xx_region_t *region = &chip->region.idx[idx]; + struct snd_cs46xx_region *region = &chip->region.idx[idx]; if (region->remap_addr) iounmap(region->remap_addr); release_and_free_resource(region->resource); } if (chip->irq >= 0) - free_irq(chip->irq, (void *)chip); + free_irq(chip->irq, chip); if (chip->active_ctrl) chip->active_ctrl(chip, -chip->amplifier); @@ -2894,16 +2894,16 @@ static int snd_cs46xx_free(cs46xx_t *chip) return 0; } -static int snd_cs46xx_dev_free(snd_device_t *device) +static int snd_cs46xx_dev_free(struct snd_device *device) { - cs46xx_t *chip = device->device_data; + struct snd_cs46xx *chip = device->device_data; return snd_cs46xx_free(chip); } /* * initialize chip */ -static int snd_cs46xx_chip_init(cs46xx_t *chip) +static int snd_cs46xx_chip_init(struct snd_cs46xx *chip) { int timeout; @@ -3132,7 +3132,7 @@ static int snd_cs46xx_chip_init(cs46xx_t *chip) /* * start and load DSP */ -int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip) +int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip) { unsigned int tmp; /* @@ -3234,12 +3234,12 @@ int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip) * AMP control - null AMP */ -static void amp_none(cs46xx_t *chip, int change) +static void amp_none(struct snd_cs46xx *chip, int change) { } #ifdef CONFIG_SND_CS46XX_NEW_DSP -static int voyetra_setup_eapd_slot(cs46xx_t *chip) +static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip) { u32 idx, valid_slots,tmp,powerdown = 0; @@ -3359,7 +3359,7 @@ static int voyetra_setup_eapd_slot(cs46xx_t *chip) * Crystal EAPD mode */ -static void amp_voyetra(cs46xx_t *chip, int change) +static void amp_voyetra(struct snd_cs46xx *chip, int change) { /* Manage the EAPD bit on the Crystal 4297 and the Analog AD1885 */ @@ -3395,7 +3395,7 @@ static void amp_voyetra(cs46xx_t *chip, int change) #endif } -static void hercules_init(cs46xx_t *chip) +static void hercules_init(struct snd_cs46xx *chip) { /* default: AMP off, and SPDIF input optical */ snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0); @@ -3406,7 +3406,7 @@ static void hercules_init(cs46xx_t *chip) /* * Game Theatre XP card - EGPIO[2] is used to enable the external amp. */ -static void amp_hercules(cs46xx_t *chip, int change) +static void amp_hercules(struct snd_cs46xx *chip, int change) { int old = chip->amplifier; int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR); @@ -3427,7 +3427,7 @@ static void amp_hercules(cs46xx_t *chip, int change) } } -static void voyetra_mixer_init (cs46xx_t *chip) +static void voyetra_mixer_init (struct snd_cs46xx *chip) { snd_printdd ("initializing Voyetra mixer\n"); @@ -3436,12 +3436,12 @@ static void voyetra_mixer_init (cs46xx_t *chip) snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, EGPIODR_GPOE0); } -static void hercules_mixer_init (cs46xx_t *chip) +static void hercules_mixer_init (struct snd_cs46xx *chip) { #ifdef CONFIG_SND_CS46XX_NEW_DSP unsigned int idx; int err; - snd_card_t *card = chip->card; + struct snd_card *card = chip->card; #endif /* set EGPIO to default */ @@ -3451,7 +3451,7 @@ static void hercules_mixer_init (cs46xx_t *chip) #ifdef CONFIG_SND_CS46XX_NEW_DSP for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) { - snd_kcontrol_t *kctl; + struct snd_kcontrol *kctl; kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip); if ((err = snd_ctl_add(card, kctl)) < 0) { @@ -3468,7 +3468,7 @@ static void hercules_mixer_init (cs46xx_t *chip) * Untested */ -static void amp_voyetra_4294(cs46xx_t *chip, int change) +static void amp_voyetra_4294(struct snd_cs46xx *chip, int change) { chip->amplifier += change; @@ -3498,7 +3498,7 @@ static void amp_voyetra_4294(cs46xx_t *chip, int change) * enough to make them useful. */ -static void clkrun_hack(cs46xx_t *chip, int change) +static void clkrun_hack(struct snd_cs46xx *chip, int change) { u16 control, nval; @@ -3523,7 +3523,7 @@ static void clkrun_hack(cs46xx_t *chip, int change) /* * detect intel piix4 */ -static void clkrun_init(cs46xx_t *chip) +static void clkrun_init(struct snd_cs46xx *chip) { struct pci_dev *pdev; u8 pp; @@ -3551,10 +3551,10 @@ struct cs_card_type u16 vendor; u16 id; char *name; - void (*init)(cs46xx_t *); - void (*amp)(cs46xx_t *, int); - void (*active)(cs46xx_t *, int); - void (*mixer_init)(cs46xx_t *); + void (*init)(struct snd_cs46xx *); + void (*amp)(struct snd_cs46xx *, int); + void (*active)(struct snd_cs46xx *, int); + void (*mixer_init)(struct snd_cs46xx *); }; static struct cs_card_type __devinitdata cards[] = { @@ -3654,9 +3654,9 @@ static struct cs_card_type __devinitdata cards[] = { * APM support */ #ifdef CONFIG_PM -static int snd_cs46xx_suspend(snd_card_t *card, pm_message_t state) +static int snd_cs46xx_suspend(struct snd_card *card, pm_message_t state) { - cs46xx_t *chip = card->pm_private_data; + struct snd_cs46xx *chip = card->pm_private_data; int amp_saved; snd_pcm_suspend_all(chip->pcm); @@ -3678,9 +3678,9 @@ static int snd_cs46xx_suspend(snd_card_t *card, pm_message_t state) return 0; } -static int snd_cs46xx_resume(snd_card_t *card) +static int snd_cs46xx_resume(struct snd_card *card) { - cs46xx_t *chip = card->pm_private_data; + struct snd_cs46xx *chip = card->pm_private_data; int amp_saved; pci_enable_device(chip->pci); @@ -3719,17 +3719,17 @@ static int snd_cs46xx_resume(snd_card_t *card) /* */ -int __devinit snd_cs46xx_create(snd_card_t * card, +int __devinit snd_cs46xx_create(struct snd_card *card, struct pci_dev * pci, int external_amp, int thinkpad, - cs46xx_t ** rchip) + struct snd_cs46xx ** rchip) { - cs46xx_t *chip; + struct snd_cs46xx *chip; int err, idx; - snd_cs46xx_region_t *region; + struct snd_cs46xx_region *region; struct cs_card_type *cp; u16 ss_card, ss_vendor; - static snd_device_ops_t ops = { + static struct snd_device_ops ops = { .dev_free = snd_cs46xx_dev_free, }; @@ -3755,7 +3755,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card, chip->ba1_addr = pci_resource_start(pci, 1); if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 || chip->ba1_addr == 0 || chip->ba1_addr == (unsigned long)~0) { - snd_printk(KERN_ERR "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n", chip->ba0_addr, chip->ba1_addr); + snd_printk(KERN_ERR "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n", + chip->ba0_addr, chip->ba1_addr); snd_cs46xx_free(chip); return -ENOMEM; } @@ -3825,8 +3826,10 @@ int __devinit snd_cs46xx_create(snd_card_t * card, for (idx = 0; idx < 5; idx++) { region = &chip->region.idx[idx]; - if ((region->resource = request_mem_region(region->base, region->size, region->name)) == NULL) { - snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n", region->base, region->base + region->size - 1); + if ((region->resource = request_mem_region(region->base, region->size, + region->name)) == NULL) { + snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n", + region->base, region->base + region->size - 1); snd_cs46xx_free(chip); return -EBUSY; } @@ -3838,7 +3841,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card, } } - if (request_irq(pci->irq, snd_cs46xx_interrupt, SA_INTERRUPT|SA_SHIRQ, "CS46XX", (void *) chip)) { + if (request_irq(pci->irq, snd_cs46xx_interrupt, SA_INTERRUPT|SA_SHIRQ, + "CS46XX", chip)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); snd_cs46xx_free(chip); 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 @@ * common I/O routines */ -static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned int val) +static inline void snd_cs46xx_poke(struct snd_cs46xx *chip, unsigned long reg, unsigned int val) { unsigned int bank = reg >> 16; unsigned int offset = reg & 0xffff; @@ -66,117 +66,128 @@ static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned i writel(val, chip->region.idx[bank+1].remap_addr + offset); } -static inline unsigned int snd_cs46xx_peek(cs46xx_t *chip, unsigned long reg) +static inline unsigned int snd_cs46xx_peek(struct snd_cs46xx *chip, unsigned long reg) { unsigned int bank = reg >> 16; unsigned int offset = reg & 0xffff; return readl(chip->region.idx[bank+1].remap_addr + offset); } -static inline void snd_cs46xx_pokeBA0(cs46xx_t *chip, unsigned long offset, unsigned int val) +static inline void snd_cs46xx_pokeBA0(struct snd_cs46xx *chip, unsigned long offset, unsigned int val) { writel(val, chip->region.name.ba0.remap_addr + offset); } -static inline unsigned int snd_cs46xx_peekBA0(cs46xx_t *chip, unsigned long offset) +static inline unsigned int snd_cs46xx_peekBA0(struct snd_cs46xx *chip, unsigned long offset) { return readl(chip->region.name.ba0.remap_addr + offset); } -dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip); -void cs46xx_dsp_spos_destroy (cs46xx_t * chip); -int cs46xx_dsp_load_module (cs46xx_t * chip,dsp_module_desc_t * module); -symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip,char * symbol_name,int symbol_type); -int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip); -int cs46xx_dsp_proc_done (cs46xx_t *chip); -int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip); -int snd_cs46xx_download (cs46xx_t *chip,u32 *src,unsigned long offset, - unsigned long len); -int snd_cs46xx_clear_BA1(cs46xx_t *chip,unsigned long offset,unsigned long len); -int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip); -int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip); -int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip); -int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip); -int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip); -int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip); -int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip); -int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip); -int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip); -int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data); -dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest); -void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb); -void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb); -dsp_scb_descriptor_t * cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip); -dsp_scb_descriptor_t * cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, - u16 channel_disp,u16 fifo_addr, - u16 child_scb_addr, - u32 dest, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, - u16 channel_disp,u16 fifo_addr, - u16 sample_buffer_addr, - u32 dest, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -void cs46xx_dsp_remove_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb); -dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, - u16 channel_disp,u16 fifo_addr, - u16 sample_buffer_addr, - u32 dest,dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -dsp_scb_descriptor_t * cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, - int sample_rate, - u16 src_buffer_addr, - u16 src_delay_buffer_addr,u32 dest, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type, - int pass_through); -dsp_scb_descriptor_t * cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, - u16 mix_buffer_addr,u32 dest, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); - -dsp_scb_descriptor_t * cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, - u16 vari_buffer_addr0, - u16 vari_buffer_addr1, - u32 dest, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -dsp_scb_descriptor_t * cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest, - u16 hfg_scb_address, - u16 asynch_buffer_address, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -dsp_scb_descriptor_t * cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -dsp_scb_descriptor_t * cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, - u16 mix_buffer_addr,u16 writeback_spb,u32 dest, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, - u16 snoop_buffer_address, - dsp_scb_descriptor_t * snoop_scb, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type); -pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,u32 sample_rate, void * private_data, u32 hw_dma_addr, - int pcm_channel_id); -void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip, - pcm_channel_descriptor_t * pcm_channel); -int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel); -int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel); -dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source, - u16 addr,char * scb_name); -int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src); -int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src); -int cs46xx_iec958_pre_open (cs46xx_t *chip); -int cs46xx_iec958_post_close (cs46xx_t *chip); -int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip, - pcm_channel_descriptor_t * pcm_channel, - int period_size); -int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip, - int period_size); -int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right); -int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right); +struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip); +void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip); +int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module); +struct dsp_symbol_entry *cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, + int symbol_type); +int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip); +int cs46xx_dsp_proc_done (struct snd_cs46xx *chip); +int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip); +int snd_cs46xx_download (struct snd_cs46xx *chip, u32 *src, unsigned long offset, + unsigned long len); +int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip, unsigned long offset, unsigned long len); +int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip); +int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip); +int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip); +int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip); +int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip); +int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip); +int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip); +int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip); +int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip); +int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data); +struct dsp_scb_descriptor * cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, + u32 * scb_data, u32 dest); +void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb); +void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip, + struct dsp_scb_descriptor * scb); +struct dsp_scb_descriptor * cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip); +struct dsp_scb_descriptor * +cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, + char * codec_name, u16 channel_disp, u16 fifo_addr, + u16 child_scb_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +struct dsp_scb_descriptor * +cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name, + u16 channel_disp, u16 fifo_addr, + u16 sample_buffer_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, + struct dsp_scb_descriptor * scb); +struct dsp_scb_descriptor * +cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name, + u16 channel_disp, u16 fifo_addr, + u16 sample_buffer_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +struct dsp_scb_descriptor * +cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name, + int sample_rate, u16 src_buffer_addr, + u16 src_delay_buffer_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type, int pass_through); +struct dsp_scb_descriptor * +cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name, + u16 mix_buffer_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); + +struct dsp_scb_descriptor * +cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip, char * scb_name, + u16 vari_buffer_addr0, u16 vari_buffer_addr1, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +struct dsp_scb_descriptor * +cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, + u32 dest, u16 hfg_scb_address, u16 asynch_buffer_address, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +struct dsp_scb_descriptor * +cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +struct dsp_scb_descriptor * +cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name, + u16 mix_buffer_addr, u16 writeback_spb, u32 dest, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +struct dsp_scb_descriptor * +cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, + u32 dest, u16 snoop_buffer_address, + struct dsp_scb_descriptor * snoop_scb, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type); +struct dsp_pcm_channel_descriptor * +cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, u32 sample_rate, + void * private_data, u32 hw_dma_addr, + int pcm_channel_id); +void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel); +int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel); +int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel); +struct dsp_scb_descriptor * +cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source, + u16 addr, char * scb_name); +int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src); +int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src); +int cs46xx_iec958_pre_open (struct snd_cs46xx *chip); +int cs46xx_iec958_post_close (struct snd_cs46xx *chip); +int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel, + int period_size); +int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip, int period_size); +int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right); +int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right); #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 @@ #include "cs46xx_lib.h" #include "dsp_spos.h" -static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entry); +static int cs46xx_dsp_async_init (struct snd_cs46xx *chip, + struct dsp_scb_descriptor * fg_entry); -static wide_opcode_t wide_opcodes[] = { +static enum wide_opcode wide_opcodes[] = { WIDE_FOR_BEGIN_LOOP, WIDE_FOR_BEGIN_LOOP2, WIDE_COND_GOTO_ADDR, @@ -54,12 +55,13 @@ static wide_opcode_t wide_opcodes[] = { WIDE_TBEQ_NCOND_CALL1_ADDR }; -static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32 overlay_begin_address) +static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 size, + u32 overlay_begin_address) { unsigned int i = 0, j, nreallocated = 0; u32 hival,loval,address; u32 mop_operands,mop_type,wide_op; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert( ((size % 2) == 0), return -EINVAL); @@ -114,7 +116,7 @@ static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32 return nreallocated; } -static segment_desc_t * get_segment_desc (dsp_module_desc_t * module, int seg_type) +static struct dsp_segment_desc * get_segment_desc (struct dsp_module_desc * module, int seg_type) { int i; 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 return NULL; }; -static int find_free_symbol_index (dsp_spos_instance_t * ins) +static int find_free_symbol_index (struct dsp_spos_instance * ins) { int index = ins->symbol_table.nsymbols,i; @@ -140,10 +142,10 @@ static int find_free_symbol_index (dsp_spos_instance_t * ins) return index; } -static int add_symbols (cs46xx_t * chip, dsp_module_desc_t * module) +static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * module) { int i; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; if (module->symbol_table.nsymbols > 0) { 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) return 0; } -static symbol_entry_t * add_symbol (cs46xx_t * chip, char * symbol_name, u32 address, int type) +static struct dsp_symbol_entry * +add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - symbol_entry_t * symbol = NULL; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_symbol_entry * symbol = NULL; int index; 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 return symbol; } -dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip) +struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) { - dsp_spos_instance_t * ins = kmalloc(sizeof(dsp_spos_instance_t), GFP_KERNEL); + struct dsp_spos_instance * ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL); if (ins == NULL) return NULL; - memset(ins, 0, sizeof(*ins)); /* better to use vmalloc for this big table */ ins->symbol_table.nsymbols = 0; - ins->symbol_table.symbols = vmalloc(sizeof(symbol_entry_t) * DSP_MAX_SYMBOLS); + ins->symbol_table.symbols = vmalloc(sizeof(struct dsp_symbol_entry) * + DSP_MAX_SYMBOLS); ins->symbol_table.highest_frag_index = 0; if (ins->symbol_table.symbols == NULL) { @@ -248,7 +251,7 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip) ins->ntask = 0; ins->nmodules = 0; - ins->modules = kmalloc(sizeof(dsp_module_desc_t) * DSP_MAX_MODULES, GFP_KERNEL); + ins->modules = kmalloc(sizeof(struct dsp_module_desc) * DSP_MAX_MODULES, GFP_KERNEL); if (ins->modules == NULL) { cs46xx_dsp_spos_destroy(chip); @@ -277,10 +280,10 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip) return ins; } -void cs46xx_dsp_spos_destroy (cs46xx_t * chip) +void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip) { int i; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert(ins != NULL, return); @@ -298,12 +301,12 @@ void cs46xx_dsp_spos_destroy (cs46xx_t * chip) up(&chip->spos_mutex); } -int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module) +int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - segment_desc_t * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM); - segment_desc_t * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER); - segment_desc_t * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE); + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_segment_desc * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM); + struct dsp_segment_desc * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER); + struct dsp_segment_desc * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE); u32 doffset, dsize; if (ins->nmodules == DSP_MAX_MODULES - 1) { @@ -410,10 +413,11 @@ int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module) return 0; } -symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name, int symbol_type) +struct dsp_symbol_entry * +cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symbol_type) { int i; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) { @@ -435,10 +439,11 @@ symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name, } -static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 address, int symbol_type) +static struct dsp_symbol_entry * +cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type) { int i; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) { @@ -456,10 +461,11 @@ static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 addr } -static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - cs46xx_t *chip = entry->private_data; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = entry->private_data; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i; snd_iprintf(buffer, "SYMBOLS:\n"); @@ -483,10 +489,11 @@ static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info } -static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - cs46xx_t *chip = entry->private_data; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = entry->private_data; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i,j; down(&chip->spos_mutex); @@ -497,7 +504,7 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups); for (j = 0; j < ins->modules[i].nsegments; ++ j) { - segment_desc_t * desc = (ins->modules[i].segments + j); + struct dsp_segment_desc * desc = (ins->modules[i].segments + j); snd_iprintf(buffer, " segment %02x offset %08x size %08x\n", desc->segment_type,desc->offset, desc->size); } @@ -505,11 +512,12 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff up(&chip->spos_mutex); } -static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - cs46xx_t *chip = entry->private_data; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - int i,j,col; + struct snd_cs46xx *chip = entry->private_data; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + int i, j, col; void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; down(&chip->spos_mutex); @@ -532,10 +540,11 @@ static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_bu up(&chip->spos_mutex); } -static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - cs46xx_t *chip = entry->private_data; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_cs46xx *chip = entry->private_data; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i; down(&chip->spos_mutex); @@ -564,13 +573,14 @@ static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t up(&chip->spos_mutex); } -static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - cs46xx_t *chip = entry->private_data; - /*dsp_spos_instance_t * ins = chip->dsp_spos_instance; */ - unsigned int i,col = 0; + struct snd_cs46xx *chip = entry->private_data; + /*struct dsp_spos_instance * ins = chip->dsp_spos_instance; */ + unsigned int i, col = 0; void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; - symbol_entry_t * symbol; + struct dsp_symbol_entry * symbol; for (i = 0;i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32),col ++) { if (col == 4) { @@ -591,9 +601,10 @@ static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_in } } -static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - cs46xx_t *chip = entry->private_data; + struct snd_cs46xx *chip = entry->private_data; int i,col = 0; void __iomem *dst = chip->region.idx[2].remap_addr; @@ -738,10 +749,10 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_ snd_iprintf(buffer,"\n"); } -int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip) +int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip) { - snd_info_entry_t *entry; - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct snd_info_entry *entry; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i; ins->snd_card = card; @@ -852,9 +863,9 @@ int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip) return 0; } -int cs46xx_dsp_proc_done (cs46xx_t *chip) +int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i; if (ins->proc_sym_info_entry) { @@ -903,7 +914,8 @@ int cs46xx_dsp_proc_done (cs46xx_t *chip) } static int debug_tree; -static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, int size) +static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data, + u32 dest, int size) { void __iomem *spdst = chip->region.idx[1].remap_addr + 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 } static int debug_scb; -static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest) +static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest) { void __iomem *spdst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32); @@ -930,7 +942,7 @@ static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest) } } -static int find_free_scb_index (dsp_spos_instance_t * ins) +static int find_free_scb_index (struct dsp_spos_instance * ins) { int index = ins->nscb, i; @@ -944,10 +956,10 @@ static int find_free_scb_index (dsp_spos_instance_t * ins) return index; } -static dsp_scb_descriptor_t * _map_scb (cs46xx_t *chip,char * name,u32 dest) +static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * name, u32 dest) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * desc = NULL; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * desc = NULL; int index; 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) return desc; } -static dsp_task_descriptor_t * _map_task_tree (cs46xx_t *chip,char * name,u32 dest,u32 size) +static struct dsp_task_descriptor * +_map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_task_descriptor_t * desc = NULL; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_task_descriptor * desc = NULL; if (ins->ntask == DSP_MAX_TASK_DESC - 1) { 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 return desc; } -dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest) +struct dsp_scb_descriptor * +cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest) { - dsp_scb_descriptor_t * desc; + struct dsp_scb_descriptor * desc; desc = _map_scb (chip,name,dest); if (desc) { @@ -1015,9 +1029,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * } -static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char * name, u32 * task_data,u32 dest,int size) +static struct dsp_task_descriptor * +cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_data, + u32 dest, int size) { - dsp_task_descriptor_t * desc; + struct dsp_task_descriptor * desc; desc = _map_task_tree (chip,name,dest,size); if (desc) { @@ -1029,31 +1045,31 @@ static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char return desc; } -int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) +int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - symbol_entry_t * fg_task_tree_header_code; - symbol_entry_t * task_tree_header_code; - symbol_entry_t * task_tree_thread; - symbol_entry_t * null_algorithm; - symbol_entry_t * magic_snoop_task; - - dsp_scb_descriptor_t * timing_master_scb; - dsp_scb_descriptor_t * codec_out_scb; - dsp_scb_descriptor_t * codec_in_scb; - dsp_scb_descriptor_t * src_task_scb; - dsp_scb_descriptor_t * master_mix_scb; - dsp_scb_descriptor_t * rear_mix_scb; - dsp_scb_descriptor_t * record_mix_scb; - dsp_scb_descriptor_t * write_back_scb; - dsp_scb_descriptor_t * vari_decimate_scb; - dsp_scb_descriptor_t * rear_codec_out_scb; - dsp_scb_descriptor_t * clfe_codec_out_scb; - dsp_scb_descriptor_t * magic_snoop_scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_symbol_entry * fg_task_tree_header_code; + struct dsp_symbol_entry * task_tree_header_code; + struct dsp_symbol_entry * task_tree_thread; + struct dsp_symbol_entry * null_algorithm; + struct dsp_symbol_entry * magic_snoop_task; + + struct dsp_scb_descriptor * timing_master_scb; + struct dsp_scb_descriptor * codec_out_scb; + struct dsp_scb_descriptor * codec_in_scb; + struct dsp_scb_descriptor * src_task_scb; + struct dsp_scb_descriptor * master_mix_scb; + struct dsp_scb_descriptor * rear_mix_scb; + struct dsp_scb_descriptor * record_mix_scb; + struct dsp_scb_descriptor * write_back_scb; + struct dsp_scb_descriptor * vari_decimate_scb; + struct dsp_scb_descriptor * rear_codec_out_scb; + struct dsp_scb_descriptor * clfe_codec_out_scb; + struct dsp_scb_descriptor * magic_snoop_scb; - int fifo_addr,fifo_span,valid_slots; + int fifo_addr, fifo_span, valid_slots; - static spos_control_block_t sposcb = { + static struct dsp_spos_control_block sposcb = { /* 0 */ HFG_TREE_SCB,HFG_STACK, /* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR, /* 2 */ DSP_SPOS_DC,0, @@ -1106,7 +1122,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) { /* create the null SCB */ - static generic_scb_t null_scb = { + static struct dsp_generic_scb null_scb = { { 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, NULL_SCB_ADDR, NULL_SCB_ADDR, @@ -1128,7 +1144,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) { /* setup foreground task tree */ - static task_tree_control_block_t fg_task_tree_hdr = { + static struct dsp_task_tree_control_block fg_task_tree_hdr = { { FG_TASK_HEADER_ADDR | (DSP_SPOS_DC << 0x10), DSP_SPOS_DC_DC, DSP_SPOS_DC_DC, @@ -1204,7 +1220,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) { /* setup foreground task tree */ - static task_tree_control_block_t bg_task_tree_hdr = { + static struct dsp_task_tree_control_block bg_task_tree_hdr = { { DSP_SPOS_DC_DC, DSP_SPOS_DC_DC, DSP_SPOS_DC_DC, @@ -1313,7 +1329,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) if (!write_back_scb) goto _fail_end; { - static mix2_ostream_spb_t mix2_ostream_spb = { + static struct dsp_mix2_ostream_spb mix2_ostream_spb = { 0x00020000, 0x0000ffff }; @@ -1448,13 +1464,14 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) return -EINVAL; } -static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entry) +static int cs46xx_dsp_async_init (struct snd_cs46xx *chip, + struct dsp_scb_descriptor * fg_entry) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - symbol_entry_t * s16_async_codec_input_task; - symbol_entry_t * spdifo_task; - symbol_entry_t * spdifi_task; - dsp_scb_descriptor_t * spdifi_scb_desc,* spdifo_scb_desc,* async_codec_scb_desc; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_symbol_entry * s16_async_codec_input_task; + struct dsp_symbol_entry * spdifo_task; + struct dsp_symbol_entry * spdifi_task; + struct dsp_scb_descriptor * spdifi_scb_desc, * spdifo_scb_desc, * async_codec_scb_desc; s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE); 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 { /* 0xBC0 */ - spdifoscb_t spdifo_scb = { + struct dsp_spdifoscb spdifo_scb = { /* 0 */ DSP_SPOS_UUUU, { /* 1 */ 0xb0, @@ -1504,7 +1521,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr }; /* 0xBB0 */ - spdifiscb_t spdifi_scb = { + struct dsp_spdifiscb spdifi_scb = { /* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI, /* 1 */ 0, /* 2 */ 0, @@ -1529,7 +1546,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr }; /* 0xBA0 */ - async_codec_input_scb_t async_codec_input_scb = { + struct dsp_async_codec_input_scb async_codec_input_scb = { /* 0 */ DSP_SPOS_UUUU, /* 1 */ 0, /* 2 */ 0, @@ -1620,9 +1637,9 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr } -static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip) +static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; /* set SPDIF output FIFO slot */ snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0); @@ -1641,9 +1658,9 @@ static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip) ins->spdif_status_out &= ~DSP_SPDIF_STATUS_HW_ENABLED; } -int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip) +int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; /* if hw-ctrl already enabled, turn off to reset logic ... */ cs46xx_dsp_disable_spdif_hw (chip); @@ -1664,9 +1681,9 @@ int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip) return 0; } -int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip) +int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; /* turn on amplifier */ chip->active_ctrl(chip, 1); @@ -1724,9 +1741,9 @@ int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip) return 0; } -int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip) +int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert (ins->asynch_rx_scb != NULL, return -EINVAL); snd_assert (ins->spdif_in_src != NULL,return -EINVAL); @@ -1750,9 +1767,9 @@ int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip) return 0; } -int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip) +int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert (ins->pcm_input == NULL,return -EINVAL); snd_assert (ins->ref_snoop_scb != NULL,return -EINVAL); @@ -1765,9 +1782,9 @@ int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip) return 0; } -int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip) +int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert (ins->pcm_input != NULL,return -EINVAL); @@ -1779,9 +1796,9 @@ int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip) return 0; } -int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip) +int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert (ins->adc_input == NULL,return -EINVAL); snd_assert (ins->codec_in_scb != NULL,return -EINVAL); @@ -1794,9 +1811,9 @@ int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip) return 0; } -int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip) +int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert (ins->adc_input != NULL,return -EINVAL); @@ -1808,7 +1825,7 @@ int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip) return 0; } -int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data) +int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data) { u32 temp; int i; @@ -1845,10 +1862,10 @@ int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data) return 0; } -int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right) +int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * scb; down(&chip->spos_mutex); @@ -1874,8 +1891,9 @@ int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right) return 0; } -int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; +int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right) +{ + struct dsp_spos_instance * ins = chip->dsp_spos_instance; down(&chip->spos_mutex); 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 @@ /* this instruction types needs to be reallocated when load code into DSP */ -typedef enum { +enum wide_opcode { WIDE_FOR_BEGIN_LOOP = 0x20, WIDE_FOR_BEGIN_LOOP2, @@ -58,7 +58,7 @@ typedef enum { WIDE_TBEQ_COND_CALL1_ADDR, WIDE_TBEQ_NCOND_GOTOI_ADDR, WIDE_TBEQ_NCOND_CALL1_ADDR, -} wide_opcode_t; +}; /* SAMPLE segment */ #define VARI_DECIMATE_BUF1 0x0000 @@ -186,7 +186,8 @@ typedef enum { #define SP_SPDOUT_CONTROL 0x804D #define SP_SPDOUT_CSUV 0x808E -static inline u8 _wrap_all_bits (u8 val) { +static inline u8 _wrap_all_bits (u8 val) +{ u8 wrapped; /* wrap all 8 bits */ @@ -201,11 +202,10 @@ static inline u8 _wrap_all_bits (u8 val) { ((val & 0x80) >> 7); return wrapped; - } - -static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descriptor_t * scb) +static inline void cs46xx_dsp_spos_update_scb (struct snd_cs46xx * chip, + struct dsp_scb_descriptor * scb) { /* update nextSCB and subListPtr in SCB */ snd_cs46xx_poke(chip, @@ -214,8 +214,10 @@ static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descripto (scb->next_scb_ptr->address)); } -static inline void cs46xx_dsp_scb_set_volume (cs46xx_t * chip,dsp_scb_descriptor_t * scb, - u16 left,u16 right) { +static inline void cs46xx_dsp_scb_set_volume (struct snd_cs46xx * chip, + struct dsp_scb_descriptor * scb, + u16 left, u16 right) +{ unsigned int val = ((0xffff - left) << 16 | (0xffff - right)); 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 @@ #include "cs46xx_lib.h" #include "dsp_spos.h" -typedef struct _proc_scb_info_t { - dsp_scb_descriptor_t * scb_desc; - cs46xx_t *chip; -} proc_scb_info_t; +struct proc_scb_info { + struct dsp_scb_descriptor * scb_desc; + struct snd_cs46xx *chip; +}; -static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol) +static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * symbol) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; int symbol_index = (int)(symbol - ins->symbol_table.symbols); snd_assert(ins->symbol_table.nsymbols > 0,return); @@ -64,12 +64,13 @@ static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol) } -static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - proc_scb_info_t * scb_info = (proc_scb_info_t *)entry->private_data; - dsp_scb_descriptor_t * scb = scb_info->scb_desc; - dsp_spos_instance_t * ins; - cs46xx_t *chip = scb_info->chip; + struct proc_scb_info * scb_info = entry->private_data; + struct dsp_scb_descriptor * scb = scb_info->scb_desc; + struct dsp_spos_instance * ins; + struct snd_cs46xx *chip = scb_info->chip; int j,col; void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; @@ -106,9 +107,9 @@ static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buf up(&chip->spos_mutex); } -static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb) +static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; unsigned long flags; if ( scb->parent_scb_ptr ) { @@ -160,7 +161,8 @@ static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb) } } -static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, int dword_count) +static void _dsp_clear_sample_buffer (struct snd_cs46xx *chip, u32 sample_buffer_addr, + int dword_count) { void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr; int i; @@ -171,9 +173,9 @@ static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, in } } -void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb) +void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; /* check integrety */ snd_assert ( (scb->index >= 0 && @@ -218,10 +220,10 @@ void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb) } -void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb) +void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb) { if (scb->proc_info) { - proc_scb_info_t * scb_info = (proc_scb_info_t *)scb->proc_info->private_data; + struct proc_scb_info * scb_info = scb->proc_info->private_data; snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name); @@ -233,11 +235,12 @@ void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb) } } -void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb) +void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip, + struct dsp_scb_descriptor * scb) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - snd_info_entry_t * entry; - proc_scb_info_t * scb_info; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct snd_info_entry * entry; + struct proc_scb_info * scb_info; /* register to proc */ 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 if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, ins->proc_dsp_dir)) != NULL) { - scb_info = kmalloc(sizeof(proc_scb_info_t), GFP_KERNEL); + scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL); if (!scb_info) { snd_info_free_entry(entry); entry = NULL; @@ -273,14 +276,14 @@ out: } } -static dsp_scb_descriptor_t * -_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, - symbol_entry_t * task_entry, - dsp_scb_descriptor_t * parent_scb, +static struct dsp_scb_descriptor * +_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest, + struct dsp_symbol_entry * task_entry, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * scb; unsigned long flags; @@ -342,13 +345,13 @@ _dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, return scb; } -static dsp_scb_descriptor_t * -cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, - char * task_entry_name, - dsp_scb_descriptor_t * parent_scb, +static struct dsp_scb_descriptor * +cs46xx_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, + u32 dest, char * task_entry_name, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - symbol_entry_t * task_entry; + struct dsp_symbol_entry * task_entry; task_entry = cs46xx_dsp_lookup_symbol (chip,task_entry_name, SYMBOL_CODE); @@ -362,12 +365,12 @@ cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 de parent_scb,scb_child_type); } -dsp_scb_descriptor_t * -cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip) +struct dsp_scb_descriptor * +cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - timing_master_scb_t timing_master_scb = { + struct dsp_timing_master_scb timing_master_scb = { { 0, 0, 0, @@ -396,16 +399,15 @@ cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip) } -dsp_scb_descriptor_t * -cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, - u16 channel_disp,u16 fifo_addr, - u16 child_scb_addr, - u32 dest,dsp_scb_descriptor_t * parent_scb, +struct dsp_scb_descriptor * +cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name, + u16 channel_disp, u16 fifo_addr, u16 child_scb_addr, + u32 dest, struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - codec_output_scb_t codec_out_scb = { + struct dsp_codec_output_scb codec_out_scb = { { 0, 0, 0, @@ -435,16 +437,15 @@ cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, return scb; } -dsp_scb_descriptor_t * -cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, - u16 channel_disp,u16 fifo_addr, - u16 sample_buffer_addr, - u32 dest,dsp_scb_descriptor_t * parent_scb, - int scb_child_type) +struct dsp_scb_descriptor * +cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name, + u16 channel_disp, u16 fifo_addr, u16 sample_buffer_addr, + u32 dest, struct dsp_scb_descriptor * parent_scb, + int scb_child_type) { - dsp_scb_descriptor_t * scb; - codec_input_scb_t codec_input_scb = { + struct dsp_scb_descriptor * scb; + struct dsp_codec_input_scb codec_input_scb = { { 0, 0, 0, @@ -481,17 +482,17 @@ cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, } -static dsp_scb_descriptor_t * -cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name, - u16 sample_buffer_addr,u32 dest, +static struct dsp_scb_descriptor * +cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name, + u16 sample_buffer_addr, u32 dest, int virtual_channel, u32 playback_hw_addr, - dsp_scb_descriptor_t * parent_scb, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * scb; - generic_scb_t pcm_reader_scb = { + struct dsp_generic_scb pcm_reader_scb = { /* 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, #define GOF_PER_SEC 200 -dsp_scb_descriptor_t * -cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, +struct dsp_scb_descriptor * +cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name, int rate, u16 src_buffer_addr, - u16 src_delay_buffer_addr,u32 dest, - dsp_scb_descriptor_t * parent_scb, + u16 src_delay_buffer_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, int scb_child_type, int pass_through) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * scb; unsigned int tmp1, tmp2; unsigned int phiIncr; unsigned int correctionPerGOF, correctionPerSec; @@ -632,7 +633,7 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, correctionPerSec = tmp1; { - src_task_scb_t src_task_scb = { + struct dsp_src_task_scb src_task_scb = { 0x0028,0x00c8, 0x5555,0x0000, 0x0000,0x0000, @@ -688,14 +689,14 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, } #if 0 /* not used */ -dsp_scb_descriptor_t * -cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name, - u16 buffer_addr,u32 dest, - dsp_scb_descriptor_t * parent_scb, +struct dsp_scb_descriptor * +cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name, + u16 buffer_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - filter_scb_t filter_scb = { + struct dsp_filter_scb filter_scb = { .a0_right = 0x41a9, .a0_left = 0x41a9, .a1_right = 0xb8e4, @@ -738,15 +739,15 @@ cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name, } #endif /* not used */ -dsp_scb_descriptor_t * -cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, - u16 mix_buffer_addr,u32 dest, - dsp_scb_descriptor_t * parent_scb, +struct dsp_scb_descriptor * +cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name, + u16 mix_buffer_addr, u32 dest, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - mix_only_scb_t master_mix_scb = { + struct dsp_mix_only_scb master_mix_scb = { /* 0 */ { 0, /* 1 */ 0, /* 2 */ mix_buffer_addr, @@ -778,15 +779,15 @@ cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, } -dsp_scb_descriptor_t * -cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, - u16 mix_buffer_addr,u16 writeback_spb,u32 dest, - dsp_scb_descriptor_t * parent_scb, +struct dsp_scb_descriptor * +cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name, + u16 mix_buffer_addr, u16 writeback_spb, u32 dest, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - mix2_ostream_scb_t mix2_ostream_scb = { + struct dsp_mix2_ostream_scb mix2_ostream_scb = { /* Basic (non scatter/gather) DMA requestor (4 ints) */ { DMA_RQ_C1_SOURCE_MOD64 + @@ -832,18 +833,18 @@ cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, } -dsp_scb_descriptor_t * -cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, +struct dsp_scb_descriptor * +cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name, u16 vari_buffer_addr0, u16 vari_buffer_addr1, u32 dest, - dsp_scb_descriptor_t * parent_scb, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - vari_decimate_scb_t vari_decimate_scb = { + struct dsp_vari_decimate_scb vari_decimate_scb = { 0x0028,0x00c8, 0x5555,0x0000, 0x0000,0x0000, @@ -876,17 +877,17 @@ cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, } -static dsp_scb_descriptor_t * -cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest, - dsp_scb_descriptor_t * input_scb, - dsp_scb_descriptor_t * parent_scb, +static struct dsp_scb_descriptor * +cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest, + struct dsp_scb_descriptor * input_scb, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - pcm_serial_input_scb_t pcm_serial_input_scb = { + struct dsp_pcm_serial_input_scb pcm_serial_input_scb = { { 0, 0, 0, @@ -919,17 +920,17 @@ cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest, } -static dsp_scb_descriptor_t * -cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest, +static struct dsp_scb_descriptor * +cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest, u16 hfg_scb_address, u16 asynch_buffer_address, - dsp_scb_descriptor_t * parent_scb, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - asynch_fg_tx_scb_t asynch_fg_tx_scb = { + struct dsp_asynch_fg_tx_scb asynch_fg_tx_scb = { 0xfc00,0x03ff, /* Prototype sample buffer size of 256 dwords */ 0x0058,0x0028, /* Min Delta 7 dwords == 28 bytes */ /* : 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, } -dsp_scb_descriptor_t * -cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest, +struct dsp_scb_descriptor * +cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest, u16 hfg_scb_address, u16 asynch_buffer_address, - dsp_scb_descriptor_t * parent_scb, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * scb; - asynch_fg_rx_scb_t asynch_fg_rx_scb = { + struct dsp_asynch_fg_rx_scb asynch_fg_rx_scb = { 0xfe00,0x01ff, /* Prototype sample buffer size of 128 dwords */ 0x0064,0x001c, /* Min Delta 7 dwords == 28 bytes */ /* : 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, #if 0 /* not used */ -dsp_scb_descriptor_t * -cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, +struct dsp_scb_descriptor * +cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest, u16 snoop_buffer_address, - dsp_scb_descriptor_t * snoop_scb, - dsp_scb_descriptor_t * parent_scb, + struct dsp_scb_descriptor * snoop_scb, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - output_snoop_scb_t output_snoop_scb = { + struct dsp_output_snoop_scb output_snoop_scb = { { 0, /* not used. Zero */ 0, 0, @@ -1058,14 +1059,14 @@ cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, #endif /* not used */ -dsp_scb_descriptor_t * -cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, - dsp_scb_descriptor_t * parent_scb, +struct dsp_scb_descriptor * +cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest, + struct dsp_scb_descriptor * parent_scb, int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - spio_write_scb_t spio_write_scb = { + struct dsp_spio_write_scb spio_write_scb = { 0,0, /* SPIOWAddress2:SPIOWAddress1; */ 0, /* SPIOWData1; */ 0, /* SPIOWData2; */ @@ -1094,15 +1095,16 @@ cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, return scb; } -dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, - u16 snoop_buffer_address, - dsp_scb_descriptor_t * snoop_scb, - dsp_scb_descriptor_t * parent_scb, - int scb_child_type) +struct dsp_scb_descriptor * +cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest, + u16 snoop_buffer_address, + struct dsp_scb_descriptor * snoop_scb, + struct dsp_scb_descriptor * parent_scb, + int scb_child_type) { - dsp_scb_descriptor_t * scb; + struct dsp_scb_descriptor * scb; - magic_snoop_task_t magic_snoop_scb = { + struct dsp_magic_snoop_task magic_snoop_scb = { /* 0 */ 0, /* i0 */ /* 1 */ 0, /* i1 */ /* 2 */ snoop_buffer_address << 0x10, @@ -1129,10 +1131,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * return scb; } -static dsp_scb_descriptor_t * find_next_free_scb (cs46xx_t * chip,dsp_scb_descriptor_t * from) +static struct dsp_scb_descriptor * +find_next_free_scb (struct snd_cs46xx * chip, struct dsp_scb_descriptor * from) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * scb = from; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * scb = from; while (scb->next_scb_ptr != ins->the_null_scb) { snd_assert (scb->next_scb_ptr != NULL, return NULL); @@ -1212,18 +1215,19 @@ static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = { 0x2B00 }; -pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip, - u32 sample_rate, void * private_data, - u32 hw_dma_addr, - int pcm_channel_id) +struct dsp_pcm_channel_descriptor * +cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, + u32 sample_rate, void * private_data, + u32 hw_dma_addr, + int pcm_channel_id) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * src_scb = NULL,* pcm_scb, * mixer_scb = NULL; - dsp_scb_descriptor_t * src_parent_scb = NULL; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * src_scb = NULL, * pcm_scb, * mixer_scb = NULL; + struct dsp_scb_descriptor * src_parent_scb = NULL; - /* dsp_scb_descriptor_t * pcm_parent_scb; */ + /* struct dsp_scb_descriptor * pcm_parent_scb; */ char scb_name[DSP_MAX_SCB_NAME]; - int i,pcm_index = -1, insert_point, src_index = -1,pass_through = 0; + int i, pcm_index = -1, insert_point, src_index = -1, pass_through = 0; unsigned long flags; switch (pcm_channel_id) { @@ -1371,8 +1375,8 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip, return (ins->pcm_channels + pcm_index); } -int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip, - pcm_channel_descriptor_t * pcm_channel, +int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel, int period_size) { 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, return 0; } -int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip, +int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip, int period_size) { u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2); @@ -1448,9 +1452,10 @@ int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip, return 0; } -void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) +void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; unsigned long flags; snd_assert(pcm_channel->active, return ); @@ -1478,9 +1483,10 @@ void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t * } } -int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) +int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; unsigned long flags; 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 return 0; } -int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) +int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip, + struct dsp_pcm_channel_descriptor * pcm_channel) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * parent_scb; - dsp_scb_descriptor_t * src_scb = pcm_channel->src_scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * parent_scb; + struct dsp_scb_descriptor * src_scb = pcm_channel->src_scb; unsigned long flags; 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) return 0; } -dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source, - u16 addr,char * scb_name) +struct dsp_scb_descriptor * +cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source, + u16 addr, char * scb_name) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * parent; - dsp_scb_descriptor_t * pcm_input; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * parent; + struct dsp_scb_descriptor * pcm_input; int insert_point; 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 return pcm_input; } -int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src) +int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src) { snd_assert (src->parent_scb_ptr != NULL, return -EINVAL ); @@ -1581,10 +1589,10 @@ int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src) return 0; } -int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src) +int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; - dsp_scb_descriptor_t * parent_scb; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + struct dsp_scb_descriptor * parent_scb; snd_assert (src->parent_scb_ptr == NULL, return -EINVAL ); 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) return 0; } -int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip) +int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) { cs46xx_dsp_enable_spdif_hw (chip); @@ -1653,9 +1661,9 @@ int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip) return 0; } -int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip) +int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; /* dont touch anything if SPDIF is open */ if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) { @@ -1685,9 +1693,9 @@ int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip) return 0; } -int cs46xx_iec958_pre_open (cs46xx_t *chip) +int cs46xx_iec958_pre_open (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) { /* remove AsynchFGTxSCB and and PCMSerialInput_II */ @@ -1718,9 +1726,9 @@ int cs46xx_iec958_pre_open (cs46xx_t *chip) return 0; } -int cs46xx_iec958_post_close (cs46xx_t *chip) +int cs46xx_iec958_post_close (struct snd_cs46xx *chip) { - dsp_spos_instance_t * ins = chip->dsp_spos_instance; + struct dsp_spos_instance * ins = chip->dsp_spos_instance; snd_assert (ins->asynch_tx_scb != NULL, return -EINVAL); 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 @@ #ifndef __HEADER_cwc4630_H__ #define __HEADER_cwc4630_H__ -static symbol_entry_t cwc4630_symbols[] = { +static struct dsp_symbol_entry cwc4630_symbols[] = { { 0x0000, "BEGINADDRESS",0x00 }, { 0x8000, "EXECCHILD",0x03 }, { 0x8001, "EXECCHILD_98",0x03 }, @@ -302,12 +302,12 @@ static u32 cwc4630_parameter[] = { }; /* #PARAMETER_END */ -static segment_desc_t cwc4630_segments[] = { +static struct dsp_segment_desc cwc4630_segments[] = { { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000328, cwc4630_code }, { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000080, cwc4630_parameter }, }; -static dsp_module_desc_t cwc4630_module = { +static struct dsp_module_desc cwc4630_module = { "cwc4630", { 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 @@ #ifndef __HEADER_cwcasync_H__ #define __HEADER_cwcasync_H__ -static symbol_entry_t cwcasync_symbols[] = { +static struct dsp_symbol_entry cwcasync_symbols[] = { { 0x8000, "EXECCHILD",0x03 }, { 0x8001, "EXECCHILD_98",0x03 }, { 0x8003, "EXECCHILD_PUSH1IND",0x03 }, @@ -159,11 +159,11 @@ static u32 cwcasync_code[] = { }; /* #CODE_END */ -static segment_desc_t cwcasync_segments[] = { +static struct dsp_segment_desc cwcasync_segments[] = { { SEGTYPE_SP_PROGRAM, 0x00000000, 0x000001b6, cwcasync_code }, }; -static dsp_module_desc_t cwcasync_module = { +static struct dsp_module_desc cwcasync_module = { "cwcasync", { 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 @@ #ifndef __HEADER_cwcbinhack_H__ #define __HEADER_cwcbinhack_H__ -static symbol_entry_t cwcbinhack_symbols[] = { +static struct dsp_symbol_entry cwcbinhack_symbols[] = { { 0x02c8, "OVERLAYBEGINADDRESS",0x00 }, { 0x02c8, "MAGICSNOOPTASK",0x03 }, { 0x0308, "#CODE_END",0x00 }, @@ -31,11 +31,11 @@ static u32 cwcbinhack_code[] = { }; /* #CODE_END */ -static segment_desc_t cwcbinhack_segments[] = { +static struct dsp_segment_desc cwcbinhack_segments[] = { { SEGTYPE_SP_PROGRAM, 0x00000000, 64, cwcbinhack_code }, }; -static dsp_module_desc_t cwcbinhack_module = { +static struct dsp_module_desc cwcbinhack_module = { "cwcbinhack", { 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 @@ #ifndef __HEADER_cwcdma_H__ #define __HEADER_cwcdma_H__ -static symbol_entry_t cwcdma_symbols[] = { +static struct dsp_symbol_entry cwcdma_symbols[] = { { 0x8000, "EXECCHILD",0x03 }, { 0x8001, "EXECCHILD_98",0x03 }, { 0x8003, "EXECCHILD_PUSH1IND",0x03 }, @@ -51,11 +51,11 @@ static u32 cwcdma_code[] = { /* #CODE_END */ -static segment_desc_t cwcdma_segments[] = { +static struct dsp_segment_desc cwcdma_segments[] = { { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000030, cwcdma_code }, }; -static dsp_module_desc_t cwcdma_module = { +static struct dsp_module_desc cwcdma_module = { "cwcdma", { 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 @@ #ifndef __HEADER_cwcemb80_H__ #define __HEADER_cwcemb80_H__ -static symbol_entry_t cwcemb80_symbols[] = { +static struct dsp_symbol_entry cwcemb80_symbols[] = { { 0x0000, "BEGINADDRESS",0x00 }, { 0x8000, "EXECCHILD",0x03 }, { 0x8001, "EXECCHILD_98",0x03 }, @@ -1588,13 +1588,13 @@ static u32 cwcemb80_sample[] = { }; /* #SAMPLE_END */ -static segment_desc_t cwcemb80_segments[] = { +static struct dsp_segment_desc cwcemb80_segments[] = { { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000031c, cwcemb80_code }, { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000697, cwcemb80_parameter }, { SEGTYPE_SP_SAMPLE, 0x00000000, 0x00000e00, cwcemb80_sample }, }; -static dsp_module_desc_t cwcemb80_module = { +static struct dsp_module_desc cwcemb80_module = { "cwcemb80", { 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 @@ #ifndef __HEADER_cwcsnoop_H__ #define __HEADER_cwcsnoop_H__ -static symbol_entry_t cwcsnoop_symbols[] = { +static struct dsp_symbol_entry cwcsnoop_symbols[] = { { 0x0500, "OVERLAYBEGINADDRESS",0x00 }, { 0x0500, "OUTPUTSNOOP",0x03 }, { 0x051f, "#CODE_END",0x00 }, @@ -29,11 +29,11 @@ static u32 cwcsnoop_code[] = { }; /* #CODE_END */ -static segment_desc_t cwcsnoop_segments[] = { +static struct dsp_segment_desc cwcsnoop_segments[] = { { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000003e, cwcsnoop_code }, }; -static dsp_module_desc_t cwcsnoop_module = { +static struct dsp_module_desc cwcsnoop_module = { "cwcsnoop", { 3, |