]> git.hungrycats.org Git - linux/commitdiff
ALSA CVS update - Takashi Iwai <tiwai@suse.de>
authorJaroslav Kysela <perex@suse.cz>
Thu, 18 Mar 2004 12:16:42 +0000 (13:16 +0100)
committerJaroslav Kysela <perex@suse.cz>
Thu, 18 Mar 2004 12:16:42 +0000 (13:16 +0100)
au88x0 driver
Manuel Jander <mjander@elo.utfsm.cl>:
clean up and small bugfixes, the routing code fix for multiple streams.

sound/pci/au88x0/au8810.h
sound/pci/au88x0/au8820.h
sound/pci/au88x0/au8830.h
sound/pci/au88x0/au88x0.c
sound/pci/au88x0/au88x0.h
sound/pci/au88x0/au88x0_core.c
sound/pci/au88x0/au88x0_pcm.c

index 42a60938712182ceb1315db31db01e21e43b99e2..e75300845758f2d5a04bb709eb5744aed8283c18 100644 (file)
@@ -7,16 +7,6 @@
 #define CARD_NAME "Aureal Advantage 3D Sound Processor"
 #define CARD_NAME_SHORT "au8810"
 
-#ifndef PCI_VENDOR_ID_AUREAL
-#define PCI_VENDOR_ID_AUREAL 0x12eb
-#endif
-#ifndef PCI_VENDOR_ID_AUREAL_ADVANTAGE
-#define PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003
-#endif
-
-#define hwread(x,y) readl((x)+((y)>>2))
-#define hwwrite(x,y,z) writel((z),(x)+((y)>>2))
-
 #define NR_ADB         0x20
 #define NR_WT          0x00
 #define NR_SRC         0x10
index a15b0fe36fe2b0d5c33da38a46b8d0850580a7aa..bd7d76c6a65ede0c683dc67c2704e497ba7ffa4e 100644 (file)
 #define CARD_NAME "Aureal Vortex 3D Sound Processor"
 #define CARD_NAME_SHORT "au8820"
 
-#ifndef PCI_VENDOR_ID_AUREAL
-#define PCI_VENDOR_ID_AUREAL 0x12eb
-#endif
-
-#ifndef PCI_VENDOR_ID_AUREAL_VORTEX
-#define PCI_DEVICE_ID_AUREAL_VORTEX 0x0001
-#endif
-
 /* Number of ADB and WT channels */
 #define NR_ADB         0x10
 #define NR_WT          0x20
index b1293475e0eb3331fd615f440d0198e564f6e46f..293df0650c342d5e1c9db3b0c05655acd45015f6 100644 (file)
 #define CARD_NAME "Aureal Vortex 2 3D Sound Processor"
 #define CARD_NAME_SHORT "au8830"
 
-#ifndef PCI_VENDOR_ID_AUREAL
-#define PCI_VENDOR_ID_AUREAL 0x12eb
-#endif
-#ifndef PCI_VENDOR_ID_AUREAL_VORTEX2
-#define PCI_DEVICE_ID_AUREAL_VORTEX2 0x0002
-#endif
-
-#define hwread(x,y) readl((x)+((y)>>2))
-#define hwwrite(x,y,z) writel((z),(x)+((y)>>2))
-
 #define NR_ADB 0x20
 #define NR_SRC 0x10
 #define NR_A3D 0x10
index 6c917f6930199b95ed116fc83c90d11bfdb96612..f8bf476860de75923bdb4aa875258ff8ae1eaedf 100644 (file)
@@ -336,28 +336,34 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
        sprintf(card->longname, "%s at 0x%lx irq %i",
                card->shortname, chip->io, chip->irq);
 
+       if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
+                                 &(chip->device))) < 0) {
+               snd_card_free(card);
+               return err;
+       }       
+       if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,
+                                 &(chip->vendor))) < 0) {
+               snd_card_free(card);
+               return err;
+       }
+       if ((err = pci_read_config_byte(pci, PCI_REVISION_ID,
+                                 &(chip->rev))) < 0) {
+               snd_card_free(card);
+               return err;
+       }
 #ifdef CHIP_AU8830
