61 |
#define FIFO_START 1 |
#define FIFO_START 1 |
62 |
#define FIFO_PAUSE 2 |
#define FIFO_PAUSE 2 |
63 |
|
|
64 |
|
/* ADB Resource */ |
65 |
|
#define VORTEX_RESOURCE_DMA 0x00000000 |
66 |
|
#define VORTEX_RESOURCE_SRC 0x00000001 |
67 |
|
#define VORTEX_RESOURCE_MIXIN 0x00000002 |
68 |
|
#define VORTEX_RESOURCE_MIXOUT 0x00000003 |
69 |
|
#define VORTEX_RESOURCE_A3D 0x00000004 |
70 |
|
#define VORTEX_RESOURCE_LAST 0x00000005 |
71 |
|
|
72 |
|
#define MIX_CAPT(x) (vortex->mixcapt[x]) |
73 |
|
#define MIX_PLAYB(x) (vortex->mixplayb[x]) |
74 |
|
#define VORTEX_IS_QUAD(x) ((x->codec == NULL) ? 0 : (x->codec->ext_id|0x80)) |
75 |
/* Structs */ |
/* Structs */ |
76 |
|
|
77 |
typedef struct { |
typedef struct { |
82 |
int cfg0; |
int cfg0; |
83 |
int cfg1; |
int cfg1; |
84 |
|
|
85 |
int nr_ch; /* Used channel bitmap */ |
int nr_ch; /* Nr of PCM channels */ |
86 |
int dma; /* dma channel */ |
int dma; /* Hardware Stream index. */ |
87 |
|
int dir; /* Stream Direction. */ |
88 |
|
u32 resources[5]; |
89 |
|
|
90 |
/* Virtual page extender stuff */ |
/* Virtual page extender stuff */ |
91 |
int nr_periods; |
int nr_periods; |
92 |
int period_bytes; |
int period_bytes; |
95 |
int period_virt; |
int period_virt; |
96 |
|
|
97 |
snd_pcm_substream_t *substream; |
snd_pcm_substream_t *substream; |
98 |
} dma_t; |
} stream_t; |
99 |
|
|
100 |
typedef struct snd_vortex vortex_t; |
typedef struct snd_vortex vortex_t; |
101 |
struct snd_vortex { |
struct snd_vortex { |
102 |
// ALSA structs. |
/* ALSA structs. */ |
103 |
snd_card_t *card; |
snd_card_t *card; |
104 |
snd_pcm_t *pcm_adb; |
snd_pcm_t *pcm_adb; |
105 |
snd_pcm_t *pcm_wt; |
snd_pcm_t *pcm_wt; |
106 |
snd_rawmidi_t *rmidi; /* Legacy Midi interface. */ |
snd_rawmidi_t *rmidi; /* Legacy Midi interface. */ |
107 |
ac97_t *codec; |
ac97_t *codec; |
108 |
|
|
109 |
// DMA structs. |
/* Stream structs. */ |
110 |
dma_t dma_adb[NR_ADB]; |
stream_t dma_adb[NR_ADB]; |
111 |
dma_t dma_wt[NR_WT]; |
#ifndef CHIP_AU8810 |
112 |
|
stream_t dma_wt[NR_WT]; |
113 |
|
unsigned char mixwt[6]; /* WT mixin objects */ |
114 |
|
#endif |
115 |
|
/* Global resources */ |
116 |
|
unsigned char mixcapt[2]; |
117 |
|
unsigned char mixplayb[4]; |
118 |
|
u32 fixed_res[5]; |
119 |
|
|
120 |
/* Hardware equalizer structs */ |
/* Hardware equalizer structs */ |
121 |
eqlzr_t eq; |
eqlzr_t eq; |
125 |
/* Gameport stuff. */ |
/* Gameport stuff. */ |
126 |
struct gameport *gameport; |
struct gameport *gameport; |
127 |
|
|
128 |
/* hardware resouces */ |
/* PCI hardware resources */ |
129 |
unsigned long io; |
unsigned long io; |
130 |
unsigned long *mmio; |
unsigned long *mmio; |
131 |
unsigned int irq; |
unsigned int irq; |
144 |
|
|
145 |
/* SRC */ |
/* SRC */ |
146 |
void vortex_adb_setsrc(vortex_t *vortex, int adbdma, unsigned int cvrt, int dir); |
void vortex_adb_setsrc(vortex_t *vortex, int adbdma, unsigned int cvrt, int dir); |
147 |
/*void vortex_src_setupchannel(vortex_t *card, unsigned char src, unsigned int cvr, |
|
|
unsigned int b, int c, int d, int e, int f, unsigned int g, int thsource); |
|
|
void vortex_src_change_convratio(vortex_t *vortex, unsigned char src, int ratio); |
|
|
*/ |
|
148 |
/* DMA Engines. */ |
/* DMA Engines. */ |
|
int vortex_getadb(vortex_t *vortex); |
|
|
int vortex_getwt(vortex_t *vortex); |
|
149 |
void vortex_adbdma_setbuffers(vortex_t *vortex, int adbdma, unsigned int addr, int size, int count); |
void vortex_adbdma_setbuffers(vortex_t *vortex, int adbdma, unsigned int addr, int size, int count); |
150 |
void vortex_wtdma_setbuffers(vortex_t *vortex, int wtdma, unsigned int addr, int size, int count); |
void vortex_wtdma_setbuffers(vortex_t *vortex, int wtdma, unsigned int addr, int size, int count); |
151 |
void vortex_adbdma_setmode(vortex_t *vortex, int adbdma, int ie, int b, int fmt, int d, unsigned long offset); |
void vortex_adbdma_setmode(vortex_t *vortex, int adbdma, int ie, int b, int fmt, int d, unsigned long offset); |
153 |
void vortex_adbdma_setstartbuffer(vortex_t *vortex, int adbdma, int sb); |
void vortex_adbdma_setstartbuffer(vortex_t *vortex, int adbdma, int sb); |
154 |
void vortex_wtdma_setstartbuffer(vortex_t *vortex, int wtdma, int sb); |
void vortex_wtdma_setstartbuffer(vortex_t *vortex, int wtdma, int sb); |
155 |
|
|
|
void vortex_fifo_adbinitialize(vortex_t *vortex, int fifo, int j); |
|
|
void vortex_fifo_wtinitialize(vortex_t *vortex, int fifo, int j); |
|
156 |
void vortex_adbdma_startfifo(vortex_t *vortex, int adbdma); |
void vortex_adbdma_startfifo(vortex_t *vortex, int adbdma); |
157 |
void vortex_adbdma_stopfifo(vortex_t *vortex, int adbdma); |
void vortex_adbdma_stopfifo(vortex_t *vortex, int adbdma); |
158 |
void vortex_wtdma_startfifo(vortex_t *vortex, int wtdma); |
void vortex_wtdma_startfifo(vortex_t *vortex, int wtdma); |
177 |
int vortex_alsafmt_aspfmt(int alsafmt); |
int vortex_alsafmt_aspfmt(int alsafmt); |
178 |
|
|
179 |
/* Connection stuff. */ |
/* Connection stuff. */ |
180 |
int vortex_adb_waveroute(vortex_t *vortex, int adbdma, int nch); |
void vortex_connect_default(vortex_t *vortex, int en); |
181 |
int vortex_wt_waveroute(vortex_t *vortex, int adbdma, int nch); |
int vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir); |
182 |
|
int vortex_wt_allocroute(vortex_t *vortex, int dma, int nr_ch); |
183 |
|
int vortex_adb_checkinout(vortex_t *vortex, int resmap[], int out, int restype); |
184 |
|
void vortex_connect_wt(vortex_t *vortex, int en, unsigned char mixers[]); |
185 |
|
void vortex_InitializeWTRegs(vortex_t * vortex); |
186 |
|
|
187 |
/* Driver stuff. */ |
/* Driver stuff. */ |
|
|
|
188 |
int __devinit vortex_gameport_register(vortex_t *card); |
int __devinit vortex_gameport_register(vortex_t *card); |
189 |
int __devexit vortex_gameport_unregister(vortex_t *card); |
int __devexit vortex_gameport_unregister(vortex_t *card); |
190 |
int __devinit vortex_eq_init(vortex_t *vortex); |
int __devinit vortex_eq_init(vortex_t *vortex); |