Update of /cvsroot/alsa/alsa-kernel/pci/au88x0
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26863

Modified Files:
        au8810.h au8820.h au8830.h au88x0.c au88x0.h au88x0_core.c 
        au88x0_pcm.c 
Log Message:
Manuel Jander <[EMAIL PROTECTED]>:
clean up and small bugfixes, the routing code fix for multiple streams.


Index: au8810.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8810.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- au8810.h    9 Mar 2004 11:52:13 -0000       1.1
+++ au8810.h    16 Mar 2004 15:25:16 -0000      1.2
@@ -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: au8820.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8820.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- au8820.h    9 Mar 2004 11:52:13 -0000       1.1
+++ au8820.h    16 Mar 2004 15:25:16 -0000      1.2
@@ -14,14 +14,6 @@
 #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: au8830.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8830.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- au8830.h    9 Mar 2004 11:52:13 -0000       1.1
+++ au8830.h    16 Mar 2004 15:25:16 -0000      1.2
@@ -14,16 +14,6 @@
 #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: au88x0.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- au88x0.c    15 Mar 2004 08:08:41 -0000      1.3
+++ au88x0.c    16 Mar 2004 15:25:16 -0000      1.4
@@ -336,28 +336,34 @@
        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 
[EMAIL PROTECTED]");
-                       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 [EMAIL 
PROTECTED]");
+               snd_card_free(card);
+               err = -ENODEV;
+               return err;
        }
 #endif
+
        // (6)
        if ((err = snd_card_register(card)) < 0) {
                snd_card_free(card);

Index: au88x0.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- au88x0.h    9 Mar 2004 11:52:13 -0000       1.1
+++ au88x0.h    16 Mar 2004 15:25:16 -0000      1.2
@@ -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
 
@@ -24,20 +29,20 @@
 #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
@@ -90,6 +95,12 @@
 
 /* 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: au88x0_core.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0_core.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- au88x0_core.c       15 Mar 2004 09:32:11 -0000      1.2
+++ au88x0_core.c       16 Mar 2004 15:25:16 -0000      1.3
@@ -2053,14 +2053,18 @@
        // 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 @@
                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 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_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: au88x0_pcm.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0_pcm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- au88x0_pcm.c        9 Mar 2004 11:52:13 -0000       1.1
+++ au88x0_pcm.c        16 Mar 2004 15:25:16 -0000      1.2
@@ -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 @@
        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;
 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to