Patch for PAS sound driver (2.1.131)

Alex Stewart (riche@crl.com)
Sun, 27 Dec 1998 02:23:44 +0000


This is a multi-part message in MIME format.
--------------DD7CCDE3DA45C9E72A2299F7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hiho.. I recently started looking at the 2.1 kernel by downloading and
compiling 2.1.131.. Everything seems to be working fairly smoothly
except I noticed that the sound driver for the Pro Audio Spectrum sound
cards has some bugs in it.

Luckily, these bugs are mostly the same ones I found in the stock
OSSFree package I had downloaded for my 2.0 kernel a little while back
so the changes weren't too hard (I have sent a similar patch off to the
OSSFree folks, but the opensound.com pages indicated that the 2.1 kernel
sound stuff is being independently developed, so I figured I'd post the
changes to the 2.1 source here as well).

In any case, attached is a patchfile against the 2.1.131 sources to fix
the pas2 audio driver to work properly. I haven't yet had a chance to
look at the new 2.1.132 kernel, but my suspicion is that there should be
no problems applying against it either. This patch can also be obtained
as http://www.crl.com/~riche/linux-2.1.131-pas.patch

Please CC any questions/comments to me personally, as I am not currently
subscribed to the linux-kernel maillist.

-alex
--------------DD7CCDE3DA45C9E72A2299F7
Content-Type: text/plain; charset=us-ascii; name="linux-2.1.131-pas.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="linux-2.1.131-pas.patch"

Patchfile: linux-2.1.131-pas.patch
Author: Alex Stewart <riche@crl.com>
Release Date: December 27, 1998
Patch Version: 1.0
Patchfile Type: Unified diff (apply using GNU 'patch' utility)
Description:

This patch fixes bugs in the linux kernel (2.1.131) for the Pro Audio Spectrum
(pas2) sound card driver:
* Fixed IRQ hardware setup to actually set the correct IRQ.
* Fixed code to correctly address cards with non-default base address as per
published specifications.
* Removed apparently unnecessary module dependency which causes driver to be
unable to load when compiled as a module.

--- linux/drivers/sound/pas2_card.c.orig Fri Dec 25 15:29:11 1998
+++ linux/drivers/sound/pas2_card.c Fri Dec 25 16:24:32 1998
@@ -73,12 +73,12 @@

unsigned char pas_read(int ioaddr)
{
- return inb(ioaddr ^ translate_code);
+ return inb(ioaddr + translate_code);
}

void pas_write(unsigned char data, int ioaddr)
{
- outb((data), ioaddr ^ translate_code);
+ outb((data), ioaddr + translate_code);
}

/******************* Begin of the Interrupt Handler ********************/
@@ -168,7 +168,7 @@
else
{
int_ptrs = pas_read(0xF38A);
- int_ptrs |= irq_bits[pas_irq] & 0xf;
+ int_ptrs = (int_ptrs & 0xf0) | irq_bits[pas_irq];
pas_write(int_ptrs, 0xF38A);
if (!irq_bits[pas_irq])
{
@@ -297,7 +297,7 @@

outb((0xBC), 0x9A01); /* Activate first board */
outb((hw_config->io_base >> 2), 0x9A01); /* Set base address */
- translate_code = 0x388 ^ hw_config->io_base;
+ translate_code = hw_config->io_base - 0x388;
pas_write(1, 0xBF88); /* Select one wait states */

board_id = pas_read(0x0B8B);
@@ -347,7 +347,7 @@
pas_pcm_init(hw_config);
#endif

-#if !defined(DISABLE_SB_EMULATION) && defined(CONFIG_SB)
+#if !defined(MODULE) && !defined(DISABLE_SB_EMULATION) && defined(CONFIG_SB)

sb_dsp_disable_midi(pas_sb_base); /* No MIDI capability */
#endif

--------------DD7CCDE3DA45C9E72A2299F7--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/