Lines Matching +full:4 +full:- +full:temp
1 // SPDX-License-Identifier: GPL-2.0-or-later
45 01-03-2003 First revision.
46 01-21-2003 Some bug fixes.
47 17-02-2003 many bugfixes after a big versioning mess.
48 18-02-2003 JAAAAAHHHUUUUUU!!!! The mixer works !! I'm just so happy !
51 20-02-2003 First steps into the ALSA world.
52 28-02-2003 As my birthday present, i discovered how the DMA buffer pages really
53 work :-). It was all wrong.
54 12-03-2003 ALSA driver starts working (2 channels).
55 16-03-2003 More srcblock_setupchannel discoveries.
56 12-04-2003 AU8830 playback support. Recording in the works.
57 17-04-2003 vortex_route() and vortex_routes() bug fixes. AU8830 recording
59 16-05-2003 SrcSetupChannel cleanup. Moved the Src setup stuff entirely
61 06-06-2003 Buffer shifter bugfix. Mixer volume fix.
62 07-12-2003 A3D routing finally fixed. Believed to be OK.
63 25-03-2004 Many thanks to Claudia, for such valuable bug reports.
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()
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()
93 hwwrite(vortex->mmio, VORTEX_MIX_INVOL_A + ((mix << 5) + channel),
95 hwwrite(vortex->mmio, VORTEX_MIX_INVOL_B + ((mix << 5) + channel),
102 a = hwread(vortex->mmio, VORTEX_MIX_VOL_A + (mix << 2)) & 0xff;
114 a = hwread(vortex->mmio,
139 a = hwread(vortex->mmio,
141 if (a > -126) {
142 a -= 2;
143 hwwrite(vortex->mmio,
146 hwwrite(vortex->mmio,
157 int addr, temp;
163 temp = hwread(vortex->mmio, VORTEX_MIX_ENIN + addr);
164 return ((temp >> (mixin & 3)) & 1);
171 int temp; in vortex_mix_setvolumebyte() local
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()
175 if ((temp != 0x80) || (vol == 0x80)) in vortex_mix_setvolumebyte()
178 hwwrite(vortex->mmio, VORTEX_MIX_VOL_B + (mix << 2), vol); in vortex_mix_setvolumebyte()
185 int temp; in vortex_mix_setinputvolumebyte() local
187 hwwrite(vortex->mmio, in vortex_mix_setinputvolumebyte()
190 temp = in vortex_mix_setinputvolumebyte()
191 hwread(vortex->mmio, in vortex_mix_setinputvolumebyte()
193 if ((temp != 0x80) || (vol == 0x80)) in vortex_mix_setinputvolumebyte()
196 hwwrite(vortex->mmio, in vortex_mix_setinputvolumebyte()
203 int temp, addr; in vortex_mix_setenablebit() local
210 temp = hwread(vortex->mmio, VORTEX_MIX_ENIN + addr); in vortex_mix_setenablebit()
212 temp |= (1 << (mixin & 3)); in vortex_mix_setenablebit()
214 temp &= ~(1 << (mixin & 3)); 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()
261 int temp, lifeboat = 0, prev; in vortex_mixer_addWTD() local
263 temp = hwread(vortex->mmio, VORTEX_MIXER_SR); in vortex_mixer_addWTD()
264 if ((temp & (1 << ch)) == 0) { in vortex_mixer_addWTD()
265 hwwrite(vortex->mmio, VORTEX_MIXER_CHNBASE + (ch << 2), mix); in vortex_mixer_addWTD()
270 temp = hwread(vortex->mmio, prev); in vortex_mixer_addWTD()
271 while (temp & 0x10) { in vortex_mixer_addWTD()
272 prev = VORTEX_MIXER_RTBASE + ((temp & 0xf) << 2); in vortex_mixer_addWTD()
273 temp = hwread(vortex->mmio, prev); in vortex_mixer_addWTD()
274 //printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp); 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()
289 int esp14 = -1, esp18, eax, ebx, edx, ebp, esi = 0; in vortex_mixer_delWTD()
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()
340 if (esp14 == -1) 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()
360 hwwrite(vortex->mmio, ebp, 0); in vortex_mixer_delWTD()
375 for (x = 0x5f; x >= 0; x--) { in vortex_mixer_init()
376 hwwrite(vortex->mmio, addr, 0); in vortex_mixer_init()
377 addr -= 4; in vortex_mixer_init()
380 for (x = 0x7f; x >= 0; x--) { in vortex_mixer_init()
381 hwwrite(vortex->mmio, addr, 0); in vortex_mixer_init()
382 addr -= 4; in vortex_mixer_init()
385 for (x = 0x5f; x >= 0; x--) { in vortex_mixer_init()
386 hwwrite(vortex->mmio, addr, 0); in vortex_mixer_init()
387 addr -= 4; in vortex_mixer_init()
390 for (x = 0x1ff; x >= 0; x--) { in vortex_mixer_init()
391 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
392 addr -= 4; in vortex_mixer_init()
395 for (x = 0xf; x >= 0; x--) { in vortex_mixer_init()
396 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
397 addr -= 4; in vortex_mixer_init()
400 for (x = 0x1ff; x >= 0; x--) { in vortex_mixer_init()
401 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
402 addr -= 4; in vortex_mixer_init()
405 for (x = 0xf; x >= 0; x--) { in vortex_mixer_init()
406 hwwrite(vortex->mmio, addr, 0x80); in vortex_mixer_init()
407 addr -= 4; in vortex_mixer_init()
409 addr = VORTEX_MIXER_RTBASE + (MIXER_RTBASE_SIZE - 1) * 4; in vortex_mixer_init()
410 for (x = (MIXER_RTBASE_SIZE - 1); x >= 0; x--) { in vortex_mixer_init()
411 hwwrite(vortex->mmio, addr, 0x0); in vortex_mixer_init()
412 addr -= 4; in vortex_mixer_init()
414 hwwrite(vortex->mmio, VORTEX_MIXER_SR, 0); in vortex_mixer_init()
419 hwwrite(vortex->mmio, VORTEX_MIXER_CLIP + (x << 2), 0x3ffff); in vortex_mixer_init()
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()
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()
447 for (i = 0x1f; i >= 0; i--) in vortex_src_flushbuffers()
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()
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()
464 int temp; in vortex_src_set_throttlesource() local
466 temp = hwread(vortex->mmio, VORTEX_SRC_SOURCE); in vortex_src_set_throttlesource()
468 temp |= 1 << src; in vortex_src_set_throttlesource()
470 temp &= ~(1 << src); in vortex_src_set_throttlesource()
471 hwwrite(vortex->mmio, VORTEX_SRC_SOURCE, temp); in vortex_src_set_throttlesource()
477 int temp, lifeboat = 0; in vortex_src_persist_convratio() local
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()
487 while (temp != ratio); in vortex_src_persist_convratio()
488 return temp; in vortex_src_persist_convratio()
494 int temp;
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));
499 if (temp & 0x200)
500 hwwrite(vortex->mmio, VORTEX_SRC_U0 + (src << 2),
501 temp & ~0x200L);
507 int temp, a;
511 a = (0x11 - ((ratio >> 0xe) & 0x3)) - 1;
513 a = (0x11 - ((ratio >> 0xe) & 0x3)) - 2;
516 temp = hwread(vortex->mmio, VORTEX_SRC_U0 + (src << 2));
517 if (((temp >> 4) & 0xf) != a)
518 hwwrite(vortex->mmio, VORTEX_SRC_U0 + (src << 2),
519 (temp & 0xf) | ((a & 0xf) << 4));
530 hw_ratio = hwread(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2));
533 hwwrite(vortex->mmio, VORTEX_SRC_CONVRATIO + (src << 2), desired_ratio);
536 pr_err( "Vortex: could not set src-%d from %d to %d\n",
563 // noplayback: d=2,4,7,0xa,0xb when using first 2 src's. in vortex_src_setupchannel()
590 esi = 0x11 - ((cr >> 0xe) & 7); in vortex_src_setupchannel()
592 esi -= 1; in vortex_src_setupchannel()
594 esi -= 2; in vortex_src_setupchannel()
616 hwwrite(card->mmio, VORTEX_SRC_U0 + (src << 2), in vortex_src_setupchannel()
617 (sl << 0x9) | (sweep << 0x8) | ((esi & 0xf) << 4) | d); in vortex_src_setupchannel()
620 hwwrite(card->mmio, VORTEX_SRC_U1 + (src << 2), b & 0xffff); in vortex_src_setupchannel()
622 hwwrite(card->mmio, VORTEX_SRC_U2 + (src << 2), in vortex_src_setupchannel()
632 hwwrite(vortex->mmio, VORTEX_SRC_SOURCESIZE, 0x1ff); in vortex_srcblock_init()
641 for (x = 0xf; x >= 0; x--) { in vortex_srcblock_init()
642 hwwrite(vortex->mmio, addr, 0); in vortex_srcblock_init()
643 addr -= 4; in vortex_srcblock_init()
648 for (x = 0x15; x >= 0; x--) { in vortex_srcblock_init()
649 hwwrite(vortex->mmio, addr, 0); in vortex_srcblock_init()
650 addr -= 4; in vortex_srcblock_init()
657 int temp, lifeboat = 0, prev; in vortex_src_addWTD() local
660 temp = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR); in vortex_src_addWTD()
661 if ((temp & (1 << ch)) == 0) { in vortex_src_addWTD()
662 hwwrite(vortex->mmio, VORTEX_SRC_CHNBASE + (ch << 2), src); in vortex_src_addWTD()
667 temp = hwread(vortex->mmio, prev); in vortex_src_addWTD()
668 //while (temp & NR_SRC) { in vortex_src_addWTD()
669 while (temp & 0x10) { in vortex_src_addWTD()
670 prev = VORTEX_SRC_RTBASE + ((temp & 0xf) << 2); /*esp12 */ in vortex_src_addWTD()
671 //prev = VORTEX_SRC_RTBASE + ((temp & (NR_SRC-1)) << 2); /*esp12*/ in vortex_src_addWTD()
672 temp = hwread(vortex->mmio, prev); in vortex_src_addWTD()
673 //printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp); 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()
681 //hwwrite(vortex->mmio, prev, (temp & (NR_SRC-1)) | NR_SRC); in vortex_src_addWTD()
682 hwwrite(vortex->mmio, prev, (temp & 0xf) | 0x10); in vortex_src_addWTD()
689 int esp14 = -1, esp18, eax, ebx, edx, ebp, esi = 0; in vortex_src_delWTD()
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()
740 if (esp14 == -1) 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()
759 hwwrite(vortex->mmio, ebp, 0); in vortex_src_delWTD()
769 for (x--; x >= 0; x--) in vortex_fifo_clearadbdata()
770 hwwrite(vortex->mmio, in vortex_fifo_clearadbdata()
780 hwwrite(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2),
783 hwwrite(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2),
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()
792 0xffffffef) | ((1 & en) << 4) | FIFO_U1); in vortex_fifo_setadbvalid()
799 int temp, lifeboat = 0; in vortex_fifo_setadbctrl() local
808 temp = hwread(vortex->mmio, VORTEX_FIFO_ADBCTRL + (fifo << 2)); in vortex_fifo_setadbctrl()
810 dev_err(vortex->card->dev, in vortex_fifo_setadbctrl()
815 while (temp & FIFO_RDONLY); in vortex_fifo_setadbctrl()
820 if ((temp & FIFO_VALID) == 0) { in vortex_fifo_setadbctrl()
824 temp = (this_4 & 0x1f) << 0xb; in vortex_fifo_setadbctrl()
826 temp = (this_4 & 0x3f) << 0xc; in vortex_fifo_setadbctrl()
828 temp = (temp & 0xfffffffd) | ((stereo & 1) << 1); in vortex_fifo_setadbctrl()
829 temp = (temp & 0xfffffff3) | ((priority & 3) << 2); in vortex_fifo_setadbctrl()
830 temp = (temp & 0xffffffef) | ((valid & 1) << 4); in vortex_fifo_setadbctrl()
831 temp |= FIFO_U1; in vortex_fifo_setadbctrl()
832 temp = (temp & 0xffffffdf) | ((empty & 1) << 5); in vortex_fifo_setadbctrl()
834 temp = (temp & 0xfffbffff) | ((f & 1) << 0x12); in vortex_fifo_setadbctrl()
837 temp = (temp & 0xf7ffffff) | ((f & 1) << 0x1b); in vortex_fifo_setadbctrl()
838 temp = (temp & 0xefffffff) | ((f & 1) << 0x1c); in vortex_fifo_setadbctrl()
841 temp = (temp & 0xfeffffff) | ((f & 1) << 0x18); in vortex_fifo_setadbctrl()
842 temp = (temp & 0xfdffffff) | ((f & 1) << 0x19); in vortex_fifo_setadbctrl()
846 if (temp & FIFO_VALID) { in vortex_fifo_setadbctrl()
848 temp = ((f & 1) << 0x12) | (temp & 0xfffbffef); in vortex_fifo_setadbctrl()
851 temp = in vortex_fifo_setadbctrl()
852 ((f & 1) << 0x1b) | (temp & 0xe7ffffef) | FIFO_BITS; in vortex_fifo_setadbctrl()
855 temp = in vortex_fifo_setadbctrl()
856 ((f & 1) << 0x18) | (temp & 0xfcffffef) | FIFO_BITS; 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()
871 for (x--; x >= 0; x--) in vortex_fifo_clearwtdata()
872 hwwrite(vortex->mmio, in vortex_fifo_clearwtdata()
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()
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()
893 0xffffffef) | ((en & 1) << 4) | FIFO_U1); in vortex_fifo_setwtvalid()
900 int temp = 0, lifeboat = 0; in vortex_fifo_setwtctrl() local
904 temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); in vortex_fifo_setwtctrl()
906 dev_err(vortex->card->dev, in vortex_fifo_setwtctrl()
911 while (temp & FIFO_RDONLY); in vortex_fifo_setwtctrl()
914 if ((temp & FIFO_VALID) == 0) { in vortex_fifo_setwtctrl()
917 temp = (this_4 & 0x1f) << 0xb; in vortex_fifo_setwtctrl()
919 temp = (this_4 & 0x3f) << 0xc; in vortex_fifo_setwtctrl()
921 temp = (temp & 0xfffffffd) | ((ctrl & 1) << 1); in vortex_fifo_setwtctrl()
922 temp = (temp & 0xfffffff3) | ((priority & 3) << 2); in vortex_fifo_setwtctrl()
923 temp = (temp & 0xffffffef) | ((valid & 1) << 4); in vortex_fifo_setwtctrl()
924 temp |= FIFO_U1; in vortex_fifo_setwtctrl()
925 temp = (temp & 0xffffffdf) | ((empty & 1) << 5); in vortex_fifo_setwtctrl()
927 temp = (temp & 0xfffbffff) | ((f & 1) << 0x12); in vortex_fifo_setwtctrl()
930 temp = (temp & 0xf7ffffff) | ((f & 1) << 0x1b); in vortex_fifo_setwtctrl()
931 temp = (temp & 0xefffffff) | ((f & 1) << 0x1c); in vortex_fifo_setwtctrl()
934 temp = (temp & 0xfeffffff) | ((f & 1) << 0x18); in vortex_fifo_setwtctrl()
935 temp = (temp & 0xfdffffff) | ((f & 1) << 0x19); in vortex_fifo_setwtctrl()
939 if (temp & FIFO_VALID) { in vortex_fifo_setwtctrl()
941 temp = ((f & 1) << 0x12) | (temp & 0xfffbffef); in vortex_fifo_setwtctrl()
944 temp = in vortex_fifo_setwtctrl()
945 ((f & 1) << 0x1b) | (temp & 0xe7ffffef) | FIFO_BITS; in vortex_fifo_setwtctrl()
948 temp = in vortex_fifo_setwtctrl()
949 ((f & 1) << 0x18) | (temp & 0xfcffffef) | FIFO_BITS; 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()
960 temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); in vortex_fifo_setwtctrl()
965 } while ((temp & FIFO_RDONLY)&&(temp & FIFO_VALID)&&(temp != 0xFFFFFFFF)); in vortex_fifo_setwtctrl()
969 if (temp & FIFO_VALID) { in vortex_fifo_setwtctrl()
970 temp = 0x40000; in vortex_fifo_setwtctrl()
971 //temp |= 0x08000000; in vortex_fifo_setwtctrl()
972 //temp |= 0x10000000; in vortex_fifo_setwtctrl()
973 //temp |= 0x04000000; in vortex_fifo_setwtctrl()
974 //temp |= 0x00400000; in vortex_fifo_setwtctrl()
975 temp |= 0x1c400000; in vortex_fifo_setwtctrl()
976 temp &= 0xFFFFFFF3; in vortex_fifo_setwtctrl()
977 temp &= 0xFFFFFFEF; in vortex_fifo_setwtctrl()
978 temp |= (valid & 1) << 4; in vortex_fifo_setwtctrl()
979 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp); in vortex_fifo_setwtctrl()
986 temp &= 0xffffffef; in vortex_fifo_setwtctrl()
987 temp |= 0x08000000; in vortex_fifo_setwtctrl()
988 temp |= 0x10000000; in vortex_fifo_setwtctrl()
989 temp |= 0x04000000; in vortex_fifo_setwtctrl()
990 temp |= 0x00400000; in vortex_fifo_setwtctrl()
991 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp); in vortex_fifo_setwtctrl()
992 temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2)); in vortex_fifo_setwtctrl()
993 //((temp >> 6) & 0x3f) in vortex_fifo_setwtctrl()
996 if (((temp & 0x0fc0) ^ ((temp >> 6) & 0x0fc0)) & 0FFFFFFC0) in vortex_fifo_setwtctrl()
999 temp = (temp & 0xfffffffd) | ((ctrl & 1) << 1); in vortex_fifo_setwtctrl()
1000 temp = (temp & 0xfffdffff) | ((f & 1) << 0x11); in vortex_fifo_setwtctrl()
1001 temp = (temp & 0xfffffff3) | ((priority & 3) << 2); in vortex_fifo_setwtctrl()
1002 temp = (temp & 0xffffffef) | ((valid & 1) << 4); in vortex_fifo_setwtctrl()
1003 temp = (temp & 0xffffffdf) | ((empty & 1) << 5); in vortex_fifo_setwtctrl()
1004 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp); in vortex_fifo_setwtctrl()
1010 temp = (temp & 0xfffffffd) | ((ctrl & 1) << 1); in vortex_fifo_setwtctrl()
1011 temp = (temp & 0xfffdffff) | ((f & 1) << 0x11); in vortex_fifo_setwtctrl()
1012 temp = (temp & 0xfffffff3) | ((priority & 3) << 2); in vortex_fifo_setwtctrl()
1013 temp = (temp & 0xffffffef) | ((valid & 1) << 4); in vortex_fifo_setwtctrl()
1014 temp = (temp & 0xffffffdf) | ((empty & 1) << 5); in vortex_fifo_setwtctrl()
1016 temp = temp | FIFO_BITS | 40000; in vortex_fifo_setwtctrl()
1019 hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp); in vortex_fifo_setwtctrl()
1030 addr = VORTEX_FIFO_ADBCTRL + ((NR_ADB - 1) * 4); in vortex_fifo_init()
1031 for (x = NR_ADB - 1; x >= 0; x--) { in vortex_fifo_init()
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()
1036 addr -= 4; in vortex_fifo_init()
1041 addr = VORTEX_FIFO_WTCTRL + ((NR_WT - 1) * 4); in vortex_fifo_init()
1042 for (x = NR_WT - 1; x >= 0; x--) { 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()
1049 addr -= 4; 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()
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()
1075 dma->dma_ctrl); in vortex_adbdma_setfirstbuffer()
1080 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setstartbuffer()
1081 …//hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), sb << (((NR_ADB-1)-((adbdma&0xf)*2)))… in vortex_adbdma_setstartbuffer()
1082 hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), in vortex_adbdma_setstartbuffer()
1083 sb << ((0xf - (adbdma & 0xf)) * 2)); in vortex_adbdma_setstartbuffer()
1084 dma->period_real = dma->period_virt = sb; in vortex_adbdma_setstartbuffer()
1091 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setbuffers()
1093 dma->period_bytes = psize; in vortex_adbdma_setbuffers()
1094 dma->nr_periods = count; in vortex_adbdma_setbuffers()
1096 dma->cfg0 = 0; in vortex_adbdma_setbuffers()
1097 dma->cfg1 = 0; in vortex_adbdma_setbuffers()
1101 case 4: in vortex_adbdma_setbuffers()
1102 dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize - 1); in vortex_adbdma_setbuffers()
1103 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1104 VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0xc, in vortex_adbdma_setbuffers()
1105 snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); in vortex_adbdma_setbuffers()
1109 dma->cfg0 |= 0x12000000; in vortex_adbdma_setbuffers()
1110 dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1111 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1112 VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x8, in vortex_adbdma_setbuffers()
1113 snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); in vortex_adbdma_setbuffers()
1117 dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize - 1); in vortex_adbdma_setbuffers()
1118 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1119 VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x4, in vortex_adbdma_setbuffers()
1120 snd_pcm_sgbuf_get_addr(dma->substream, psize)); in vortex_adbdma_setbuffers()
1124 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1125 hwwrite(vortex->mmio, in vortex_adbdma_setbuffers()
1126 VORTEX_ADBDMA_BUFBASE + (adbdma << 4), in vortex_adbdma_setbuffers()
1127 snd_pcm_sgbuf_get_addr(dma->substream, 0)); in vortex_adbdma_setbuffers()
1132 dma->cfg0, dma->cfg1); 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()
1145 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setmode()
1147 dma->dma_unknown = stereo; in vortex_adbdma_setmode()
1148 dma->dma_ctrl = in vortex_adbdma_setmode()
1149 ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); in vortex_adbdma_setmode()
1151 dma->dma_ctrl = in vortex_adbdma_setmode()
1152 (dma->dma_ctrl & ~IE_MASK) | ((ie << IE_SHIFT) & IE_MASK); in vortex_adbdma_setmode()
1154 dma->dma_ctrl = in vortex_adbdma_setmode()
1155 (dma->dma_ctrl & ~DIR_MASK) | ((dir << DIR_SHIFT) & DIR_MASK); in vortex_adbdma_setmode()
1156 dma->dma_ctrl = in vortex_adbdma_setmode()
1157 (dma->dma_ctrl & ~FMT_MASK) | ((fmt << FMT_SHIFT) & FMT_MASK); in vortex_adbdma_setmode()
1159 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_setmode()
1160 dma->dma_ctrl); in vortex_adbdma_setmode()
1161 hwread(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2)); in vortex_adbdma_setmode()
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()
1172 if (dma->nr_periods >= 4) in vortex_adbdma_bufshift()
1173 delta = (page - dma->period_real) & 3; in vortex_adbdma_bufshift()
1175 delta = (page - dma->period_real); in vortex_adbdma_bufshift()
1177 delta += dma->nr_periods; in vortex_adbdma_bufshift()
1183 if (dma->nr_periods > 4) { in vortex_adbdma_bufshift()
1186 p = dma->period_virt + i + 4; in vortex_adbdma_bufshift()
1187 if (p >= dma->nr_periods) in vortex_adbdma_bufshift()
1188 p -= dma->nr_periods; in vortex_adbdma_bufshift()
1190 pp = dma->period_real + i; in vortex_adbdma_bufshift()
1191 if (pp >= 4) in vortex_adbdma_bufshift()
1192 pp -= 4; in vortex_adbdma_bufshift()
1193 //hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), dma->table[p].addr); in vortex_adbdma_bufshift()
1194 hwwrite(vortex->mmio, in vortex_adbdma_bufshift()
1196 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_adbdma_bufshift()
1197 dma->period_bytes * p)); in vortex_adbdma_bufshift()
1199 hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + in vortex_adbdma_bufshift()
1203 dma->period_virt += delta; in vortex_adbdma_bufshift()
1204 dma->period_real = page; in vortex_adbdma_bufshift()
1205 if (dma->period_virt >= dma->nr_periods) in vortex_adbdma_bufshift()
1206 dma->period_virt -= dma->nr_periods; in vortex_adbdma_bufshift()
1208 dev_info(vortex->card->dev, in vortex_adbdma_bufshift()
1210 adbdma, dma->period_virt, dma->period_real, delta); in vortex_adbdma_bufshift()
1217 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resetup()
1221 for (i=0 ; i < 4 && i < dma->nr_periods; i++) { in vortex_adbdma_resetup()
1223 p = dma->period_virt + i; in vortex_adbdma_resetup()
1224 if (p >= dma->nr_periods) in vortex_adbdma_resetup()
1225 p -= dma->nr_periods; in vortex_adbdma_resetup()
1227 pp = dma->period_real + i; in vortex_adbdma_resetup()
1228 if (dma->nr_periods < 4) { in vortex_adbdma_resetup()
1229 if (pp >= dma->nr_periods) in vortex_adbdma_resetup()
1230 pp -= dma->nr_periods; in vortex_adbdma_resetup()
1233 if (pp >= 4) in vortex_adbdma_resetup()
1234 pp -= 4; in vortex_adbdma_resetup()
1236 hwwrite(vortex->mmio, in vortex_adbdma_resetup()
1238 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_adbdma_resetup()
1239 dma->period_bytes * p)); in vortex_adbdma_resetup()
1241 hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + (((adbdma << 2)+pp) << 2)); in vortex_adbdma_resetup()
1247 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_getlinearpos()
1248 int temp, page, delta; in vortex_adbdma_getlinearpos() local
1250 temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); in vortex_adbdma_getlinearpos()
1251 page = (temp & ADB_SUBBUF_MASK) >> ADB_SUBBUF_SHIFT; in vortex_adbdma_getlinearpos()
1252 if (dma->nr_periods >= 4) in vortex_adbdma_getlinearpos()
1253 delta = (page - dma->period_real) & 3; in vortex_adbdma_getlinearpos()
1255 delta = (page - dma->period_real); in vortex_adbdma_getlinearpos()
1257 delta += dma->nr_periods; in vortex_adbdma_getlinearpos()
1259 return (dma->period_virt + delta) * dma->period_bytes in vortex_adbdma_getlinearpos()
1260 + (temp & (dma->period_bytes - 1)); in vortex_adbdma_getlinearpos()
1266 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_startfifo()
1268 switch (dma->fifo_status) { in vortex_adbdma_startfifo()
1271 dma->fifo_enabled ? 1 : 0); in vortex_adbdma_startfifo()
1275 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_startfifo()
1276 dma->dma_ctrl); in vortex_adbdma_startfifo()
1277 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1279 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1282 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1284 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1287 dma->fifo_status = FIFO_START; in vortex_adbdma_startfifo()
1292 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resumefifo()
1295 switch (dma->fifo_status) { in vortex_adbdma_resumefifo()
1297 hwwrite(vortex->mmio, VORTEX_ADBDMA_CTRL + (adbdma << 2), in vortex_adbdma_resumefifo()
1298 dma->dma_ctrl); in vortex_adbdma_resumefifo()
1299 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1301 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1304 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1306 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1309 dma->fifo_status = FIFO_START; in vortex_adbdma_resumefifo()
1314 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_pausefifo()
1317 switch (dma->fifo_status) { 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()
1324 dma->dma_ctrl); in vortex_adbdma_pausefifo()
1325 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_pausefifo()
1329 dma->fifo_status = FIFO_PAUSE; in vortex_adbdma_pausefifo()
1334 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_stopfifo()
1337 if (dma->fifo_status == FIFO_START) in vortex_adbdma_stopfifo()
1338 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_stopfifo()
1340 else if (dma->fifo_status == FIFO_STOP) in vortex_adbdma_stopfifo()
1342 dma->fifo_status = FIFO_STOP; in vortex_adbdma_stopfifo()
1343 dma->fifo_enabled = 0; in vortex_adbdma_stopfifo()
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()
1359 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setstartbuffer()
1360 //hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), sb << ((0x1f-(wtdma&0xf)*2))); in vortex_wtdma_setstartbuffer()
1361 hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), in vortex_wtdma_setstartbuffer()
1362 sb << ((0xf - (wtdma & 0xf)) * 2)); in vortex_wtdma_setstartbuffer()
1363 dma->period_real = dma->period_virt = sb; in vortex_wtdma_setstartbuffer()
1370 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setbuffers()
1372 dma->period_bytes = psize; in vortex_wtdma_setbuffers()
1373 dma->nr_periods = count; in vortex_wtdma_setbuffers()
1375 dma->cfg0 = 0; in vortex_wtdma_setbuffers()
1376 dma->cfg1 = 0; in vortex_wtdma_setbuffers()
1380 case 4: in vortex_wtdma_setbuffers()
1381 dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize-1); in vortex_wtdma_setbuffers()
1382 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0xc, in vortex_wtdma_setbuffers()
1383 snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); in vortex_wtdma_setbuffers()
1387 dma->cfg0 |= 0x12000000; in vortex_wtdma_setbuffers()
1388 dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); in vortex_wtdma_setbuffers()
1389 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x8, in vortex_wtdma_setbuffers()
1390 snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); in vortex_wtdma_setbuffers()
1394 dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize-1); in vortex_wtdma_setbuffers()
1395 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x4, in vortex_wtdma_setbuffers()
1396 snd_pcm_sgbuf_get_addr(dma->substream, psize)); in vortex_wtdma_setbuffers()
1400 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); in vortex_wtdma_setbuffers()
1401 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4), in vortex_wtdma_setbuffers()
1402 snd_pcm_sgbuf_get_addr(dma->substream, 0)); 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()
1416 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setmode()
1418 //dma->this_08 = e; in vortex_wtdma_setmode()
1419 dma->dma_unknown = d; in vortex_wtdma_setmode()
1420 dma->dma_ctrl = 0; in vortex_wtdma_setmode()
1421 dma->dma_ctrl = in vortex_wtdma_setmode()
1422 ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); in vortex_wtdma_setmode()
1424 dma->dma_ctrl = in vortex_wtdma_setmode()
1425 (dma->dma_ctrl & ~IE_MASK) | ((ie << IE_SHIFT) & IE_MASK); in vortex_wtdma_setmode()
1427 dma->dma_ctrl |= (1 << DIR_SHIFT); in vortex_wtdma_setmode()
1429 dma->dma_ctrl = in vortex_wtdma_setmode()
1430 (dma->dma_ctrl & FMT_MASK) | ((fmt << FMT_SHIFT) & FMT_MASK); in vortex_wtdma_setmode()
1432 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl); in vortex_wtdma_setmode()
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()
1443 if (dma->nr_periods >= 4) in vortex_wtdma_bufshift()
1444 delta = (page - dma->period_real) & 3; in vortex_wtdma_bufshift()
1446 delta = (page - dma->period_real); in vortex_wtdma_bufshift()
1448 delta += dma->nr_periods; in vortex_wtdma_bufshift()
1454 if (dma->nr_periods > 4) { in vortex_wtdma_bufshift()
1457 p = dma->period_virt + i + 4; in vortex_wtdma_bufshift()
1458 if (p >= dma->nr_periods) in vortex_wtdma_bufshift()
1459 p -= dma->nr_periods; in vortex_wtdma_bufshift()
1461 pp = dma->period_real + i; in vortex_wtdma_bufshift()
1462 if (pp >= 4) in vortex_wtdma_bufshift()
1463 pp -= 4; in vortex_wtdma_bufshift()
1464 hwwrite(vortex->mmio, in vortex_wtdma_bufshift()
1467 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_wtdma_bufshift()
1468 dma->period_bytes * p)); in vortex_wtdma_bufshift()
1470 hwread(vortex->mmio, VORTEX_WTDMA_BUFBASE + in vortex_wtdma_bufshift()
1474 dma->period_virt += delta; in vortex_wtdma_bufshift()
1475 if (dma->period_virt >= dma->nr_periods) in vortex_wtdma_bufshift()
1476 dma->period_virt -= dma->nr_periods; in vortex_wtdma_bufshift()
1477 dma->period_real = page; in vortex_wtdma_bufshift()
1480 dev_warn(vortex->card->dev, "wt virt = %d, delta = %d\n", in vortex_wtdma_bufshift()
1481 dma->period_virt, delta); in vortex_wtdma_bufshift()
1490 int temp;
1491 temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2));
1492 *subbuf = (temp >> WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK;
1493 *pos = temp & POS_MASK;
1498 return ((hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)) >>
1504 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_getlinearpos()
1505 int temp; in vortex_wtdma_getlinearpos() local
1507 temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)); in vortex_wtdma_getlinearpos()
1508 temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1)); in vortex_wtdma_getlinearpos()
1509 return temp; in vortex_wtdma_getlinearpos()
1514 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_startfifo()
1517 switch (dma->fifo_status) { in vortex_wtdma_startfifo()
1520 dma->fifo_enabled ? 1 : 0); in vortex_wtdma_startfifo()
1524 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), in vortex_wtdma_startfifo()
1525 dma->dma_ctrl); in vortex_wtdma_startfifo()
1526 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1528 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1531 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1533 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1536 dma->fifo_status = FIFO_START; in vortex_wtdma_startfifo()
1541 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_resumefifo()
1544 switch (dma->fifo_status) { in vortex_wtdma_resumefifo()
1546 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), in vortex_wtdma_resumefifo()
1547 dma->dma_ctrl); in vortex_wtdma_resumefifo()
1548 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1550 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1553 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1555 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1558 dma->fifo_status = FIFO_START; in vortex_wtdma_resumefifo()
1563 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_pausefifo()
1566 switch (dma->fifo_status) { 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()
1573 dma->dma_ctrl); in vortex_wtdma_pausefifo()
1574 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_pausefifo()
1578 dma->fifo_status = FIFO_PAUSE; in vortex_wtdma_pausefifo()
1583 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_stopfifo()
1586 if (dma->fifo_status == FIFO_START) in vortex_wtdma_stopfifo()
1587 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_stopfifo()
1589 else if (dma->fifo_status == FIFO_STOP) in vortex_wtdma_stopfifo()
1591 dma->fifo_status = FIFO_STOP; in vortex_wtdma_stopfifo()
1592 dma->fifo_enabled = 0; in vortex_wtdma_stopfifo()
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()
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()
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()
1632 int temp, prev, lifeboat = 0; in vortex_adb_addroutes() local
1637 rnum--; in vortex_adb_addroutes()
1638 hwwrite(vortex->mmio, in vortex_adb_addroutes()
1642 hwwrite(vortex->mmio, in vortex_adb_addroutes()
1644 ((route[rnum - 1] & ADB_MASK) << 2), route[rnum]); in vortex_adb_addroutes()
1645 rnum--; in vortex_adb_addroutes()
1648 temp = in vortex_adb_addroutes()
1649 hwread(vortex->mmio, in vortex_adb_addroutes()
1651 if (temp == ADB_MASK) { in vortex_adb_addroutes()
1653 hwwrite(vortex->mmio, VORTEX_ADB_CHNBASE + (channel << 2), in vortex_adb_addroutes()
1660 prev = temp; in vortex_adb_addroutes()
1661 temp = in vortex_adb_addroutes()
1662 hwread(vortex->mmio, in vortex_adb_addroutes()
1663 VORTEX_ADB_RTBASE + (temp << 2)) & ADB_MASK; in vortex_adb_addroutes()
1665 dev_err(vortex->card->dev, in vortex_adb_addroutes()
1671 while (temp != ADB_MASK); in vortex_adb_addroutes()
1672 hwwrite(vortex->mmio, VORTEX_ADB_RTBASE + (prev << 2), route[0]); in vortex_adb_addroutes()
1679 int temp, lifeboat = 0, prev; in vortex_adb_delroutes() local
1682 temp = in vortex_adb_delroutes()
1683 hwread(vortex->mmio, in vortex_adb_delroutes()
1685 if (temp == (route0 & ADB_MASK)) { in vortex_adb_delroutes()
1686 temp = in vortex_adb_delroutes()
1687 hwread(vortex->mmio, in vortex_adb_delroutes()
1689 if ((temp & ADB_MASK) == ADB_MASK) in vortex_adb_delroutes()
1691 hwwrite(vortex->mmio, VORTEX_ADB_CHNBASE + (channel << 2), in vortex_adb_delroutes()
1692 temp); in vortex_adb_delroutes()
1696 prev = temp; in vortex_adb_delroutes()
1697 temp = in vortex_adb_delroutes()
1698 hwread(vortex->mmio, in vortex_adb_delroutes()
1700 if (((lifeboat++) > ADB_MASK) || (temp == ADB_MASK)) { in vortex_adb_delroutes()
1701 dev_err(vortex->card->dev, in vortex_adb_delroutes()
1707 while (temp != (route0 & ADB_MASK)); in vortex_adb_delroutes()
1708 temp = hwread(vortex->mmio, VORTEX_ADB_RTBASE + (temp << 2)); in vortex_adb_delroutes()
1709 if ((temp & ADB_MASK) == route1) 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()
1726 vortex_src_addWTD(vortex, (source - OFFSET_SRCOUT), in vortex_route()
1731 (source - OFFSET_MIXOUT), channel); in vortex_route()
1736 vortex_src_delWTD(vortex, (source - OFFSET_SRCOUT), in vortex_route()
1741 (source - OFFSET_MIXOUT), channel); in vortex_route()
1759 vortex_src_addWTD(vortex, (source - OFFSET_SRCOUT),
1764 (source - OFFSET_MIXOUT), channel);
1769 vortex_src_delWTD(vortex, (source - OFFSET_SRCOUT),
1774 (source - OFFSET_MIXOUT), channel);
1798 (source0 - OFFSET_SRCOUT), ch); in vortex_routeLRT()
1800 (source1 - OFFSET_SRCOUT), ch); in vortex_routeLRT()
1804 (source0 - OFFSET_MIXOUT), ch); in vortex_routeLRT()
1806 (source1 - OFFSET_MIXOUT), ch); in vortex_routeLRT()
1813 (source0 - OFFSET_SRCOUT), ch); in vortex_routeLRT()
1815 (source1 - OFFSET_SRCOUT), ch); in vortex_routeLRT()
1819 (source0 - OFFSET_MIXOUT), ch); in vortex_routeLRT()
1821 (source1 - OFFSET_MIXOUT), ch); in vortex_routeLRT()
1962 ADB_CODECOUT(0 + 4)); in vortex_connect_codecplay()
1964 ADB_CODECOUT(1 + 4)); in vortex_connect_codecplay()
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()
2029 return -EINVAL; in vortex_adb_checkinout()
2043 dev_err(vortex->card->dev, in vortex_adb_checkinout()
2046 return -ENOMEM; in vortex_adb_checkinout()
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()
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()
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()
2104 dir: direction of stream. Uses same values as substream->stream.
2119 vortex->dma_adb[dma].resources, en, in vortex_adb_allocroute()
2126 return -EBUSY; in vortex_adb_allocroute()
2129 stream = &vortex->dma_adb[dma]; in vortex_adb_allocroute()
2130 stream->dma = dma; in vortex_adb_allocroute()
2131 stream->dir = dir; in vortex_adb_allocroute()
2132 stream->type = type; in vortex_adb_allocroute()
2136 int src[4], mix[4], ch_top; in vortex_adb_allocroute()
2141 if (stream->type != VORTEX_PCM_SPDIF) { in vortex_adb_allocroute()
2144 stream->resources, en, in vortex_adb_allocroute()
2147 memset(stream->resources, 0, in vortex_adb_allocroute()
2148 sizeof(stream->resources)); in vortex_adb_allocroute()
2149 return -EBUSY; in vortex_adb_allocroute()
2151 if (stream->type != VORTEX_PCM_A3D) { in vortex_adb_allocroute()
2153 stream->resources, in vortex_adb_allocroute()
2157 memset(stream->resources, in vortex_adb_allocroute()
2159 sizeof(stream->resources)); in vortex_adb_allocroute()
2160 return -EBUSY; in vortex_adb_allocroute()
2166 if (stream->type == VORTEX_PCM_A3D) { in vortex_adb_allocroute()
2168 stream->resources, en, in vortex_adb_allocroute()
2171 memset(stream->resources, 0, in vortex_adb_allocroute()
2172 sizeof(stream->resources)); in vortex_adb_allocroute()
2173 dev_err(vortex->card->dev, in vortex_adb_allocroute()
2175 return -EBUSY; in vortex_adb_allocroute()
2178 vortex_Vort3D_InitializeSource(&vortex->a3d[a3d], en, in vortex_adb_allocroute()
2182 if ((stream->type == VORTEX_PCM_SPDIF) && (en)) { in vortex_adb_allocroute()
2184 ADB_MIXOUT(vortex->mixspdif[0]), in vortex_adb_allocroute()
2187 ADB_MIXOUT(vortex->mixspdif[1]), in vortex_adb_allocroute()
2193 if (stream->type == VORTEX_PCM_ADB) { in vortex_adb_allocroute()
2195 src[nr_ch - 1], in vortex_adb_allocroute()
2215 if (stream->type == VORTEX_PCM_A3D) { in vortex_adb_allocroute()
2217 src[nr_ch - 1], in vortex_adb_allocroute()
2222 //vortex_route(vortex, en, 0x11, dma, ADB_XTALKIN(i?9:4)); in vortex_adb_allocroute()
2223 //vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_XTALKIN(i?4:9)); in vortex_adb_allocroute()
2225 if (stream->type == VORTEX_PCM_SPDIF) in vortex_adb_allocroute()
2227 ADB_DMA(stream->dma), in vortex_adb_allocroute()
2231 if (stream->type != VORTEX_PCM_SPDIF && stream->type != VORTEX_PCM_A3D) { in vortex_adb_allocroute()
2232 ch_top = (VORTEX_IS_QUAD(vortex) ? 4 : 2); in vortex_adb_allocroute()
2248 if (stream->type == VORTEX_PCM_ADB && en) { in vortex_adb_allocroute()
2249 p = &vortex->pcm_vol[subdev]; in vortex_adb_allocroute()
2250 p->dma = dma; in vortex_adb_allocroute()
2252 p->mixin[i] = mix[i]; in vortex_adb_allocroute()
2254 p->vol[i] = 0; in vortex_adb_allocroute()
2259 if (nr_ch == 1 && stream->type == VORTEX_PCM_SPDIF) in vortex_adb_allocroute()
2261 ADB_DMA(stream->dma), in vortex_adb_allocroute()
2265 if ((stream->type == VORTEX_PCM_SPDIF) && (!en)) { in vortex_adb_allocroute()
2267 ADB_MIXOUT(vortex->mixspdif[0]), in vortex_adb_allocroute()
2270 ADB_MIXOUT(vortex->mixspdif[1]), in vortex_adb_allocroute()
2279 return -EINVAL; in vortex_adb_allocroute()
2284 stream->resources, en, in vortex_adb_allocroute()
2287 memset(stream->resources, 0, in vortex_adb_allocroute()
2288 sizeof(stream->resources)); in vortex_adb_allocroute()
2289 return -EBUSY; in vortex_adb_allocroute()
2292 stream->resources, en, in vortex_adb_allocroute()
2295 memset(stream->resources, 0, in vortex_adb_allocroute()
2296 sizeof(stream->resources)); in vortex_adb_allocroute()
2297 return -EBUSY; in vortex_adb_allocroute()
2320 vortex->dma_adb[dma].nr_ch = nr_ch; in vortex_adb_allocroute()
2324 if (nr_ch < 4) { 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()
2330 | 4); 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()
2338 4)); in vortex_adb_allocroute()
2350 stream_t *stream = &(vortex->dma_adb[adbdma]); in vortex_adb_setsrc()
2361 if (stream->resources[VORTEX_RESOURCE_SRC] & (1 << i)) in vortex_adb_setsrc()
2371 hwwrite(vortex->mmio, VORTEX_IRQ_STAT, period); in vortex_settimer()
2377 hwwrite(card->mmio, VORTEX_IRQ_CTRL,
2378 hwread(card->mmio, VORTEX_IRQ_CTRL) | IRQ_TIMER | 0x60);
2383 hwwrite(card->mmio, VORTEX_IRQ_CTRL,
2384 hwread(card->mmio, VORTEX_IRQ_CTRL) & ~IRQ_TIMER);
2391 hwwrite(card->mmio, VORTEX_CTRL, in vortex_enable_int()
2392 hwread(card->mmio, VORTEX_CTRL) | CTRL_IRQ_ENABLE); in vortex_enable_int()
2393 hwwrite(card->mmio, VORTEX_IRQ_CTRL, in vortex_enable_int()
2394 (hwread(card->mmio, VORTEX_IRQ_CTRL) & 0xffffefc0) | 0x24); in vortex_enable_int()
2399 hwwrite(card->mmio, VORTEX_CTRL, in vortex_disable_int()
2400 hwread(card->mmio, VORTEX_CTRL) & ~CTRL_IRQ_ENABLE); in vortex_disable_int()
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()
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()
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()
2504 /* the windows driver writes -i, so we write -i */ in vortex_codec_init()
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()
2541 vortex_t *card = (vortex_t *) codec->private_data; in vortex_codec_write()
2545 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { in vortex_codec_write()
2548 dev_err(card->card->dev, "ac97 codec stuck busy\n"); in vortex_codec_write()
2553 hwwrite(card->mmio, VORTEX_CODEC_IO, in vortex_codec_write()
2557 (codec->num << VORTEX_CODEC_ID_SHIFT) ); in vortex_codec_write()
2560 hwread(card->mmio, VORTEX_CODEC_IO); in vortex_codec_write()
2566 vortex_t *card = (vortex_t *) codec->private_data; in vortex_codec_read()
2571 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { in vortex_codec_read()
2574 dev_err(card->card->dev, "ac97 codec stuck busy\n"); in vortex_codec_read()
2580 (codec->num << VORTEX_CODEC_ID_SHIFT) ; in vortex_codec_read()
2581 hwwrite(card->mmio, VORTEX_CODEC_IO, read_addr); in vortex_codec_read()
2586 data = hwread(card->mmio, VORTEX_CODEC_IO); in vortex_codec_read()
2588 dev_err(card->card->dev, in vortex_codec_read()
2606 hwwrite(vortex->mmio, VORTEX_SPDIF_FLAGS, in vortex_spdif_init()
2607 hwread(vortex->mmio, VORTEX_SPDIF_FLAGS) & 0xfff3fffd); in vortex_spdif_init()
2608 //for (i=0x291D4; i<0x29200; i+=4) in vortex_spdif_init()
2610 hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1 + (i << 2), 0); in vortex_spdif_init()
2611 //hwwrite(vortex->mmio, 0x29190, hwread(vortex->mmio, 0x29190) | 0xc0000); 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()
2673 /* looks like the next 2 lines transfer a 16-bit value into 2 8-bit 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()
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()
2700 hwwrite(vortex->mmio, VORTEX_CTRL, in vortex_core_init()
2701 hwread(vortex->mmio, VORTEX_CTRL) | 0x1000000); in vortex_core_init()
2706 hwwrite(vortex->mmio, VORTEX_ENGINE_CTRL, 0x0); //, 0xc83c7e58, 0xc5f93e58 in vortex_core_init()
2726 // hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0); 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()
2740 dev_info(vortex->card->dev, "shutdown started\n"); in vortex_core_shutdown()
2754 //hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, hwread(vortex->mmio, VORTEX_IRQ_CTRL) & ~IRQ_MIDI); in vortex_core_shutdown()
2755 //hwwrite(vortex->mmio, VORTEX_CTRL, hwread(vortex->mmio, VORTEX_CTRL) & ~CTRL_MIDI_EN); 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()
2796 dev_err(v->card->dev, in vortex_alsafmt_aspfmt()
2820 return -1;
2845 case 4: