1 |
/* |
/* |
2 |
Aureal Vortex Soundcard driver. |
Aureal Vortex Soundcard driver. |
3 |
|
|
4 |
IO addr collected from asp4core.vxd: |
IO addr collected from asp4core.vxd: |
5 |
function address |
function address |
6 |
0005D5A0 13004 |
0005D5A0 13004 |
7 |
00080674 14004 |
00080674 14004 |
8 |
00080AFF 12818 |
00080AFF 12818 |
9 |
|
|
10 |
*/ |
*/ |
|
|
|
|
#ifndef __SOUND_AU88X0_H |
|
|
#define __SOUND_AU88X0_H |
|
11 |
|
|
12 |
|
#ifndef __SOUND_AU88X0_H |
13 |
|
#define __SOUND_AU88X0_H |
14 |
|
|
15 |
#ifdef __KERNEL__ |
#ifdef __KERNEL__ |
16 |
#include <sound/driver.h> |
#include <sound/driver.h> |
22 |
#include <sound/ac97_codec.h> |
#include <sound/ac97_codec.h> |
23 |
#include <asm/io.h> |
#include <asm/io.h> |
24 |
/* |
/* |
25 |
#ifndef PCI_VENDOR_ID_AUREAL |
#ifndef PCI_VENDOR_ID_AUREAL |
26 |
#define PCI_VENDOR_ID_AUREAL 0x12eb |
#define PCI_VENDOR_ID_AUREAL 0x12eb |
27 |
#endif |
#endif |
28 |
#ifndef PCI_VENDOR_ID_AUREAL_VORTEX |
#ifndef PCI_VENDOR_ID_AUREAL_VORTEX |
29 |
#define PCI_DEVICE_ID_AUREAL_VORTEX 0x0001 |
#define PCI_DEVICE_ID_AUREAL_VORTEX 0x0001 |
30 |
#endif |
#endif |
31 |
#ifndef PCI_VENDOR_ID_AUREAL_VORTEX2 |
#ifndef PCI_VENDOR_ID_AUREAL_VORTEX2 |
32 |
#define PCI_DEVICE_ID_AUREAL_VORTEX2 0x0002 |
#define PCI_DEVICE_ID_AUREAL_VORTEX2 0x0002 |
33 |
#endif |
#endif |
34 |
#ifndef PCI_VENDOR_ID_AUREAL_ADVANTAGE |
#ifndef PCI_VENDOR_ID_AUREAL_ADVANTAGE |
35 |
#define PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003 |
#define PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003 |
36 |
#endif |
#endif |
37 |
*/ |
*/ |
38 |
#endif |
#endif |
39 |
|
|
40 |
#define VORTEX_DMA_MASK 0xffffffff |
#define VORTEX_DMA_MASK 0xffffffff |
|
|
|
|
#define hwread(x,y) readl((x)+((y)>>2)) |
|
|
#define hwwrite(x,y,z) writel((z),(x)+((y)>>2)) |
|
41 |
|
|
42 |
|
#define hwread(x,y) readl((x)+((y)>>2)) |
43 |
|
#define hwwrite(x,y,z) writel((z),(x)+((y)>>2)) |
44 |
|
|
45 |
/* Vortex MPU401 defines. */ |
/* Vortex MPU401 defines. */ |
46 |
#define MIDI_CLOCK_DIV 0x61 |
#define MIDI_CLOCK_DIV 0x61 |
47 |
/* Standart MPU401 defines. */ |
/* Standart MPU401 defines. */ |
48 |
#define MPU401_RESET 0xff |
#define MPU401_RESET 0xff |
49 |
#define MPU401_ENTER_UART 0x3f |
#define MPU401_ENTER_UART 0x3f |
50 |
#define MPU401_ACK 0xfe |
#define MPU401_ACK 0xfe |
|
|
|
|
#define SRC_RATIO(x) ((((x<<15)/48000) + 1)/2) |
|
|
#define SRC_RATIO2(x) ((((48000<<15)/x) + 1)/2) |
|
51 |
|
|
52 |
|
#define SRC_RATIO(x) ((((x<<15)/48000) + 1)/2) |
53 |
|
#define SRC_RATIO2(x) ((((48000<<15)/x) + 1)/2) |
54 |
|
|
55 |
/* Structs */ |
/* Structs */ |
56 |
|
|
61 |
int dma_unknown; /* this_74 (ADB), this_78 (WT) */ |
int dma_unknown; /* this_74 (ADB), this_78 (WT) */ |
62 |
int cfg0; |
int cfg0; |
63 |
int cfg1; |
int cfg1; |
64 |
|
|
65 |
int nr_ch; /* Used channel bitmap */ |
int nr_ch; /* Used channel bitmap */ |
66 |
int dma; /* dma channel */ |
int dma; /* dma channel */ |
67 |
|
|
68 |
/* Virtual page extender stuff */ |
/* Virtual page extender stuff */ |
69 |
int nr_periods; |
int nr_periods; |
70 |
int period_bytes; |
int period_bytes; |
71 |
unsigned long buf_addr; |
unsigned long buf_addr; |
72 |
int period_real; |
int period_real; |
73 |
int period_virt; |
int period_virt; |
74 |
|
|
75 |
|
|
76 |
snd_pcm_substream_t *substream; |
snd_pcm_substream_t *substream; |
77 |
} dma_t; |
} dma_t; |
78 |
|
|
|
|
|
79 |
typedef struct snd_vortex vortex_t; |
typedef struct snd_vortex vortex_t; |
80 |
struct snd_vortex { |
struct snd_vortex { |
81 |
// ALSA structs. |
// ALSA structs. |
84 |
snd_pcm_t *pcm_wt; |
snd_pcm_t *pcm_wt; |
85 |
snd_rawmidi_t *rmidi; /* Legacy Midi interface. */ |
snd_rawmidi_t *rmidi; /* Legacy Midi interface. */ |
86 |
ac97_t *codec; |
ac97_t *codec; |
87 |
|
|
88 |
// DMA structs. |
// DMA structs. |
89 |
dma_t dma_adb[NR_ADB]; |
dma_t dma_adb[NR_ADB]; |
90 |
dma_t dma_wt[NR_WT]; |
dma_t dma_wt[NR_WT]; |
91 |
|
|
92 |
struct gameport *gameport; |
struct gameport *gameport; |
93 |
|
|
94 |
/* hardware resouces */ |
/* hardware resouces */ |
95 |
unsigned long io; |
unsigned long io; |
96 |
unsigned long *mmio; |
unsigned long *mmio; |
97 |
struct resource *port0, *port1; |
struct resource *port0, *port1; |
98 |
unsigned int irq; |
unsigned int irq; |
99 |
spinlock_t lock; |
spinlock_t lock; |
100 |
|
|
101 |
/* PCI device */ |
/* PCI device */ |
102 |
struct pci_dev * pci_dev; |
struct pci_dev * pci_dev; |
103 |
u16 vendor; |
u16 vendor; |
108 |
/* Functions. */ |
/* Functions. */ |
109 |
|
|
110 |
/* SRC */ |
/* SRC */ |
111 |
void vortex_src_setupchannel(vortex_t *card, unsigned char src, unsigned int cvr, |
void vortex_src_setupchannel(vortex_t *card, unsigned char src, unsigned int cvr, |
112 |
unsigned int b, int c, int d, int e, int f, unsigned int g, int thsource); |
unsigned int b, int c, int d, int e, int f, unsigned int g, int thsource); |
113 |
void vortex_src_change_convratio(vortex_t *vortex, unsigned char src, int ratio); |
void vortex_src_change_convratio(vortex_t *vortex, unsigned char src, int ratio); |
114 |
|
|
122 |
void vortex_adbdma_setstartbuffer(vortex_t *vortex, int adbdma, int sb); |
void vortex_adbdma_setstartbuffer(vortex_t *vortex, int adbdma, int sb); |
123 |
void vortex_wtdma_setstartbuffer(vortex_t *vortex, int wtdma, int sb); |
void vortex_wtdma_setstartbuffer(vortex_t *vortex, int wtdma, int sb); |
124 |
|
|
|
|
|
125 |
void vortex_fifo_adbinitialize(vortex_t *vortex, int fifo, int j); |
void vortex_fifo_adbinitialize(vortex_t *vortex, int fifo, int j); |
126 |
void vortex_fifo_wtinitialize(vortex_t *vortex, int fifo, int j); |
void vortex_fifo_wtinitialize(vortex_t *vortex, int fifo, int j); |
127 |
void vortex_adbdma_startfifo(vortex_t *vortex, int adbdma); |
void vortex_adbdma_startfifo(vortex_t *vortex, int adbdma); |
150 |
int vortex_adb_waveroute(vortex_t *vortex, int adbdma, int nch); |
int vortex_adb_waveroute(vortex_t *vortex, int adbdma, int nch); |
151 |
int vortex_wt_waveroute(vortex_t *vortex, int adbdma, int nch); |
int vortex_wt_waveroute(vortex_t *vortex, int adbdma, int nch); |
152 |
|
|
|
|
|
153 |
/* Driver stuff. */ |
/* Driver stuff. */ |
154 |
|
|
155 |
int __devinit vortex_gameport_register(vortex_t *card); |
int __devinit vortex_gameport_register(vortex_t *card); |
158 |
int __devinit snd_vortex_new_pcm(vortex_t *vortex, int idx, int nr); |
int __devinit snd_vortex_new_pcm(vortex_t *vortex, int idx, int nr); |
159 |
int __devinit snd_vortex_mixer(vortex_t *vortex); |
int __devinit snd_vortex_mixer(vortex_t *vortex); |
160 |
int __devinit snd_vortex_midi(vortex_t *vortex); |
int __devinit snd_vortex_midi(vortex_t *vortex); |
|
|
|
|
|
|
161 |
#endif |
#endif |
|
|
|
|
/* End of au88x0.h */ |
|