aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Grant <cg@FreeBSD.org>1999-12-21 08:43:28 +0000
committerCameron Grant <cg@FreeBSD.org>1999-12-21 08:43:28 +0000
commit9035ec00a0e5840d346eb3032570b769b09d232d (patch)
treee20fefe8db2c0cc1394ec3e1fc0a9bae0c891f66
parentf662a816e40de1f73e7bacfc251fa4f3c76291a1 (diff)
Notes
-rw-r--r--sys/dev/sound/isa/mss.c41
-rw-r--r--sys/dev/sound/pcm/channel.c13
2 files changed, 20 insertions, 34 deletions
diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c
index d1dceb578881..9fe3cab0f490 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 665e5b2a377f..b74efd94176b 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