summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-29 06:28:00 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-29 06:28:00 +0000
commit3e69d06600d67479fe28260f374456ba5edb721f (patch)
tree32a27b22c7fb3e591c25472d6b2c7ea3ecd33540 /sys/dev/isa
parent272fb308d299aaa40f31254b14fe752eee6cef70 (diff)
new timeouts; spaces
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/ess.c116
-rw-r--r--sys/dev/isa/ess_isapnp.c3
-rw-r--r--sys/dev/isa/essreg.h28
-rw-r--r--sys/dev/isa/essvar.h19
4 files changed, 86 insertions, 80 deletions
diff --git a/sys/dev/isa/ess.c b/sys/dev/isa/ess.c
index 54c8e89c94e..89f257f1875 100644
--- a/sys/dev/isa/ess.c
+++ b/sys/dev/isa/ess.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ess.c,v 1.2 1999/09/30 22:13:52 kstailey Exp $ */
+/* $OpenBSD: ess.c,v 1.3 2001/01/29 06:27:59 mickey Exp $ */
/* $NetBSD: ess.c,v 1.44.4.1 1999/06/21 01:18:00 thorpej Exp $ */
/*
@@ -45,8 +45,8 @@
**
** MODULE DESCRIPTION:
**
-** This module contains the device driver for the ESS
-** Technologies 1888/1887/888 sound chip. The code in sbdsp.c was
+** This module contains the device driver for the ESS
+** Technologies 1888/1887/888 sound chip. The code in sbdsp.c was
** used as a reference point when implementing this driver.
**
** AUTHORS:
@@ -54,7 +54,7 @@
** Blair Fidler Software Engineering Australia
** Gold Coast, Australia.
**
-** CREATION DATE:
+** CREATION DATE:
**
** March 10, 1997.
**
@@ -74,6 +74,7 @@
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/kernel.h>
+#include <sys/timeout.h>
#include <machine/cpu.h>
#include <machine/intr.h>
@@ -119,10 +120,10 @@ void ess_1788_close __P((void *));
void ess_1888_close __P((void *));
int ess_getdev __P((void *, struct audio_device *));
int ess_drain __P((void *));
-
+
int ess_query_encoding __P((void *, struct audio_encoding *));
-int ess_set_params __P((void *, int, int, struct audio_params *,
+int ess_set_params __P((void *, int, int, struct audio_params *,
struct audio_params *));
int ess_round_blocksize __P((void *, int));
@@ -143,7 +144,7 @@ void ess_audio2_poll __P((void *));
int ess_speaker_ctl __P((void *, int));
int ess_getdev __P((void *, struct audio_device *));
-
+
int ess_set_port __P((void *, mixer_ctrl_t *));
int ess_get_port __P((void *, mixer_ctrl_t *));
@@ -276,7 +277,7 @@ ess_printsc(sc)
struct ess_softc *sc;
{
int i;
-
+
printf("open %d iobase 0x%x outport %u inport %u speaker %s\n",
(int)sc->sc_open, sc->sc_iobase, sc->out_port,
sc->in_port, sc->spkr_state ? "on" : "off");
@@ -415,7 +416,7 @@ ess_config_addr(sc)
/* Write the base address information into SCR[0]. */
EWRITE1(iot, scr_ioh, ESS_SCR_INDEX, 0);
EWRITE1(iot, scr_ioh, ESS_SCR_DATA, scr_value);
-
+
/* Lock the SCR. */
EWRITE1(iot, scr_access_ioh, ESS_SCR_LOCK, 0);
@@ -473,7 +474,7 @@ ess_config_irq(sc)
break;
#ifdef DIAGNOSTIC
default:
- printf("ess_config_irq: configured irq %d not supported for Audio 1\n",
+ printf("ess_config_irq: configured irq %d not supported for Audio 1\n",
sc->sc_audio1.irq);
return;
#endif
@@ -509,7 +510,7 @@ ess_config_irq(sc)
break;
#ifdef DIAGNOSTIC
default:
- printf("ess: configured irq %d not supported for Audio 1\n",
+ printf("ess: configured irq %d not supported for Audio 1\n",
sc->sc_audio1.irq);
return;
#endif
@@ -522,11 +523,11 @@ ess_config_irq(sc)
if (sc->sc_audio2.polled) {
/* Turn off Audio2 interrupts. */
- ess_clear_mreg_bits(sc, ESS_MREG_AUDIO2_CTRL2,
+ ess_clear_mreg_bits(sc, ESS_MREG_AUDIO2_CTRL2,
ESS_AUDIO2_CTRL2_IRQ2_ENABLE);
} else {
/* Audio2 is hardwired to INTRE in this mode. */
- ess_set_mreg_bits(sc, ESS_MREG_AUDIO2_CTRL2,
+ ess_set_mreg_bits(sc, ESS_MREG_AUDIO2_CTRL2,
ESS_AUDIO2_CTRL2_IRQ2_ENABLE);
}
}
@@ -554,7 +555,7 @@ ess_config_drq(sc)
break;
#ifdef DIAGNOSTIC
default:
- printf("ess_config_drq: configured dma chan %d not supported for Audio 1\n",
+ printf("ess_config_drq: configured dma chan %d not supported for Audio 1\n",
sc->sc_audio1.drq);
return;
#endif
@@ -582,19 +583,19 @@ ess_config_drq(sc)
break;
#ifdef DIAGNOSTIC
default:
- printf("ess_config_drq: configured dma chan %d not supported for Audio 2\n",
+ printf("ess_config_drq: configured dma chan %d not supported for Audio 2\n",
sc->sc_audio2.drq);
return;
#endif
}
ess_write_mix_reg(sc, ESS_MREG_AUDIO2_CTRL3, v);
/* Enable DMA 2 */
- ess_set_mreg_bits(sc, ESS_MREG_AUDIO2_CTRL2,
+ ess_set_mreg_bits(sc, ESS_MREG_AUDIO2_CTRL2,
ESS_AUDIO2_CTRL2_DMA_ENABLE);
}
-/*
- * Set up registers after a reset.
+/*
+ * Set up registers after a reset.
*/
void
ess_setup(sc)
@@ -611,7 +612,7 @@ ess_setup(sc)
* Determine the model of ESS chip we are talking to. Currently we
* only support ES1888, ES1887 and ES888. The method of determining
* the chip is based on the information on page 27 of the ES1887 data
- * sheet.
+ * sheet.
*
* This routine sets the values of sc->sc_model and sc->sc_version.
*/
@@ -660,9 +661,9 @@ ess_identify(sc)
*/
reg1 = ess_read_mix_reg(sc, ESS_MREG_VOLUME_CTRL);
reg2 = reg1 ^ 0x04; /* toggle bit 2 */
-
+
ess_write_mix_reg(sc, ESS_MREG_VOLUME_CTRL, reg2);
-
+
if (ess_read_mix_reg(sc, ESS_MREG_VOLUME_CTRL) != reg2) {
printf("ess: Hardware error (unable to toggle bit 2 of mixer register 0x64)\n");
return 1;
@@ -675,7 +676,7 @@ ess_identify(sc)
/*
- * 3. Verify we can change the value of mixer register
+ * 3. Verify we can change the value of mixer register
* ESS_MREG_SAMPLE_RATE.
* This is possible on the 1888/1887/888, but not on the 1788.
* It is not necessary to restore the value of this mixer register.
@@ -684,7 +685,7 @@ ess_identify(sc)
reg2 = reg1 ^ 0xff; /* toggle all bits */
ess_write_mix_reg(sc, ESS_MREG_SAMPLE_RATE, reg2);
-
+
if (ess_read_mix_reg(sc, ESS_MREG_SAMPLE_RATE) != reg2) {
/* If we got this far before failing, it's a 1788. */
sc->sc_model = ESS_1788;
@@ -713,9 +714,9 @@ ess_identify(sc)
*/
reg1 = ess_read_mix_reg(sc, ESS_MREG_VOLUME_CTRL);
reg2 = reg1 ^ 0x20; /* toggle bit 5 */
-
+
ess_write_mix_reg(sc, ESS_MREG_VOLUME_CTRL, reg2);
-
+
if (ess_read_mix_reg(sc, ESS_MREG_VOLUME_CTRL) == reg2) {
sc->sc_model = ESS_1887;
@@ -762,7 +763,7 @@ ess_identify(sc)
sc->sc_model = ESS_888;
else
sc->sc_model = ESS_1888;
-
+
/*
* Restore the original value of the registers.
*/
@@ -811,7 +812,7 @@ essmatch(sc)
if (ess_config_addr(sc))
return (0);
- if (ess_setup_sc(sc, 1))
+ if (ess_setup_sc(sc, 1))
return (0);
if (sc->sc_model == ESS_UNSUPPORTED) {
@@ -839,8 +840,8 @@ essmatch(sc)
if (!isa_drq_isfree(sc->sc_isa, sc->sc_audio2.drq))
return (0);
}
-
- /*
+
+ /*
* The 1887 has an additional IRQ mode where both channels are mapped
* to the same IRQ.
*/
@@ -895,7 +896,7 @@ essattach(sc)
return;
}
- printf(": ESS Technology ES%s [version 0x%04x]\n",
+ printf(": ESS Technology ES%s [version 0x%04x]\n",
essmodel[sc->sc_model], sc->sc_version);
sc->sc_audio1.polled = sc->sc_audio1.irq == -1;
@@ -932,7 +933,10 @@ essattach(sc)
}
}
- /*
+ timeout_set(&sc->sc_tmo1, ess_audio1_poll, sc);
+ timeout_set(&sc->sc_tmo2, ess_audio2_poll, sc);
+
+ /*
* Set record and play parameters to default values defined in
* generic audio driver.
*/
@@ -1032,7 +1036,7 @@ ess_open(addr, flags)
struct ess_softc *sc = addr;
DPRINTF(("ess_open: sc=%p\n", sc));
-
+
if (sc->sc_open != 0 || ess_reset(sc) != 0)
return ENXIO;
@@ -1214,7 +1218,7 @@ ess_set_params(addr, setmode, usemode, play, rec)
return (EINVAL);
}
- for (mode = AUMODE_RECORD; mode != -1;
+ for (mode = AUMODE_RECORD; mode != -1;
mode = mode == AUMODE_RECORD ? AUMODE_PLAY : -1) {
if ((setmode & mode) == 0)
continue;
@@ -1299,7 +1303,7 @@ ess_audio1_trigger_output(addr, start, end, blksize, intr, arg, param)
sc->sc_audio1.buffersize = (char *)end - (char *)start;
sc->sc_audio1.dmacount = 0;
sc->sc_audio1.blksize = blksize;
- timeout(ess_audio1_poll, sc, hz/30);
+ timeout_add(&sc->sc_tmo1, hz/30);
}
reg = ess_read_x_reg(sc, ESS_XCMD_AUDIO_CTRL);
@@ -1329,7 +1333,7 @@ ess_audio1_trigger_output(addr, start, end, blksize, intr, arg, param)
reg |= ESS_AUDIO1_CTRL1_FIFO_CONNECT;
ess_write_x_reg(sc, ESS_XCMD_AUDIO1_CTRL1, reg);
- isa_dmastart(sc->sc_isa, sc->sc_audio1.drq, start,
+ isa_dmastart(sc->sc_isa, sc->sc_audio1.drq, start,
(char *)end - (char *)start, NULL,
DMAMODE_WRITE | DMAMODE_LOOP, BUS_DMA_NOWAIT);
@@ -1342,7 +1346,7 @@ ess_audio1_trigger_output(addr, start, end, blksize, intr, arg, param)
ess_set_xreg_bits(sc, ESS_XCMD_DEMAND_CTRL, ESS_DEMAND_CTRL_DEMAND_4);
/* Start auto-init DMA */
- ess_wdsp(sc, ESS_ACMD_ENABLE_SPKR);
+ ess_wdsp(sc, ESS_ACMD_ENABLE_SPKR);
reg = ess_read_x_reg(sc, ESS_XCMD_AUDIO1_CTRL2);
reg &= ~(ESS_AUDIO1_CTRL2_DMA_READ | ESS_AUDIO1_CTRL2_ADC_ENABLE);
reg |= ESS_AUDIO1_CTRL2_FIFO_ENABLE | ESS_AUDIO1_CTRL2_AUTO_INIT;
@@ -1377,7 +1381,7 @@ ess_audio2_trigger_output(addr, start, end, blksize, intr, arg, param)
sc->sc_audio2.buffersize = (char *)end - (char *)start;
sc->sc_audio2.dmacount = 0;
sc->sc_audio2.blksize = blksize;
- timeout(ess_audio2_poll, sc, hz/30);
+ timeout_add(&sc->sc_tmo2, hz/30);
}
reg = ess_read_mix_reg(sc, ESS_MREG_AUDIO2_CTRL2);
@@ -1396,7 +1400,7 @@ ess_audio2_trigger_output(addr, start, end, blksize, intr, arg, param)
reg &= ~ESS_AUDIO2_CTRL2_FIFO_SIGNED;
ess_write_mix_reg(sc, ESS_MREG_AUDIO2_CTRL2, reg);
- isa_dmastart(sc->sc_isa, sc->sc_audio2.drq, start,
+ isa_dmastart(sc->sc_isa, sc->sc_audio2.drq, start,
(char *)end - (char *)start, NULL,
DMAMODE_WRITE | DMAMODE_LOOP, BUS_DMA_NOWAIT);
@@ -1446,7 +1450,7 @@ ess_audio1_trigger_input(addr, start, end, blksize, intr, arg, param)
sc->sc_audio1.buffersize = (char *)end - (char *)start;
sc->sc_audio1.dmacount = 0;
sc->sc_audio1.blksize = blksize;
- timeout(ess_audio1_poll, sc, hz/30);
+ timeout_add(&sc->sc_tmo1, hz/30);
}
reg = ess_read_x_reg(sc, ESS_XCMD_AUDIO_CTRL);
@@ -1476,7 +1480,7 @@ ess_audio1_trigger_input(addr, start, end, blksize, intr, arg, param)
reg |= ESS_AUDIO1_CTRL1_FIFO_CONNECT;
ess_write_x_reg(sc, ESS_XCMD_AUDIO1_CTRL1, reg);
- isa_dmastart(sc->sc_isa, sc->sc_audio1.drq, start,
+ isa_dmastart(sc->sc_isa, sc->sc_audio1.drq, start,
(char *)end - (char *)start, NULL,
DMAMODE_READ | DMAMODE_LOOP, BUS_DMA_NOWAIT);
@@ -1489,7 +1493,7 @@ ess_audio1_trigger_input(addr, start, end, blksize, intr, arg, param)
ess_set_xreg_bits(sc, ESS_XCMD_DEMAND_CTRL, ESS_DEMAND_CTRL_DEMAND_4);
/* Start auto-init DMA */
- ess_wdsp(sc, ESS_ACMD_DISABLE_SPKR);
+ ess_wdsp(sc, ESS_ACMD_DISABLE_SPKR);
reg = ess_read_x_reg(sc, ESS_XCMD_AUDIO1_CTRL2);
reg |= ESS_AUDIO1_CTRL2_DMA_READ | ESS_AUDIO1_CTRL2_ADC_ENABLE;
reg |= ESS_AUDIO1_CTRL2_FIFO_ENABLE | ESS_AUDIO1_CTRL2_AUTO_INIT;
@@ -1511,7 +1515,7 @@ ess_audio1_halt(addr)
ESS_AUDIO1_CTRL2_FIFO_ENABLE);
isa_dmaabort(sc->sc_isa, sc->sc_audio1.drq);
if (sc->sc_audio1.polled)
- untimeout(ess_audio1_poll, sc);
+ timeout_del(&sc->sc_tmo1);
sc->sc_audio1.active = 0;
}
@@ -1532,7 +1536,7 @@ ess_audio2_halt(addr)
ESS_AUDIO2_CTRL1_FIFO_ENABLE);
isa_dmaabort(sc->sc_isa, sc->sc_audio2.drq);
if (sc->sc_audio2.polled)
- untimeout(ess_audio2_poll, sc);
+ timeout_del(&sc->sc_tmo2);
sc->sc_audio2.active = 0;
}
@@ -1616,7 +1620,7 @@ ess_audio1_poll(addr)
(*sc->sc_audio1.intr)(sc->sc_audio1.arg, dmacount);
#endif
- timeout(ess_audio1_poll, sc, hz/30);
+ timeout_add(&sc->sc_tmo1, hz/30);
}
void
@@ -1647,7 +1651,7 @@ ess_audio2_poll(addr)
(*sc->sc_audio2.intr)(sc->sc_audio2.arg, dmacount);
#endif
- timeout(ess_audio2_poll, sc, hz/30);
+ timeout_add(&sc->sc_tmo2, hz/30);
}
int
@@ -1665,7 +1669,7 @@ ess_set_port(addr, cp)
{
struct ess_softc *sc = addr;
int lgain, rgain;
-
+
DPRINTFN(5,("ess_set_port: port=%d num_channels=%d\n",
cp->dev, cp->un.value.num_channels));
@@ -1805,7 +1809,7 @@ ess_get_port(addr, cp)
mixer_ctrl_t *cp;
{
struct ess_softc *sc = addr;
-
+
DPRINTFN(5,("ess_get_port: port=%d\n", cp->dev));
switch (cp->dev) {
@@ -1819,13 +1823,13 @@ ess_get_port(addr, cp)
case ESS_RECORD_VOL:
switch (cp->un.value.num_channels) {
case 1:
- cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] =
+ cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] =
sc->gain[cp->dev][ESS_LEFT];
break;
case 2:
- cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] =
+ cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] =
sc->gain[cp->dev][ESS_LEFT];
- cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] =
+ cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] =
sc->gain[cp->dev][ESS_RIGHT];
break;
default:
@@ -1837,7 +1841,7 @@ ess_get_port(addr, cp)
if (cp->un.value.num_channels != 1)
return EINVAL;
- cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] =
+ cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] =
sc->gain[cp->dev][ESS_LEFT];
return (0);
@@ -1866,13 +1870,13 @@ ess_get_port(addr, cp)
case ESS_AUXB_REC_VOL:
switch (cp->un.value.num_channels) {
case 1:
- cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] =
+ cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] =
sc->gain[cp->dev][ESS_LEFT];
break;
case 2:
- cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] =
+ cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] =
sc->gain[cp->dev][ESS_LEFT];
- cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] =
+ cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] =
sc->gain[cp->dev][ESS_RIGHT];
break;
default:
@@ -1896,7 +1900,7 @@ ess_query_devinfo(addr, dip)
{
struct ess_softc *sc = addr;
- DPRINTFN(5,("ess_query_devinfo: model=%d index=%d\n",
+ DPRINTFN(5,("ess_query_devinfo: model=%d index=%d\n",
sc->sc_model, dip->index));
/*
@@ -2016,7 +2020,7 @@ ess_query_devinfo(addr, dip)
/*
* The 1788 doesn't use the input mixer control that
* the 1888 uses, because it's a pain when you only
- * have one mixer.
+ * have one mixer.
* Perhaps it could be emulated by keeping both sets of
* gain values, and doing a `context switch' of the
* mixer registers when shifting from playing to
diff --git a/sys/dev/isa/ess_isapnp.c b/sys/dev/isa/ess_isapnp.c
index 5e1179df724..2b41da20bb9 100644
--- a/sys/dev/isa/ess_isapnp.c
+++ b/sys/dev/isa/ess_isapnp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ess_isapnp.c,v 1.1 1999/06/22 16:20:03 niklas Exp $ */
+/* $OpenBSD: ess_isapnp.c,v 1.2 2001/01/29 06:27:59 mickey Exp $ */
/* $NetBSD: ess_isa.c,v 1.4 1999/03/18 20:57:11 mycroft Exp $ */
/*-
@@ -41,6 +41,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
+#include <sys/timeout.h>
#include <machine/cpu.h>
#include <machine/bus.h>
diff --git a/sys/dev/isa/essreg.h b/sys/dev/isa/essreg.h
index 811eebed51d..0b50d812da3 100644
--- a/sys/dev/isa/essreg.h
+++ b/sys/dev/isa/essreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: essreg.h,v 1.2 1999/09/30 22:13:52 kstailey Exp $ */
+/* $OpenBSD: essreg.h,v 1.3 2001/01/29 06:27:59 mickey Exp $ */
/* $NetBSD: essreg.h,v 1.12 1999/06/18 20:25:23 augustss Exp $ */
/*
* Copyright 1997
@@ -34,7 +34,7 @@
*/
/*
-** @(#) $RCSfile: essreg.h,v $ $Revision: 1.2 $ (SHARK) $Date: 1999/09/30 22:13:52 $
+** @(#) $RCSfile: essreg.h,v $ $Revision: 1.3 $ (SHARK) $Date: 2001/01/29 06:27:59 $
**
**++
**
@@ -46,15 +46,15 @@
**
** MODULE DESCRIPTION:
**
-** This module contains the constant definitions for the device
-** registers on the ESS Technologies 1888/1887/888 sound chip.
+** This module contains the constant definitions for the device
+** registers on the ESS Technologies 1888/1887/888 sound chip.
**
** AUTHORS:
**
** Blair Fidler Software Engineering Australia
** Gold Coast, Australia.
**
-** CREATION DATE:
+** CREATION DATE:
**
** March 10, 1997.
**
@@ -67,7 +67,7 @@
* DSP commands. This unit handles MIDI and audio capabilities.
* The DSP can be reset, data/commands can be read or written to it,
* and it can generate interrupts. Interrupts are generated for MIDI
- * input or DMA completion. They seem to have neglected the fact
+ * input or DMA completion. They seem to have neglected the fact
* that it would be nice to have a MIDI transmission complete interrupt.
* Worse, the DMA engine is half-duplex. This means you need to do
* (timed) programmed I/O to be able to record and play simulataneously.
@@ -109,7 +109,7 @@
#define ESS_AUDIO_CTRL_MONITOR 0x08 /* 0=disable/1=enable */
#define ESS_AUDIO_CTRL_MONO 0x02 /* 0=disable/1=enable */
#define ESS_AUDIO_CTRL_STEREO 0x01 /* 0=disable/1=enable */
-#define ESS_XCMD_PREAMP_CTRL 0xA9 /* */
+#define ESS_XCMD_PREAMP_CTRL 0xA9 /* */
#define ESS_PREAMP_CTRL_ENABLE 0x04
#define ESS_XCMD_IRQ_CTRL 0xB1 /* legacy audio interrupt control */
@@ -127,8 +127,8 @@
#define ESS_DRQ_CTRL_EXT 0x40
#define ESS_XCMD_VOLIN_CTRL 0xB4 /* stereo input volume control */
#define ESS_1788_XCMD_AUDIO_CTRL0 0xB6
-#define ESS_CTRL0_SIGNED 0x00
-#define ESS_CTRL0_UNSIGNED 0x80
+#define ESS_CTRL0_SIGNED 0x00
+#define ESS_CTRL0_UNSIGNED 0x80
#define ESS_XCMD_AUDIO1_CTRL1 0xB7 /* */
#define ESS_AUDIO1_CTRL1_FIFO_CONNECT 0x80 /* 1=connected */
#define ESS_AUDIO1_CTRL1_FIFO_MONO 0x40 /* 0=stereo/1=mono */
@@ -216,10 +216,10 @@
#endif
/*****************************************************************************/
-/* DSP Timeout Definitions */
+/* DSP Timeout Definitions */
/*****************************************************************************/
-#define ESS_READ_TIMEOUT 5000 /* number of times to try a read, 5ms*/
-#define ESS_WRITE_TIMEOUT 5000 /* number of times to try a write, 5ms */
+#define ESS_READ_TIMEOUT 5000 /* number of times to try a read, 5ms*/
+#define ESS_WRITE_TIMEOUT 5000 /* number of times to try a write, 5ms */
#define ESS_NPORT 16
@@ -234,7 +234,7 @@
#define ESS_DSP_RW_STATUS 0x0C
#define ESS_DSP_WRITE_BUSY 0x80
-#define ESS_DSP_READ_READY 0x40
+#define ESS_DSP_READ_READY 0x40
#define ESS_DSP_READ_FULL 0x20 /* FIFO full */
#define ESS_DSP_READ_EMPTY 0x10 /* FIFO empty */
#define ESS_DSP_READ_HALF 0x08 /* FIFO half-empty */
@@ -247,7 +247,7 @@
#define ESS_MIX_REG_SELECT 0x04
#define ESS_MIX_REG_DATA 0x05
-#define ESS_MIX_RESET 0x00 /* mixer reset port and value */
+#define ESS_MIX_RESET 0x00 /* mixer reset port and value */
/*
diff --git a/sys/dev/isa/essvar.h b/sys/dev/isa/essvar.h
index cf1838a94d2..a3530f682b0 100644
--- a/sys/dev/isa/essvar.h
+++ b/sys/dev/isa/essvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: essvar.h,v 1.2 1999/09/30 22:13:52 kstailey Exp $ */
+/* $OpenBSD: essvar.h,v 1.3 2001/01/29 06:27:59 mickey Exp $ */
/* $NetBSD: essvar.h,v 1.14 1999/03/18 06:03:31 mycroft Exp $ */
/*
* Copyright 1997
@@ -34,7 +34,7 @@
*/
/*
-** @(#) $RCSfile: essvar.h,v $ $Revision: 1.2 $ (SHARK) $Date: 1999/09/30 22:13:52 $
+** @(#) $RCSfile: essvar.h,v $ $Revision: 1.3 $ (SHARK) $Date: 2001/01/29 06:27:59 $
**
**++
**
@@ -46,16 +46,16 @@
**
** MODULE DESCRIPTION:
**
-** This module contains the structure definitions and function
-** prototypes for the ESS Technologies 1887/888 sound chip
-** driver.
+** This module contains the structure definitions and function
+** prototypes for the ESS Technologies 1887/888 sound chip
+** driver.
**
** AUTHORS:
**
** Blair Fidler Software Engineering Australia
** Gold Coast, Australia.
**
-** CREATION DATE:
+** CREATION DATE:
**
** May 12, 1997.
**
@@ -125,22 +125,23 @@ struct ess_softc
isa_chipset_tag_t sc_ic;
bus_space_tag_t sc_iot; /* tag */
bus_space_handle_t sc_ioh; /* handle */
+ struct timeout sc_tmo1, sc_tmo2;
int sc_iobase; /* I/O port base address */
u_short sc_open; /* reference count of open calls */
- int ndevs;
+ int ndevs;
u_char gain[ESS_MAX_NDEVS][2]; /* kept in input levels */
#define ESS_LEFT 0
#define ESS_RIGHT 1
-
+
u_int out_port; /* output port */
u_int in_mask; /* input ports */
u_int in_port; /* XXX needed for MI interface */
u_int spkr_state; /* non-null is on */
-
+
struct ess_audio_channel sc_audio1; /* audio channel for record */
struct ess_audio_channel sc_audio2; /* audio channel for playback */