Module Name: src Committed By: isaki Date: Fri Jun 21 09:34:30 UTC 2019
Modified Files: src/sys/dev: spkr_audio.c Log Message: Use hztoms() instead of incorrect calculation. This makes spkr work on HZ=1024 like alpha. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/spkr_audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/spkr_audio.c diff -u src/sys/dev/spkr_audio.c:1.7 src/sys/dev/spkr_audio.c:1.8 --- src/sys/dev/spkr_audio.c:1.7 Wed May 8 13:40:17 2019 +++ src/sys/dev/spkr_audio.c Fri Jun 21 09:34:30 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: spkr_audio.c,v 1.7 2019/05/08 13:40:17 isaki Exp $ */ +/* $NetBSD: spkr_audio.c,v 1.8 2019/06/21 09:34:30 isaki Exp $ */ /*- * Copyright (c) 2016 Nathanial Sloss <nathanialsl...@yahoo.com.au> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.7 2019/05/08 13:40:17 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.8 2019/06/21 09:34:30 isaki Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -70,7 +70,7 @@ spkr_audio_tone(device_t self, u_int xhz #ifdef SPKRDEBUG aprint_debug_dev(self, "%s: %u %d\n", __func__, xhz, ticks); #endif /* SPKRDEBUG */ - audiobell(sc->sc_audiodev, xhz, ticks * (1000 / hz), + audiobell(sc->sc_audiodev, xhz, hztoms(ticks), sc->sc_spkr.sc_vol, 0); } @@ -83,7 +83,7 @@ spkr_audio_rest(device_t self, int ticks aprint_debug_dev(self, "%s: %d\n", __func__, ticks); #endif /* SPKRDEBUG */ if (ticks > 0) - audiobell(sc->sc_audiodev, 0, ticks * (1000 / hz), + audiobell(sc->sc_audiodev, 0, hztoms(ticks), sc->sc_spkr.sc_vol, 0); }