aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/trident/trident_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/trident/trident_main.c')
-rw-r--r--sound/pci/trident/trident_main.c71
1 files changed, 21 insertions, 50 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index a235e034a690..71138ff9b310 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -27,7 +27,6 @@
27 * SiS7018 S/PDIF support by Thomas Winischhofer <thomas@winischhofer.net> 27 * SiS7018 S/PDIF support by Thomas Winischhofer <thomas@winischhofer.net>
28 */ 28 */
29 29
30#include <sound/driver.h>
31#include <linux/delay.h> 30#include <linux/delay.h>
32#include <linux/init.h> 31#include <linux/init.h>
33#include <linux/interrupt.h> 32#include <linux/interrupt.h>
@@ -436,7 +435,7 @@ static void snd_trident_free_synth_channel(struct snd_trident *trident, int chan
436 Description: This routine will complete and write the 5 hardware channel 435 Description: This routine will complete and write the 5 hardware channel
437 registers to hardware. 436 registers to hardware.
438 437
439 Paramters: trident - pointer to target device class for 4DWave. 438 Parameters: trident - pointer to target device class for 4DWave.
440 voice - synthesizer voice structure 439 voice - synthesizer voice structure
441 Each register field. 440 Each register field.
442 441
@@ -514,7 +513,7 @@ EXPORT_SYMBOL(snd_trident_write_voice_regs);
514 Description: This routine will write the new CSO offset 513 Description: This routine will write the new CSO offset
515 register to hardware. 514 register to hardware.
516 515
517 Paramters: trident - pointer to target device class for 4DWave. 516 Parameters: trident - pointer to target device class for 4DWave.
518 voice - synthesizer voice structure 517 voice - synthesizer voice structure
519 CSO - new CSO value 518 CSO - new CSO value
520 519
@@ -540,7 +539,7 @@ static void snd_trident_write_cso_reg(struct snd_trident * trident,
540 Description: This routine will write the new ESO offset 539 Description: This routine will write the new ESO offset
541 register to hardware. 540 register to hardware.
542 541
543 Paramters: trident - pointer to target device class for 4DWave. 542 Parameters: trident - pointer to target device class for 4DWave.
544 voice - synthesizer voice structure 543 voice - synthesizer voice structure
545 ESO - new ESO value 544 ESO - new ESO value
546 545
@@ -566,7 +565,7 @@ static void snd_trident_write_eso_reg(struct snd_trident * trident,
566 Description: This routine will write the new voice volume 565 Description: This routine will write the new voice volume
567 register to hardware. 566 register to hardware.
568 567
569 Paramters: trident - pointer to target device class for 4DWave. 568 Parameters: trident - pointer to target device class for 4DWave.
570 voice - synthesizer voice structure 569 voice - synthesizer voice structure
571 Vol - new voice volume 570 Vol - new voice volume
572 571
@@ -597,7 +596,7 @@ static void snd_trident_write_vol_reg(struct snd_trident * trident,
597 Description: This routine will write the new voice pan 596 Description: This routine will write the new voice pan
598 register to hardware. 597 register to hardware.
599 598
600 Paramters: trident - pointer to target device class for 4DWave. 599 Parameters: trident - pointer to target device class for 4DWave.
601 voice - synthesizer voice structure 600 voice - synthesizer voice structure
602 Pan - new pan value 601 Pan - new pan value
603 602
@@ -619,7 +618,7 @@ static void snd_trident_write_pan_reg(struct snd_trident * trident,
619 Description: This routine will write the new reverb volume 618 Description: This routine will write the new reverb volume
620 register to hardware. 619 register to hardware.
621 620
622 Paramters: trident - pointer to target device class for 4DWave. 621 Parameters: trident - pointer to target device class for 4DWave.
623 voice - synthesizer voice structure 622 voice - synthesizer voice structure
624 RVol - new reverb volume 623 RVol - new reverb volume
625 624
@@ -643,7 +642,7 @@ static void snd_trident_write_rvol_reg(struct snd_trident * trident,
643 Description: This routine will write the new chorus volume 642 Description: This routine will write the new chorus volume
644 register to hardware. 643 register to hardware.
645 644
646 Paramters: trident - pointer to target device class for 4DWave. 645 Parameters: trident - pointer to target device class for 4DWave.
647 voice - synthesizer voice structure 646 voice - synthesizer voice structure
648 CVol - new chorus volume 647 CVol - new chorus volume
649 648
@@ -666,7 +665,7 @@ static void snd_trident_write_cvol_reg(struct snd_trident * trident,
666 665
667 Description: This routine converts rate in HZ to hardware delta value. 666 Description: This routine converts rate in HZ to hardware delta value.
668 667
669 Paramters: trident - pointer to target device class for 4DWave. 668 Parameters: trident - pointer to target device class for 4DWave.
670 rate - Real or Virtual channel number. 669 rate - Real or Virtual channel number.
671 670
672 Returns: Delta value. 671 Returns: Delta value.
@@ -696,7 +695,7 @@ static unsigned int snd_trident_convert_rate(unsigned int rate)
696 695
697 Description: This routine converts rate in HZ to hardware delta value. 696 Description: This routine converts rate in HZ to hardware delta value.
698 697
699 Paramters: trident - pointer to target device class for 4DWave. 698 Parameters: trident - pointer to target device class for 4DWave.
700 rate - Real or Virtual channel number. 699 rate - Real or Virtual channel number.
701 700
702 Returns: Delta value. 701 Returns: Delta value.
@@ -726,7 +725,7 @@ static unsigned int snd_trident_convert_adc_rate(unsigned int rate)
726 725
727 Description: This routine converts rate in HZ to spurious threshold. 726 Description: This routine converts rate in HZ to spurious threshold.
728 727
729 Paramters: trident - pointer to target device class for 4DWave. 728 Parameters: trident - pointer to target device class for 4DWave.
730 rate - Real or Virtual channel number. 729 rate - Real or Virtual channel number.
731 730
732 Returns: Delta value. 731 Returns: Delta value.
@@ -748,7 +747,7 @@ static unsigned int snd_trident_spurious_threshold(unsigned int rate,
748 747
749 Description: This routine returns a control mode for a PCM channel. 748 Description: This routine returns a control mode for a PCM channel.
750 749
751 Paramters: trident - pointer to target device class for 4DWave. 750 Parameters: trident - pointer to target device class for 4DWave.
752 substream - PCM substream 751 substream - PCM substream
753 752
754 Returns: Control value. 753 Returns: Control value.
@@ -781,7 +780,7 @@ static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream
781 780
782 Description: Device I/O control handler for playback/capture parameters. 781 Description: Device I/O control handler for playback/capture parameters.
783 782
784 Paramters: substream - PCM substream class 783 Parameters: substream - PCM substream class
785 cmd - what ioctl message to process 784 cmd - what ioctl message to process
786 arg - additional message infoarg 785 arg - additional message infoarg
787 786
@@ -1664,7 +1663,7 @@ static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *
1664 1663
1665 Description: This routine return the capture position 1664 Description: This routine return the capture position
1666 1665
1667 Paramters: pcm1 - PCM device class 1666 Parameters: pcm1 - PCM device class
1668 1667
1669 Returns: position of buffer 1668 Returns: position of buffer
1670 1669
@@ -2157,7 +2156,7 @@ static struct snd_pcm_ops snd_trident_spdif_7018_ops = {
2157 2156
2158 Description: This routine registers the 4DWave device for PCM support. 2157 Description: This routine registers the 4DWave device for PCM support.
2159 2158
2160 Paramters: trident - pointer to target device class for 4DWave. 2159 Parameters: trident - pointer to target device class for 4DWave.
2161 2160
2162 Returns: None 2161 Returns: None
2163 2162
@@ -2215,7 +2214,7 @@ int __devinit snd_trident_pcm(struct snd_trident * trident,
2215 2214
2216 Description: This routine registers the 4DWave device for foldback PCM support. 2215 Description: This routine registers the 4DWave device for foldback PCM support.
2217 2216
2218 Paramters: trident - pointer to target device class for 4DWave. 2217 Parameters: trident - pointer to target device class for 4DWave.
2219 2218
2220 Returns: None 2219 Returns: None
2221 2220
@@ -2272,7 +2271,7 @@ int __devinit snd_trident_foldback_pcm(struct snd_trident * trident,
2272 2271
2273 Description: This routine registers the 4DWave-NX device for SPDIF support. 2272 Description: This routine registers the 4DWave-NX device for SPDIF support.
2274 2273
2275 Paramters: trident - pointer to target device class for 4DWave-NX. 2274 Parameters: trident - pointer to target device class for 4DWave-NX.
2276 2275
2277 Returns: None 2276 Returns: None
2278 2277
@@ -2956,7 +2955,7 @@ static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_tr
2956 2955
2957 Description: This routine registers the 4DWave device for mixer support. 2956 Description: This routine registers the 4DWave device for mixer support.
2958 2957
2959 Paramters: trident - pointer to target device class for 4DWave. 2958 Parameters: trident - pointer to target device class for 4DWave.
2960 2959
2961 Returns: None 2960 Returns: None
2962 2961
@@ -3313,12 +3312,6 @@ static void snd_trident_proc_read(struct snd_info_entry *entry,
3313 snd_iprintf(buffer, "Memory Free : %d\n", snd_util_mem_avail(trident->tlb.memhdr)); 3312 snd_iprintf(buffer, "Memory Free : %d\n", snd_util_mem_avail(trident->tlb.memhdr));
3314 } 3313 }
3315 } 3314 }
3316#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
3317 snd_iprintf(buffer,"\nWavetable Synth\n");
3318 snd_iprintf(buffer, "Memory Maximum : %d\n", trident->synth.max_size);
3319 snd_iprintf(buffer, "Memory Used : %d\n", trident->synth.current_size);
3320 snd_iprintf(buffer, "Memory Free : %d\n", (trident->synth.max_size-trident->synth.current_size));
3321#endif
3322} 3315}
3323 3316
3324static void __devinit snd_trident_proc_init(struct snd_trident * trident) 3317static void __devinit snd_trident_proc_init(struct snd_trident * trident)
@@ -3344,7 +3337,7 @@ static int snd_trident_dev_free(struct snd_device *device)
3344 Description: Allocate and set up the TLB page table on 4D NX. 3337 Description: Allocate and set up the TLB page table on 4D NX.
3345 Each entry has 4 bytes (physical PCI address). 3338 Each entry has 4 bytes (physical PCI address).
3346 3339
3347 Paramters: trident - pointer to target device class for 4DWave. 3340 Parameters: trident - pointer to target device class for 4DWave.
3348 3341
3349 Returns: 0 or negative error code 3342 Returns: 0 or negative error code
3350 3343
@@ -3521,7 +3514,7 @@ static int snd_trident_sis_init(struct snd_trident *trident)
3521 Description: This routine will create the device specific class for 3514 Description: This routine will create the device specific class for
3522 the 4DWave card. It will also perform basic initialization. 3515 the 4DWave card. It will also perform basic initialization.
3523 3516
3524 Paramters: card - which card to create 3517 Parameters: card - which card to create
3525 pci - interface to PCI bus resource info 3518 pci - interface to PCI bus resource info
3526 dma1ptr - playback dma buffer 3519 dma1ptr - playback dma buffer
3527 dma2ptr - capture dma buffer 3520 dma2ptr - capture dma buffer
@@ -3667,7 +3660,7 @@ int __devinit snd_trident_create(struct snd_card *card,
3667 Description: This routine will free the device specific class for 3660 Description: This routine will free the device specific class for
3668 the 4DWave card. 3661 the 4DWave card.
3669 3662
3670 Paramters: trident - device specific private data for 4DWave card 3663 Parameters: trident - device specific private data for 4DWave card
3671 3664
3672 Returns: None. 3665 Returns: None.
3673 3666
@@ -3705,7 +3698,7 @@ static int snd_trident_free(struct snd_trident *trident)
3705 3698
3706 Description: ISR for Trident 4DWave device 3699 Description: ISR for Trident 4DWave device
3707 3700
3708 Paramters: trident - device specific private data for 4DWave card 3701 Parameters: trident - device specific private data for 4DWave card
3709 3702
3710 Problems: It seems that Trident chips generates interrupts more than 3703 Problems: It seems that Trident chips generates interrupts more than
3711 one time in special cases. The spurious interrupts are 3704 one time in special cases. The spurious interrupts are
@@ -3815,28 +3808,6 @@ static irqreturn_t snd_trident_interrupt(int irq, void *dev_id)
3815 return IRQ_HANDLED; 3808 return IRQ_HANDLED;
3816} 3809}
3817 3810
3818/*---------------------------------------------------------------------------
3819 snd_trident_attach_synthesizer
3820
3821 Description: Attach synthesizer hooks
3822
3823 Paramters: trident - device specific private data for 4DWave card
3824
3825 Returns: None.
3826
3827 ---------------------------------------------------------------------------*/
3828int snd_trident_attach_synthesizer(struct snd_trident *trident)
3829{
3830#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
3831 if (snd_seq_device_new(trident->card, 1, SNDRV_SEQ_DEV_ID_TRIDENT,
3832 sizeof(struct snd_trident *), &trident->seq_dev) >= 0) {
3833 strcpy(trident->seq_dev->name, "4DWave");
3834 *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(trident->seq_dev) = trident;
3835 }
3836#endif
3837 return 0;
3838}
3839
3840struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, int client, int port) 3811struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, int client, int port)
3841{ 3812{
3842 struct snd_trident_voice *pvoice; 3813 struct snd_trident_voice *pvoice;