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