/[openvortex]/alsa/pci/au88x0/au88x0.c
ViewVC logotype

Diff of /alsa/pci/au88x0/au88x0.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mjander, Fri Apr 18 23:47:50 2003 UTC revision 1.3 by vizard, Tue Apr 22 02:52:03 2003 UTC
# Line 1  Line 1 
1  /*  /*
2   * ALSA driver for the Aureal Vortex family of soundprocessors.   * ALSA driver for the Aureal Vortex family of soundprocessors.
3   * Author: Manuel Jander (mjander@embedded.cl)   * Author: Manuel Jander (mjander@embedded.cl)
4   *   *
5   *   This driver is the result of the OpenVortex Project from Savannah   *   This driver is the result of the OpenVortex Project from Savannah
6   * (savannah.nongnu.org/projects/openvortex). I would like to thank   * (savannah.nongnu.org/projects/openvortex). I would like to thank
7   * the developers of OpenVortex, Jeff Muizelar and Kester Maddock, from   * the developers of OpenVortex, Jeff Muizelar and Kester Maddock, from
# Line 13  Line 13 
13   *   *
14   * Now at least i can play Legacy DOOM with MIDI music :-)   * Now at least i can play Legacy DOOM with MIDI music :-)
15   */   */
16    
17  #include "au88x0.h"  #include "au88x0.h"
18  #include <linux/init.h>  #include <linux/init.h>
19  #include <linux/pci.h>  #include <linux/pci.h>
# Line 21  Line 21 
21  #define SNDRV_GET_ID  #define SNDRV_GET_ID
22  #include <sound/initval.h>  #include <sound/initval.h>
23    
   
24  // module parameters (see "Module Parameters")  // module parameters (see "Module Parameters")
25  static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;  static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
26  static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;  static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
# Line 61  __setup("snd-au88x0=", alsa_card_vortex_ Line 60  __setup("snd-au88x0=", alsa_card_vortex_
60    
61  MODULE_DEVICE_TABLE(pci, snd_vortex_ids);  MODULE_DEVICE_TABLE(pci, snd_vortex_ids);
62    
63    
64  // chip-specific destructor  // chip-specific destructor
65  // (see "PCI Resource Managements")  // (see "PCI Resource Managements")
66  static int snd_vortex_free(vortex_t * vortex) {  static int snd_vortex_free(vortex_t * vortex) {
67        
68      vortex_gameport_unregister(vortex);      vortex_gameport_unregister(vortex);
69      vortex_core_shutdown(vortex);      vortex_core_shutdown(vortex);
70      // Take down PCI interface.      // Take down PCI interface.
# Line 97  snd_vortex_create(snd_card_t * card, str Line 97  snd_vortex_create(snd_card_t * card, str
97    
98      *rchip = NULL;      *rchip = NULL;
99    
100      // check PCI availability (DMA).        // check PCI availability (DMA).
101      if ((err = pci_enable_device(pci)) < 0)      if ((err = pci_enable_device(pci)) < 0)
102          return err;          return err;
103      if (!pci_dma_supported(pci, VORTEX_DMA_MASK)) {      if (!pci_dma_supported(pci, VORTEX_DMA_MASK)) {
# Line 145  snd_vortex_create(snd_card_t * card, str Line 145  snd_vortex_create(snd_card_t * card, str
145          return -EBUSY;          return -EBUSY;
146      }      }
147      chip->port0 = request_region(pci_resource_start(pci, 1), 8, CARD_NAME_SHORT);      chip->port0 = request_region(pci_resource_start(pci, 1), 8, CARD_NAME_SHORT);
148        
149      if (check_region(pci_resource_start(pci, 2), 8)) {      if (check_region(pci_resource_start(pci, 2), 8)) {
150          snd_vortex_free(chip);          snd_vortex_free(chip);
151          printk(KERN_ERR "cannot allocate the I/O port1.\n");          printk(KERN_ERR "cannot allocate the I/O port1.\n");
152          return -EBUSY;          return -EBUSY;
153      }      }
154      chip->port1 = request_region(pci_resource_start(pci, 2), 8, CARD_NAME_SHORT);      chip->port1 = request_region(pci_resource_start(pci, 2), 8, CARD_NAME_SHORT);
155        
156      if (request_irq(pci->irq, vortex_interrupt, SA_INTERRUPT | SA_SHIRQ,      if (request_irq(pci->irq, vortex_interrupt, SA_INTERRUPT | SA_SHIRQ,
157                      CARD_NAME_SHORT, (void *) chip)) {                      CARD_NAME_SHORT, (void *) chip)) {
158          snd_vortex_free(chip);          snd_vortex_free(chip);
159          printk(KERN_ERR "cannot grab irq\n");          printk(KERN_ERR "cannot grab irq\n");
# Line 216  snd_vortex_probe(struct pci_dev *pci, co Line 216  snd_vortex_probe(struct pci_dev *pci, co
216      if ((err = snd_vortex_mixer(chip)) < 0) {      if ((err = snd_vortex_mixer(chip)) < 0) {
217          snd_card_free(card);          snd_card_free(card);
218          return err;          return err;
219      }          }
220      if ((err = snd_vortex_midi(chip)) < 0) {      if ((err = snd_vortex_midi(chip)) < 0) {
221          snd_card_free(card);          snd_card_free(card);
222          return err;          return err;
# Line 263  snd_vortex_probe(struct pci_dev *pci, co Line 263  snd_vortex_probe(struct pci_dev *pci, co
263  static void __devexit snd_vortex_remove(struct pci_dev *pci) {  static void __devexit snd_vortex_remove(struct pci_dev *pci) {
264      vortex_t *vortex = snd_magic_cast(vortex_t,      vortex_t *vortex = snd_magic_cast(vortex_t,
265                                        pci_get_drvdata(pci), return);                                        pci_get_drvdata(pci), return);
266        
267      if (vortex) {      if (vortex) {
268          // Release ALSA stuff.          // Release ALSA stuff.
269          snd_card_free(vortex->card);          snd_card_free(vortex->card);
270          // Free Vortex struct.          // Free Vortex struct.
271          pci_set_drvdata(pci, NULL);          pci_set_drvdata(pci, NULL);
272      } else      } else
273          printk("snd_vortex_remove called more than one time!\n");          printk("snd_vortex_remove called more than one time!\n");
# Line 302  static void __exit alsa_card_vortex_exit Line 302  static void __exit alsa_card_vortex_exit
302  module_init(alsa_card_vortex_init)  module_init(alsa_card_vortex_init)
303  module_exit(alsa_card_vortex_exit)  module_exit(alsa_card_vortex_exit)
304    
305  // for old kernels only  // for old kernels only
306  EXPORT_NO_SYMBOLS;  EXPORT_NO_SYMBOLS;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26