Lines Matching +full:0 +full:x44000000
80 hwread(vortex->mmio, VORTEX_MIXER_SR) | (0x1 << channel)); in vortex_mixer_en_sr()
85 hwread(vortex->mmio, VORTEX_MIXER_SR) & ~(0x1 << channel)); in vortex_mixer_dis_sr()
88 #if 0
94 0x80);
96 0x80);
102 a = hwread(vortex->mmio, VORTEX_MIX_VOL_A + (mix << 2)) & 0xff;
113 return 0;
117 if (rampchs[mix] == 0)
123 return (0);
136 for (ch = 0; ch < 0x20; ch++) {
137 if (((1 << ch) & rampchs[mix]) == 0)
158 if (mixin >= 0)
175 if ((temp != 0x80) || (vol == 0x80)) in vortex_mix_setvolumebyte()
193 if ((temp != 0x80) || (vol == 0x80)) in vortex_mix_setinputvolumebyte()
205 if (mixin < 0) in vortex_mix_setenablebit()
217 VORTEX_MIX_INVOL_B + (((mix << 5) + mixin) << 2), 0x80); 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()
229 vortex_mix_setinputvolumebyte(vortex, mix, mixin, 0x80); in vortex_mix_killinput()
231 vortex_mix_setenablebit(vortex, mix, mixin, 0); in vortex_mix_killinput()
238 if ((mchannels[mix] & (1 << mixin)) == 0) { in vortex_mix_enableinput()
239 vortex_mix_setinputvolumebyte(vortex, mix, mixin, 0x80); /*0x80 : mute */ in vortex_mix_enableinput()
261 int temp, lifeboat = 0, prev; in vortex_mixer_addWTD()
264 if ((temp & (1 << ch)) == 0) { in vortex_mixer_addWTD()
271 while (temp & 0x10) { in vortex_mixer_addWTD()
272 prev = VORTEX_MIXER_RTBASE + ((temp & 0xf) << 2); in vortex_mixer_addWTD()
275 if ((++lifeboat) > 0xf) { in vortex_mixer_addWTD()
278 return 0; 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()
293 if (((1 << ch) & eax) == 0) { in vortex_mixer_delWTD()
295 return 0; in vortex_mixer_delWTD()
299 if (esp18 & 0x10) { in vortex_mixer_delWTD()
300 ebx = (esp18 & 0xf); in vortex_mixer_delWTD()
306 hwwrite(vortex->mmio, ebx, 0); in vortex_mixer_delWTD()
313 while ((edx & 0xf) != mix) { in vortex_mixer_delWTD()
314 if ((esi) > 0xf) { in vortex_mixer_delWTD()
317 return 0; in vortex_mixer_delWTD()
320 ebx = edx & 0xf; in vortex_mixer_delWTD()
330 if (edx & 0x10) { /* Delete entry in between others */ in vortex_mixer_delWTD()
331 ebx = VORTEX_MIXER_RTBASE + ((edx & 0xf) << 2); in vortex_mixer_delWTD()
336 hwwrite(vortex->mmio, ebx, 0); in vortex_mixer_delWTD()
337 //printk(KERN_INFO "vortex mixdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx); in vortex_mixer_delWTD()
343 (ch << 2), esp18 & 0xef); in vortex_mixer_delWTD()
345 ebx = (0xffffffe0 & edx) | (0xf & ebx); in vortex_mixer_delWTD()
349 //printk(KERN_INFO "vortex mixdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx); in vortex_mixer_delWTD()
352 VORTEX_MIXER_RTBASE + ebp, 0); in vortex_mixer_delWTD()
360 hwwrite(vortex->mmio, ebp, 0); in vortex_mixer_delWTD()
371 memset(mchannels, 0, NR_MIXOUT * sizeof(int)); in vortex_mixer_init()
372 memset(rampchs, 0, NR_MIXOUT * sizeof(int)); in vortex_mixer_init()
374 addr = VORTEX_MIX_SMP + 0x17c; in vortex_mixer_init()
375 for (x = 0x5f; x >= 0; x--) { in vortex_mixer_init()
376 hwwrite(vortex->mmio, addr, 0); in vortex_mixer_init()
379 addr = VORTEX_MIX_ENIN + 0x1fc; 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()
384 addr = VORTEX_MIX_SMP + 0x17c; 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()
389 addr = VORTEX_MIX_INVOL_A + 0x7fc; 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()
394 addr = VORTEX_MIX_VOL_A + 0x3c; 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()
399 addr = VORTEX_MIX_INVOL_B + 0x7fc; 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()
404 addr = VORTEX_MIX_VOL_B + 0x3c; 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()
410 for (x = (MIXER_RTBASE_SIZE - 1); x >= 0; x--) { 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()
418 for (x = 0; x < 0x80; x++) { in vortex_mixer_init()
419 hwwrite(vortex->mmio, VORTEX_MIXER_CLIP + (x << 2), 0x3ffff); in vortex_mixer_init()
434 hwread(vortex->mmio, VORTEX_SRCBLOCK_SR) | (0x1 << channel)); in vortex_src_en_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()
449 VORTEX_SRC_DATA0 + (src << 7) + (i << 2), 0); 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()
477 int temp, lifeboat = 0; in vortex_src_persist_convratio()
482 if ((++lifeboat) > 0x9) { in vortex_src_persist_convratio()
491 #if 0
497 hwwrite(vortex->mmio, VORTEX_SRC_DRIFT0 + (src << 2), 0);
499 if (temp & 0x200)
501 temp & ~0x200L);
509 if ((ratio & 0x10000) && (ratio != 0x10000)) {
510 if (ratio & 0x3fff)
511 a = (0x11 - ((ratio >> 0xe) & 0x3)) - 1;
513 a = (0x11 - ((ratio >> 0xe) & 0x3)) - 2;
515 a = 0xc;
517 if (((temp >> 4) & 0xf) != a)
519 (temp & 0xf) | ((a & 0xf) << 4));
528 int hw_ratio, lifeboat = 0;
554 dirplay: 1: playback, 0: recording.
563 // noplayback: d=2,4,7,0xa,0xb when using first 2 src's. in vortex_src_setupchannel()
567 // dirplay: 0 = recording, 1 = playback in vortex_src_setupchannel()
570 int esi, ebp = 0, esp10; in vortex_src_setupchannel()
575 if ((tr & 0x10000) && (tr != 0x10000)) { in vortex_src_setupchannel()
576 tr = 0; in vortex_src_setupchannel()
577 esi = 0x7; in vortex_src_setupchannel()
579 if ((((short)tr) < 0) && (tr != 0x8000)) { in vortex_src_setupchannel()
580 tr = 0; in vortex_src_setupchannel()
581 esi = 0x8; in vortex_src_setupchannel()
584 esi = 0xc; in vortex_src_setupchannel()
588 if ((cr & 0x10000) && (cr != 0x10000)) { in vortex_src_setupchannel()
589 tr = 0; /*ebx = 0 */ in vortex_src_setupchannel()
590 esi = 0x11 - ((cr >> 0xe) & 7); in vortex_src_setupchannel()
591 if (cr & 0x3fff) in vortex_src_setupchannel()
597 esi = 0xc; in vortex_src_setupchannel()
603 if ((dirplay == 0) && (sweep == 0)) { in vortex_src_setupchannel()
605 esp10 = 0xf; in vortex_src_setupchannel()
607 esp10 = 0xc; in vortex_src_setupchannel()
608 ebp = 0; in vortex_src_setupchannel()
611 ebp = 0xf; in vortex_src_setupchannel()
613 ebp = 0xc; in vortex_src_setupchannel()
614 esp10 = 0; in vortex_src_setupchannel()
617 (sl << 0x9) | (sweep << 0x8) | ((esi & 0xf) << 4) | d); in vortex_src_setupchannel()
618 /* 0xc0 esi=0xc c=f=0 d=0 */ in vortex_src_setupchannel()
620 hwwrite(card->mmio, VORTEX_SRC_U1 + (src << 2), b & 0xffff); in vortex_src_setupchannel()
621 /* 0 b=0 */ in vortex_src_setupchannel()
623 (tr << 0x11) | (dirplay << 0x10) | (ebp << 0x8) | esp10); in vortex_src_setupchannel()
624 /* 0x30f00 e=g=1 esp10=0 ebp=f */ in vortex_src_setupchannel()
625 …//printk(KERN_INFO "vortex: SRC %d, d=0x%x, esi=0x%x, esp10=0x%x, ebp=0x%x\n", src, d, esi, esp10,… in vortex_src_setupchannel()
632 hwwrite(vortex->mmio, VORTEX_SRC_SOURCESIZE, 0x1ff); in vortex_srcblock_init()
634 for (x=0; x<0x10; x++) { in vortex_srcblock_init()
638 //addr = 0xcc3c; in vortex_srcblock_init()
639 //addr = 0x26c3c; in vortex_srcblock_init()
640 addr = VORTEX_SRC_RTBASE + 0x3c; 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()
645 //addr = 0xcc94; in vortex_srcblock_init()
646 //addr = 0x26c94; in vortex_srcblock_init()
647 addr = VORTEX_SRC_CHNBASE + 0x54; 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()
657 int temp, lifeboat = 0, prev; in vortex_src_addWTD()
661 if ((temp & (1 << ch)) == 0) { 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()
674 if ((++lifeboat) > 0xf) { in vortex_src_addWTD()
677 return 0; 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()
689 int esp14 = -1, esp18, eax, ebx, edx, ebp, esi = 0; in vortex_src_delWTD()
693 if (((1 << ch) & eax) == 0) { in vortex_src_delWTD()
695 return 0; in vortex_src_delWTD()
699 if (esp18 & 0x10) { in vortex_src_delWTD()
700 ebx = (esp18 & 0xf); in vortex_src_delWTD()
706 hwwrite(vortex->mmio, ebx, 0); in vortex_src_delWTD()
713 while ((edx & 0xf) != src) { in vortex_src_delWTD()
714 if ((esi) > 0xf) { in vortex_src_delWTD()
717 return 0; in vortex_src_delWTD()
720 ebx = edx & 0xf; in vortex_src_delWTD()
730 if (edx & 0x10) { /* Delete entry in between others */ in vortex_src_delWTD()
731 ebx = VORTEX_SRC_RTBASE + ((edx & 0xf) << 2); in vortex_src_delWTD()
736 hwwrite(vortex->mmio, ebx, 0); in vortex_src_delWTD()
737 //printk(KERN_INFO "vortex srcdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx); in vortex_src_delWTD()
743 (ch << 2), esp18 & 0xef); in vortex_src_delWTD()
745 ebx = (0xffffffe0 & edx) | (0xf & ebx); in vortex_src_delWTD()
749 //printk(KERN_INFO"vortex srcdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx); in vortex_src_delWTD()
752 VORTEX_SRC_RTBASE + ebp, 0); in vortex_src_delWTD()
759 hwwrite(vortex->mmio, ebp, 0); in vortex_src_delWTD()
769 for (x--; x >= 0; x--) in vortex_fifo_clearadbdata()
772 (((fifo << FIFO_SIZE_BITS) + x) << 2), 0); in vortex_fifo_clearadbdata()
775 #if 0
781 (FIFO_U1 | ((j & FIFO_MASK) << 0xb)));
784 (FIFO_U1 | ((j & FIFO_MASK) << 0xc)));
792 0xffffffef) | ((1 & en) << 4) | FIFO_U1); in vortex_fifo_setadbvalid()
799 int temp, lifeboat = 0; in vortex_fifo_setadbctrl()
800 //int this_8[NR_ADB] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* position */ in vortex_fifo_setadbctrl()
801 int this_4 = 0x2; in vortex_fifo_setadbctrl()
804 * every where else it is set to 0. It seems, however, that CAsp4AdbDma::SetPriority in vortex_fifo_setadbctrl()
809 if (lifeboat++ > 0xbb8) { in vortex_fifo_setadbctrl()
820 if ((temp & FIFO_VALID) == 0) { in vortex_fifo_setadbctrl()
821 //this_8[fifo] = 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()
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()
848 temp = ((f & 1) << 0x12) | (temp & 0xfffbffef); in vortex_fifo_setadbctrl()
852 ((f & 1) << 0x1b) | (temp & 0xe7ffffef) | FIFO_BITS; in vortex_fifo_setadbctrl()
856 ((f & 1) << 0x18) | (temp & 0xfcffffef) | FIFO_BITS; in vortex_fifo_setadbctrl()
871 for (x--; x >= 0; x--) in vortex_fifo_clearwtdata()
874 (((fifo << FIFO_SIZE_BITS) + x) << 2), 0); in vortex_fifo_clearwtdata()
882 (FIFO_U1 | ((j & FIFO_MASK) << 0xb))); in vortex_fifo_wtinitialize()
885 (FIFO_U1 | ((j & FIFO_MASK) << 0xc))); in vortex_fifo_wtinitialize()
893 0xffffffef) | ((en & 1) << 4) | FIFO_U1); in vortex_fifo_setwtvalid()
900 int temp = 0, lifeboat = 0; in vortex_fifo_setwtctrl()
905 if (lifeboat++ > 0xbb8) { 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()
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()
941 temp = ((f & 1) << 0x12) | (temp & 0xfffbffef); in vortex_fifo_setwtctrl()
945 ((f & 1) << 0x1b) | (temp & 0xe7ffffef) | FIFO_BITS; in vortex_fifo_setwtctrl()
949 ((f & 1) << 0x18) | (temp & 0xfcffffef) | FIFO_BITS; in vortex_fifo_setwtctrl()
961 if (lifeboat++ > 0xbb8) { in vortex_fifo_setwtctrl()
965 } while ((temp & FIFO_RDONLY)&&(temp & FIFO_VALID)&&(temp != 0xFFFFFFFF)); 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()
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()
993 //((temp >> 6) & 0x3f) in vortex_fifo_setwtctrl()
995 priority = 0; in vortex_fifo_setwtctrl()
996 if (((temp & 0x0fc0) ^ ((temp >> 6) & 0x0fc0)) & 0FFFFFFC0) in vortex_fifo_setwtctrl()
998 valid = 0xfb; 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()
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()
1018 // 0x1c440010, 0x1c400000 in vortex_fifo_setwtctrl()
1031 for (x = NR_ADB - 1; x >= 0; x--) { in vortex_fifo_init()
1042 for (x = NR_WT - 1; x >= 0; x--) { in vortex_fifo_init()
1046 "bad wt fifo reset (0x%08x, 0x%08x)!\n", 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()
1081 …//hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), sb << (((NR_ADB-1)-((adbdma&0xf)*2)))… in vortex_adbdma_setstartbuffer()
1083 sb << ((0xf - (adbdma & 0xf)) * 2)); in vortex_adbdma_setstartbuffer()
1096 dma->cfg0 = 0; in vortex_adbdma_setbuffers()
1097 dma->cfg1 = 0; in vortex_adbdma_setbuffers()
1102 dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize - 1); in vortex_adbdma_setbuffers()
1104 VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0xc, in vortex_adbdma_setbuffers()
1109 dma->cfg0 |= 0x12000000; in vortex_adbdma_setbuffers()
1110 dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1112 VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x8, in vortex_adbdma_setbuffers()
1117 dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize - 1); in vortex_adbdma_setbuffers()
1119 VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x4, in vortex_adbdma_setbuffers()
1124 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1127 snd_pcm_sgbuf_get_addr(dma->substream, 0)); in vortex_adbdma_setbuffers()
1131 pr_debug( "vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", in vortex_adbdma_setbuffers()
1138 vortex_adbdma_setstartbuffer(vortex, adbdma, 0); in vortex_adbdma_setbuffers()
1176 if (delta < 0) in vortex_adbdma_bufshift()
1179 if (delta == 0) in vortex_adbdma_bufshift()
1180 return 0; in vortex_adbdma_bufshift()
1184 for (i = 0; i < delta; i++) { in vortex_adbdma_bufshift()
1221 for (i=0 ; i < 4 && i < dma->nr_periods; i++) { in vortex_adbdma_resetup()
1256 if (delta < 0) in vortex_adbdma_getlinearpos()
1265 int this_8 = 0 /*empty */ , this_4 = 0 /*priority */ ; in vortex_adbdma_startfifo()
1271 dma->fifo_enabled ? 1 : 0); in vortex_adbdma_startfifo()
1279 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1284 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1294 int this_8 = 1, this_4 = 0; in vortex_adbdma_resumefifo()
1301 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1306 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1316 int this_8 = 0, this_4 = 0; in vortex_adbdma_pausefifo()
1320 this_4, this_8, 0, 0); in vortex_adbdma_pausefifo()
1326 this_4, this_8, 0, 0); in vortex_adbdma_pausefifo()
1336 int this_4 = 0, this_8 = 0; in vortex_adbdma_stopfifo()
1339 this_4, this_8, 0, 0); in vortex_adbdma_stopfifo()
1343 dma->fifo_enabled = 0; in vortex_adbdma_stopfifo()
1360 //hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), sb << ((0x1f-(wtdma&0xf)*2))); in vortex_wtdma_setstartbuffer()
1362 sb << ((0xf - (wtdma & 0xf)) * 2)); in vortex_wtdma_setstartbuffer()
1375 dma->cfg0 = 0; in vortex_wtdma_setbuffers()
1376 dma->cfg1 = 0; 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()
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()
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()
1400 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); in vortex_wtdma_setbuffers()
1402 snd_pcm_sgbuf_get_addr(dma->substream, 0)); in vortex_wtdma_setbuffers()
1409 vortex_wtdma_setstartbuffer(vortex, wtdma, 0); in vortex_wtdma_setbuffers()
1420 dma->dma_ctrl = 0; in vortex_wtdma_setmode()
1447 if (delta < 0) in vortex_wtdma_bufshift()
1450 if (delta == 0) in vortex_wtdma_bufshift()
1451 return 0; in vortex_wtdma_bufshift()
1455 for (i = 0; i < delta; i++) { in vortex_wtdma_bufshift()
1486 #if 0
1515 int this_8 = 0, this_4 = 0; in vortex_wtdma_startfifo()
1520 dma->fifo_enabled ? 1 : 0); in vortex_wtdma_startfifo()
1528 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1533 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1543 int this_8 = 0, this_4 = 0; in vortex_wtdma_resumefifo()
1550 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1555 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1565 int this_8 = 0, this_4 = 0; in vortex_wtdma_pausefifo()
1569 this_4, this_8, 0, 0); in vortex_wtdma_pausefifo()
1575 this_4, this_8, 0, 0); in vortex_wtdma_pausefifo()
1585 int this_4 = 0, this_8 = 0; in vortex_wtdma_stopfifo()
1588 this_4, this_8, 0, 0); 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()
1605 for (i = 0; i < VORTEX_ADB_RTBASE_COUNT; i++) in vortex_adb_init()
1609 for (i = 0; i < VORTEX_ADB_CHNBASE_COUNT; i++) { in vortex_adb_init()
1619 hwread(vortex->mmio, VORTEX_ADB_SR) | (0x1 << channel)); in vortex_adb_en_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()
1634 if ((rnum <= 0) || (route == NULL)) in vortex_adb_addroutes()
1641 while (rnum > 0) { in vortex_adb_addroutes()
1654 route[0]); in vortex_adb_addroutes()
1666 "vortex_adb_addroutes: unending route! 0x%x\n", 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()
1702 "vortex_adb_delroutes: route not found! 0x%x\n", in vortex_adb_delroutes()
1745 #if 0
1752 route[0] = ((source & ADB_MASK) << ADB_SHIFT) | (dest0 & ADB_MASK);
1766 vortex_adb_delroutes(vortex, channel, route[0], route[1]);
1787 route[0] = ((source0 & ADB_MASK) << ADB_SHIFT) | (dest & ADB_MASK); in vortex_routeLRT()
1790 if (dest < 0x10) in vortex_routeLRT()
1791 route[1] = (route[1] & ~ADB_MASK) | (dest + 0x20); /* fifo A */ in vortex_routeLRT()
1809 vortex_adb_delroutes(vortex, ch, route[0], route[1]); in vortex_routeLRT()
1901 #if 0
1920 routes[0] =
1925 0x20) &
1928 vortex_adb_addroutes(vortex, ch, routes, 0x2);
1932 vortex_adb_delroutes(vortex, ch, routes[0], routes[1]);
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()
1958 /* Check if reg 0x28 has SDAC bit set. */ in vortex_connect_codecplay()
1960 /* Rear channel. Note: ADB_CODECOUT(0+2) and (1+2) is for AC97 modem */ in vortex_connect_codecplay()
1961 vortex_connection_mix_adb(vortex, en, 0x11, mixers[2], in vortex_connect_codecplay()
1962 ADB_CODECOUT(0 + 4)); 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()
1980 Enable: 0x1, 0x1 in vortex_connect_codecrec()
1981 Channel: 0x11, 0x11 in vortex_connect_codecrec()
1982 ADB Source address: 0x48, 0x49 in vortex_connect_codecrec()
1983 Destination Asp4Topology_0x9c,0x98 in vortex_connect_codecrec()
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()
1998 out: Mean checkout if != 0. Else mean Checkin resource.
2004 int i, qty = resnum[restype], resinuse = 0; in vortex_adb_checkinout()
2008 for (i = 0; i < NR_ADB; i++) { in vortex_adb_checkinout()
2013 for (i = 0; i < qty; i++) { in vortex_adb_checkinout()
2014 if ((resinuse & (1 << i)) == 0) { in vortex_adb_checkinout()
2031 for (i = 0; i < qty; i++) { in vortex_adb_checkinout()
2054 vortex->mixplayb[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en, in vortex_connect_default()
2066 vortex->mixcapt[0] = 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()
2078 vortex_connection_mix_adb(vortex, en, 0x14, vortex->mixspdif[0], in vortex_connect_default()
2079 ADB_SPDIFOUT(0)); in vortex_connect_default()
2080 vortex_connection_mix_adb(vortex, en, 0x14, vortex->mixspdif[1], in vortex_connect_default()
2100 Allocate nr_ch pcm audio routes if dma < 0. If dma >= 0, existing routes
2102 dma: DMA engine routes to be deallocated when dma >= 0.
2106 Return: Return allocated DMA or same DMA passed as "dma" when dma >= 0.
2116 if (dma >= 0) { in vortex_adb_allocroute()
2117 en = 0; in vortex_adb_allocroute()
2125 if (dma < 0) in vortex_adb_allocroute()
2138 int a3d = 0; in vortex_adb_allocroute()
2142 for (i = 0; i < nr_ch; i++) { in vortex_adb_allocroute()
2146 if (src[i] < 0) { in vortex_adb_allocroute()
2147 memset(stream->resources, 0, in vortex_adb_allocroute()
2156 if (mix[i] < 0) { in vortex_adb_allocroute()
2158 0, in vortex_adb_allocroute()
2170 if (a3d < 0) { in vortex_adb_allocroute()
2171 memset(stream->resources, 0, in vortex_adb_allocroute()
2183 vortex_route(vortex, 0, 0x14, in vortex_adb_allocroute()
2184 ADB_MIXOUT(vortex->mixspdif[0]), in vortex_adb_allocroute()
2185 ADB_SPDIFOUT(0)); in vortex_adb_allocroute()
2186 vortex_route(vortex, 0, 0x14, in vortex_adb_allocroute()
2192 for (i = 0; i < nr_ch; i++) { in vortex_adb_allocroute()
2199 0x11, src[i], in vortex_adb_allocroute()
2203 MIX_PLAYB(i), 0); in vortex_adb_allocroute()
2207 MIX_SPDIF(i % 2), 0); in vortex_adb_allocroute()
2220 vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_A3DIN(a3d)); 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()
2226 vortex_route(vortex, en, 0x14, in vortex_adb_allocroute()
2236 MIX_PLAYB(i), 0); in vortex_adb_allocroute()
2241 0); in vortex_adb_allocroute()
2251 for (i = 0; i < nr_ch; i++) in vortex_adb_allocroute()
2253 for (i = 0; i < ch_top; i++) in vortex_adb_allocroute()
2254 p->vol[i] = 0; 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()
2268 ADB_SPDIFOUT(0)); in vortex_adb_allocroute()
2269 vortex_route(vortex, 1, 0x14, in vortex_adb_allocroute()
2282 for (i = 0; i < nr_ch; i++) { in vortex_adb_allocroute()
2286 if (mix[i] < 0) { in vortex_adb_allocroute()
2287 memset(stream->resources, 0, in vortex_adb_allocroute()
2294 if (src[i] < 0) { in vortex_adb_allocroute()
2295 memset(stream->resources, 0, 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()
2306 MIX_CAPT(1), mix[0], 0); in vortex_adb_allocroute()
2308 src[0], in vortex_adb_allocroute()
2309 src[0], dma); in vortex_adb_allocroute()
2312 MIX_CAPT(1), mix[1], 0); in vortex_adb_allocroute()
2313 vortex_connection_mix_src(vortex, en, 0x11, mix[1], in vortex_adb_allocroute()
2316 src[1], src[0], in vortex_adb_allocroute()
2322 #if 0 in vortex_adb_allocroute()
2353 /* dir=1:play ; dir=0:rec */ in vortex_adb_setsrc()
2360 for (i = 0; i < NR_SRC; i++) { in vortex_adb_setsrc()
2362 vortex_src_setupchannel(vortex, i, cvrt, 0, 0, i, dir, 1, cvrt, dir); in vortex_adb_setsrc()
2374 #if 0
2378 hwread(card->mmio, VORTEX_IRQ_CTRL) | IRQ_TIMER | 0x60);
2394 (hwread(card->mmio, VORTEX_IRQ_CTRL) & 0xffffefc0) | 0x24); in vortex_enable_int()
2410 if (!(hwread(vortex->mmio, VORTEX_STAT) & 0x1)) in vortex_interrupt()
2422 if (source == 0) { in vortex_interrupt()
2427 handled = 0; in vortex_interrupt()
2450 for (i = 0; i < NR_ADB; i++) { in vortex_interrupt()
2461 for (i = 0; i < NR_WT; i++) { in vortex_interrupt()
2503 for (i = 0; i < 32; i++) { in vortex_codec_init()
2508 if (0) { 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()
2526 for (i = 0; i < 32; i++) { in vortex_codec_init()
2530 hwwrite(vortex->mmio, VORTEX_CODEC_CTRL, 0xe8); in vortex_codec_init()
2532 /* Enable codec channels 0 and 1. */ in vortex_codec_init()
2542 unsigned int lifeboat = 0; in vortex_codec_write()
2545 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { in vortex_codec_write()
2568 unsigned lifeboat = 0; in vortex_codec_read()
2571 while (!(hwread(card->mmio, VORTEX_CODEC_CTRL) & 0x100)) { in vortex_codec_read()
2575 return 0xffff; in vortex_codec_read()
2590 return 0xffff; in vortex_codec_read()
2603 int i, this_38 = 0, this_04 = 0, this_08 = 0, this_0c = 0; 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()
2609 for (i = 0; i < 11; i++) 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()
2619 i = (((0x5DC00000 / spdif_sr) + 1) >> 1); in vortex_spdif_init()
2620 if (i > 0x800) { in vortex_spdif_init()
2621 if (i < 0x1ffff) in vortex_spdif_init()
2624 edi = 0x1ffff; in vortex_spdif_init()
2626 edi = 0x800; in vortex_spdif_init()
2629 vortex_src_setupchannel(vortex, this_04, edi, 0, 1, in vortex_spdif_init()
2630 this_0c, 1, 0, edi, 1); in vortex_spdif_init()
2631 vortex_src_setupchannel(vortex, this_08, edi, 0, 1, in vortex_spdif_init()
2632 this_0c, 1, 0, edi, 1); in vortex_spdif_init()
2636 spdif_sr |= 0x8c; in vortex_spdif_init()
2639 this_38 &= 0xFFFFFFFE; in vortex_spdif_init()
2640 this_38 &= 0xFFFFFFFD; in vortex_spdif_init()
2641 this_38 &= 0xF3FFFFFF; in vortex_spdif_init()
2642 this_38 |= 0x03000000; /* set 32khz samplerate */ in vortex_spdif_init()
2643 this_38 &= 0xFFFFFF3F; in vortex_spdif_init()
2644 spdif_sr &= 0xFFFFFFFD; in vortex_spdif_init()
2648 this_38 &= 0xFFFFFFFE; in vortex_spdif_init()
2649 this_38 &= 0xFFFFFFFD; in vortex_spdif_init()
2650 this_38 &= 0xF0FFFFFF; in vortex_spdif_init()
2651 this_38 |= 0x03000000; in vortex_spdif_init()
2652 this_38 &= 0xFFFFFF3F; in vortex_spdif_init()
2653 spdif_sr &= 0xFFFFFFFC; in vortex_spdif_init()
2657 this_38 &= 0xFFFFFFFE; in vortex_spdif_init()
2658 this_38 &= 0xFFFFFFFD; in vortex_spdif_init()
2659 this_38 &= 0xF2FFFFFF; in vortex_spdif_init()
2660 this_38 |= 0x02000000; /* set 48khz samplerate */ in vortex_spdif_init()
2661 this_38 &= 0xFFFFFF3F; in vortex_spdif_init()
2664 this_38 |= 0x00000003; in vortex_spdif_init()
2665 this_38 &= 0xFFFFFFBF; in vortex_spdif_init()
2666 this_38 |= 0x80; in vortex_spdif_init()
2669 spdif_sr &= 0xFFFFFFFE; 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()
2688 hwwrite(vortex->mmio, VORTEX_CTRL, 0xffffffff); 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()
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()
2723 vortex_settimer(vortex, 0x90); in vortex_core_init()
2726 // hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0); in vortex_core_init()
2734 return 0; in vortex_core_init()
2747 vortex_connect_default(vortex, 0); 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()
2763 return 0; in vortex_core_shutdown()
2774 fmt = 0x1; in vortex_alsafmt_aspfmt()
2777 fmt = 0x2; in vortex_alsafmt_aspfmt()
2780 fmt = 0x3; in vortex_alsafmt_aspfmt()
2783 fmt = 0x4; /* guess. */ in vortex_alsafmt_aspfmt()
2786 fmt = 0x5; /* guess. */ in vortex_alsafmt_aspfmt()
2789 fmt = 0x8; in vortex_alsafmt_aspfmt()
2792 fmt = 0x9; /* check this... */ in vortex_alsafmt_aspfmt()
2795 fmt = 0x8; in vortex_alsafmt_aspfmt()
2804 #if 0
2806 ASPFMTLINEAR16 = 0, /* 0x8 */
2807 ASPFMTLINEAR8, /* 0x1 */
2808 ASPFMTULAW, /* 0x2 */
2809 ASPFMTALAW, /* 0x3 */
2823 case 0:
2824 if (bits == 0x10)
2840 this_194 = 0;
2860 this_148 = 0xbb80 / d;