diff options
author | cg <cg@FreeBSD.org> | 1999-12-21 08:43:28 +0000 |
---|---|---|
committer | cg <cg@FreeBSD.org> | 1999-12-21 08:43:28 +0000 |
commit | d213246f9d90fce1e5417589787ee6a03f4cc820 (patch) | |
tree | fb33afe673247461da957dc68cc77d37993ea594 /sys | |
parent | a91e0d2474d47b131eb15054f8e6993d2dd16509 (diff) | |
download | FreeBSD-src-d213246f9d90fce1e5417589787ee6a03f4cc820.zip FreeBSD-src-d213246f9d90fce1e5417589787ee6a03f4cc820.tar.gz |
minor cleanup
Parts Submitted by: Ville-Pertti Keinonen <will@ztango.com>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/isa/mss.c | 41 | ||||
-rw-r--r-- | 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 d1dceb5..9fe3cab 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 665e5b2..b74efd9 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 |