From 9035ec00a0e5840d346eb3032570b769b09d232d Mon Sep 17 00:00:00 2001 From: Cameron Grant Date: Tue, 21 Dec 1999 08:43:28 +0000 Subject: [PATCH] minor cleanup Parts Submitted by: Ville-Pertti Keinonen --- sys/dev/sound/isa/mss.c | 41 +++++++++++++++++-------------------- sys/dev/sound/pcm/channel.c | 13 +----------- 2 files changed, 20 insertions(+), 34 deletions(-) diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index d1dceb57888..9fe3cab0f49 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -586,7 +586,7 @@ static int mss_detect(device_t dev, struct mss_info *mss) { int i; - u_char tmp, tmp1, tmp2; + u_char tmp = 0, tmp1, tmp2; char *name, *yamaha; if (mss->bd_id != 0) { @@ -1068,34 +1068,31 @@ ad_write_cnt(struct mss_info *mss, int reg, u_short cnt) static void wait_for_calibration(struct mss_info *mss) { - int n, t; + int t; /* - * Wait until the auto calibration process has finished. - * - * 1) Wait until the chip becomes ready (reads don't return 0x80). - * 2) Wait until the ACI bit of I11 gets on - * 3) Wait until the ACI bit of I11 gets off - */ + * Wait until the auto calibration process has finished. + * + * 1) Wait until the chip becomes ready (reads don't return 0x80). + * 2) Wait until the ACI bit of I11 gets on + * 3) Wait until the ACI bit of I11 gets off + */ - n = ad_wait_init(mss, 1000); - if (n & MSS_IDXBUSY) printf("mss: Auto calibration timed out(1).\n"); + t = ad_wait_init(mss, 1000); + if (t & MSS_IDXBUSY) printf("mss: Auto calibration timed out(1).\n"); /* - * There is no guarantee that we'll ever see ACI go on, - * calibration may finish before we get here. - * - * XXX Are there docs that even state that it might ever be - * visible off before calibration starts using any chip? + * The calibration mode for chips that support it is set so that + * we never see ACI go on. */ - if (mss->bd_id == MD_GUSMAX) { - /* 10 ms of busy-waiting is not reasonable normal behavior */ - for (t = 100; t > 0 && (ad_read(mss, 11) & 0x20) == 0; t--) - ; - if (t > 0 && t != 100) - printf("debug: ACI turned on: t = %d\n", t); + if (mss->bd_id == MD_GUSMAX || mss->bd_id == MD_GUSPNP) { + for (t = 100; t > 0 && (ad_read(mss, 11) & 0x20) == 0; t--); } else { - for (t = 100; t > 0 && (ad_read(mss, 11) & 0x20) == 0; t--) DELAY(100); + /* + * XXX This should only be enabled for cards that *really* + * need it. Are there any? + */ + for (t = 100; t > 0 && (ad_read(mss, 11) & 0x20) == 0; t--) DELAY(100); } for (t = 100; t > 0 && ad_read(mss, 11) & 0x20; t--) DELAY(100); } diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 665e5b2a377..b74efd94176 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -36,7 +36,6 @@ #define ISA_DMA(b) (((b)->chan >= 0 && (b)->chan != 4 && (b)->chan < 8)) #define CANCHANGE(c) (!(c)->buffer.dl) -static void chn_stintr(pcm_channel *c); static void chn_clearbuf(pcm_channel *c, int length); /* * SOUND OUTPUT @@ -621,17 +620,7 @@ chn_read(pcm_channel *c, struct uio *buf) void chn_intr(pcm_channel *c) { -/* if (!c->buffer.dl) chn_reinit(c); -*/ if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); -} - -static void -chn_stintr(pcm_channel *c) -{ - u_long s; - s = spltty(); - chn_intr(c); - splx(s); + if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); } static void