/* Put 2 WT channels together for one stereo interlaced channel. */ static void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo) { int temp; //temp = hwread(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2)); temp = hwread(vortex->mmio, WT_STEREO(wt)); temp = (temp & 0xfe) | (stereo & 1); //hwwrite(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2), temp); 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; /* There is one DSREG register for each bank (32 voices each). */ temp = hwread(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0)); if (en) temp |= (1 << (wt & 0x1f)); else temp &= (1 << ~(wt & 0x1f)); hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp); }
static void vortex_EqHw_GetLevels(vortex_t * vortex, u16 a[]) { eqhw_t *eqhw = &(vortex->eq.this04); int ebx; if (eqhw->this04 < 0) return; ebx = 0; do { a[ebx] = hwread(vortex->mmio, 0x2b024 + ebx * 0x30); ebx++; } while (ebx < eqhw->this04); a[eqhw->this04] = hwread(vortex->mmio, 0x2b3cc); a[eqhw->this04 + 1] = hwread(vortex->mmio, 0x2b3d8); ebx = 0; do { a[ebx + (eqhw->this04 + 2)] = hwread(vortex->mmio, 0x2b204 + ebx * 0x30); ebx++; } while (ebx < eqhw->this04); a[2 + (eqhw->this04 * 2)] = hwread(vortex->mmio, 0x2b3e4); a[3 + (eqhw->this04 * 2)] = hwread(vortex->mmio, 0x2b3f0); }
static void vortex_EqHw_GetRightGainsCurrent(vortex_t * vortex, u16 a[]) { eqhw_t *eqhw = &(vortex->eq.this04); int ebx = 0; if (eqhw->this04 < 0) return; do { a[ebx] = hwread(vortex->mmio, 0x2b208 + ebx * 0x30); ebx++; } while (ebx < eqhw->this04); }
/* Setup WT route. */ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch) { wt_voice_t *voice = &(vortex->wt_voice[wt]); int temp; //FIXME: WT audio routing. if (nr_ch) { 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); /* 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 hwwrite(vortex->mmio, WT_SRAMP(1), 0x880000); //hwwrite(vortex->mmio, WT_GMODE(1), 0xffffffff); #endif hwwrite(vortex->mmio, WT_PARM(wt, 0), 0); hwwrite(vortex->mmio, WT_PARM(wt, 1), 0); hwwrite(vortex->mmio, WT_PARM(wt, 2), 0); temp = hwread(vortex->mmio, WT_PARM(wt, 3)); ; //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); ; hwwrite(vortex->mmio, WT_PARM(wt, 2), 0xffffffff); hwwrite(vortex->mmio, WT_PARM(wt, 3), 0xcff1c810); voice->parm0 = voice->parm1 = 0xcfb23e2f; hwwrite(vortex->mmio, WT_PARM(wt, 0), voice->parm0); hwwrite(vortex->mmio, WT_PARM(wt, 1), voice->parm1); ; return 0; }
static void vortex_EqHw_GetControlReg(vortex_t * vortex, unsigned long *reg) { *reg = hwread(vortex->mmio, 0x2b440); }
static void vortex_EqHw_GetTimeConsts(vortex_t * vortex, u16 * a, u16 * b) { *a = hwread(vortex->mmio, 0x2b3c4); *b = hwread(vortex->mmio, 0x2b3c8); }