Lines Matching full:ch
310 tr_testint(struct tr_chinfo *ch)
312 struct tr_info *tr = ch->parent;
315 bank = (ch->index & 0x20) ? 1 : 0;
316 chan = ch->index & 0x1f;
322 tr_clrint(struct tr_chinfo *ch) in tr_clrint() argument
324 struct tr_info *tr = ch->parent; in tr_clrint()
327 bank = (ch->index & 0x20) ? 1 : 0; in tr_clrint()
328 chan = ch->index & 0x1f; in tr_clrint()
333 tr_enaint(struct tr_chinfo *ch, int enable) in tr_enaint() argument
335 struct tr_info *tr = ch->parent; in tr_enaint()
340 bank = (ch->index & 0x20) ? 1 : 0; in tr_enaint()
341 chan = ch->index & 0x1f; in tr_enaint()
348 tr_clrint(ch); in tr_enaint()
356 tr_selch(struct tr_chinfo *ch) in tr_selch() argument
358 struct tr_info *tr = ch->parent; in tr_selch()
363 i |= ch->index & 0x3f; in tr_selch()
368 tr_startch(struct tr_chinfo *ch) in tr_startch() argument
370 struct tr_info *tr = ch->parent; in tr_startch()
373 bank = (ch->index & 0x20) ? 1 : 0; in tr_startch()
374 chan = ch->index & 0x1f; in tr_startch()
379 tr_stopch(struct tr_chinfo *ch) in tr_stopch() argument
381 struct tr_info *tr = ch->parent; in tr_stopch()
384 bank = (ch->index & 0x20) ? 1 : 0; in tr_stopch()
385 chan = ch->index & 0x1f; in tr_stopch()
390 tr_wrch(struct tr_chinfo *ch) in tr_wrch() argument
392 struct tr_info *tr = ch->parent; in tr_wrch()
395 ch->gvsel &= 0x00000001; in tr_wrch()
396 ch->fmc &= 0x00000003; in tr_wrch()
397 ch->fms &= 0x0000000f; in tr_wrch()
398 ch->ctrl &= 0x0000000f; in tr_wrch()
399 ch->pan &= 0x0000007f; in tr_wrch()
400 ch->rvol &= 0x0000007f; in tr_wrch()
401 ch->cvol &= 0x0000007f; in tr_wrch()
402 ch->vol &= 0x000000ff; in tr_wrch()
403 ch->ec &= 0x00000fff; in tr_wrch()
404 ch->alpha &= 0x00000fff; in tr_wrch()
405 ch->delta &= 0x0000ffff; in tr_wrch()
407 ch->lba &= ALI_MAXADDR; in tr_wrch()
409 ch->lba &= TR_MAXADDR; in tr_wrch()
411 cr[1]=ch->lba; in tr_wrch()
412 cr[3]=(ch->fmc<<14) | (ch->rvol<<7) | (ch->cvol); in tr_wrch()
413 cr[4]=(ch->gvsel<<31) | (ch->pan<<24) | (ch->vol<<16) | (ch->ctrl<<12) | (ch->ec); in tr_wrch()
419 ch->cso &= 0x0000ffff; in tr_wrch()
420 ch->eso &= 0x0000ffff; in tr_wrch()
421 cr[0]=(ch->cso<<16) | (ch->alpha<<4) | (ch->fms); in tr_wrch()
422 cr[2]=(ch->eso<<16) | (ch->delta); in tr_wrch()
425 ch->cso &= 0x00ffffff; in tr_wrch()
426 ch->eso &= 0x00ffffff; in tr_wrch()
427 cr[0]=((ch->delta & 0xff)<<24) | (ch->cso); in tr_wrch()
428 cr[2]=((ch->delta>>8)<<24) | (ch->eso); in tr_wrch()
429 cr[3]|=(ch->alpha<<20) | (ch->fms<<16) | (ch->fmc<<14); in tr_wrch()
433 tr_selch(ch); in tr_wrch()
440 tr_rdch(struct tr_chinfo *ch) in tr_rdch() argument
442 struct tr_info *tr = ch->parent; in tr_rdch()
446 tr_selch(ch); in tr_rdch()
452 ch->lba=(cr[1] & ALI_MAXADDR); in tr_rdch()
454 ch->lba=(cr[1] & TR_MAXADDR); in tr_rdch()
455 ch->fmc= (cr[3] & 0x0000c000) >> 14; in tr_rdch()
456 ch->rvol= (cr[3] & 0x00003f80) >> 7; in tr_rdch()
457 ch->cvol= (cr[3] & 0x0000007f); in tr_rdch()
458 ch->gvsel= (cr[4] & 0x80000000) >> 31; in tr_rdch()
459 ch->pan= (cr[4] & 0x7f000000) >> 24; in tr_rdch()
460 ch->vol= (cr[4] & 0x00ff0000) >> 16; in tr_rdch()
461 ch->ctrl= (cr[4] & 0x0000f000) >> 12; in tr_rdch()
462 ch->ec= (cr[4] & 0x00000fff); in tr_rdch()
467 ch->cso= (cr[0] & 0xffff0000) >> 16; in tr_rdch()
468 ch->alpha= (cr[0] & 0x0000fff0) >> 4; in tr_rdch()
469 ch->fms= (cr[0] & 0x0000000f); in tr_rdch()
470 ch->eso= (cr[2] & 0xffff0000) >> 16; in tr_rdch()
471 ch->delta= (cr[2] & 0x0000ffff); in tr_rdch()
474 ch->cso= (cr[0] & 0x00ffffff); in tr_rdch()
475 ch->eso= (cr[2] & 0x00ffffff); in tr_rdch()
476 ch->delta= ((cr[2] & 0xff000000) >> 16) | ((cr[0] & 0xff000000) >> 24); in tr_rdch()
477 ch->alpha= (cr[3] & 0xfff00000) >> 20; in tr_rdch()
478 ch->fms= (cr[3] & 0x000f0000) >> 16; in tr_rdch()
503 struct tr_chinfo *ch; in trpchan_init() local
506 ch = &tr->chinfo[tr->playchns]; in trpchan_init()
507 ch->index = tr->playchns++; in trpchan_init()
508 ch->buffer = b; in trpchan_init()
509 ch->parent = tr; in trpchan_init()
510 ch->channel = c; in trpchan_init()
511 if (sndbuf_alloc(ch->buffer, tr->parent_dmat, 0, tr->bufsz) != 0) in trpchan_init()
514 return ch; in trpchan_init()
520 struct tr_chinfo *ch = data; in trpchan_setformat() local
522 ch->ctrl = tr_fmttobits(format) | 0x01; in trpchan_setformat()
530 struct tr_chinfo *ch = data; in trpchan_setspeed() local
532 ch->delta = (speed << 12) / 48000; in trpchan_setspeed()
533 return (ch->delta * 48000) >> 12; in trpchan_setspeed()
539 struct tr_chinfo *ch = data; in trpchan_setblocksize() local
541 sndbuf_resize(ch->buffer, 2, blocksize); in trpchan_setblocksize()
548 struct tr_chinfo *ch = data; in trpchan_trigger() local
554 ch->fmc = 3; in trpchan_trigger()
555 ch->fms = 0; in trpchan_trigger()
556 ch->ec = 0; in trpchan_trigger()
557 ch->alpha = 0; in trpchan_trigger()
558 ch->lba = sndbuf_getbufaddr(ch->buffer); in trpchan_trigger()
559 ch->cso = 0; in trpchan_trigger()
560 ch->eso = (sndbuf_getsize(ch->buffer) / sndbuf_getalign(ch->buffer)) - 1; in trpchan_trigger()
561 ch->rvol = ch->cvol = 0x7f; in trpchan_trigger()
562 ch->gvsel = 0; in trpchan_trigger()
563 ch->pan = 0; in trpchan_trigger()
564 ch->vol = 0; in trpchan_trigger()
565 ch->bufhalf = 0; in trpchan_trigger()
566 tr_wrch(ch); in trpchan_trigger()
567 tr_enaint(ch, 1); in trpchan_trigger()
568 tr_startch(ch); in trpchan_trigger()
569 ch->active = 1; in trpchan_trigger()
571 tr_stopch(ch); in trpchan_trigger()
572 ch->active = 0; in trpchan_trigger()
581 struct tr_chinfo *ch = data; in trpchan_getptr() local
583 tr_rdch(ch); in trpchan_getptr()
584 return ch->cso * sndbuf_getalign(ch->buffer); in trpchan_getptr()
612 struct tr_rchinfo *ch; in trrchan_init() local
615 ch = &tr->recchinfo; in trrchan_init()
616 ch->buffer = b; in trrchan_init()
617 ch->parent = tr; in trrchan_init()
618 ch->channel = c; in trrchan_init()
619 if (sndbuf_alloc(ch->buffer, tr->parent_dmat, 0, tr->bufsz) != 0) in trrchan_init()
622 return ch; in trrchan_init()
628 struct tr_rchinfo *ch = data; in trrchan_setformat() local
629 struct tr_info *tr = ch->parent; in trrchan_setformat()
634 i = (sndbuf_runsz(ch->buffer) >> ((bits & 0x08)? 1 : 0)) - 1; in trrchan_setformat()
646 struct tr_rchinfo *ch = data; in trrchan_setspeed() local
647 struct tr_info *tr = ch->parent; in trrchan_setspeed()
650 ch->delta = (48000 << 12) / speed; in trrchan_setspeed()
651 tr_wr(tr, TR_REG_SBDELTA, ch->delta, 2); in trrchan_setspeed()
654 return (48000 << 12) / ch->delta; in trrchan_setspeed()
660 struct tr_rchinfo *ch = data; in trrchan_setblocksize() local
662 sndbuf_resize(ch->buffer, 2, blocksize); in trrchan_setblocksize()
670 struct tr_rchinfo *ch = data; in trrchan_trigger() local
671 struct tr_info *tr = ch->parent; in trrchan_trigger()
683 tr_wr(tr, TR_REG_DMAR0, sndbuf_getbufaddr(ch->buffer), 4); in trrchan_trigger()
686 tr_wr(tr, TR_REG_DMAR4, i | (sndbuf_runsz(ch->buffer) - 1), 4); in trrchan_trigger()
689 ch->active = 1; in trrchan_trigger()
692 ch->active = 0; in trrchan_trigger()
702 struct tr_rchinfo *ch = data; in trrchan_getptr() local
703 struct tr_info *tr = ch->parent; in trrchan_getptr()
706 return tr_rd(tr, TR_REG_DMAR0, 4) - sndbuf_getbufaddr(ch->buffer); in trrchan_getptr()
734 struct tr_chinfo *ch; in tr_intr() local
750 ch = &tr->chinfo[chnum]; in tr_intr()
751 /* printf("%d @ %d, ", chnum, trpchan_getptr(NULL, ch)); */ in tr_intr()
752 if (ch->bufhalf != tmp) { in tr_intr()
753 chn_intr(ch->channel); in tr_intr()
754 ch->bufhalf = tmp; in tr_intr()