summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-03-05 03:28:38 +0000
committerache <ache@FreeBSD.org>1995-03-05 03:28:38 +0000
commitced0d594a6c93a1f3d3b8f6c1fa9669ba16f2a32 (patch)
tree775d659ae59e0bd9f7fc726e841fe464606755f0 /sys
parent3404bd722eca44f7f190c96cac79a611f46961a9 (diff)
downloadFreeBSD-src-ced0d594a6c93a1f3d3b8f6c1fa9669ba16f2a32.zip
FreeBSD-src-ced0d594a6c93a1f3d3b8f6c1fa9669ba16f2a32.tar.gz
PLEASE, PLEASE, PLEASE!!!!!!!
DO NOT COMMIT NEW VOXWARE VERSIONS BLINDLY, TAKE CARE TO RESTORE PAS16D FIXES, I AM REALLY TIRED TO DO IT WITH EACH NEW RELEASE!!!
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/isa/sound/pas.h1
-rw-r--r--sys/i386/isa/sound/pas2_card.c25
-rw-r--r--sys/i386/isa/sound/pas2_mixer.c24
3 files changed, 30 insertions, 20 deletions
diff --git a/sys/i386/isa/sound/pas.h b/sys/i386/isa/sound/pas.h
index 585bc64..9759542 100644
--- a/sys/i386/isa/sound/pas.h
+++ b/sys/i386/isa/sound/pas.h
@@ -128,6 +128,7 @@
#define F_F_PCM_RATE_COUNTER 0x40 /* R W PCM 1=enable, 0=disable sample rate counter */
#define F_F_PCM_BUFFER_COUNTER 0x80 /* R W PCM 1=enable, 0=disable sample buffer counter */
+#define CHIP_REV 0xFF88 /* R Control 0=PAS, 1=PAS+, 2=CDPC, 3=PAS16C, 4=PAS16D */
#define PAS_NONE 0
#define PAS_PLUS 1
#define PAS_CDPC 2
diff --git a/sys/i386/isa/sound/pas2_card.c b/sys/i386/isa/sound/pas2_card.c
index 1bfd73f..8086cfb 100644
--- a/sys/i386/isa/sound/pas2_card.c
+++ b/sys/i386/isa/sound/pas2_card.c
@@ -70,6 +70,23 @@ pas_write (unsigned char data, int ioaddr)
OUTB (data, ioaddr ^ translat_code);
}
+/*
+ * The Revision D cards have a problem with their MVA508 interface. The
+ * kludge-o-rama fix is to make a 16-bit quantity with identical LSB and
+ * MSBs out of the output byte and to do a 16-bit out to the mixer port -
+ * 1. We need to do this because there was access problems, not timing
+ * problems.
+ */
+void
+mix_write (unsigned char data, int ioaddr)
+{
+ if (pas_model == PAS_16D) {
+ outw ((ioaddr ^ translat_code) - 1, data | (data << 8));
+ outb (0, 0x80);
+ } else
+ OUTB (data, ioaddr ^ translat_code);
+}
+
void
pas2_msg (char *foo)
{
@@ -253,8 +270,8 @@ config_pas_hw (struct address_info *hw_config)
else
pas_write (0, PRESCALE_DIVIDER);
- pas_write (P_M_MV508_ADDRESS | 5, PARALLEL_MIXER);
- pas_write (5, PARALLEL_MIXER);
+ mix_write (P_M_MV508_ADDRESS | 5, PARALLEL_MIXER);
+ mix_write (5, PARALLEL_MIXER);
#if !defined(EXCLUDE_SB_EMULATION) || !defined(EXCLUDE_SB)
@@ -348,7 +365,7 @@ detect_pas_hw (struct address_info *hw_config)
*/
return 0;
- pas_model = O_M_1_to_card[pas_read (OPERATION_MODE_1) & 0x0f];
+ pas_model = pas_read (CHIP_REV);
return pas_model;
}
@@ -361,7 +378,7 @@ attach_pas_card (long mem_start, struct address_info *hw_config)
if (detect_pas_hw (hw_config))
{
- if ((pas_model = O_M_1_to_card[pas_read (OPERATION_MODE_1) & 0x0f]))
+ if (pas_model = pas_read (CHIP_REV))
{
printk (" <%s rev %d>", pas_model_names[(int) pas_model], pas_read (BOARD_REV_ID));
}
diff --git a/sys/i386/isa/sound/pas2_mixer.c b/sys/i386/isa/sound/pas2_mixer.c
index bf0a20b..bd53bc0 100644
--- a/sys/i386/isa/sound/pas2_mixer.c
+++ b/sys/i386/isa/sound/pas2_mixer.c
@@ -106,14 +106,6 @@ mixer_output (int right_vol, int left_vol, int div, int bits,
int left = left_vol * div / 100;
int right = right_vol * div / 100;
- /*
- * The Revision D cards have a problem with their MVA508 interface. The
- * kludge-o-rama fix is to make a 16-bit quantity with identical LSB and
- * MSBs out of the output byte and to do a 16-bit out to the mixer port -
- * 1. We don't need to do this because the call to pas_write more than
- * compensates for the timing problems.
- */
-
if (bits & P_M_MV508_MIXER)
{ /*
* Select input or output mixer
@@ -126,16 +118,16 @@ mixer_output (int right_vol, int left_vol, int div, int bits,
{ /*
* Bass and treble are mono devices
*/
- pas_write (P_M_MV508_ADDRESS | bits, PARALLEL_MIXER);
- pas_write (left, PARALLEL_MIXER);
+ mix_write (P_M_MV508_ADDRESS | bits, PARALLEL_MIXER);
+ mix_write (left, PARALLEL_MIXER);
right_vol = left_vol;
}
else
{
- pas_write (P_M_MV508_ADDRESS | P_M_MV508_LEFT | bits, PARALLEL_MIXER);
- pas_write (left, PARALLEL_MIXER);
- pas_write (P_M_MV508_ADDRESS | P_M_MV508_RIGHT | bits, PARALLEL_MIXER);
- pas_write (right, PARALLEL_MIXER);
+ mix_write (P_M_MV508_ADDRESS | P_M_MV508_LEFT | bits, PARALLEL_MIXER);
+ mix_write (left, PARALLEL_MIXER);
+ mix_write (P_M_MV508_ADDRESS | P_M_MV508_RIGHT | bits, PARALLEL_MIXER);
+ mix_write (right, PARALLEL_MIXER);
}
return (left_vol | (right_vol << 8));
@@ -144,8 +136,8 @@ mixer_output (int right_vol, int left_vol, int div, int bits,
void
set_mode (int new_mode)
{
- pas_write (P_M_MV508_ADDRESS | P_M_MV508_MODE, PARALLEL_MIXER);
- pas_write (new_mode, PARALLEL_MIXER);
+ mix_write (P_M_MV508_ADDRESS | P_M_MV508_MODE, PARALLEL_MIXER);
+ mix_write (new_mode, PARALLEL_MIXER);
mode_control = new_mode;
}
OpenPOWER on IntegriCloud