X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fau88x0%2Fau88x0_synth.c;h=d3e662a1285ddd526cc8fccd674054967565ea71;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=186721869f580ddb410c073c817d23d88fbb5d9b;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c index 186721869..d3e662a12 100644 --- a/sound/pci/au88x0/au88x0_synth.c +++ b/sound/pci/au88x0/au88x0_synth.c @@ -32,10 +32,11 @@ static void vortex_connection_mixin_mix(vortex_t * vortex, int en, unsigned char mix, int a); static void vortex_fifo_wtinitialize(vortex_t * vortex, int fifo, int j); static int vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt, - unsigned long val); + u32 val); /* WT */ +/* Put 2 WT channels together for one stereo interlaced channel. */ static void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo) { int temp; @@ -47,6 +48,7 @@ static void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo) hwwrite(vortex->mmio, WT_STEREO(wt), temp); } +/* Join to mixdown route. */ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en) { int temp; @@ -60,7 +62,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en) hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp); } -// WT routing is still a mistery. +/* Setup WT route. */ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch) { wt_voice_t *voice = &(vortex->wt_voice[wt]); @@ -68,13 +70,15 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch) //FIXME: WT audio routing. if (nr_ch) { - vortex_fifo_wtinitialize(vortex, wt, 2); + vortex_fifo_wtinitialize(vortex, wt, 1); vortex_fifo_setwtvalid(vortex, wt, 1); vortex_wt_setstereo(vortex, wt, nr_ch - 1); } else vortex_fifo_setwtvalid(vortex, wt, 0); - - vortex_wt_setdsout(vortex, wt, 0); + + /* Set mixdown mode. */ + vortex_wt_setdsout(vortex, wt, 1); + /* Set other parameter registers. */ hwwrite(vortex->mmio, WT_SRAMP(0), 0x880000); //hwwrite(vortex->mmio, WT_GMODE(0), 0xffffffff); #ifdef CHIP_AU8830 @@ -86,15 +90,15 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch) hwwrite(vortex->mmio, WT_PARM(wt, 2), 0); temp = hwread(vortex->mmio, WT_PARM(wt, 3)); - printk("vortex: WT PARM3: %x\n", temp); - hwwrite(vortex->mmio, WT_PARM(wt, 3), temp); + printk(KERN_DEBUG "vortex: WT PARM3: %x\n", temp); + //hwwrite(vortex->mmio, WT_PARM(wt, 3), temp); hwwrite(vortex->mmio, WT_DELAY(wt, 0), 0); hwwrite(vortex->mmio, WT_DELAY(wt, 1), 0); hwwrite(vortex->mmio, WT_DELAY(wt, 2), 0); hwwrite(vortex->mmio, WT_DELAY(wt, 3), 0); - printk("vortex: WT GMODE: %x\n", hwread(vortex->mmio, WT_GMODE(wt))); + printk(KERN_DEBUG "vortex: WT GMODE: %x\n", hwread(vortex->mmio, WT_GMODE(wt))); hwwrite(vortex->mmio, WT_PARM(wt, 2), 0xffffffff); hwwrite(vortex->mmio, WT_PARM(wt, 3), 0xcff1c810); @@ -102,10 +106,11 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch) voice->parm0 = voice->parm1 = 0xcfb23e2f; hwwrite(vortex->mmio, WT_PARM(wt, 0), voice->parm0); hwwrite(vortex->mmio, WT_PARM(wt, 1), voice->parm1); - printk("vortex: WT GMODE 2 : %x\n", hwread(vortex->mmio, WT_GMODE(wt))); + printk(KERN_DEBUG "vortex: WT GMODE 2 : %x\n", hwread(vortex->mmio, WT_GMODE(wt))); return 0; } + static void vortex_wt_connect(vortex_t * vortex, int en) { int i, ii, mix; @@ -129,15 +134,12 @@ static void vortex_wt_connect(vortex_t * vortex, int en) ADB_WTOUT(i, ii + 0x20), ADB_MIXIN(mix)); vortex_connection_mixin_mix(vortex, en, mix, - vortex->mixplayb[ii % - 2], 0); + vortex->mixplayb[ii % 2], 0); if (VORTEX_IS_QUAD(vortex)) vortex_connection_mixin_mix(vortex, en, mix, - vortex-> - mixplayb[2 + - (ii % - 2)], 0); + vortex->mixplayb[2 + + (ii % 2)], 0); } } for (i = 0; i < NR_WT; i++) { @@ -164,7 +166,7 @@ static int vortex_wt_GetReg(vortex_t * vortex, char reg, int wt) /* WT hardware abstraction layer generic register interface. */ static int vortex_wt_SetReg2(vortex_t * vortex, unsigned char reg, int wt, - unsigned short val) + u16 val) { /* int eax, edx; @@ -188,7 +190,7 @@ vortex_wt_SetReg2(vortex_t * vortex, unsigned char reg, int wt, #endif static int vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt, - unsigned long val) + u32 val) { int ecx; @@ -201,7 +203,7 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt, } } else { if (wt >= NR_WT) { - printk("vortex: WT SetReg: voice out of range\n"); + printk(KERN_ERR "vortex: WT SetReg: voice out of range\n"); return 0; } } @@ -277,7 +279,7 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt, static void vortex_wt_init(vortex_t * vortex) { - int var4, var8, varc, var10 = 0, edi; + u32 var4, var8, varc, var10 = 0, edi; var10 &= 0xFFFFFFE3; var10 |= 0x22; @@ -351,7 +353,7 @@ static void vortex_wt_SetVolume(vortex_t * vortex, int wt, int vol[]) static void vortex_wt_SetFrequency(vortex_t * vortex, int wt, unsigned int sr) { wt_voice_t *voice = &(vortex->wt_voice[wt]); - long int eax, edx; + u32 eax, edx; //FIXME: 64 bit operation. eax = ((sr << 0xf) * 0x57619F1) & 0xffffffff;