#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
#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
#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
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);
/*
- 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
// 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;
+ }
}
/*
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,
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);
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);
/*
- * 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.
*
*/
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;