diff options
author | cheloha <cheloha@cvs.openbsd.org> | 2020-01-19 00:03:47 +0000 |
---|---|---|
committer | cheloha <cheloha@cvs.openbsd.org> | 2020-01-19 00:03:47 +0000 |
commit | 76cbb4ebdfbfdde20e1b477709d43cb156e1117f (patch) | |
tree | 883b9517ab46ca74a464f2041831cfafe5671c27 /sys/dev/pci | |
parent | 3b26b6d23f25ac9a2b479f8c9e9a314dcb6d1f54 (diff) |
eso(4): msleep(9) -> msleep_nsec(9)
Ticks to milliseconds.
ok ratchov@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/eso.c | 16 | ||||
-rw-r--r-- | sys/dev/pci/esovar.h | 4 |
2 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c index e8fb8dea6b4..c99dd0f4128 100644 --- a/sys/dev/pci/eso.c +++ b/sys/dev/pci/eso.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eso.c,v 1.45 2019/12/14 12:49:50 fcambus Exp $ */ +/* $OpenBSD: eso.c,v 1.46 2020/01/19 00:03:46 cheloha Exp $ */ /* $NetBSD: eso.c,v 1.48 2006/12/18 23:13:39 kleink Exp $ */ /* @@ -760,7 +760,8 @@ eso_halt_output(void *hdl) ESO_IO_A2DMAM_DMAENB); sc->sc_pintr = NULL; - error = msleep(&sc->sc_pintr, &audio_lock, PWAIT, "esoho", sc->sc_pdrain); + error = msleep_nsec(&sc->sc_pintr, &audio_lock, PWAIT, "esoho", + MSEC_TO_NSEC(sc->sc_pdrain)); mtx_leave(&audio_lock); /* Shut down DMA completely. */ @@ -787,7 +788,8 @@ eso_halt_input(void *hdl) DMA37MD_WRITE | DMA37MD_DEMAND); sc->sc_rintr = NULL; - error = msleep(&sc->sc_rintr, &audio_lock, PWAIT, "esohi", sc->sc_rdrain); + error = msleep_nsec(&sc->sc_rintr, &audio_lock, PWAIT, "esohi", + MSEC_TO_NSEC(sc->sc_rdrain)); mtx_leave(&audio_lock); /* Shut down DMA completely. */ @@ -1605,8 +1607,8 @@ eso_trigger_output(void *hdl, void *start, void *end, int blksize, sc->sc_pintr = intr; sc->sc_parg = arg; - /* Compute drain timeout. */ - sc->sc_pdrain = hz * (blksize * 3 / 2) / + /* Compute drain timeout (milliseconds). */ + sc->sc_pdrain = 1000 * (blksize * 3 / 2) / (param->sample_rate * param->channels * param->bps); /* DMA transfer count (in `words'!) reload using 2's complement. */ @@ -1688,8 +1690,8 @@ eso_trigger_input(void *hdl, void *start, void *end, int blksize, sc->sc_rintr = intr; sc->sc_rarg = arg; - /* Compute drain timeout. */ - sc->sc_rdrain = hz * (blksize * 3 / 2) / + /* Compute drain timeout (milliseconds). */ + sc->sc_rdrain = 1000 * (blksize * 3 / 2) / (param->sample_rate * param->channels * param->bps); /* Set up ADC DMA converter parameters. */ diff --git a/sys/dev/pci/esovar.h b/sys/dev/pci/esovar.h index 677a495b282..50b3c45beb2 100644 --- a/sys/dev/pci/esovar.h +++ b/sys/dev/pci/esovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: esovar.h,v 1.6 2010/09/21 20:11:44 jakemsr Exp $ */ +/* $OpenBSD: esovar.h,v 1.7 2020/01/19 00:03:46 cheloha Exp $ */ /* $NetBSD: esovar.h,v 1.5 2004/05/25 21:38:11 kleink Exp $ */ /* @@ -129,7 +129,7 @@ struct eso_softc { void (*sc_rintr)(void *); void * sc_rarg; - /* Auto-initialize DMA transfer block drain timeouts, in ticks */ + /* Auto-initialize DMA transfer block drain timeouts, in milliseconds */ int sc_pdrain; int sc_rdrain; |