-       {
-               unsigned char revision;
-               if ((err =
-                    pci_read_config_byte(pci, PCI_REVISION_ID,
-                                         &revision)) < 0) {
-                       snd_card_free(card);
-                       return err;
-               }
-
-               if (revision != 0xfe && revision != 0xfa) {
-                       printk(KERN_ALERT
-                              "vortex: The revision (%x) of your card has not been seen before.\n",
-                              revision);
-                       printk(KERN_ALERT
-                              "vortex: Please email the results of 'lspci -vv' to openvortex-dev@nongnu.org.\n");
-                       snd_card_free(card);
-                       err = -ENODEV;
-                       return err;
-               }
+       if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) {
+               printk(KERN_ALERT
+                      "vortex: The revision (%x) of your card has not been seen before.\n",
+                      chip->rev);
+               printk(KERN_ALERT
+                      "vortex: Please email the results of 'lspci -vv' to openvortex-dev@nongnu.org.\n");
+               snd_card_free(card);
+               err = -ENODEV;
+               return err;
        }
 #endif
+
        // (6)
        if ((err = snd_card_register(card)) < 0) {
                snd_card_free(card);
index a978f07c5c48fee8dd0485553b03245426bbb302..fff8c02847151f4ac106b5b42d304d8b4c62ae3a 100644 (file)
@@ -1,14 +1,19 @@
 /*
-    Aureal Vortex Soundcard driver.
-
-    IO addr collected from asp4core.vxd:
-    function    address
-    0005D5A0    13004
-    00080674    14004
-    00080AFF    12818
-
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
-
 #ifndef __SOUND_AU88X0_H
 #define __SOUND_AU88X0_H
 
 #include <sound/hwdep.h>
 #include <sound/ac97_codec.h>
 
-/*
+
 #ifndef        PCI_VENDOR_ID_AUREAL
 #define        PCI_VENDOR_ID_AUREAL 0x12eb
 #endif
-#ifndef        PCI_VENDOR_ID_AUREAL_VORTEX
+#ifndef        PCI_DEVICE_ID_AUREAL_VORTEX
 #define        PCI_DEVICE_ID_AUREAL_VORTEX 0x0001
 #endif
-#ifndef        PCI_VENDOR_ID_AUREAL_VORTEX2
+#ifndef        PCI_DEVICE_ID_AUREAL_VORTEX2
 #define        PCI_DEVICE_ID_AUREAL_VORTEX2 0x0002
 #endif
-#ifndef        PCI_VENDOR_ID_AUREAL_ADVANTAGE
+#ifndef        PCI_DEVICE_ID_AUREAL_ADVANTAGE
 #define        PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003
 #endif
-*/
+
 #endif
 
 #ifndef CHIP_AU8820
 
 /* Check for SDAC bit in "Extended audio ID" AC97 register */
 #define VORTEX_IS_QUAD(x) ((x->codec == NULL) ?  0 : (x->codec->ext_id|0x80))
+/* Check if chip has bug. */
+#define IS_BAD_CHIP(x) (\
+       (x->rev < 3 && x->device == PCI_DEVICE_ID_AUREAL_VORTEX) || \
+       (x->rev < 0xfe && x->device == PCI_DEVICE_ID_AUREAL_VORTEX2) || \
+       (x->rev < 0xfe && x->device == PCI_DEVICE_ID_AUREAL_ADVANTAGE))
+
 
 /* PCM devices */
 #define VORTEX_PCM_ADB         0
index 7ff29b2ccaa786f243256d7654f7e62779721d75..5239c24268d21b3d410ca2e5dc744d0cd46b2613 100644 (file)
@@ -2053,14 +2053,18 @@ static void vortex_connect_default(vortex_t * vortex, int en)
        // Connect DSP interface for SQ3500 turbo (not here i think...)
 
        // Connect AC98 modem codec
