#endif
static int snd_trident_sis_reset(trident_t *trident);
+static void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max);
+static int snd_trident_free(trident_t *trident);
+
/*
* common I/O routines
*/
Returns: Delta value.
---------------------------------------------------------------------------*/
-unsigned int snd_trident_convert_rate(unsigned int rate)
+static unsigned int snd_trident_convert_rate(unsigned int rate)
{
unsigned int delta;
Returns: Delta value.
---------------------------------------------------------------------------*/
-unsigned int snd_trident_spurious_threshold(unsigned int rate, unsigned int period_size)
+static unsigned int snd_trident_spurious_threshold(unsigned int rate, unsigned int period_size)
{
unsigned int res = (rate * period_size) / 48000;
if (res < 64)
Returns: Control value.
---------------------------------------------------------------------------*/
-unsigned int snd_trident_control_mode(snd_pcm_substream_t *substream)
+static unsigned int snd_trident_control_mode(snd_pcm_substream_t *substream)
{
unsigned int CTRL;
snd_pcm_runtime_t *runtime = substream->runtime;
---------------------------------------------------------------------------*/
-int snd_trident_allocate_pcm_mem(snd_pcm_substream_t * substream,
- snd_pcm_hw_params_t * hw_params)
+static int snd_trident_allocate_pcm_mem(snd_pcm_substream_t * substream,
+ snd_pcm_hw_params_t * hw_params)
{
trident_t *trident = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
---------------------------------------------------------------------------*/
-int snd_trident_allocate_evoice(snd_pcm_substream_t * substream,
- snd_pcm_hw_params_t * hw_params)
+static int snd_trident_allocate_evoice(snd_pcm_substream_t * substream,
+ snd_pcm_hw_params_t * hw_params)
{
trident_t *trident = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
if (pci_set_dma_mask(pci, 0x3fffffff) < 0 ||
pci_set_consistent_dma_mask(pci, 0x3fffffff) < 0) {
snd_printk("architecture does not support 30bit PCI busmaster DMA\n");
+ pci_disable_device(pci);
return -ENXIO;
}
trident = kcalloc(1, sizeof(*trident), GFP_KERNEL);
- if (trident == NULL)
+ if (trident == NULL) {
+ pci_disable_device(pci);
return -ENOMEM;
+ }
trident->device = (pci->vendor << 16) | pci->device;
trident->card = card;
trident->pci = pci;
if ((err = pci_request_regions(pci, "Trident Audio")) < 0) {
kfree(trident);
+ pci_disable_device(pci);
return err;
}
trident->port = pci_resource_start(pci, 0);
return err;
}
- if ((err = snd_trident_mixer(trident, pcm_spdif_device)) < 0) {
+ if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops)) < 0) {
snd_trident_free(trident);
return err;
}
+
+ if ((err = snd_trident_mixer(trident, pcm_spdif_device)) < 0)
+ return err;
/* initialise synth voices */
for (i = 0; i < 64; i++) {
snd_card_set_pm_callback(card, snd_trident_suspend, snd_trident_resume, trident);
-
snd_trident_proc_init(trident);
- if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops)) < 0) {
- snd_trident_free(trident);
- return err;
- }
snd_card_set_dev(card, &pci->dev);
*rtrident = trident;
return 0;
snd_trident_free
Description: This routine will free the device specific class for
- q the 4DWave card.
+ the 4DWave card.
Paramters: trident - device specific private data for 4DWave card
---------------------------------------------------------------------------*/
-int snd_trident_free(trident_t *trident)
+static int snd_trident_free(trident_t *trident)
{
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
if (trident->gameport) {
snd_util_memhdr_free(trident->tlb.memhdr);
if (trident->tlb.silent_page.area)
snd_dma_free_pages(&trident->tlb.silent_page);
- if (trident->tlb.shadow_entries)
- vfree(trident->tlb.shadow_entries);
+ vfree(trident->tlb.shadow_entries);
snd_dma_free_pages(&trident->tlb.buffer);
}
if (trident->irq >= 0)
free_irq(trident->irq, (void *)trident);
pci_release_regions(trident->pci);
+ pci_disable_device(trident->pci);
kfree(trident);
return 0;
}
}
/*---------------------------------------------------------------------------
- snd_trident_attach_synthesizer, snd_trident_detach_synthesizer
+ snd_trident_attach_synthesizer
- Description: Attach/detach synthesizer hooks
+ Description: Attach synthesizer hooks
Paramters: trident - device specific private data for 4DWave card
return 0;
}
-int snd_trident_detach_synthesizer(trident_t *trident)
-{
-#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
- if (trident->seq_dev) {
- snd_device_free(trident->card, trident->seq_dev);
- trident->seq_dev = NULL;
- }
-#endif
- return 0;
-}
-
snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port)
{
snd_trident_voice_t *pvoice;
private_free(voice);
}
-void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max)
+static void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max)
{
unsigned int i, val, mask[2] = { 0, 0 };
case TRIDENT_DEVICE_ID_SI7018:
break;
}
- snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+ pci_disable_device(trident->pci);
return 0;
}
snd_trident_enable_eso(trident);
- snd_power_change_state(card, SNDRV_CTL_POWER_D0);
trident->in_suspend = 0;
return 0;
}
EXPORT_SYMBOL(snd_trident_start_voice);
EXPORT_SYMBOL(snd_trident_stop_voice);
EXPORT_SYMBOL(snd_trident_write_voice_regs);
-EXPORT_SYMBOL(snd_trident_clear_voices);
/* trident_memory.c symbols */
EXPORT_SYMBOL(snd_trident_synth_alloc);
EXPORT_SYMBOL(snd_trident_synth_free);
-EXPORT_SYMBOL(snd_trident_synth_bzero);
EXPORT_SYMBOL(snd_trident_synth_copy_from_user);