/[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.19 by mjander, Mon Sep 22 03:51:28 2003 UTC revision 1.20 by mjander, Sun Oct 26 04:48:53 2003 UTC
# Line 26  Line 26 
26  static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;  static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
27  static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;  static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
28  static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;  static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
29    static int pcifix[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 255 };
30    
31  MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");  MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
32  MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");  MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
# Line 36  MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC); Line 37  MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
37  MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");  MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
38  MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");  MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
39  MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);  MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
40    MODULE_PARM(pcifix, "1-255i");
41    MODULE_PARM_DESC(pcifix, "Enable VIA-workaround for " CARD_NAME " soundcard.");
42    MODULE_PARM_SYNTAX(pcifix, SNDRV_ENABLED ",allows:{{0,Disabled},{1,Latency},{2,Bridge},{3,Both},{255,Auto}},default:4,dialog:check");
43    
44  MODULE_DESCRIPTION("Aureal vortex");  MODULE_DESCRIPTION("Aureal vortex");
45  MODULE_CLASSES("{sound}");  MODULE_CLASSES("{sound}");
# Line 61  __setup("snd-au88x0=", alsa_card_vortex_ Line 65  __setup("snd-au88x0=", alsa_card_vortex_
65    
66  MODULE_DEVICE_TABLE(pci, snd_vortex_ids);  MODULE_DEVICE_TABLE(pci, snd_vortex_ids);
67    
68    static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix) {
69            struct pci_dev *via=NULL;
70                    /* autodetect if workarounds are required */
71            while( (via = pci_find_device(PCI_VENDOR_ID_VIA,
72                                    PCI_DEVICE_ID_VIA_8365_1, via)) ) {
73                    if(fix == 255) {
74                            printk(KERN_INFO CARD_NAME
75                                    ": detected VIA KT133/KM133. activating workaround...\n");
76                            fix = 3; // do latency and via bridge workaround
77                    }
78                    break;
79            }
80            
81            int rc;
82    
83                    /* fix vortex latency */
84            if(fix & 0x01) {
85                    if( !(rc = pci_write_config_byte(vortex, 0x40, 0xff)) ) {
86                            printk(KERN_INFO CARD_NAME
87                                            ": vortex latency is 0xff\n");
88                    }
89                    else {
90                            printk(KERN_WARNING CARD_NAME ": could not set vortex latency: pci error 0x%x\n", rc);
91                    }
92            }
93    
94                    /* fix via agp bridge */
95            if(via && (fix & 0x02)) {
96                    u8 value;
97    
98                            /*
99                             * only set the bit (Extend PCI#2 Internal Master for
100                             * Efficient Handling of Dummy Requests) if the can
101                             * read the config and it is not already set
102                             */
103    
104                    if( !(rc = pci_read_config_byte(via, 0x42, &value)) && (
105                            (value & 0x10) ||
106                            !(rc=pci_write_config_byte(via, 0x42, value|0x10)) ) ) {
107    
108                            printk(KERN_INFO CARD_NAME
109                                            ": bridge config is 0x%x\n",
110                                            value|0x10);
111                    }
112                    else {
113                            printk(KERN_WARNING CARD_NAME ": could not set vortex latency: pci error 0x%x\n", rc);
114                    }
115            }
116    }
117    
118    
119  // component-destructor  // component-destructor
120  // (see "Management of Cards and Components")  // (see "Management of Cards and Components")
# Line 198  snd_vortex_probe(struct pci_dev *pci, co Line 252  snd_vortex_probe(struct pci_dev *pci, co
252          snd_card_free(card);          snd_card_free(card);
253          return err;          return err;
254      }      }
255        snd_vortex_workaround(pci, pcifix[dev]);
256      // (4) Alloc components.      // (4) Alloc components.
257      // ADB pcm.      // ADB pcm.
258      if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {      if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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