diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2009-05-06 23:13:30 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2009-05-06 23:13:30 +0000 |
commit | 3ddc3c179802d7c21c46e1fdbcc2d84d34bde623 (patch) | |
tree | e9b15f102750a0f7a7123eae956d96b197d696ee /sys/dev/pci/cmpci.c | |
parent | a9579ee8d3b43f59b3b4a65aaf9cbdb71db7d436 (diff) |
configure the input and output ports in trigger_{input,output} instead
of set_params so they only get configured when necessary.
Diffstat (limited to 'sys/dev/pci/cmpci.c')
-rw-r--r-- | sys/dev/pci/cmpci.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pci/cmpci.c b/sys/dev/pci/cmpci.c index e698fac419f..260fb8eaaf1 100644 --- a/sys/dev/pci/cmpci.c +++ b/sys/dev/pci/cmpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmpci.c,v 1.23 2009/05/06 22:25:57 jakemsr Exp $ */ +/* $OpenBSD: cmpci.c,v 1.24 2009/05/06 23:13:29 jakemsr Exp $ */ /* $NetBSD: cmpci.c,v 1.25 2004/10/26 06:32:20 xtraeme Exp $ */ /* @@ -901,9 +901,8 @@ cmpci_set_params(void *handle, int setmode, int usemode, CMPCI_REG_ADC_FS_MASK, md_divide); sc->sc_ch1.md_divide = md_divide; } - cmpci_set_out_ports(sc); - cmpci_set_in_ports(sc); } + return 0; } @@ -1926,6 +1925,8 @@ cmpci_trigger_output(void *handle, void *start, void *end, int blksize, uint32_t length; int bps; + cmpci_set_out_ports(sc); + if (sc->sc_play_channel == 1) { chan = &sc->sc_ch1; reg_dma_base = CMPCI_REG_DMA1_BASE; @@ -1982,6 +1983,8 @@ cmpci_trigger_input(void *handle, void *start, void *end, int blksize, struct cmpci_dmanode *p; int bps; + cmpci_set_in_ports(sc); + sc->sc_ch1.intr = intr; sc->sc_ch1.intr_arg = arg; bps = param->channels*param->precision*param->factor/8; |