-
-       /* Fast Play Workaround */
-#ifndef CHIP_AU8820
-       vortex->fixed_res[VORTEX_RESOURCE_DMA] = 0x00000001;
-#endif
-       // Channel swapping workaround. We are nuking registers somewhere, or
-       // its a hardware bug.
-       vortex->fixed_res[VORTEX_RESOURCE_SRC] = 0x00000001;
+       
+       /* Fast Play Workaround. Revision 0xFE does not seem to need it. */
+       printk(KERN_INFO "vortex: revision = 0x%x, device = %d\n", vortex->rev, vortex->device);
+       if (IS_BAD_CHIP(vortex)) {
+               printk(KERN_INFO "vortex: Erratum workaround enabled.\n");
+ #ifndef CHIP_AU8820
+               vortex->fixed_res[VORTEX_RESOURCE_DMA] = 0x00000001;
+ #endif
+               // Channel swapping workaround. We are nuking registers somewhere, or
+               // its a hardware bug.
+               vortex->fixed_res[VORTEX_RESOURCE_SRC] = 0x00000001;
+       }
 }
 
 /*
@@ -2161,8 +2165,8 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
                for (i = 0; i < nr_ch; i++) {
                        if (stream->type == VORTEX_PCM_ADB) {
                                vortex_connection_adbdma_src(vortex, en,
-                                                            //src[nr_ch - 1], 
-                                                            src[0], 
+                                                            src[nr_ch - 1], 
+                                                            //src[0], 
                                                             dma,
                                                             src[i]);
                                vortex_connection_src_mixin(vortex, en,
@@ -2644,7 +2648,7 @@ static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode)
 static int vortex_core_init(vortex_t * vortex)
 {
 
-       printk(KERN_INFO "Vortex: hardware init.... ");
+       printk(KERN_INFO "Vortex: init.... ");
        /* Hardware Init. */
        hwwrite(vortex->mmio, VORTEX_CTRL, 0xffffffff);
        udelay(5000);
@@ -2698,7 +2702,7 @@ static int vortex_core_init(vortex_t * vortex)
 static int vortex_core_shutdown(vortex_t * vortex)
 {
 
-       printk(KERN_INFO "Vortex: hardware shutdown...");
+       printk(KERN_INFO "Vortex: shutdown...");
 #ifndef CHIP_AU8820
        vortex_eq_free(vortex);
        vortex_Vort3D(vortex, 0);
index 8596d1d90835eca3ac4eefe58615edf61084443a..686ca8ff75103b4e62ef73287c5e1f4faebb909a 100644 (file)
@@ -1,10 +1,24 @@
 /*
- * Vortex PCM ALSA driver.
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
  *
- * Supports ADB and WT DMA. Unfortunately, WT routing is still a
- * mistery. To discover that, we need to disassemble the windoze
- * driver too.
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+/*
+ * Vortex PCM ALSA driver.
  *
+ * Supports ADB and WT DMA. Unfortunately, WT channels do not run yet.
+ * It remains stuck,and DMA transfers do not happen.
  *
  */
 
@@ -488,14 +502,18 @@ static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
        if (idx == VORTEX_PCM_ADB)
                snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
                                &snd_vortex_playback_ops);
-       /* pre-allocation of linear buffers */
-       //snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-       //                                    snd_dma_pci_data(chip->pci_dev), 0x10000, 0x10000);
+
        /* pre-allocation of Scatter-Gather buffers */
+       
        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-                                             snd_dma_pci_data(chip->pci_dev),
-                                             0x10000, 0x10000);
-
+                                                                                 snd_dma_pci_data(chip->pci_dev),
+                                                                                 0x10000, 0x10000);
+       
+       // The above should be used, as soon as ALSA gets updated.
+       /*
+       snd_pcm_lib_preallocate_sg_pages_for_all(chip->pci_dev, pcm,
+                                                0x10000, 0x10000);
+       */
        if (VORTEX_PCM_TYPE(pcm) == VORTEX_PCM_SPDIF) {
                snd_kcontrol_t *kcontrol;