Lines Matching refs:vortex
77 static void vortex_mixer_en_sr(vortex_t * vortex, int channel) in vortex_mixer_en_sr() argument
79 hwwrite(vortex->mmio, VORTEX_MIXER_SR, in vortex_mixer_en_sr()
80 hwread(vortex->mmio, VORTEX_MIXER_SR) | (0x1 << channel)); in vortex_mixer_en_sr()
82 static void vortex_mixer_dis_sr(vortex_t * vortex, int channel) in vortex_mixer_dis_sr() argument
84 hwwrite(vortex->mmio, VORTEX_MIXER_SR, in vortex_mixer_dis_sr()
85 hwread(vortex->mmio, VORTEX_MIXER_SR) & ~(0x1 << channel)); in vortex_mixer_dis_sr()
90 vortex_mix_muteinputgain(vortex_t * vortex, unsigned char mix,
93 hwwrite(vortex->mmio, VORTEX_MIX_INVOL_A + ((mix << 5) + channel),
95 hwwrite(vortex->mmio, VORTEX_MIX_INVOL_B + ((mix << 5) + channel),
99 static int vortex_mix_getvolume(vortex_t * vortex, unsigned char mix)
102 a = hwread(vortex->mmio, VORTEX_MIX_VOL_A + (mix << 2)) & 0xff;
108 vortex_mix_getinputvolume(vortex_t * vortex, unsigned char mix,
114 a = hwread(vortex->mmio,
131 static void vortex_mix_rampvolume(vortex_t * vortex, int mix)
139 a = hwread(vortex->mmio,
143 hwwrite(vortex->mmio,
146 hwwrite(vortex->mmio,
150 vortex_mix_killinput(vortex, mix, ch);
155 vortex_mix_getenablebit(vortex_t * vortex, unsigned char mix, int mixin)
163 temp = hwread(vortex->mmio, VORTEX_MIX_ENIN + addr);
168 vortex_mix_setvolumebyte(vortex_t * vortex, unsigned char mix, in vortex_mix_setvolumebyte() argument
172 hwwrite(vortex->mmio, VORTEX_MIX_VOL_A + (mix << 2), vol); in vortex_mix_setvolumebyte()
174 temp = hwread(vortex->mmio, VORTEX_MIX_VOL_B + (mix << 2)); in vortex_mix_setvolumebyte()
178 hwwrite(vortex->mmio, VORTEX_MIX_VOL_B + (mix << 2), vol); in vortex_mix_setvolumebyte()
182 vortex_mix_setinputvolumebyte(vortex_t * vortex, unsigned char mix, in vortex_mix_setinputvolumebyte() argument
187 hwwrite(vortex->mmio, in vortex_mix_setinputvolumebyte()
191 hwread(vortex->mmio, in vortex_mix_setinputvolumebyte()
196 hwwrite(vortex->mmio, in vortex_mix_setinputvolumebyte()
201 vortex_mix_setenablebit(vortex_t * vortex, unsigned char mix, int mixin, int en) in vortex_mix_setenablebit() argument
210 temp = hwread(vortex->mmio, VORTEX_MIX_ENIN + addr); in vortex_mix_setenablebit()
216 hwwrite(vortex->mmio, in vortex_mix_setenablebit()
219 hwwrite(vortex->mmio, VORTEX_MIX_SMP + (mixin << 2), 0x0); in vortex_mix_setenablebit()
220 hwwrite(vortex->mmio, VORTEX_MIX_SMP + 4 + (mixin << 2), 0x0); in vortex_mix_setenablebit()
222 hwwrite(vortex->mmio, VORTEX_MIX_ENIN + addr, temp); in vortex_mix_setenablebit()
226 vortex_mix_killinput(vortex_t * vortex, unsigned char mix, int mixin) in vortex_mix_killinput() argument
229 vortex_mix_setinputvolumebyte(vortex, mix, mixin, 0x80); in vortex_mix_killinput()
231 vortex_mix_setenablebit(vortex, mix, mixin, 0); in vortex_mix_killinput()
235 vortex_mix_enableinput(vortex_t * vortex, unsigned char mix, int mixin) in vortex_mix_enableinput() argument
237 vortex_mix_killinput(vortex, mix, mixin); in vortex_mix_enableinput()
239 vortex_mix_setinputvolumebyte(vortex, mix, mixin, 0x80); /*0x80 : mute */ in vortex_mix_enableinput()
242 vortex_mix_setenablebit(vortex, mix, mixin, 1); in vortex_mix_enableinput()
246 vortex_mix_disableinput(vortex_t * vortex, unsigned char mix, int channel, in vortex_mix_disableinput() argument
253 vortex_mix_killinput(vortex, mix, channel); in vortex_mix_disableinput()
255 vortex_mix_killinput(vortex, mix, channel); in vortex_mix_disableinput()
259 vortex_mixer_addWTD(vortex_t * vortex, unsigned char mix, unsigned char ch) in vortex_mixer_addWTD() argument
263 temp = hwread(vortex->mmio, VORTEX_MIXER_SR); in vortex_mixer_addWTD()
265 hwwrite(vortex->mmio, VORTEX_MIXER_CHNBASE + (ch << 2), mix); in vortex_mixer_addWTD()
266 vortex_mixer_en_sr(vortex, ch); in vortex_mixer_addWTD()
270 temp = hwread(vortex->mmio, prev); in vortex_mixer_addWTD()
273 temp = hwread(vortex->mmio, prev); in vortex_mixer_addWTD()
276 dev_err(vortex->card->dev, in vortex_mixer_addWTD()
281 hwwrite(vortex->mmio, VORTEX_MIXER_RTBASE + ((temp & 0xf) << 2), mix); in vortex_mixer_addWTD()
282 hwwrite(vortex->mmio, prev, (temp & 0xf) | 0x10); in vortex_mixer_addWTD()
287 vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch) in vortex_mixer_delWTD() argument
292 eax = hwread(vortex->mmio, VORTEX_MIXER_SR); in vortex_mixer_delWTD()
294 dev_err(vortex->card->dev, "mix ALARM %x\n", eax); in vortex_mixer_delWTD()
298 esp18 = hwread(vortex->mmio, ebp); in vortex_mixer_delWTD()
303 edx = hwread(vortex->mmio, ebx); in vortex_mixer_delWTD()
305 hwwrite(vortex->mmio, ebp, edx); in vortex_mixer_delWTD()
306 hwwrite(vortex->mmio, ebx, 0); in vortex_mixer_delWTD()
310 hwread(vortex->mmio, in vortex_mixer_delWTD()
315 dev_err(vortex->card->dev, in vortex_mixer_delWTD()
323 hwread(vortex->mmio, in vortex_mixer_delWTD()
332 edx = hwread(vortex->mmio, ebx); in vortex_mixer_delWTD()
334 hwwrite(vortex->mmio, in vortex_mixer_delWTD()
336 hwwrite(vortex->mmio, ebx, 0); in vortex_mixer_delWTD()
341 hwwrite(vortex->mmio, in vortex_mixer_delWTD()
346 hwwrite(vortex->mmio, in vortex_mixer_delWTD()
351 hwwrite(vortex->mmio, in vortex_mixer_delWTD()
359 vortex_mixer_dis_sr(vortex, ch); in vortex_mixer_delWTD()
360 hwwrite(vortex->mmio, ebp, 0); in vortex_mixer_delWTD()
365 static void vortex_mixer_init(vortex_t * vortex) in vortex_mixer_init() argument
376 hwwrite(vortex->mmio, addr, 0); in vortex_mixer_init()
381 hwwrite(vortex->mmio, addr, 0); in vortex_mixer_init()
386 hwwrite(vortex->mmio, addr, 0); in vortex_mixer_init()
391 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
396 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
401 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
406 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
411 hwwrite(vortex->mmio, addr, 0x0); in vortex_mixer_init()
414 hwwrite(vortex->mmio, VORTEX_MIXER_SR, 0); in vortex_mixer_init()
431 static void vortex_src_en_sr(vortex_t * vortex, int channel) in vortex_src_en_sr() argument
433 hwwrite(vortex->mmio, VORTEX_SRCBLOCK_SR, in vortex_src_en_sr()
434 hwread(vortex->mmio, VORTEX_SRCBLOCK_SR) | (0x1 << channel)); in vortex_src_en_sr()
437 static void vortex_src_dis_sr(vortex_t * vortex, int channel) in vortex_src_dis_sr() argument
439 hwwrite(vortex->mmio, VORTEX_SRCBLOCK_SR, in vortex_src_dis_sr()
440 hwread(vortex->mmio, VORTEX_SRCBLOCK_SR) & ~(0x1 << channel)); in vortex_src_dis_sr()
443 static void vortex_src_flushbuffers(vortex_t * vortex, unsigned char src) in vortex_src_flushbuffers() argument
448 hwwrite(vortex->mmio, in vortex_src_flushbuffers()
450 hwwrite(vortex->mmio, VORTEX_SRC_DATA + (src << 3), 0); in vortex_src_flushbuffers()
451 hwwrite(vortex->mmio, VORTEX_SRC_DATA + (src << 3) + 4, 0); in vortex_src_flushbuffers()
454 static void vortex_src_cleardrift(vortex_t * vortex, unsigned char src) in vortex_src_cleardrift() argument
456 hwwrite(vortex->mmio, VORTEX_SRC_DRIFT0 + (src << 2), 0); in vortex_src_cleardrift()
457 hwwrite(vortex->mmio, VORTEX_SRC_DRIFT1 + (src << 2), 0); in vortex_src_cleardrift()
458 hwwrite(vortex->mmio, VORTEX_SRC_DRIFT2 + (src << 2), 1); in vortex_src_cleardrift()
462 vortex_src_set_throttlesource(vortex_t * vortex, unsigned char src, int en) in vortex_src_set_throttlesource() argument
466 temp = hwread(vortex->mmio, VORTEX_SRC_SOURCE); in vortex_src_set_throttlesource()
471 hwwrite(vortex->mmio, VORTEX_SRC_SOURCE, temp); in vortex_src_set_throttlesource()
475 vortex_src_persist_convratio(vortex_t * vortex, unsigned char src, int ratio) in vortex_src_persist_convratio() argument
480 hwwrite(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2), ratio); in vortex_src_persist_convratio()
481 temp = hwread(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2)); in vortex_src_persist_convratio()
483 dev_err(vortex->card->dev, "Src cvr fail\n"); in vortex_src_persist_convratio()
492 static void vortex_src_slowlock(vortex_t * vortex, unsigned char src)
496 hwwrite(vortex->mmio, VORTEX_SRC_DRIFT2 + (src << 2), 1);
497 hwwrite(vortex->mmio, VORTEX_SRC_DRIFT0 + (src << 2), 0);
498 temp = hwread(vortex->mmio, VORTEX_SRC_U0 + (src << 2));
500 hwwrite(vortex->mmio, VORTEX_SRC_U0 + (src << 2),
505 vortex_src_change_convratio(vortex_t * vortex, unsigned char src, int ratio)
516 temp = hwread(vortex->mmio, VORTEX_SRC_U0 + (src << 2));
518 hwwrite(vortex->mmio, VORTEX_SRC_U0 + (src << 2),
521 vortex_src_persist_convratio(vortex, src, ratio);
525 vortex_src_checkratio(vortex_t * vortex, unsigned char src,
530 hw_ratio = hwread(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2));
533 hwwrite(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2), desired_ratio);
628 static void vortex_srcblock_init(vortex_t * vortex) in vortex_srcblock_init() argument
632 hwwrite(vortex->mmio, VORTEX_SRC_SOURCESIZE, 0x1ff); in vortex_srcblock_init()
642 hwwrite(vortex->mmio, addr, 0); in vortex_srcblock_init()
649 hwwrite(vortex->mmio, addr, 0); in vortex_srcblock_init()
655 vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch) in vortex_src_addWTD() argument
660 temp = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR); in vortex_src_addWTD()
662 hwwrite(vortex->mmio, VORTEX_SRC_CHNBASE + (ch << 2), src); in vortex_src_addWTD()
663 vortex_src_en_sr(vortex, ch); in vortex_src_addWTD()
667 temp = hwread(vortex->mmio, prev); in vortex_src_addWTD()
672 temp = hwread(vortex->mmio, prev); in vortex_src_addWTD()
675 dev_err(vortex->card->dev, in vortex_src_addWTD()
680 hwwrite(vortex->mmio, VORTEX_SRC_RTBASE + ((temp & 0xf) << 2), src); in vortex_src_addWTD()
682 hwwrite(vortex->mmio, prev, (temp & 0xf) | 0x10); in vortex_src_addWTD()
687 vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch) in vortex_src_delWTD() argument
692 eax = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR); in vortex_src_delWTD()
694 dev_err(vortex->card->dev, "src alarm\n"); in vortex_src_delWTD()
698 esp18 = hwread(vortex->mmio, ebp); in vortex_src_delWTD()
703 edx = hwread(vortex->mmio, ebx); in vortex_src_delWTD()
705 hwwrite(vortex->mmio, ebp, edx); in vortex_src_delWTD()
706 hwwrite(vortex->mmio, ebx, 0); in vortex_src_delWTD()
710 hwread(vortex->mmio, in vortex_src_delWTD()
715 dev_warn(vortex->card->dev, in vortex_src_delWTD()
723 hwread(vortex->mmio, in vortex_src_delWTD()
732 edx = hwread(vortex->mmio, ebx); in vortex_src_delWTD()
734 hwwrite(vortex->mmio, in vortex_src_delWTD()
736 hwwrite(vortex->mmio, ebx, 0); in vortex_src_delWTD()
741 hwwrite(vortex->mmio, in vortex_src_delWTD()
746 hwwrite(vortex->mmio, in vortex_src_delWTD()
751 hwwrite(vortex->mmio, in vortex_src_delWTD()
758 vortex_src_dis_sr(vortex, ch); in vortex_src_delWTD()
759 hwwrite(vortex->mmio, ebp, 0); in vortex_src_delWTD()
767 vortex_fifo_clearadbdata(vortex_t * vortex, int fifo, int x) in vortex_fifo_clearadbdata() argument
770 hwwrite(vortex->mmio, in vortex_fifo_clearadbdata()
776 static void vortex_fifo_adbinitialize(vortex_t * vortex, int fifo, int j)
778 vortex_fifo_clearadbdata(vortex, fifo, FIFO_SIZE);
780 hwwrite(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2),
783 hwwrite(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2),
788 static void vortex_fifo_setadbvalid(vortex_t * vortex, int fifo, int en) in vortex_fifo_setadbvalid() argument
790 hwwrite(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2), in vortex_fifo_setadbvalid()
791 (hwread(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2)) & in vortex_fifo_setadbvalid()
796 vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int stereo, int priority, in vortex_fifo_setadbctrl() argument
808 temp = hwread(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2)); in vortex_fifo_setadbctrl()
810 dev_err(vortex->card->dev, in vortex_fifo_setadbctrl()
822 vortex_fifo_clearadbdata(vortex, fifo, FIFO_SIZE); // this_4 in vortex_fifo_setadbctrl()
860 vortex_fifo_clearadbdata(vortex, fifo, FIFO_SIZE); in vortex_fifo_setadbctrl()
862 hwwrite(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2), temp); in vortex_fifo_setadbctrl()
863 hwread(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2)); in vortex_fifo_setadbctrl()
867 static void vortex_fifo_clearwtdata(vortex_t * vortex, int fifo, int x) in vortex_fifo_clearwtdata() argument
872 hwwrite(vortex->mmio, in vortex_fifo_clearwtdata()
877 static void vortex_fifo_wtinitialize(vortex_t * vortex, int fifo, int j) in vortex_fifo_wtinitialize() argument
879 vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE); in vortex_fifo_wtinitialize()
881 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), in vortex_fifo_wtinitialize()
884 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), in vortex_fifo_wtinitialize()
889 static void vortex_fifo_setwtvalid(vortex_t * vortex, int fifo, int en) in vortex_fifo_setwtvalid() argument
891 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), in vortex_fifo_setwtvalid()
892 (hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)) & in vortex_fifo_setwtvalid()
897 vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority, in vortex_fifo_setwtctrl() argument
904 temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); in vortex_fifo_setwtctrl()
906 dev_err(vortex->card->dev, in vortex_fifo_setwtctrl()
915 vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE); // this_4 in vortex_fifo_setwtctrl()
953 vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE); in vortex_fifo_setwtctrl()
955 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp); in vortex_fifo_setwtctrl()
956 hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); in vortex_fifo_setwtctrl()
1024 static void vortex_fifo_init(vortex_t * vortex) in vortex_fifo_init() argument
1032 hwwrite(vortex->mmio, addr, (FIFO_U0 | FIFO_U1)); in vortex_fifo_init()
1033 if (hwread(vortex->mmio, addr) != (FIFO_U0 | FIFO_U1)) in vortex_fifo_init()
1034 dev_err(vortex->card->dev, "bad adb fifo reset!\n"); in vortex_fifo_init()
1035 vortex_fifo_clearadbdata(vortex, x, FIFO_SIZE); in vortex_fifo_init()
1043 hwwrite(vortex->mmio, addr, FIFO_U0); in vortex_fifo_init()
1044 if (hwread(vortex->mmio, addr) != FIFO_U0) in vortex_fifo_init()
1045 dev_err(vortex->card->dev, in vortex_fifo_init()
1047 addr, hwread(vortex->mmio, addr)); in vortex_fifo_init()
1048 vortex_fifo_clearwtdata(vortex, x, FIFO_SIZE); in vortex_fifo_init()
1054 hwwrite(vortex->mmio, 0xf8c0, 0xd03); //0x0843 0xd6b in vortex_fifo_init()
1057 hwwrite(vortex->mmio, 0x17000, 0x61); /* wt a */ in vortex_fifo_init()
1058 hwwrite(vortex->mmio, 0x17004, 0x61); /* wt b */ in vortex_fifo_init()
1060 hwwrite(vortex->mmio, 0x17008, 0x61); /* adb */ in vortex_fifo_init()
1066 static void vortex_adbdma_init(vortex_t * vortex) in vortex_adbdma_init() argument
1070 static void vortex_adbdma_setfirstbuffer(vortex_t * vortex, int adbdma) in vortex_adbdma_setfirstbuffer() argument
1072 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setfirstbuffer()
1074 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_setfirstbuffer()
1078 static void vortex_adbdma_setstartbuffer(vortex_t * vortex, int adbdma, int sb) in vortex_adbdma_setstartbuffer() argument
1080 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setstartbuffer()
1082 hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), in vortex_adbdma_setstartbuffer()
1088 vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma, in vortex_adbdma_setbuffers() argument
1091 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setbuffers()
1103 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1111 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1118 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1125 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1134 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0); in vortex_adbdma_setbuffers()
1135 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG1 + (adbdma << 3), dma->cfg1); in vortex_adbdma_setbuffers()
1137 vortex_adbdma_setfirstbuffer(vortex, adbdma); in vortex_adbdma_setbuffers()
1138 vortex_adbdma_setstartbuffer(vortex, adbdma, 0); in vortex_adbdma_setbuffers()
1142 vortex_adbdma_setmode(vortex_t * vortex, int adbdma, int ie, int dir, in vortex_adbdma_setmode() argument
1145 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setmode()
1159 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_setmode()
1161 hwread(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2)); in vortex_adbdma_setmode()
1164 static int vortex_adbdma_bufshift(vortex_t * vortex, int adbdma) in vortex_adbdma_bufshift() argument
1166 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_bufshift()
1170 (hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)) & in vortex_adbdma_bufshift()
1194 hwwrite(vortex->mmio, in vortex_adbdma_bufshift()
1199 hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + in vortex_adbdma_bufshift()
1208 dev_info(vortex->card->dev, in vortex_adbdma_bufshift()
1216 static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) { in vortex_adbdma_resetup() argument
1217 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resetup()
1236 hwwrite(vortex->mmio, in vortex_adbdma_resetup()
1241 hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + (((adbdma << 2)+pp) << 2)); in vortex_adbdma_resetup()
1245 static inline int vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma) in vortex_adbdma_getlinearpos() argument
1247 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_getlinearpos()
1250 temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); in vortex_adbdma_getlinearpos()
1263 static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma) in vortex_adbdma_startfifo() argument
1266 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_startfifo()
1270 vortex_fifo_setadbvalid(vortex, adbdma, in vortex_adbdma_startfifo()
1275 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_startfifo()
1277 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1282 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1290 static void vortex_adbdma_resumefifo(vortex_t * vortex, int adbdma) in vortex_adbdma_resumefifo() argument
1292 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resumefifo()
1297 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_resumefifo()
1299 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1304 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1312 static void vortex_adbdma_pausefifo(vortex_t * vortex, int adbdma) in vortex_adbdma_pausefifo() argument
1314 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_pausefifo()
1319 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_pausefifo()
1323 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_pausefifo()
1325 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_pausefifo()
1332 static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma) in vortex_adbdma_stopfifo() argument
1334 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_stopfifo()
1338 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_stopfifo()
1349 static void vortex_wtdma_setfirstbuffer(vortex_t * vortex, int wtdma) in vortex_wtdma_setfirstbuffer() argument
1352 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setfirstbuffer()
1354 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl); in vortex_wtdma_setfirstbuffer()
1357 static void vortex_wtdma_setstartbuffer(vortex_t * vortex, int wtdma, int sb) in vortex_wtdma_setstartbuffer() argument
1359 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setstartbuffer()
1361 hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), in vortex_wtdma_setstartbuffer()
1367 vortex_wtdma_setbuffers(vortex_t * vortex, int wtdma, in vortex_wtdma_setbuffers() argument
1370 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setbuffers()
1382 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0xc, in vortex_wtdma_setbuffers()
1389 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x8, in vortex_wtdma_setbuffers()
1395 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x4, in vortex_wtdma_setbuffers()
1401 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4), in vortex_wtdma_setbuffers()
1405 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG0 + (wtdma << 3), dma->cfg0); in vortex_wtdma_setbuffers()
1406 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG1 + (wtdma << 3), dma->cfg1); in vortex_wtdma_setbuffers()
1408 vortex_wtdma_setfirstbuffer(vortex, wtdma); in vortex_wtdma_setbuffers()
1409 vortex_wtdma_setstartbuffer(vortex, wtdma, 0); in vortex_wtdma_setbuffers()
1413 vortex_wtdma_setmode(vortex_t * vortex, int wtdma, int ie, int fmt, int d, in vortex_wtdma_setmode() argument
1416 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setmode()
1432 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl); in vortex_wtdma_setmode()
1435 static int vortex_wtdma_bufshift(vortex_t * vortex, int wtdma) in vortex_wtdma_bufshift() argument
1437 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_bufshift()
1441 (hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)) in vortex_wtdma_bufshift()
1464 hwwrite(vortex->mmio, in vortex_wtdma_bufshift()
1470 hwread(vortex->mmio, VORTEX_WTDMA_BUFBASE + in vortex_wtdma_bufshift()
1480 dev_warn(vortex->card->dev, "wt virt = %d, delta = %d\n", in vortex_wtdma_bufshift()
1488 vortex_wtdma_getposition(vortex_t * vortex, int wtdma, int *subbuf, int *pos)
1491 temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2));
1496 static int vortex_wtdma_getcursubuffer(vortex_t * vortex, int wtdma)
1498 return ((hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)) >>
1502 static inline int vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma) in vortex_wtdma_getlinearpos() argument
1504 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_getlinearpos()
1507 temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)); in vortex_wtdma_getlinearpos()
1512 static void vortex_wtdma_startfifo(vortex_t * vortex, int wtdma) in vortex_wtdma_startfifo() argument
1514 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_startfifo()
1519 vortex_fifo_setwtvalid(vortex, wtdma, in vortex_wtdma_startfifo()
1524 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), in vortex_wtdma_startfifo()
1526 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1531 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1539 static void vortex_wtdma_resumefifo(vortex_t * vortex, int wtdma) in vortex_wtdma_resumefifo() argument
1541 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_resumefifo()
1546 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), in vortex_wtdma_resumefifo()
1548 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1553 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1561 static void vortex_wtdma_pausefifo(vortex_t * vortex, int wtdma) in vortex_wtdma_pausefifo() argument
1563 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_pausefifo()
1568 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_pausefifo()
1572 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), in vortex_wtdma_pausefifo()
1574 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_pausefifo()
1581 static void vortex_wtdma_stopfifo(vortex_t * vortex, int wtdma) in vortex_wtdma_stopfifo() argument
1583 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_stopfifo()
1587 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_stopfifo()
1599 static void vortex_adb_init(vortex_t * vortex) in vortex_adb_init() argument
1604 hwwrite(vortex->mmio, VORTEX_ADB_SR, 0); in vortex_adb_init()
1606 hwwrite(vortex->mmio, VORTEX_ADB_RTBASE + (i << 2), in vortex_adb_init()
1607 hwread(vortex->mmio, in vortex_adb_init()
1610 hwwrite(vortex->mmio, VORTEX_ADB_CHNBASE + (i << 2), in vortex_adb_init()
1611 hwread(vortex->mmio, in vortex_adb_init()
1616 static void vortex_adb_en_sr(vortex_t * vortex, int channel) in vortex_adb_en_sr() argument
1618 hwwrite(vortex->mmio, VORTEX_ADB_SR, in vortex_adb_en_sr()
1619 hwread(vortex->mmio, VORTEX_ADB_SR) | (0x1 << channel)); in vortex_adb_en_sr()
1622 static void vortex_adb_dis_sr(vortex_t * vortex, int channel) in vortex_adb_dis_sr() argument
1624 hwwrite(vortex->mmio, VORTEX_ADB_SR, in vortex_adb_dis_sr()
1625 hwread(vortex->mmio, VORTEX_ADB_SR) & ~(0x1 << channel)); in vortex_adb_dis_sr()
1629 vortex_adb_addroutes(vortex_t * vortex, unsigned char channel, in vortex_adb_addroutes() argument
1638 hwwrite(vortex->mmio, in vortex_adb_addroutes()
1642 hwwrite(vortex->mmio, in vortex_adb_addroutes()
1649 hwread(vortex->mmio, in vortex_adb_addroutes()
1653 hwwrite(vortex->mmio, VORTEX_ADB_CHNBASE + (channel << 2), in vortex_adb_addroutes()
1655 vortex_adb_en_sr(vortex, channel); in vortex_adb_addroutes()
1662 hwread(vortex->mmio, in vortex_adb_addroutes()
1665 dev_err(vortex->card->dev, in vortex_adb_addroutes()
1672 hwwrite(vortex->mmio, VORTEX_ADB_RTBASE + (prev << 2), route[0]); in vortex_adb_addroutes()
1676 vortex_adb_delroutes(vortex_t * vortex, unsigned char channel, in vortex_adb_delroutes() argument
1683 hwread(vortex->mmio, in vortex_adb_delroutes()
1687 hwread(vortex->mmio, in vortex_adb_delroutes()
1690 vortex_adb_dis_sr(vortex, channel); in vortex_adb_delroutes()
1691 hwwrite(vortex->mmio, VORTEX_ADB_CHNBASE + (channel << 2), in vortex_adb_delroutes()
1698 hwread(vortex->mmio, in vortex_adb_delroutes()
1701 dev_err(vortex->card->dev, in vortex_adb_delroutes()
1708 temp = hwread(vortex->mmio, VORTEX_ADB_RTBASE + (temp << 2)); in vortex_adb_delroutes()
1710 temp = hwread(vortex->mmio, VORTEX_ADB_RTBASE + (temp << 2)); in vortex_adb_delroutes()
1712 hwwrite(vortex->mmio, VORTEX_ADB_RTBASE + (prev << 2), temp); in vortex_adb_delroutes()
1716 vortex_route(vortex_t * vortex, int en, unsigned char channel, in vortex_route() argument
1723 vortex_adb_addroutes(vortex, channel, &route, 1); in vortex_route()
1726 vortex_src_addWTD(vortex, (source - OFFSET_SRCOUT), in vortex_route()
1730 vortex_mixer_addWTD(vortex, in vortex_route()
1733 vortex_adb_delroutes(vortex, channel, route, route); in vortex_route()
1736 vortex_src_delWTD(vortex, (source - OFFSET_SRCOUT), in vortex_route()
1740 vortex_mixer_delWTD(vortex, in vortex_route()
1747 vortex_routes(vortex_t * vortex, int en, unsigned char channel,
1756 vortex_adb_addroutes(vortex, channel, route, 2);
1759 vortex_src_addWTD(vortex, (source - OFFSET_SRCOUT),
1763 vortex_mixer_addWTD(vortex,
1766 vortex_adb_delroutes(vortex, channel, route[0], route[1]);
1769 vortex_src_delWTD(vortex, (source - OFFSET_SRCOUT),
1773 vortex_mixer_delWTD(vortex,
1781 vortex_routeLRT(vortex_t * vortex, int en, unsigned char ch, in vortex_routeLRT() argument
1794 vortex_adb_addroutes(vortex, ch, route, 2); in vortex_routeLRT()
1797 vortex_src_addWTD(vortex, in vortex_routeLRT()
1799 vortex_src_addWTD(vortex, in vortex_routeLRT()
1803 vortex_mixer_addWTD(vortex, in vortex_routeLRT()
1805 vortex_mixer_addWTD(vortex, in vortex_routeLRT()
1809 vortex_adb_delroutes(vortex, ch, route[0], route[1]); in vortex_routeLRT()
1812 vortex_src_delWTD(vortex, in vortex_routeLRT()
1814 vortex_src_delWTD(vortex, in vortex_routeLRT()
1818 vortex_mixer_delWTD(vortex, in vortex_routeLRT()
1820 vortex_mixer_delWTD(vortex, in vortex_routeLRT()
1830 vortex_connection_adbdma_src(vortex_t * vortex, int en, unsigned char ch, in vortex_connection_adbdma_src() argument
1833 vortex_route(vortex, en, ch, ADB_DMA(adbdma), ADB_SRCIN(src)); in vortex_connection_adbdma_src()
1838 vortex_connection_src_mixin(vortex_t * vortex, int en, in vortex_connection_src_mixin() argument
1842 vortex_route(vortex, en, channel, ADB_SRCOUT(src), ADB_MIXIN(mixin)); in vortex_connection_src_mixin()
1847 vortex_connection_mixin_mix(vortex_t * vortex, int en, unsigned char mixin, in vortex_connection_mixin_mix() argument
1851 vortex_mix_enableinput(vortex, mix, mixin); in vortex_connection_mixin_mix()
1852 vortex_mix_setinputvolumebyte(vortex, mix, mixin, MIX_DEFIGAIN); // added to original code. in vortex_connection_mixin_mix()
1854 vortex_mix_disableinput(vortex, mix, mixin, a); in vortex_connection_mixin_mix()
1859 vortex_connection_adb_mixin(vortex_t * vortex, int en, in vortex_connection_adb_mixin() argument
1863 vortex_route(vortex, en, channel, source, ADB_MIXIN(mixin)); in vortex_connection_adb_mixin()
1867 vortex_connection_src_adbdma(vortex_t * vortex, int en, unsigned char ch, in vortex_connection_src_adbdma() argument
1870 vortex_route(vortex, en, ch, ADB_SRCOUT(src), ADB_DMA(adbdma)); in vortex_connection_src_adbdma()
1874 vortex_connection_src_src_adbdma(vortex_t * vortex, int en, in vortex_connection_src_src_adbdma() argument
1879 vortex_routeLRT(vortex, en, ch, ADB_SRCOUT(src0), ADB_SRCOUT(src1), in vortex_connection_src_src_adbdma()
1885 vortex_connection_mix_adb(vortex_t * vortex, int en, unsigned char ch, in vortex_connection_mix_adb() argument
1888 vortex_route(vortex, en, ch, ADB_MIXOUT(mix), dest); in vortex_connection_mix_adb()
1889 vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); // added to original code. in vortex_connection_mix_adb()
1894 vortex_connection_mix_src(vortex_t * vortex, int en, unsigned char ch, in vortex_connection_mix_src() argument
1897 vortex_route(vortex, en, ch, ADB_MIXOUT(mix), ADB_SRCIN(src)); in vortex_connection_mix_src()
1898 vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); // added to original code. in vortex_connection_mix_src()
1903 vortex_connection_adbdma_src_src(vortex_t * vortex, int en,
1908 vortex_routes(vortex, en, channel, ADB_DMA(adbdma),
1914 vortex_connection_mix_mix_adbdma(vortex_t * vortex, int en,
1928 vortex_adb_addroutes(vortex, ch, routes, 0x2);
1929 vortex_mixer_addWTD(vortex, mix0, ch);
1930 vortex_mixer_addWTD(vortex, mix1, ch);
1932 vortex_adb_delroutes(vortex, ch, routes[0], routes[1]);
1933 vortex_mixer_delWTD(vortex, mix0, ch);
1934 vortex_mixer_delWTD(vortex, mix1, ch);
1942 vortex_connect_codecplay(vortex_t * vortex, int en, unsigned char mixers[]) in vortex_connect_codecplay() argument
1945 vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_CODECOUT(0)); in vortex_connect_codecplay()
1946 vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_CODECOUT(1)); in vortex_connect_codecplay()
1950 vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_EQIN(0)); in vortex_connect_codecplay()
1951 vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_EQIN(1)); in vortex_connect_codecplay()
1953 vortex_mix_setvolumebyte(vortex, mixers[0], 0); in vortex_connect_codecplay()
1954 vortex_mix_setvolumebyte(vortex, mixers[1], 0); in vortex_connect_codecplay()
1955 vortex_route(vortex, en, 0x11, ADB_EQOUT(0), ADB_CODECOUT(0)); in vortex_connect_codecplay()
1956 vortex_route(vortex, en, 0x11, ADB_EQOUT(1), ADB_CODECOUT(1)); in vortex_connect_codecplay()
1959 if (VORTEX_IS_QUAD(vortex)) { in vortex_connect_codecplay()
1961 vortex_connection_mix_adb(vortex, en, 0x11, mixers[2], in vortex_connect_codecplay()
1963 vortex_connection_mix_adb(vortex, en, 0x11, mixers[3], in vortex_connect_codecplay()
1969 vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_CODECOUT(0)); in vortex_connect_codecplay()
1970 vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_CODECOUT(1)); in vortex_connect_codecplay()
1976 vortex_connect_codecrec(vortex_t * vortex, int en, unsigned char mixin0, in vortex_connect_codecrec() argument
1985 vortex_connection_adb_mixin(vortex, en, 0x11, ADB_CODECIN(0), mixin0); in vortex_connect_codecrec()
1986 vortex_connection_adb_mixin(vortex, en, 0x11, ADB_CODECIN(1), mixin1); in vortex_connect_codecrec()
2002 vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype) in vortex_adb_checkinout() argument
2009 resinuse |= vortex->dma_adb[i].resources[restype]; in vortex_adb_checkinout()
2011 resinuse |= vortex->fixed_res[restype]; in vortex_adb_checkinout()
2018 vortex->dma_adb[i].resources[restype] |= (1 << i); in vortex_adb_checkinout()
2043 dev_err(vortex->card->dev, in vortex_adb_checkinout()
2051 static void vortex_connect_default(vortex_t * vortex, int en) in vortex_connect_default() argument
2054 vortex->mixplayb[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2056 vortex->mixplayb[1] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2058 if (VORTEX_IS_QUAD(vortex)) { in vortex_connect_default()
2059 vortex->mixplayb[2] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2061 vortex->mixplayb[3] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2064 vortex_connect_codecplay(vortex, en, vortex->mixplayb); in vortex_connect_default()
2066 vortex->mixcapt[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2068 vortex->mixcapt[1] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2070 vortex_connect_codecrec(vortex, en, MIX_CAPT(0), MIX_CAPT(1)); in vortex_connect_default()
2074 vortex->mixspdif[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2076 vortex->mixspdif[1] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2078 vortex_connection_mix_adb(vortex, en, 0x14, vortex->mixspdif[0], in vortex_connect_default()
2080 vortex_connection_mix_adb(vortex, en, 0x14, vortex->mixspdif[1], in vortex_connect_default()
2085 vortex_wt_connect(vortex, en); in vortex_connect_default()
2089 vortex_Vort3D_connect(vortex, en); in vortex_connect_default()
2109 vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir, in vortex_adb_allocroute() argument
2118 vortex_adb_checkinout(vortex, in vortex_adb_allocroute()
2119 vortex->dma_adb[dma].resources, en, in vortex_adb_allocroute()
2123 dma = vortex_adb_checkinout(vortex, NULL, en, in vortex_adb_allocroute()
2129 stream = &vortex->dma_adb[dma]; in vortex_adb_allocroute()
2143 src[i] = vortex_adb_checkinout(vortex, in vortex_adb_allocroute()
2152 mix[i] = vortex_adb_checkinout(vortex, in vortex_adb_allocroute()
2167 a3d = vortex_adb_checkinout(vortex, in vortex_adb_allocroute()
2173 dev_err(vortex->card->dev, in vortex_adb_allocroute()
2178 vortex_Vort3D_InitializeSource(&vortex->a3d[a3d], en, in vortex_adb_allocroute()
2179 vortex); in vortex_adb_allocroute()
2183 vortex_route(vortex, 0, 0x14, in vortex_adb_allocroute()
2184 ADB_MIXOUT(vortex->mixspdif[0]), in vortex_adb_allocroute()
2186 vortex_route(vortex, 0, 0x14, in vortex_adb_allocroute()
2187 ADB_MIXOUT(vortex->mixspdif[1]), in vortex_adb_allocroute()
2194 vortex_connection_adbdma_src(vortex, en, in vortex_adb_allocroute()
2198 vortex_connection_src_mixin(vortex, en, in vortex_adb_allocroute()
2201 vortex_connection_mixin_mix(vortex, en, in vortex_adb_allocroute()
2205 vortex_connection_mixin_mix(vortex, en, in vortex_adb_allocroute()
2208 vortex_mix_setinputvolumebyte(vortex, in vortex_adb_allocroute()
2216 vortex_connection_adbdma_src(vortex, en, in vortex_adb_allocroute()
2220 vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_A3DIN(a3d)); in vortex_adb_allocroute()
2226 vortex_route(vortex, en, 0x14, in vortex_adb_allocroute()
2232 ch_top = (VORTEX_IS_QUAD(vortex) ? 4 : 2); in vortex_adb_allocroute()
2234 vortex_connection_mixin_mix(vortex, en, in vortex_adb_allocroute()
2238 vortex_connection_mixin_mix(vortex, en, in vortex_adb_allocroute()
2242 vortex_mix_setinputvolumebyte(vortex, in vortex_adb_allocroute()
2249 p = &vortex->pcm_vol[subdev]; in vortex_adb_allocroute()
2260 vortex_route(vortex, en, 0x14, in vortex_adb_allocroute()
2266 vortex_route(vortex, 1, 0x14, in vortex_adb_allocroute()
2267 ADB_MIXOUT(vortex->mixspdif[0]), in vortex_adb_allocroute()
2269 vortex_route(vortex, 1, 0x14, in vortex_adb_allocroute()
2270 ADB_MIXOUT(vortex->mixspdif[1]), in vortex_adb_allocroute()
2283 mix[i] = vortex_adb_checkinout(vortex, in vortex_adb_allocroute()
2291 src[i] = vortex_adb_checkinout(vortex, in vortex_adb_allocroute()
2302 vortex_connection_mixin_mix(vortex, en, MIX_CAPT(0), mix[0], 0); in vortex_adb_allocroute()
2303 vortex_connection_mix_src(vortex, en, 0x11, mix[0], src[0]); in vortex_adb_allocroute()
2305 vortex_connection_mixin_mix(vortex, en, in vortex_adb_allocroute()
2307 vortex_connection_src_adbdma(vortex, en, in vortex_adb_allocroute()
2311 vortex_connection_mixin_mix(vortex, en, in vortex_adb_allocroute()
2313 vortex_connection_mix_src(vortex, en, 0x11, mix[1], in vortex_adb_allocroute()
2315 vortex_connection_src_src_adbdma(vortex, en, in vortex_adb_allocroute()
2320 vortex->dma_adb[dma].nr_ch = nr_ch; in vortex_adb_allocroute()
2326 snd_ac97_write_cache(vortex->codec, in vortex_adb_allocroute()
2328 snd_ac97_read(vortex->codec, in vortex_adb_allocroute()
2333 snd_ac97_write_cache(vortex->codec, in vortex_adb_allocroute()
2335 snd_ac97_read(vortex->codec, in vortex_adb_allocroute()
2348 vortex_adb_setsrc(vortex_t * vortex, int adbdma, unsigned int rate, int dir) in vortex_adb_setsrc() argument
2350 stream_t *stream = &(vortex->dma_adb[adbdma]); in vortex_adb_setsrc()
2362 vortex_src_setupchannel(vortex, i, cvrt, 0, 0, i, dir, 1, cvrt, dir); in vortex_adb_setsrc()
2368 static void vortex_settimer(vortex_t * vortex, int period) in vortex_settimer() argument
2371 hwwrite(vortex->mmio, VORTEX_IRQ_STAT, period); in vortex_settimer()
2405 vortex_t *vortex = dev_id; in vortex_interrupt() local
2410 if (!(hwread(vortex->mmio, VORTEX_STAT) & 0x1)) in vortex_interrupt()
2414 if (!(hwread(vortex->mmio, VORTEX_CTRL) & CTRL_IRQ_ENABLE)) in vortex_interrupt()
2417 source = hwread(vortex->mmio, VORTEX_IRQ_SOURCE); in vortex_interrupt()
2419 hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, source); in vortex_interrupt()
2420 hwread(vortex->mmio, VORTEX_IRQ_SOURCE); in vortex_interrupt()
2423 dev_err(vortex->card->dev, "missing irq source\n"); in vortex_interrupt()
2431 dev_err(vortex->card->dev, "IRQ fatal error\n"); in vortex_interrupt()
2434 dev_err(vortex->card->dev, "IRQ parity error\n"); in vortex_interrupt()
2437 dev_err(vortex->card->dev, "IRQ reg error\n"); in vortex_interrupt()
2440 dev_err(vortex->card->dev, "IRQ fifo error\n"); in vortex_interrupt()
2443 dev_err(vortex->card->dev, "IRQ dma error\n"); in vortex_interrupt()
2449 spin_lock(&vortex->lock); in vortex_interrupt()
2451 if (vortex->dma_adb[i].fifo_status == FIFO_START) { in vortex_interrupt()
2452 if (!vortex_adbdma_bufshift(vortex, i)) in vortex_interrupt()
2454 spin_unlock(&vortex->lock); in vortex_interrupt()
2455 snd_pcm_period_elapsed(vortex->dma_adb[i]. in vortex_interrupt()
2457 spin_lock(&vortex->lock); in vortex_interrupt()
2462 if (vortex->dma_wt[i].fifo_status == FIFO_START) { in vortex_interrupt()
2468 vortex_wtdma_bufshift(vortex, i); in vortex_interrupt()
2469 spin_unlock(&vortex->lock); in vortex_interrupt()
2470 snd_pcm_period_elapsed(vortex->dma_wt[i]. in vortex_interrupt()
2472 spin_lock(&vortex->lock); in vortex_interrupt()
2476 spin_unlock(&vortex->lock); in vortex_interrupt()
2481 hwread(vortex->mmio, VORTEX_IRQ_STAT); in vortex_interrupt()
2484 if ((source & IRQ_MIDI) && vortex->rmidi) { in vortex_interrupt()
2485 snd_mpu401_uart_interrupt(vortex->irq, in vortex_interrupt()
2486 vortex->rmidi->private_data); in vortex_interrupt()
2491 dev_err(vortex->card->dev, "unknown irq source %x\n", source); in vortex_interrupt()
2499 static void vortex_codec_init(vortex_t * vortex) in vortex_codec_init() argument
2505 hwwrite(vortex->mmio, (VORTEX_CODEC_CHN + (i << 2)), -i); in vortex_codec_init()
2509 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x8068); in vortex_codec_init()
2511 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x00e8); in vortex_codec_init()
2514 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x00a8); in vortex_codec_init()
2516 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x80a8); in vortex_codec_init()
2518 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x80e8); in vortex_codec_init()
2520 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x80a8); in vortex_codec_init()
2522 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x00a8); in vortex_codec_init()
2524 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0x00e8); in vortex_codec_init()
2527 hwwrite(vortex->mmio, (VORTEX_CODEC_CHN + (i << 2)), -i); in vortex_codec_init()
2530 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0xe8); in vortex_codec_init()
2533 hwwrite(vortex->mmio, VORTEX_CODEC_EN, in vortex_codec_init()
2534 hwread(vortex->mmio, VORTEX_CODEC_EN) | EN_CODEC); in vortex_codec_init()
2601 static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode) in vortex_spdif_init() argument
2606 hwwrite(vortex->mmio, VORTEX_SPDIF_FLAGS, in vortex_spdif_init()
2607 hwread(vortex->mmio, VORTEX_SPDIF_FLAGS) & 0xfff3fffd); in vortex_spdif_init()
2610 hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1 + (i << 2), 0); in vortex_spdif_init()
2612 hwwrite(vortex->mmio, VORTEX_CODEC_EN, in vortex_spdif_init()
2613 hwread(vortex->mmio, VORTEX_CODEC_EN) | EN_SPDIF); in vortex_spdif_init()
2629 vortex_src_setupchannel(vortex, this_04, edi, 0, 1, in vortex_spdif_init()
2631 vortex_src_setupchannel(vortex, this_08, edi, 0, 1, in vortex_spdif_init()
2676 hwwrite(vortex->mmio, VORTEX_SPDIF_CFG0, this_38 & 0xffff); in vortex_spdif_init()
2677 hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1, this_38 >> 0x10); in vortex_spdif_init()
2678 hwwrite(vortex->mmio, VORTEX_SPDIF_SMPRATE, spdif_sr); in vortex_spdif_init()
2683 static int vortex_core_init(vortex_t *vortex) in vortex_core_init() argument
2686 dev_info(vortex->card->dev, "init started\n"); in vortex_core_init()
2688 hwwrite(vortex->mmio, VORTEX_CTRL, 0xffffffff); in vortex_core_init()
2690 hwwrite(vortex->mmio, VORTEX_CTRL, in vortex_core_init()
2691 hwread(vortex->mmio, VORTEX_CTRL) & 0xffdfffff); in vortex_core_init()
2694 hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, 0xffffffff); in vortex_core_init()
2695 hwread(vortex->mmio, VORTEX_IRQ_STAT); in vortex_core_init()
2697 vortex_codec_init(vortex); in vortex_core_init()
2700 hwwrite(vortex->mmio, VORTEX_CTRL, in vortex_core_init()
2701 hwread(vortex->mmio, VORTEX_CTRL) | 0x1000000); in vortex_core_init()
2705 vortex_adbdma_init(vortex); in vortex_core_init()
2706 hwwrite(vortex->mmio, VORTEX_ENGINE_CTRL, 0x0); //, 0xc83c7e58, 0xc5f93e58 in vortex_core_init()
2707 vortex_adb_init(vortex); in vortex_core_init()
2709 vortex_fifo_init(vortex); in vortex_core_init()
2710 vortex_mixer_init(vortex); in vortex_core_init()
2711 vortex_srcblock_init(vortex); in vortex_core_init()
2713 vortex_eq_init(vortex); in vortex_core_init()
2714 vortex_spdif_init(vortex, 48000, 1); in vortex_core_init()
2715 vortex_Vort3D_enable(vortex); in vortex_core_init()
2718 vortex_wt_init(vortex); in vortex_core_init()
2723 vortex_settimer(vortex, 0x90); in vortex_core_init()
2731 dev_info(vortex->card->dev, "init.... done.\n"); in vortex_core_init()
2732 spin_lock_init(&vortex->lock); in vortex_core_init()
2737 static int vortex_core_shutdown(vortex_t * vortex) in vortex_core_shutdown() argument
2740 dev_info(vortex->card->dev, "shutdown started\n"); in vortex_core_shutdown()
2742 vortex_eq_free(vortex); in vortex_core_shutdown()
2743 vortex_Vort3D_disable(vortex); in vortex_core_shutdown()
2746 vortex_disable_int(vortex); in vortex_core_shutdown()
2747 vortex_connect_default(vortex, 0); in vortex_core_shutdown()
2749 vortex_fifo_init(vortex); in vortex_core_shutdown()
2751 vortex_adb_init(vortex); in vortex_core_shutdown()
2757 hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0); in vortex_core_shutdown()
2758 hwwrite(vortex->mmio, VORTEX_CTRL, 0); in vortex_core_shutdown()
2760 hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, 0xffff); in vortex_core_shutdown()
2762 dev_info(vortex->card->dev, "shutdown.... done.\n"); in vortex_core_shutdown()
2815 vortex_translateformat(vortex_t * vortex, char bits, char nch, int encod)
2855 static void vortex_cdmacore_setformat(vortex_t * vortex, int bits, int nch)