diff options
author | orion <orion@FreeBSD.org> | 2003-02-21 01:47:17 +0000 |
---|---|---|
committer | orion <orion@FreeBSD.org> | 2003-02-21 01:47:17 +0000 |
commit | 453e885c33a6c165e9f20b4ccfa6b78caf96fe70 (patch) | |
tree | 5eeb6aa619676930833f7c2cd5c8a046928ea45e /sys/dev | |
parent | 0cf9890aec9b5a86b0649ef8706a3402793dc8d9 (diff) | |
download | FreeBSD-src-453e885c33a6c165e9f20b4ccfa6b78caf96fe70.zip FreeBSD-src-453e885c33a6c165e9f20b4ccfa6b78caf96fe70.tar.gz |
Fix assignment of record sgd_addr and clean up via8233chan_init.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sound/pci/via8233.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 1af7caa..d315470 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -355,23 +355,26 @@ via8233chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) { struct via_info *via = devinfo; - struct via_chinfo *ch = (dir == PCMDIR_PLAY)? &via->pch : &via->rch; + struct via_chinfo *ch; - ch->parent = via; - ch->channel = c; - ch->buffer = b; - ch->dir = dir; - ch->sgd_table = &via->sgd_table[(dir == PCMDIR_PLAY)? 0 : SEGS_PER_CHAN]; - ch->sgd_addr = dir == PCMDIR_PLAY ? via->sgd_addr : - via->sgd_addr * SEGS_PER_CHAN; - - if (ch->dir == PCMDIR_PLAY) { + if (dir == PCMDIR_PLAY) { + ch = &via->pch; ch->rbase = VIA_MC_SGD_STATUS; + ch->sgd_table = &via->sgd_table[0]; + ch->sgd_addr = via->sgd_addr; } else { + ch = &via->rch; ch->rbase = VIA_WR0_SGD_STATUS; + ch->sgd_table = &via->sgd_table[SEGS_PER_CHAN]; + ch->sgd_addr = via->sgd_addr + sizeof(struct via_dma_op) * SEGS_PER_CHAN; via_wr(via, VIA_WR0_SGD_FORMAT, WR_FIFO_ENABLE, 1); } + ch->parent = via; + ch->channel = c; + ch->buffer = b; + ch->dir = dir; + if (sndbuf_alloc(ch->buffer, via->parent_dmat, via->bufsz) == -1) return NULL; |