Commit e695b6a4 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.10

parent ccec108f
VERSION = 1 VERSION = 1
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 9 SUBLEVEL = 10
all: Version zImage all: Version zImage
......
...@@ -91,17 +91,20 @@ int el3_probe(struct device *dev) ...@@ -91,17 +91,20 @@ int el3_probe(struct device *dev)
/* First check for a board on the EISA bus. */ /* First check for a board on the EISA bus. */
if (EISA_bus) { if (EISA_bus) {
for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) { for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
if (inw(ioaddr) != 0x6d50) /* Check the standard EISA ID register for an encoded '3Com'. */
if (inw(ioaddr + 0xC80) != 0x6d50)
continue; continue;
/* Change the register set to the configuration window 0. */
outw(0x0800, ioaddr + 0xC80 + EL3_CMD);
irq = inw(ioaddr + 8) >> 12; irq = inw(ioaddr + 8) >> 12;
if_port = inw(ioaddr + 6)>>14; if_port = inw(ioaddr + 6)>>14;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
phys_addr[i] = htons(read_eeprom(ioaddr, i)); phys_addr[i] = htons(read_eeprom(ioaddr, i));
/* Restore the "Manufacturer ID" to the EEPROM read register. */ /* Restore the "Product ID" to the EEPROM read register. */
/* The manual says to restore "Product ID" (reg. 3). !???! */ read_eeprom(ioaddr, 3);
read_eeprom(ioaddr, 7);
/* Was the EISA code an add-on hack? Nahhhhh... */ /* Was the EISA code an add-on hack? Nahhhhh... */
goto found; goto found;
......
...@@ -4,9 +4,3 @@ NOTE! This driver version is not compatible with the version 1.0c. ...@@ -4,9 +4,3 @@ NOTE! This driver version is not compatible with the version 1.0c.
other programs using ioctl calls of the driver, they must be other programs using ioctl calls of the driver, they must be
recompiled. Most of them will not work without some source recompiled. Most of them will not work without some source
modifications. modifications.
******** LINUX VERSION 0.99.14 OR LATER IS REQUIRED *******
See sound/Readme for more details
Hannu
Changelog for version 2.4 Changelog for version 2.5a
------------------------- --------------------------
Since 2.5
- Minor fix to read from /dev/sequencer
Since 2.5-beta2
- Some fine tuning to the GUS v3.7 mixer code.
- Fixed speed limits for the plain SB (1.0 to 2.0).
Since 2.5-beta
- Fixed OPL-3 detection with SB. Caused problems with PAS16.
- GUS v3.7 mixer support.
Since 2.4
- Mixer support for Sound Galaxy NX Pro (define __SGNXPRO__ on your local.h).
- Fixed truncated sound on /dev/dsp when the device is closed.
- Linear volume mode for GUS
- Pitch bends larger than +/- 2 octaves.
- MIDI recording for SB and SB Pro. (Untested).
- Some other fixes.
- SB16 MIDI and DSP drivers only initialized if SB16 actually installed.
- Implemented better detection for OPL-3. This should be usefull if you
have an old SB Pro (the non-OPL-3 one) or a SB 2.0 clone which has a OPL-3.
- SVR4.2 support by Ian Hartas. Initial ALPHA TEST version (untested).
Since 2.3b Since 2.3b
- Fixed bug which made it impossible to make long recordings to disk. - Fixed bug which made it impossible to make long recordings to disk.
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# #
# #
VERSION = 2.4 VERSION = 2.5a
TARGET_OS = linux TARGET_OS = linux
.c.s: .c.s:
...@@ -19,7 +19,7 @@ OBJS = soundcard.o audio.o dmabuf.o sb_dsp.o dev_table.o \ ...@@ -19,7 +19,7 @@ OBJS = soundcard.o audio.o dmabuf.o sb_dsp.o dev_table.o \
opl3.o sequencer.o midibuf.o sb_card.o pas2_card.o adlib_card.o \ opl3.o sequencer.o midibuf.o sb_card.o pas2_card.o adlib_card.o \
pas2_pcm.o pas2_mixer.o pas2_midi.o gus_card.o gus_wave.o mpu401.o \ pas2_pcm.o pas2_mixer.o pas2_midi.o gus_card.o gus_wave.o mpu401.o \
gus_midi.o gus_vol.o patmgr.o sb_mixer.o sb16_dsp.o sb_midi.o \ gus_midi.o gus_vol.o patmgr.o sb_mixer.o sb16_dsp.o sb_midi.o \
sb16_midi.o sound_switch.o sb16_midi.o sound_switch.o ics2101.o
all: local.h sound.a all: local.h sound.a
......
Release notes for the Linux Sound Driver 2.4 Release notes for the Linux Sound Driver 2.5a
-------------------------------------------- ---------------------------------------------
This directory contains just the Linux version. The portable version
(SCO/ISC, FreeBSD/NetBSD and SVR4.2) is available from sunsite.unc.edu:
pub/Linux/kernel/sound.
This is mainly a bug fix release. There are couple of new things such as
linear volume mode for GUS and MIDI recording for SB 2.0 and SB Pro.
Also this version supports the mixer of GUS v3.7. (Support for GUS MAX and
the 16-bit daughtercard is coming sooner or later).
NOTE! The sound driver is a part of the Linux kernel distribution also. NOTE! The sound driver is a part of the Linux kernel distribution also.
Check that your kernel doesn't have more recent version than this Check that your kernel doesn't have more recent version than this
...@@ -17,17 +25,13 @@ time with the /dev/dsp. Also the WaveBlaster daughter board is supported. ...@@ -17,17 +25,13 @@ time with the /dev/dsp. Also the WaveBlaster daughter board is supported.
No support for the ASP chip yet (the ASP chip can be installed but it's No support for the ASP chip yet (the ASP chip can be installed but it's
not used by the driver). not used by the driver).
You will need the snd-util-2.4.tar.gz and snd-data-0.1.tar.Z You will need the snd-util-2.5.tar.gz and snd-data-0.1.tar.Z
packages to use this driver. They should be in the same packages to use this driver. They should be in the same
ftp site or BBS from where you got this driver. For ftp site or BBS from where you got this driver. For
example at nic.funet.fi:pub/OS/Linux/*. example at nic.funet.fi:pub/OS/Linux/*.
There is a new version of the tracker program available (tracker-3_19.lzh) but
I don't know where it is available. The tracker 3.10 has bugs and it don't work
without some fixes. Look at the README of the snd-util-2.3.
If you are looking for the installation instructions, please If you are looking for the installation instructions, please
look at linux/Readme. look at $OS/Readme.
This version supports the following soundcards: This version supports the following soundcards:
GUS, SoundBlaster, SB Pro, SB16, Pro Audio Spectrum 16 and AdLib. GUS, SoundBlaster, SB Pro, SB16, Pro Audio Spectrum 16 and AdLib.
...@@ -36,19 +40,6 @@ In addition there is rather limited support for MPU-401. ...@@ -36,19 +40,6 @@ In addition there is rather limited support for MPU-401.
Most of the features of the /dev/sequencer device file are Most of the features of the /dev/sequencer device file are
available just for GUS owners. available just for GUS owners.
NOTE! There are separate driver for CD-ROMS supported by
some soundcards. The driver for CDU31A (Fusion 16) is
called cdu31a-0.6.diff.z. It will be contained in the
Linux version 0.99.12. The driver for the CD-ROM of SB Pro
is sbpcd0.4.tar.gz (these were the latest versions when I wrote
this). These files should be at least at sunsite.unc.edu.
Also the SCSI interface of the PAS16 should be supported by
Linux 0.99.13k and later.
There is also a driver for joystick. Look for file joystick-0.5.tar.gz
(sunsite).
Compatibility with the earlier versions Compatibility with the earlier versions
--------------------------------------- ---------------------------------------
...@@ -104,58 +95,6 @@ at the same time, the ioctl(SNDCTL_FM_LOAD_INSTR) is obsolete. In addition ...@@ -104,58 +95,6 @@ at the same time, the ioctl(SNDCTL_FM_LOAD_INSTR) is obsolete. In addition
there is some new fields which must be initialized. Look at the sbiset.c in there is some new fields which must be initialized. Look at the sbiset.c in
the snd-util-2.0 package for further info. the snd-util-2.0 package for further info.
This version is almost 100% compatible with the alpha test version (1.99.9). The
difference is in the installation procedure.
Using this driver with other operating systems than Linux
---------------------------------------------------------
This package contains just the Linux version. The version 2.3
for SCO is available at nic.funet.fi:pub/OS/Linux/ALPHA/sound.
The version 2.3 doesn't work well with xxxxxBSD. Use the version
2.3 for them.
/dev/sndstat
------------
The /dev/sndstat is now available in the SCO and BSD versions also.
This is a new devicefile for debugging purposes. A better place for
it is in the /proc -directory but I was just too lazy to implement it
properly. The /dev/sndstat (major 14, minor 6) is a file which returns
info about the current configuration (see the example below). If you
send me a error/problem report, please include a printout from this
device to your message (cat /dev/sndstat).
Note! This device file is currently present only in the Linux version
of this driver.
------ cut here --- cat /dev/sndstat example --------
Sound Driver:1.99.7 (Fri Jul 9 17:01:47 GMT 1993 root@lucifer.savolai.fi)
Config options: 0x00000d4b
HW config:
Type 4: Gravis Ultrasound at 0x210 irq 15 drq 6
Type 3: ProAudioSpectrum at 0x388 irq 10 drq 3
Type 2: SoundBlaster at 0x220 irq 7 drq 1
Type 1: AdLib at 0x388 irq 0 drq 0
PCM devices:
00: Gravis UltraSound
01: Pro Audio Spectrum
02: SoundBlaster 2.0
Synth devices:
00: Gravis UltraSound
01: Yamaha OPL-3
Midi devices:
00: Gravis UltraSound
01: Pro Audio Spectrum
Mixer(s) installed
------ cut here ---- End of Example -----------
Known bugs/limitations Known bugs/limitations
---------------------- ----------------------
...@@ -164,7 +103,6 @@ Known bugs/limitations ...@@ -164,7 +103,6 @@ Known bugs/limitations
recording process too much. A delay longer than 0.1 to 0.3 seconds is recording process too much. A delay longer than 0.1 to 0.3 seconds is
too much. too much.
- The SB16 driver sometimes swaps the left and right channels together. - The SB16 driver sometimes swaps the left and right channels together.
- Midi input doesn't work with SB and SB Pro (SB16 works).
- It's not possible to open /dev/dsp (or /dev/audio) while the - It's not possible to open /dev/dsp (or /dev/audio) while the
/dev/sequencer is open for output and GUS is the only soundcard /dev/sequencer is open for output and GUS is the only soundcard
installed. It's possible if /dev/dsp is opened before /dev/sequencer installed. It's possible if /dev/dsp is opened before /dev/sequencer
...@@ -173,9 +111,6 @@ Known bugs/limitations ...@@ -173,9 +111,6 @@ Known bugs/limitations
- MPU-401 driver hangs the computer on boot if there is no MPU-401 installed. - MPU-401 driver hangs the computer on boot if there is no MPU-401 installed.
It uses by default the I/O port 0x330 whic is used by Adaptec 1542 SCSI It uses by default the I/O port 0x330 whic is used by Adaptec 1542 SCSI
adapter. adapter.
- There are some problems in midi input with MPU-401 and the SB16 midi
(MPU-401 emulation). This makes it impossible to read long sysex dumps
using these devices.
- The /dev/sequencer playback to GUS sounds sometimes rather weird. Hitting - The /dev/sequencer playback to GUS sounds sometimes rather weird. Hitting
^C and playing again should solve this problem. This is propably caused by ^C and playing again should solve this problem. This is propably caused by
incompatibilities between GUS and certain VLB motherboards (like mine). incompatibilities between GUS and certain VLB motherboards (like mine).
...@@ -220,21 +155,28 @@ This driver contains code by several contributors. In addition several other ...@@ -220,21 +155,28 @@ This driver contains code by several contributors. In addition several other
persons have given usefull suggestions. The following is a list of major persons have given usefull suggestions. The following is a list of major
contributors. (I could have forgotten some names.) contributors. (I could have forgotten some names.)
Craig Metz 1/2 of the PAS16 Mixer and PCM support Craig Metz 1/2 of the PAS16 Mixer and PCM support
Rob Hooft Volume computation algorithm for the FM synth. Rob Hooft Volume computation algorithm for the FM synth.
Mika Liljeberg uLaw encoding and decoding routines Mika Liljeberg uLaw encoding and decoding routines
Greg Lee Volume computation algorithm for the GUS and Greg Lee Volume computation algorithm for the GUS and
lot's of valuable suggestions. lot's of valuable suggestions.
Andy Warner ISC port Andy Warner Initial ISC port
Jim Lowe FreeBSD port Jim Lowe Initial FreeBSD port
Anders Baekgaard Bughunting and valuable suggestions. Anders Baekgaard Bughunting and valuable suggestions.
Joerg Schubert SB16 DSP support. Joerg Schubert SB16 DSP support.
Andrew Robinson Improvements to the GUS driver Andrew Robinson Improvements to the GUS driver
Megens SA MIDI recording for SB and SB Pro.
Mikael Nordqvist Linear volume support for GUS.
Ian Hartas SVR4.2 port
Markus Aroharju and
Risto Kankkunen Major contributions to the mixer support
of GUS v3.7.
Hunyue Yau Sound Galaxy NX Pro mixer support.
Regards, Regards,
Hannu Savolainen Hannu Savolainen
hsavolai@cs.helsinki.fi hannu@voxware.pp.fi, Hannu.Savolainen@Helsinki.fi
Snail mail: Hannu Savolainen Snail mail: Hannu Savolainen
Pallaksentie 4 A 2 Pallaksentie 4 A 2
......
Sound Driver version 2.4 for Linux Sound Driver version 2.5 for Linux
---------------------------------- ----------------------------------
NOTE! The sound driver is now a part of the Linux kernel distribution. NOTE! The sound driver is now a part of the Linux kernel distribution.
...@@ -174,7 +174,8 @@ If you want to play modules on a 386sx while recompiling the world, buy a GUS. ...@@ -174,7 +174,8 @@ If you want to play modules on a 386sx while recompiling the world, buy a GUS.
It runs without burning your CPU. It runs without burning your CPU.
Hannu Savolainen Hannu Savolainen
hsavolai@cs.helsinki.fi Hannu.Savolainen@Helsinki.fi
(hannu@voxware.pp.fi (april 94 ->))
----------------- cut here ------------------------------ ----------------- cut here ------------------------------
#!/bin/sh #!/bin/sh
......
/* /*
* sound/adlib_card.c * sound/adlib_card.c
* *
* Detection routine for the AdLib card. * Detection routine for the AdLib card.
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include "sound_config.h" #include "sound_config.h"
......
/* /*
* sound/audio.c * sound/audio.c
* *
* Device file manager for /dev/audio * Device file manager for /dev/audio
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include "sound_config.h" #include "sound_config.h"
...@@ -38,10 +38,12 @@ ...@@ -38,10 +38,12 @@
#define OFF 0 #define OFF 0
static int wr_buff_no[MAX_DSP_DEV]; /* != -1, if there is a static int wr_buff_no[MAX_DSP_DEV]; /* != -1, if there is a
* incomplete output block */ * incomplete output block */
static int wr_buff_size[MAX_DSP_DEV], wr_buff_ptr[MAX_DSP_DEV]; static int wr_buff_size[MAX_DSP_DEV], wr_buff_ptr[MAX_DSP_DEV];
static int audio_mode[MAX_DSP_DEV]; static int audio_mode[MAX_DSP_DEV];
#define AM_NONE 0 #define AM_NONE 0
#define AM_WRITE 1 #define AM_WRITE 1
#define AM_READ 2 #define AM_READ 2
...@@ -52,16 +54,16 @@ int ...@@ -52,16 +54,16 @@ int
audio_open (int dev, struct fileinfo *file) audio_open (int dev, struct fileinfo *file)
{ {
int ret; int ret;
int bits; int bits;
int dev_type = dev & 0x0f; int dev_type = dev & 0x0f;
int mode = file->mode & O_ACCMODE; int mode = file->mode & O_ACCMODE;
dev = dev >> 4; dev = dev >> 4;
if (dev_type == SND_DEV_DSP16) if (dev_type == SND_DEV_DSP16)
bits = 16; bits = 16;
else else
bits = 8; bits = 8;
if ((ret = DMAbuf_open (dev, mode)) < 0) if ((ret = DMAbuf_open (dev, mode)) < 0)
return ret; return ret;
...@@ -126,7 +128,7 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count) ...@@ -126,7 +128,7 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count)
{ {
int c, p, l; int c, p, l;
int err; int err;
int dev_type = dev & 0x0f; int dev_type = dev & 0x0f;
dev = dev >> 4; dev = dev >> 4;
...@@ -134,9 +136,9 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count) ...@@ -134,9 +136,9 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count)
c = count; c = count;
if (audio_mode[dev] == AM_READ) /* Direction changed */ if (audio_mode[dev] == AM_READ) /* Direction changed */
{ {
wr_buff_no[dev] = -1; wr_buff_no[dev] = -1;
} }
audio_mode[dev] = AM_WRITE; audio_mode[dev] = AM_WRITE;
...@@ -170,19 +172,19 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count) ...@@ -170,19 +172,19 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count)
} }
else else
dsp_devs[dev]->copy_from_user (dev, dsp_devs[dev]->copy_from_user (dev,
wr_dma_buf[dev], wr_buff_ptr[dev], buf, p, l); wr_dma_buf[dev], wr_buff_ptr[dev], buf, p, l);
/* Insert local processing here */ /* Insert local processing here */
if (dev_type == SND_DEV_AUDIO) if (dev_type == SND_DEV_AUDIO)
{ {
#ifdef linux #ifdef linux
/* This just allows interrupts while the conversion is running */ /* This just allows interrupts while the conversion is running */
__asm__ ("sti"); __asm__ ("sti");
#endif #endif
translate_bytes (ulaw_dsp, &wr_dma_buf[dev][wr_buff_ptr[dev]], l); translate_bytes (ulaw_dsp, (unsigned char *) &wr_dma_buf[dev][wr_buff_ptr[dev]], l);
} }
c -= l; c -= l;
p += l; p += l;
...@@ -207,21 +209,21 @@ audio_read (int dev, struct fileinfo *file, snd_rw_buf * buf, int count) ...@@ -207,21 +209,21 @@ audio_read (int dev, struct fileinfo *file, snd_rw_buf * buf, int count)
int c, p, l; int c, p, l;
char *dmabuf; char *dmabuf;
int buff_no; int buff_no;
int dev_type = dev & 0x0f; int dev_type = dev & 0x0f;
dev = dev >> 4; dev = dev >> 4;
p = 0; p = 0;
c = count; c = count;
if (audio_mode[dev] == AM_WRITE) if (audio_mode[dev] == AM_WRITE)
{ {
if (wr_buff_no[dev] >= 0) if (wr_buff_no[dev] >= 0)
{ {
DMAbuf_start_output (dev, wr_buff_no[dev], wr_buff_ptr[dev]); DMAbuf_start_output (dev, wr_buff_no[dev], wr_buff_ptr[dev]);
wr_buff_no[dev] = -1; wr_buff_no[dev] = -1;
} }
} }
audio_mode[dev] = AM_READ; audio_mode[dev] = AM_READ;
...@@ -236,14 +238,14 @@ audio_read (int dev, struct fileinfo *file, snd_rw_buf * buf, int count) ...@@ -236,14 +238,14 @@ audio_read (int dev, struct fileinfo *file, snd_rw_buf * buf, int count)
/* Insert any local processing here. */ /* Insert any local processing here. */
if (dev_type == SND_DEV_AUDIO) if (dev_type == SND_DEV_AUDIO)
{ {
#ifdef linux #ifdef linux
/* This just allows interrupts while the conversion is running */ /* This just allows interrupts while the conversion is running */
__asm__ ("sti"); __asm__ ("sti");
#endif #endif
translate_bytes (dsp_ulaw, dmabuf, l); translate_bytes (dsp_ulaw, (unsigned char *) dmabuf, l);
} }
COPY_TO_USER (buf, p, dmabuf, l); COPY_TO_USER (buf, p, dmabuf, l);
...@@ -260,7 +262,8 @@ int ...@@ -260,7 +262,8 @@ int
audio_ioctl (int dev, struct fileinfo *file, audio_ioctl (int dev, struct fileinfo *file,
unsigned int cmd, unsigned int arg) unsigned int cmd, unsigned int arg)
{ {
int dev_type = dev & 0x0f; int dev_type = dev & 0x0f;
dev = dev >> 4; dev = dev >> 4;
switch (cmd) switch (cmd)
...@@ -292,7 +295,7 @@ audio_ioctl (int dev, struct fileinfo *file, ...@@ -292,7 +295,7 @@ audio_ioctl (int dev, struct fileinfo *file,
default: default:
if (dev_type == SND_DEV_AUDIO) if (dev_type == SND_DEV_AUDIO)
return RET_ERROR (EIO); return RET_ERROR (EIO);
return DMAbuf_ioctl (dev, cmd, arg, 0); return DMAbuf_ioctl (dev, cmd, arg, 0);
} }
...@@ -321,14 +324,14 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count) ...@@ -321,14 +324,14 @@ audio_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count)
int int
audio_open (int dev, struct fileinfo *file) audio_open (int dev, struct fileinfo *file)
{ {
return RET_ERROR (ENXIO); return RET_ERROR (ENXIO);
} }
void void
audio_release (int dev, struct fileinfo *file) audio_release (int dev, struct fileinfo *file)
{ {
}; };
int int
audio_ioctl (int dev, struct fileinfo *file, audio_ioctl (int dev, struct fileinfo *file,
unsigned int cmd, unsigned int arg) unsigned int cmd, unsigned int arg)
......
/* /*
* sound/configure.c - Configuration program for the Linux Sound Driver * sound/configure.c - Configuration program for the Linux Sound Driver
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include <stdio.h> #include <stdio.h>
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
#define OPT_MIDI_AUTO 8 #define OPT_MIDI_AUTO 8
#define OPT_MIDI 9 #define OPT_MIDI 9
#define OPT_YM3812_AUTO 10 /* Select this automaticly if user selects #define OPT_YM3812_AUTO 10 /* Select this automaticly if user selects
* MIDI or AdLib driver */ * MIDI or AdLib driver */
#define OPT_YM3812 11 /* Select this if the previous one was not #define OPT_YM3812 11 /* Select this if the previous one was not
* selected */ * selected */
#define OPT_SEQUENCER 12 #define OPT_SEQUENCER 12
#define OPT_CHIP_MIDI 13 /* New support added at UW - Milwauklee UW - #define OPT_CHIP_MIDI 13 /* New support added at UW - Milwauklee UW -
* Milwauklee */ * Milwauklee */
#define OPT_LAST 12 #define OPT_LAST 12
#define ANY_DEVS (B(OPT_AUDIO)|B(OPT_MIDI)|B(OPT_SEQUENCER)|B(OPT_GUS)|B(OPT_MPU401)) #define ANY_DEVS (B(OPT_AUDIO)|B(OPT_MIDI)|B(OPT_SEQUENCER)|B(OPT_GUS)|B(OPT_MPU401))
...@@ -65,7 +65,7 @@ typedef struct ...@@ -65,7 +65,7 @@ typedef struct
char macro[20]; char macro[20];
int verify; int verify;
int alias; int alias;
int default_answ; int default_answ;
} }
hw_entry; hw_entry;
...@@ -77,11 +77,11 @@ hw_entry; ...@@ -77,11 +77,11 @@ hw_entry;
* second field is a set of options which are not allowed with this one. If * second field is a set of options which are not allowed with this one. If
* the fourth field is zero, the option is selected without asking * the fourth field is zero, the option is selected without asking
* confirmation from the user. * confirmation from the user.
* *
* With this version of the rule table it is possible to select just one type of * With this version of the rule table it is possible to select just one type of
* hardware. * hardware.
* *
* NOTE! Keep the following table and the questions array in sync with the * NOTE! Keep the following table and the questions array in sync with the
* option numbering! * option numbering!
*/ */
...@@ -127,7 +127,7 @@ char *questions[] = ...@@ -127,7 +127,7 @@ char *questions[] =
}; };
unsigned long selected_options = 0; unsigned long selected_options = 0;
int sb_dma = 0; int sb_dma = 0;
int int
can_select_option (int nr) can_select_option (int nr)
...@@ -272,11 +272,11 @@ main (int argc, char *argv[]) ...@@ -272,11 +272,11 @@ main (int argc, char *argv[])
} }
else else
{ {
int def_answ = hw_table[i].default_answ; int def_answ = hw_table[i].default_answ;
fprintf (stderr, fprintf (stderr,
def_answ ? " %s (y/n) ? " : " %s (n/y) ? ", def_answ ? " %s (y/n) ? " : " %s (n/y) ? ",
questions[i]); questions[i]);
if (think_positively (def_answ)) if (think_positively (def_answ))
if (hw_table[i].alias) if (hw_table[i].alias)
selected_options |= B (hw_table[i].alias); selected_options |= B (hw_table[i].alias);
...@@ -286,8 +286,8 @@ main (int argc, char *argv[]) ...@@ -286,8 +286,8 @@ main (int argc, char *argv[])
} }
} }
if (selected_options & B(OPT_SB16)) if (selected_options & B (OPT_SB16))
selected_options |= B(OPT_SBPRO); selected_options |= B (OPT_SBPRO);
if (!(selected_options & ANY_DEVS)) if (!(selected_options & ANY_DEVS))
{ {
...@@ -319,8 +319,9 @@ main (int argc, char *argv[]) ...@@ -319,8 +319,9 @@ main (int argc, char *argv[])
if (selected_options & B (OPT_SB) && selected_options & (B (OPT_AUDIO) | B (OPT_MIDI))) if (selected_options & B (OPT_SB) && selected_options & (B (OPT_AUDIO) | B (OPT_MIDI)))
{ {
fprintf (stderr, "\nIRQ number for SoundBlaster?\n" fprintf (stderr, "\nIRQ number for SoundBlaster?\n"
"The IRQ adress is defined by the jumpers on your card and\n" "The IRQ address is defined by the jumpers on your card.\n"
"7 is the factory default. Valid values are 9, 5, 7 and 10.\n" "The factory default is either 5 or 7 (depending on the model).\n"
"Valid values are 9, 5, 7 and 10.\n"
"Enter the value: "); "Enter the value: ");
num = ask_value ("%d", 7); num = ask_value ("%d", 7);
...@@ -331,9 +332,10 @@ main (int argc, char *argv[]) ...@@ -331,9 +332,10 @@ main (int argc, char *argv[])
num = 7; num = 7;
} }
fprintf (stderr, "SoundBlaster IRQ set to %d\n", num); fprintf (stderr, "SoundBlaster IRQ set to %d\n", num);
printf ("#define SBC_BASE 0x220\n");
printf ("#define SBC_IRQ %d\n", num); printf ("#define SBC_IRQ %d\n", num);
if (selected_options & B (OPT_SBPRO)) if (selected_options & (B (OPT_SBPRO) | B (OPT_PAS)))
{ {
fprintf (stderr, "\nDMA channel for SoundBlaster?\n" fprintf (stderr, "\nDMA channel for SoundBlaster?\n"
...@@ -359,7 +361,7 @@ main (int argc, char *argv[]) ...@@ -359,7 +361,7 @@ main (int argc, char *argv[])
{ {
fprintf (stderr, "\n16 bit DMA channel for SoundBlaster 16?\n" fprintf (stderr, "\n16 bit DMA channel for SoundBlaster 16?\n"
"Possible values are 5, 6 or 7\n" "Possible values are 5, 6 or 7\n"
"The default value is 6\n" "The default value is 6\n"
"Enter the value: "); "Enter the value: ");
...@@ -373,14 +375,14 @@ main (int argc, char *argv[]) ...@@ -373,14 +375,14 @@ main (int argc, char *argv[])
fprintf (stderr, "SoundBlaster DMA set to %d\n", num); fprintf (stderr, "SoundBlaster DMA set to %d\n", num);
printf ("#define SB16_DMA %d\n", num); printf ("#define SB16_DMA %d\n", num);
fprintf (stderr, "\nI/O base for SB16 Midi?\n" fprintf (stderr, "\nI/O base for SB16 Midi?\n"
"Possible values are 300 and 330\n" "Possible values are 300 and 330\n"
"The factory default is 330\n" "The factory default is 330\n"
"Enter the SB16 Midi I/O base: "); "Enter the SB16 Midi I/O base: ");
num = ask_value ("%x", 0x330); num = ask_value ("%x", 0x330);
fprintf (stderr, "SB16 Midi I/O base set to %03x\n", num); fprintf (stderr, "SB16 Midi I/O base set to %03x\n", num);
printf ("#define SB16MIDI_BASE 0x%03x\n", num); printf ("#define SB16MIDI_BASE 0x%03x\n", num);
} }
} }
...@@ -428,7 +430,7 @@ main (int argc, char *argv[]) ...@@ -428,7 +430,7 @@ main (int argc, char *argv[])
if (selected_options & B (OPT_GUS)) if (selected_options & B (OPT_GUS))
{ {
fprintf (stderr, "\nI/O base for Gravis Ultrasound?\n" fprintf (stderr, "\nI/O base for Gravis Ultrasound?\n"
"Valid choises are 210, 220, 230, 240, 250 or 260\n" "Valid choices are 210, 220, 230, 240, 250 or 260\n"
"The factory default is 220\n" "The factory default is 220\n"
"Enter the GUS I/O base: "); "Enter the GUS I/O base: ");
...@@ -515,12 +517,12 @@ main (int argc, char *argv[]) ...@@ -515,12 +517,12 @@ main (int argc, char *argv[])
{ {
def_size = 16384; def_size = 16384;
if (selected_options & (B (OPT_SBPRO) | B (OPT_PAS) | B(OPT_SB16))) if (selected_options & (B (OPT_SBPRO) | B (OPT_PAS) | B (OPT_SB16)))
def_size = 32768; def_size = 32768;
#ifndef __386BSD__ #ifndef __386BSD__
if (((selected_options & B (OPT_PAS)) || (selected_options & B (OPT_SB16))) && if (((selected_options & B (OPT_PAS)) || (selected_options & B (OPT_SB16))) &&
!full_driver) !full_driver)
def_size = 65536; /* PAS16 or SB16 */ def_size = 65536; /* PAS16 or SB16 */
#endif #endif
...@@ -543,7 +545,7 @@ main (int argc, char *argv[]) ...@@ -543,7 +545,7 @@ main (int argc, char *argv[])
fprintf (stderr, "The sound driver is now configured.\n"); fprintf (stderr, "The sound driver is now configured.\n");
#if defined(SCO) || defined(ISC) || defined(SYSV) #if defined(SCO) || defined(ISC) || defined(SYSV)
fprintf(stderr, "Rember to update the System file\n"); fprintf (stderr, "Remember to update the System file\n");
#endif #endif
exit (0); exit (0);
......
/* /*
* sound/dev_table.c * sound/dev_table.c
* *
* Device call tables. * Device call tables.
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#define _DEV_TABLE_C_ #define _DEV_TABLE_C_
...@@ -39,23 +39,23 @@ sndtable_init (long mem_start) ...@@ -39,23 +39,23 @@ sndtable_init (long mem_start)
for (i = 0; i < (n - 1); i++) for (i = 0; i < (n - 1); i++)
if (supported_drivers[i].enabled) if (supported_drivers[i].enabled)
if (supported_drivers[i].probe (&supported_drivers[i].config)) if (supported_drivers[i].probe (&supported_drivers[i].config))
{ {
#ifndef SHORT_BANNERS #ifndef SHORT_BANNERS
printk ("snd%d", printk ("snd%d",
supported_drivers[i].card_type); supported_drivers[i].card_type);
#endif #endif
mem_start = supported_drivers[i].attach (mem_start, &supported_drivers[i].config); mem_start = supported_drivers[i].attach (mem_start, &supported_drivers[i].config);
#ifndef SHORT_BANNERS #ifndef SHORT_BANNERS
printk (" at 0x%x irq %d drq %d\n", printk (" at 0x%x irq %d drq %d\n",
supported_drivers[i].config.io_base, supported_drivers[i].config.io_base,
supported_drivers[i].config.irq, supported_drivers[i].config.irq,
supported_drivers[i].config.dma); supported_drivers[i].config.dma);
#endif #endif
} }
else else
supported_drivers[i].enabled=0; /* Mark as not detected */ supported_drivers[i].enabled = 0; /* Mark as not detected */
return mem_start; return mem_start;
} }
...@@ -69,14 +69,15 @@ sndtable_probe (int unit, struct address_info *hw_config) ...@@ -69,14 +69,15 @@ sndtable_probe (int unit, struct address_info *hw_config)
for (i = 0; i < (n - 1); i++) for (i = 0; i < (n - 1); i++)
if (supported_drivers[i].card_type == unit) if (supported_drivers[i].card_type == unit)
{ {
supported_drivers[i].config.io_base = hw_config->io_base; supported_drivers[i].config.io_base = hw_config->io_base;
supported_drivers[i].config.irq = hw_config->irq; supported_drivers[i].config.irq = hw_config->irq;
supported_drivers[i].config.dma = hw_config->dma; supported_drivers[i].config.dma = hw_config->dma;
if (supported_drivers[i].probe (hw_config)) return 1; if (supported_drivers[i].probe (hw_config))
supported_drivers[i].enabled=0; /* Mark as not detected */ return 1;
return 0; supported_drivers[i].enabled = 0; /* Mark as not detected */
} return 0;
}
return FALSE; return FALSE;
} }
...@@ -115,91 +116,102 @@ sndtable_get_cardcount (void) ...@@ -115,91 +116,102 @@ sndtable_get_cardcount (void)
} }
#ifdef linux #ifdef linux
void sound_setup(char *str, int *ints) void
sound_setup (char *str, int *ints)
{ {
int i, n = sizeof (supported_drivers) / sizeof (struct card_info); int i, n = sizeof (supported_drivers) / sizeof (struct card_info);
/* /*
* First disable all drivers * First disable all drivers
*/ */
for (i=0;i<n;i++) for (i = 0; i < n; i++)
supported_drivers[i].enabled = 0; supported_drivers[i].enabled = 0;
if (ints[0] == 0 || ints[1] == 0) return; if (ints[0] == 0 || ints[1] == 0)
/* return;
/*
* Then enable them one by time * Then enable them one by time
*/ */
for (i=1;i<=ints[0];i++) for (i = 1; i <= ints[0]; i++)
{ {
int card_type, ioaddr, irq, dma, ptr, j; int card_type, ioaddr, irq, dma, ptr, j;
unsigned int val; unsigned int val;
val = (unsigned int)ints[i]; val = (unsigned int) ints[i];
card_type = (val & 0x0ff00000) >> 20; card_type = (val & 0x0ff00000) >> 20;
if (card_type > 127) if (card_type > 127)
{ {
/* Add any future extensions here*/ /* Add any future extensions here */
return; return;
} }
ioaddr = (val & 0x000fff00) >> 8; ioaddr = (val & 0x000fff00) >> 8;
irq = (val & 0x000000f0) >> 4; irq = (val & 0x000000f0) >> 4;
dma = (val & 0x0000000f); dma = (val & 0x0000000f);
ptr = -1; ptr = -1;
for (j=0;j<n && ptr == -1;j++) for (j = 0; j < n && ptr == -1; j++)
if (supported_drivers[j].card_type == card_type) if (supported_drivers[j].card_type == card_type)
ptr = j; ptr = j;
if (ptr == -1) if (ptr == -1)
printk("Sound: Invalid setup parameter 0x%08x\n", val); printk ("Sound: Invalid setup parameter 0x%08x\n", val);
else else
{ {
supported_drivers[ptr].enabled = 1; supported_drivers[ptr].enabled = 1;
supported_drivers[ptr].config.io_base = ioaddr; supported_drivers[ptr].config.io_base = ioaddr;
supported_drivers[ptr].config.irq = irq; supported_drivers[ptr].config.irq = irq;
supported_drivers[ptr].config.dma = dma; supported_drivers[ptr].config.dma = dma;
} }
} }
} }
#else #else
void sound_chconf(int card_type, int ioaddr, int irq, int dma) void
sound_chconf (int card_type, int ioaddr, int irq, int dma)
{ {
int i, n = sizeof (supported_drivers) / sizeof (struct card_info); int i, n = sizeof (supported_drivers) / sizeof (struct card_info);
int ptr, j; int ptr, j;
ptr = -1; ptr = -1;
for (j=0;j<n && ptr == -1;j++) for (j = 0; j < n && ptr == -1; j++)
if (supported_drivers[j].card_type == card_type) if (supported_drivers[j].card_type == card_type)
ptr = j; ptr = j;
if (ptr != -1) if (ptr != -1)
{ {
supported_drivers[ptr].enabled = 1; supported_drivers[ptr].enabled = 1;
if (ioaddr) supported_drivers[ptr].config.io_base = ioaddr; if (ioaddr)
if (irq) supported_drivers[ptr].config.irq = irq; supported_drivers[ptr].config.io_base = ioaddr;
if (dma) supported_drivers[ptr].config.dma = dma; if (irq)
} supported_drivers[ptr].config.irq = irq;
if (dma)
supported_drivers[ptr].config.dma = dma;
}
} }
#endif #endif
struct address_info *sound_getconf(int card_type) struct address_info *
sound_getconf (int card_type)
{ {
int j, ptr; int j, ptr;
int n = sizeof (supported_drivers) / sizeof (struct card_info); int n = sizeof (supported_drivers) / sizeof (struct card_info);
ptr = -1; ptr = -1;
for (j=0;j<n && ptr == -1;j++) for (j = 0; j < n && ptr == -1; j++)
if (supported_drivers[j].card_type == card_type) if (supported_drivers[j].card_type == card_type)
ptr = j; ptr = j;
if (ptr == -1) return (struct address_info *)NULL; if (ptr == -1)
return (struct address_info *) NULL;
return &supported_drivers[ptr].config; return &supported_drivers[ptr].config;
} }
#endif #endif
...@@ -58,6 +58,9 @@ struct generic_midi_info{ ...@@ -58,6 +58,9 @@ struct generic_midi_info{
struct audio_operations { struct audio_operations {
char name[32]; char name[32];
int flags;
#define NOTHING_SPECIAL 0
#define NEEDS_RESTART 1
int (*open) (int dev, int mode); int (*open) (int dev, int mode);
void (*close) (int dev); void (*close) (int dev);
void (*output_block) (int dev, unsigned long buf, void (*output_block) (int dev, unsigned long buf,
...@@ -96,6 +99,7 @@ struct synth_operations { ...@@ -96,6 +99,7 @@ struct synth_operations {
void (*aftertouch) (int dev, int voice, int pressure); void (*aftertouch) (int dev, int voice, int pressure);
void (*controller) (int dev, int voice, int ctrl_num, int value); void (*controller) (int dev, int voice, int ctrl_num, int value);
void (*panning) (int dev, int voice, int value); void (*panning) (int dev, int voice, int value);
void (*volume_method) (int dev, int mode);
int (*pmgr_interface) (int dev, struct patmgr_info *info); int (*pmgr_interface) (int dev, struct patmgr_info *info);
}; };
...@@ -177,7 +181,7 @@ struct generic_midi_operations { ...@@ -177,7 +181,7 @@ struct generic_midi_operations {
{SBC_BASE, SBC_IRQ, SBC_DMA}, SND_DEFAULT_ENABLE}, {SBC_BASE, SBC_IRQ, SBC_DMA}, SND_DEFAULT_ENABLE},
#endif #endif
#if !defined(EXCLUDE_SB) && !defined(EXCLUDE_SB16) #if !defined(EXCLUDE_SB) && !defined(EXCLUDE_SB16) && !defined(EXCLUDE_SBPRO)
#ifndef EXCLUDE_AUDIO #ifndef EXCLUDE_AUDIO
{SNDCARD_SB16, "SoundBlaster16", sb16_dsp_init, sb16_dsp_detect, {SNDCARD_SB16, "SoundBlaster16", sb16_dsp_init, sb16_dsp_detect,
{SBC_BASE, SBC_IRQ, SB16_DMA}, SND_DEFAULT_ENABLE}, {SBC_BASE, SBC_IRQ, SB16_DMA}, SND_DEFAULT_ENABLE},
......
This diff is collapsed.
/* /*
* sound/gus_card.c * sound/gus_card.c
* *
* Detection routine for the Gravis Ultrasound. * Detection routine for the Gravis Ultrasound.
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include "sound_config.h" #include "sound_config.h"
...@@ -106,7 +106,7 @@ gusintr (int unit) ...@@ -106,7 +106,7 @@ gusintr (int unit)
unsigned char src; unsigned char src;
#ifdef linux #ifdef linux
sti(); sti ();
#endif #endif
while (1) while (1)
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#define u_Command (gus_base + 0x103) #define u_Command (gus_base + 0x103)
#define u_DataLo (gus_base + 0x104) #define u_DataLo (gus_base + 0x104)
#define u_DataHi (gus_base + 0x105) #define u_DataHi (gus_base + 0x105)
#define u_MixData (gus_base + 0x106) /* Rev. 3.7+ mixing */
#define u_MixSelect (gus_base + 0x506) /* registers. */
#define u_IrqStatus u_Status #define u_IrqStatus u_Status
# define MIDI_TX_IRQ 0x01 /* pending MIDI xmit IRQ */ # define MIDI_TX_IRQ 0x01 /* pending MIDI xmit IRQ */
# define MIDI_RX_IRQ 0x02 /* pending MIDI recv IRQ */ # define MIDI_RX_IRQ 0x02 /* pending MIDI recv IRQ */
...@@ -32,4 +34,17 @@ ...@@ -32,4 +34,17 @@
# define WAVETABLE_IRQ 0x20 /* pending wavetable IRQ */ # define WAVETABLE_IRQ 0x20 /* pending wavetable IRQ */
# define ENVELOPE_IRQ 0x40 /* pending volume envelope IRQ */ # define ENVELOPE_IRQ 0x40 /* pending volume envelope IRQ */
# define DMA_TC_IRQ 0x80 /* pending dma tc IRQ */ # define DMA_TC_IRQ 0x80 /* pending dma tc IRQ */
#define ICS2101 1
# define ICS_MIXDEVS 6
# define DEV_MIC 0
# define DEV_LINE 1
# define DEV_CD 2
# define DEV_GF1 3
# define DEV_UNUSED 4
# define DEV_VOL 5
# define CHN_LEFT 0
# define CHN_RIGHT 1
#define CS4231 2
#define u_DRAMIO (gus_base + 0x107) #define u_DRAMIO (gus_base + 0x107)
static unsigned short gus_linearvol[128] = {
0x0000, 0x08ff, 0x09ff, 0x0a80, 0x0aff, 0x0b40, 0x0b80, 0x0bc0,
0x0bff, 0x0c20, 0x0c40, 0x0c60, 0x0c80, 0x0ca0, 0x0cc0, 0x0ce0,
0x0cff, 0x0d10, 0x0d20, 0x0d30, 0x0d40, 0x0d50, 0x0d60, 0x0d70,
0x0d80, 0x0d90, 0x0da0, 0x0db0, 0x0dc0, 0x0dd0, 0x0de0, 0x0df0,
0x0dff, 0x0e08, 0x0e10, 0x0e18, 0x0e20, 0x0e28, 0x0e30, 0x0e38,
0x0e40, 0x0e48, 0x0e50, 0x0e58, 0x0e60, 0x0e68, 0x0e70, 0x0e78,
0x0e80, 0x0e88, 0x0e90, 0x0e98, 0x0ea0, 0x0ea8, 0x0eb0, 0x0eb8,
0x0ec0, 0x0ec8, 0x0ed0, 0x0ed8, 0x0ee0, 0x0ee8, 0x0ef0, 0x0ef8,
0x0eff, 0x0f04, 0x0f08, 0x0f0c, 0x0f10, 0x0f14, 0x0f18, 0x0f1c,
0x0f20, 0x0f24, 0x0f28, 0x0f2c, 0x0f30, 0x0f34, 0x0f38, 0x0f3c,
0x0f40, 0x0f44, 0x0f48, 0x0f4c, 0x0f50, 0x0f54, 0x0f58, 0x0f5c,
0x0f60, 0x0f64, 0x0f68, 0x0f6c, 0x0f70, 0x0f74, 0x0f78, 0x0f7c,
0x0f80, 0x0f84, 0x0f88, 0x0f8c, 0x0f90, 0x0f94, 0x0f98, 0x0f9c,
0x0fa0, 0x0fa4, 0x0fa8, 0x0fac, 0x0fb0, 0x0fb4, 0x0fb8, 0x0fbc,
0x0fc0, 0x0fc4, 0x0fc8, 0x0fcc, 0x0fd0, 0x0fd4, 0x0fd8, 0x0fdc,
0x0fe0, 0x0fe4, 0x0fe8, 0x0fec, 0x0ff0, 0x0ff4, 0x0ff8, 0x0ffc
};
/* /*
* sound/gus2_midi.c * sound/gus2_midi.c
* *
* The low level driver for the GUS Midi Interface. * The low level driver for the GUS Midi Interface.
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include "sound_config.h" #include "sound_config.h"
......
/* /*
* gus_vol.c - Compute volume for GUS. * gus_vol.c - Compute volume for GUS.
* *
* Greg Lee 1993. * Greg Lee 1993.
*/ */
#include "sound_config.h" #include "sound_config.h"
#ifndef EXCLUDE_GUS #ifndef EXCLUDE_GUS
#include "gus_linearvol.h"
#define GUS_VOLUME gus_wave_volume #define GUS_VOLUME gus_wave_volume
extern int gus_wave_volume; extern int gus_wave_volume;
/* /*
* Calculate gus volume from note velocity, main volume, expression, and * Calculate gus volume from note velocity, main volume, expression, and
* intrinsic patch volume given in patch library. Expression is multiplied * intrinsic patch volume given in patch library. Expression is multiplied
* in, so it emphasizes differences in note velocity, while main volume is * in, so it emphasizes differences in note velocity, while main volume is
...@@ -20,7 +21,7 @@ extern int gus_wave_volume; ...@@ -20,7 +21,7 @@ extern int gus_wave_volume;
* to expression controller messages, if they were found to be used for * to expression controller messages, if they were found to be used for
* dynamic volume adjustments, so here, main volume can be assumed to be * dynamic volume adjustments, so here, main volume can be assumed to be
* constant throughout a song.) * constant throughout a song.)
* *
* Intrinsic patch volume is added in, but if over 64 is also multiplied in, so * Intrinsic patch volume is added in, but if over 64 is also multiplied in, so
* we can give a big boost to very weak voices like nylon guitar and the * we can give a big boost to very weak voices like nylon guitar and the
* basses. The normal value is 64. Strings are assigned lower values. * basses. The normal value is 64. Strings are assigned lower values.
...@@ -31,27 +32,27 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev) ...@@ -31,27 +32,27 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
int i, m, n, x; int i, m, n, x;
/* /*
* A voice volume of 64 is considered neutral, so adjust the main volume if * A voice volume of 64 is considered neutral, so adjust the main volume if
* something other than this neutral value was assigned in the patch * something other than this neutral value was assigned in the patch
* library. * library.
*/ */
x = 256 + 6 * (voicev - 64); x = 256 + 6 * (voicev - 64);
/* /*
* Boost expression by voice volume above neutral. * Boost expression by voice volume above neutral.
*/ */
if (voicev > 65) if (voicev > 65)
xpn += voicev - 64; xpn += voicev - 64;
xpn += (voicev - 64) / 2; xpn += (voicev - 64) / 2;
/* /*
* Combine multiplicative and level components. * Combine multiplicative and level components.
*/ */
x = vel * xpn * 6 + (voicev / 4) * x; x = vel * xpn * 6 + (voicev / 4) * x;
#ifdef GUS_VOLUME #ifdef GUS_VOLUME
/* /*
* Further adjustment by installation-specific master volume control * Further adjustment by installation-specific master volume control
* (default 60). * (default 60).
*/ */
...@@ -63,8 +64,8 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev) ...@@ -63,8 +64,8 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
* Experimental support for the channel main volume * Experimental support for the channel main volume
*/ */
mainv = (mainv / 2) + 64; /* Scale to 64 to 127 */ mainv = (mainv / 2) + 64; /* Scale to 64 to 127 */
x = (x * mainv * mainv) / 16384; x = (x * mainv * mainv) / 16384;
#endif #endif
if (x < 2) if (x < 2)
...@@ -72,7 +73,7 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev) ...@@ -72,7 +73,7 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
else if (x >= 65535) else if (x >= 65535)
return ((15 << 8) | 255); return ((15 << 8) | 255);
/* /*
* Convert to gus's logarithmic form with 4 bit exponent i and 8 bit * Convert to gus's logarithmic form with 4 bit exponent i and 8 bit
* mantissa m. * mantissa m.
*/ */
...@@ -89,14 +90,14 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev) ...@@ -89,14 +90,14 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
n >>= 1; n >>= 1;
i++; i++;
} }
/* /*
* Mantissa is part of linear volume not expressed in exponent. (This is * Mantissa is part of linear volume not expressed in exponent. (This is
* not quite like real logs -- I wonder if it's right.) * not quite like real logs -- I wonder if it's right.)
*/ */
m = x - (1 << i); m = x - (1 << i);
/* /*
* Adjust mantissa to 8 bits. * Adjust mantissa to 8 bits.
*/ */
if (m > 0) if (m > 0)
{ {
...@@ -109,4 +110,38 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev) ...@@ -109,4 +110,38 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
return ((i << 8) + m); return ((i << 8) + m);
} }
/*
* Volume-values are interpreted as linear values. Volume is based on the
* value supplied with SEQ_START_NOTE(), channel main volume (if compiled in)
* and the volume set by the mixer-device (default 60%).
*/
unsigned short
gus_linear_vol (int vol, int mainvol)
{
int mixer_mainvol;
if (vol <= 0)
vol = 0;
else if (vol >= 127)
vol = 127;
#ifdef GUS_VOLUME
mixer_mainvol = GUS_VOLUME;
#else
mixer_mainvol = 100;
#endif
#ifdef GUS_USE_CHN_MAIN_VOLUME
if (mainvol <= 0)
mainvol = 0;
else if (mainvol >= 127)
mainvol = 127;
#else
mainvol = 128;
#endif
return gus_linearvol[(((vol * mainvol) / 128) * mixer_mainvol) / 100];
}
#endif #endif
This diff is collapsed.
/*
* sound/ics2101.c
*
* Driver for the ICS2101 mixer of GUS v3.7.
*
* Copyright by Hannu Savolainen 1994
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. 2.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include "sound_config.h"
#if defined(CONFIGURE_SOUNDCARD) && !defined(EXCLUDE_GUS)
#include <linux/ultrasound.h>
#include "gus_hw.h"
#define MIX_DEVS (SOUND_MASK_MIC|SOUND_MASK_LINE| \
SOUND_MASK_SYNTH| \
SOUND_MASK_CD | SOUND_MASK_VOLUME)
extern int gus_base;
static int volumes[ICS_MIXDEVS];
static int left_fix[ICS_MIXDEVS] =
{1, 1, 1, 2, 1, 2};
static int right_fix[ICS_MIXDEVS] =
{2, 2, 2, 1, 2, 1};
static int
scale_vol(int vol)
{
#if 1
/*
* Experimental volume scaling by Risto Kankkunen.
* This should give smoother volume response than just
* a plain multiplication.
*/
int e;
if (vol < 0)
vol = 0;
if (vol > 100)
vol = 100;
vol = (31 * vol + 50) / 100;
e = 0;
if (vol) {
while (vol < 16) {
vol <<= 1;
e--;
}
vol -= 16;
e += 7;
}
return ((e << 4) + vol);
#else
return ((vol*127)+50)/100;
#endif
}
static void
write_mix (int dev, int chn, int vol)
{
int *selector;
unsigned long flags;
int ctrl_addr = dev << 3;
int attn_addr = dev << 3;
vol=scale_vol(vol);
if (chn == CHN_LEFT)
{
selector = left_fix;
ctrl_addr |= 0x00;
attn_addr |= 0x02;
}
else
{
selector = right_fix;
ctrl_addr |= 0x01;
attn_addr |= 0x03;
}
DISABLE_INTR (flags);
OUTB (ctrl_addr, u_MixSelect);
OUTB (selector[dev], u_MixData);
OUTB (attn_addr, u_MixSelect);
OUTB ((unsigned char) vol, u_MixData);
RESTORE_INTR (flags);
}
static int
set_volumes (int dev, int vol)
{
int left = vol & 0x00ff;
int right = (vol >> 8) & 0x00ff;
if (left < 0)
left = 0;
if (left > 100)
left = 100;
if (right < 0)
right = 0;
if (right > 100)
right = 100;
write_mix (dev, CHN_LEFT, left);
write_mix (dev, CHN_RIGHT, right);
vol = left + (right << 8);
volumes[dev] = vol;
return vol;
}
static int
ics2101_mixer_ioctl (int dev, unsigned int cmd, unsigned int arg)
{
if (((cmd >> 8) & 0xff) == 'M')
{
if (cmd & IOC_IN)
switch (cmd & 0xff)
{
case SOUND_MIXER_RECSRC:
return gus_default_mixer_ioctl (dev, cmd, arg);
break;
case SOUND_MIXER_MIC:
return IOCTL_OUT (arg, set_volumes (DEV_MIC, IOCTL_IN (arg)));
break;
case SOUND_MIXER_CD:
return IOCTL_OUT (arg, set_volumes (DEV_CD, IOCTL_IN (arg)));
break;
case SOUND_MIXER_LINE:
return IOCTL_OUT (arg, set_volumes (DEV_LINE, IOCTL_IN (arg)));
break;
case SOUND_MIXER_SYNTH:
return IOCTL_OUT (arg, set_volumes (DEV_GF1, IOCTL_IN (arg)));
break;
case SOUND_MIXER_VOLUME:
return IOCTL_OUT (arg, set_volumes (DEV_VOL, IOCTL_IN (arg)));
break;
default:
return RET_ERROR (EINVAL);
}
else
switch (cmd & 0xff) /*
* Return parameters
*/
{
case SOUND_MIXER_RECSRC:
return gus_default_mixer_ioctl (dev, cmd, arg);
break;
case SOUND_MIXER_DEVMASK:
return IOCTL_OUT (arg, MIX_DEVS);
break;
case SOUND_MIXER_STEREODEVS:
return IOCTL_OUT (arg, SOUND_MASK_LINE | SOUND_MASK_CD |
SOUND_MASK_SYNTH | SOUND_MASK_VOLUME|
SOUND_MASK_MIC);
break;
case SOUND_MIXER_RECMASK:
return IOCTL_OUT (arg, SOUND_MASK_MIC | SOUND_MASK_LINE);
break;
case SOUND_MIXER_CAPS:
return IOCTL_OUT (arg, 0);
break;
case SOUND_MIXER_MIC:
return IOCTL_OUT (arg, volumes[DEV_MIC]);
break;
case SOUND_MIXER_LINE:
return IOCTL_OUT (arg, volumes[DEV_LINE]);
break;
case SOUND_MIXER_CD:
return IOCTL_OUT (arg, volumes[DEV_CD]);
break;
case SOUND_MIXER_VOLUME:
return IOCTL_OUT (arg, volumes[DEV_VOL]);
break;
case SOUND_MIXER_SYNTH:
return IOCTL_OUT (arg, volumes[DEV_GF1]);
break;
default:
return RET_ERROR (EINVAL);
}
}
return RET_ERROR (EINVAL);
}
static struct mixer_operations ics2101_mixer_operations =
{
ics2101_mixer_ioctl
};
long
ics2101_mixer_init (long mem_start)
{
int i;
if (num_mixers < MAX_MIXER_DEV)
{
mixer_devs[num_mixers++] = &ics2101_mixer_operations;
/*
* Some GUS v3.7 cards had some channels flipped. Disable
* the flipping feature if the model id is other than 5.
*/
if (INB (u_MixSelect) != 5)
{
for (i = 0; i < ICS_MIXDEVS; i++)
left_fix[i] = 1;
for (i = 0; i < ICS_MIXDEVS; i++)
right_fix[i] = 2;
}
set_volumes (DEV_GF1, 0x5a5a);
set_volumes (DEV_CD, 0x5a5a);
set_volumes (DEV_MIC, 0x0000);
set_volumes (DEV_LINE, 0x5a5a);
set_volumes (DEV_VOL, 0x5a5a);
set_volumes (DEV_UNUSED, 0x0000);
}
return mem_start;
}
#endif
/* /*
* sound/midibuf.c * sound/midibuf.c
* *
* Device file manager for /dev/midi * Device file manager for /dev/midi
* *
* NOTE! This part of the driver is currently just a stub. * NOTE! This part of the driver is currently just a stub.
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include "sound_config.h" #include "sound_config.h"
......
/* /*
* sound/mpu401.c * sound/mpu401.c
* *
* The low level driver for Roland MPU-401 compatible Midi cards. * The low level driver for Roland MPU-401 compatible Midi cards.
* *
* This version supports just the DUMB UART mode. * This version supports just the DUMB UART mode.
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include "sound_config.h" #include "sound_config.h"
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#if !defined(EXCLUDE_MPU401) && !defined(EXCLUDE_MIDI) #if !defined(EXCLUDE_MPU401) && !defined(EXCLUDE_MIDI)
#define DATAPORT (mpu401_base) /* MPU-401 Data I/O Port on IBM */ #define DATAPORT (mpu401_base)/* MPU-401 Data I/O Port on IBM */
#define COMDPORT (mpu401_base+1) /* MPU-401 Command Port on IBM */ #define COMDPORT (mpu401_base+1) /* MPU-401 Command Port on IBM */
#define STATPORT (mpu401_base+1) /* MPU-401 Status Port on IBM */ #define STATPORT (mpu401_base+1) /* MPU-401 Status Port on IBM */
...@@ -61,58 +61,16 @@ static int my_dev; ...@@ -61,58 +61,16 @@ static int my_dev;
static int reset_mpu401 (void); static int reset_mpu401 (void);
static void (*midi_input_intr) (int dev, unsigned char data); static void (*midi_input_intr) (int dev, unsigned char data);
static void
mpu401_input_loop (void)
{
int count;
count = 10;
while (count) /* Not timed out */
if (input_avail ())
{
unsigned char c = mpu401_read ();
count = 100;
if (mpu401_opened & OPEN_READ)
midi_input_intr (my_dev, c);
}
else
while (!input_avail () && count)
count--;
}
void void
mpuintr (int unit) mpuintr (int unit)
{ {
if (input_avail ()) while (input_avail ())
mpu401_input_loop (); {
} unsigned char c = mpu401_read ();
/*
* It looks like there is no input interrupts in the UART mode. Let's try
* polling.
*/
static void
poll_mpu401 (unsigned long dummy)
{
unsigned long flags;
DEFINE_TIMER(mpu401_timer, poll_mpu401);
if (!(mpu401_opened & OPEN_READ))
return; /* No longer required */
DISABLE_INTR (flags);
if (input_avail ())
mpu401_input_loop ();
ACTIVATE_TIMER(mpu401_timer, poll_mpu401, 1); /* Come back later */
RESTORE_INTR (flags); if (mpu401_opened & OPEN_READ)
midi_input_intr (my_dev, c);
}
} }
static int static int
...@@ -127,11 +85,10 @@ mpu401_open (int dev, int mode, ...@@ -127,11 +85,10 @@ mpu401_open (int dev, int mode,
return RET_ERROR (EBUSY); return RET_ERROR (EBUSY);
} }
mpu401_input_loop (); mpuintr (0);
midi_input_intr = input; midi_input_intr = input;
mpu401_opened = mode; mpu401_opened = mode;
poll_mpu401 (0); /* Enable input polling */
return 0; return 0;
} }
...@@ -155,7 +112,7 @@ mpu401_out (int dev, unsigned char midi_byte) ...@@ -155,7 +112,7 @@ mpu401_out (int dev, unsigned char midi_byte)
DISABLE_INTR (flags); DISABLE_INTR (flags);
if (input_avail ()) if (input_avail ())
mpu401_input_loop (); mpuintr (0);
RESTORE_INTR (flags); RESTORE_INTR (flags);
...@@ -291,7 +248,7 @@ reset_mpu401 (void) ...@@ -291,7 +248,7 @@ reset_mpu401 (void)
mpu401_opened = 0; mpu401_opened = 0;
if (ok) if (ok)
mpu401_input_loop (); /* Flush input before enabling interrupts */ mpuintr (0); /* Flush input before enabling interrupts */
RESTORE_INTR (flags); RESTORE_INTR (flags);
......
/* /*
* sound/opl3.c * sound/opl3.c
* *
* A low level driver for Yamaha YM3812 and OPL-3 -chips * A low level driver for Yamaha YM3812 and OPL-3 -chips
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
/* Major improvements to the FM handling 30AUG92 by Rob Hooft, */ /* Major improvements to the FM handling 30AUG92 by Rob Hooft, */
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#define MAX_VOICE 18 #define MAX_VOICE 18
#define OFFS_4OP 11 /* Definitions for the operators OP3 and OP4 #define OFFS_4OP 11 /* Definitions for the operators OP3 and OP4
* begin here */ * begin here */
static int opl3_enabled = 0; static int opl3_enabled = 0;
static int left_address = 0x388, right_address = 0x388, both_address = 0; static int left_address = 0x388, right_address = 0x388, both_address = 0;
...@@ -70,7 +70,7 @@ static int already_initialized = 0; ...@@ -70,7 +70,7 @@ static int already_initialized = 0;
static int opl3_ok = 0; static int opl3_ok = 0;
static int opl3_busy = 0; static int opl3_busy = 0;
static int fm_model = 0; /* 0=no fm, 1=mono, 2=SB Pro 1, 3=SB Pro 2 */ static int fm_model = 0; /* 0=no fm, 1=mono, 2=SB Pro 1, 3=SB Pro 2 */
static int store_instr (int instr_no, struct sbi_instrument *instr); static int store_instr (int instr_no, struct sbi_instrument *instr);
static void freq_to_fnum (int freq, int *block, int *fnum); static void freq_to_fnum (int freq, int *block, int *fnum);
...@@ -81,6 +81,9 @@ static unsigned char connection_mask = 0x00; ...@@ -81,6 +81,9 @@ static unsigned char connection_mask = 0x00;
void void
enable_opl3_mode (int left, int right, int both) enable_opl3_mode (int left, int right, int both)
{ {
if (opl3_enabled)
return;
opl3_enabled = 1; opl3_enabled = 1;
left_address = left; left_address = left;
right_address = right; right_address = right;
...@@ -168,10 +171,10 @@ opl3_detect (int ioaddr) ...@@ -168,10 +171,10 @@ opl3_detect (int ioaddr)
* This function returns 1 if the FM chicp is present at the given I/O port * This function returns 1 if the FM chicp is present at the given I/O port
* The detection algorithm plays with the timer built in the FM chip and * The detection algorithm plays with the timer built in the FM chip and
* looks for a change in the status register. * looks for a change in the status register.
* *
* Note! The timers of the FM chip are not connected to AdLib (and compatible) * Note! The timers of the FM chip are not connected to AdLib (and compatible)
* boards. * boards.
* *
* Note2! The chip is initialized if detected. * Note2! The chip is initialized if detected.
*/ */
...@@ -194,7 +197,7 @@ opl3_detect (int ioaddr) ...@@ -194,7 +197,7 @@ opl3_detect (int ioaddr)
if ((stat1 & 0xE0) != 0x00) if ((stat1 & 0xE0) != 0x00)
{ {
return 0; /* Should be 0x00 */ return 0; /* Should be 0x00 */
} }
opl3_command (ioaddr, TIMER1_REGISTER, 0xff); /* Set timer 1 to 0xff */ opl3_command (ioaddr, TIMER1_REGISTER, 0xff); /* Set timer 1 to 0xff */
...@@ -364,7 +367,7 @@ set_voice_volume (int voice, int volume) ...@@ -364,7 +367,7 @@ set_voice_volume (int voice, int volume)
vol2 = instr->operators[3]; vol2 = instr->operators[3];
if ((instr->operators[10] & 0x01)) if ((instr->operators[10] & 0x01))
{ /* Additive synthesis */ { /* Additive synthesis */
calc_vol (&vol1, volume); calc_vol (&vol1, volume);
calc_vol (&vol2, volume); calc_vol (&vol2, volume);
} }
...@@ -627,7 +630,7 @@ opl3_command (int io_addr, unsigned int addr, unsigned int val) ...@@ -627,7 +630,7 @@ opl3_command (int io_addr, unsigned int addr, unsigned int val)
* register. The OPL-3 survives with just two INBs * register. The OPL-3 survives with just two INBs
*/ */
OUTB ((unsigned char)(addr & 0xff), io_addr); /* Select register */ OUTB ((unsigned char) (addr & 0xff), io_addr); /* Select register */
if (!opl3_enabled) if (!opl3_enabled)
tenmicrosec (); tenmicrosec ();
...@@ -635,7 +638,7 @@ opl3_command (int io_addr, unsigned int addr, unsigned int val) ...@@ -635,7 +638,7 @@ opl3_command (int io_addr, unsigned int addr, unsigned int val)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
INB (io_addr); INB (io_addr);
OUTB ((unsigned char)(val & 0xff), io_addr + 1); /* Write to register */ OUTB ((unsigned char) (val & 0xff), io_addr + 1); /* Write to register */
if (!opl3_enabled) if (!opl3_enabled)
{ {
...@@ -747,6 +750,11 @@ opl3_panning (int dev, int voice, int pressure) ...@@ -747,6 +750,11 @@ opl3_panning (int dev, int voice, int pressure)
{ {
} }
static void
opl3_volume_method (int dev, int mode)
{
}
#define SET_VIBRATO(cell) { \ #define SET_VIBRATO(cell) { \
tmp = instr->operators[(cell-1)+(((cell-1)/2)*OFFS_4OP)]; \ tmp = instr->operators[(cell-1)+(((cell-1)/2)*OFFS_4OP)]; \
if (pressure > 110) \ if (pressure > 110) \
...@@ -852,7 +860,7 @@ opl3_controller (int dev, int voice, int ctrl_num, int value) ...@@ -852,7 +860,7 @@ opl3_controller (int dev, int voice, int ctrl_num, int value)
opl3_command (map->ioaddr, FNUM_LOW + map->voice_num, data); opl3_command (map->ioaddr, FNUM_LOW + map->voice_num, data);
data = 0x20 | ((block & 0x7) << 2) | ((fnum >> 8) & 0x3); /* KEYON|OCTAVE|MS bits data = 0x20 | ((block & 0x7) << 2) | ((fnum >> 8) & 0x3); /* KEYON|OCTAVE|MS bits
* of f-num */ * of f-num */
voices[voice].keyon_byte = data; voices[voice].keyon_byte = data;
opl3_command (map->ioaddr, KEYON_BLOCK + map->voice_num, data); opl3_command (map->ioaddr, KEYON_BLOCK + map->voice_num, data);
break; break;
...@@ -886,6 +894,7 @@ static struct synth_operations opl3_operations = ...@@ -886,6 +894,7 @@ static struct synth_operations opl3_operations =
opl3_aftertouch, opl3_aftertouch,
opl3_controller, opl3_controller,
opl3_panning, opl3_panning,
opl3_volume_method,
opl3_patchmgr opl3_patchmgr
}; };
...@@ -894,8 +903,8 @@ opl3_init (long mem_start) ...@@ -894,8 +903,8 @@ opl3_init (long mem_start)
{ {
int i; int i;
PERMANENT_MALLOC(struct sbi_instrument*, instrmap, PERMANENT_MALLOC (struct sbi_instrument *, instrmap,
SBFM_MAXINSTR*sizeof(*instrmap), mem_start); SBFM_MAXINSTR * sizeof (*instrmap), mem_start);
synth_devs[num_synths++] = &opl3_operations; synth_devs[num_synths++] = &opl3_operations;
fm_model = 0; fm_model = 0;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/string.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -46,6 +45,7 @@ ...@@ -46,6 +45,7 @@
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/malloc.h> #include <linux/malloc.h>
#include <linux/soundcard.h> #include <linux/soundcard.h>
#include <linux/string.h>
typedef char snd_rw_buf; typedef char snd_rw_buf;
...@@ -141,7 +141,7 @@ struct snd_wait { ...@@ -141,7 +141,7 @@ struct snd_wait {
#define DEFINE_TIMER(name, proc) \ #define DEFINE_TIMER(name, proc) \
static struct timer_list name = \ static struct timer_list name = \
{NULL, NULL, 0, 0, proc} {NULL, 0, 0, 0, proc}
/* /*
* The ACTIVATE_TIMER requests system to call 'proc' after 'time' ticks. * The ACTIVATE_TIMER requests system to call 'proc' after 'time' ticks.
......
...@@ -138,11 +138,11 @@ ...@@ -138,11 +138,11 @@
char I_C_2_PCM_DMA_translate[] = /* R W PCM PCM DMA channel value translations */ char I_C_2_PCM_DMA_translate[] = /* R W PCM PCM DMA channel value translations */
{ 4, 1, 2, 3, 0, 5, 6, 7 }; { 4, 1, 2, 3, 0, 5, 6, 7 };
char I_C_3_PCM_IRQ_translate[] = /* R W PCM PCM IRQ level value translation */ char I_C_3_PCM_IRQ_translate[] = /* R W PCM PCM IRQ level value translation */
{ 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 }; { 0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 7, 8, 9, 0, 10, 11 };
char E_C_MPU401_IRQ_translate[] = /* R W MIDI MPU401 emulation IRQ value translation */ char E_C_MPU401_IRQ_translate[] = /* R W MIDI MPU401 emulation IRQ value translation */
{ 0x00, 0x00, 0x01, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x05, 0x06, 0x07 }; { 0x00, 0x00, 0x01, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x01, 0x05, 0x06, 0x07 };
char E_C_SB_IRQ_translate[] = /* R W PCM SB emulation IRQ translate */ char E_C_SB_IRQ_translate[] = /* R W PCM SB emulation IRQ translate */
{ 0x00, 0x00, 0x08, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x28, 0x30, 0x38, 0, 0 }; { 0x00, 0x00, 0x08, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, 0x08, 0x28, 0x30, 0x38, 0, 0 };
char E_C_SB_DMA_translate[] = /* R W PCM SB emulation DMA translate */ char E_C_SB_DMA_translate[] = /* R W PCM SB emulation DMA translate */
{ 0x00, 0x40, 0x80, 0xC0, 0, 0, 0, 0 }; { 0x00, 0x40, 0x80, 0xC0, 0, 0, 0, 0 };
char O_M_1_to_card[] = /* R W Control Translate (OM1 & 0x0f) to card type */ char O_M_1_to_card[] = /* R W Control Translate (OM1 & 0x0f) to card type */
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
#define SND_SA_INTERRUPT #define SND_SA_INTERRUPT
/* /*
* sound/pas2_card.c * sound/pas2_card.c
* *
* Detection routine for the Pro Audio Spectrum cards. * Detection routine for the Pro Audio Spectrum cards.
* *
* Copyright by Hannu Savolainen 1993 * Copyright by Hannu Savolainen 1993
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright * met: 1. Redistributions of source code must retain the above copyright
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*/ */
#include "sound_config.h" #include "sound_config.h"
...@@ -196,14 +196,14 @@ config_pas_hw (struct address_info *hw_config) ...@@ -196,14 +196,14 @@ config_pas_hw (struct address_info *hw_config)
ok = 0; ok = 0;
} }
} }
/* /*
* This fixes the timing problems of the PAS due to the Symphony chipset * This fixes the timing problems of the PAS due to the Symphony chipset
* as per Media Vision. Only define this if your PAS doesn't work correctly. * as per Media Vision. Only define this if your PAS doesn't work correctly.
*/ */
#ifdef SYMPHONY_PAS #ifdef SYMPHONY_PAS
OUTB(0x05,0xa8); OUTB (0x05, 0xa8);
OUTB(0x60,0xa9); OUTB (0x60, 0xa9);
#endif #endif
#ifdef BROKEN_BUS_CLOCK #ifdef BROKEN_BUS_CLOCK
...@@ -228,35 +228,35 @@ config_pas_hw (struct address_info *hw_config) ...@@ -228,35 +228,35 @@ config_pas_hw (struct address_info *hw_config)
#if !defined(EXCLUDE_SB_EMULATION) || !defined(EXCLUDE_SB) #if !defined(EXCLUDE_SB_EMULATION) || !defined(EXCLUDE_SB)
{ {
struct address_info *sb_config; struct address_info *sb_config;
if ((sb_config=sound_getconf(SNDCARD_SB))) if ((sb_config = sound_getconf (SNDCARD_SB)))
{ {
unsigned char irq_dma; unsigned char irq_dma;
/* Turn on Sound Blaster compatibility */ /* Turn on Sound Blaster compatibility */
/* bit 1 = SB emulation */ /* bit 1 = SB emulation */
/* bit 0 = MPU401 emulation (CDPC only :-( ) */ /* bit 0 = MPU401 emulation (CDPC only :-( ) */
pas_write (0x02, COMPATIBILITY_ENABLE); pas_write (0x02, COMPATIBILITY_ENABLE);
/* "Emulation address" */ /* "Emulation address" */
pas_write ((sb_config->io_base >> 4) & 0x0f, EMULATION_ADDRESS); pas_write ((sb_config->io_base >> 4) & 0x0f, EMULATION_ADDRESS);
if (!E_C_SB_DMA_translate[sb_config->dma]) if (!E_C_SB_DMA_translate[sb_config->dma])
printk("\n\nPAS16 Warning: Invalid SB DMA %d\n\n", printk ("\n\nPAS16 Warning: Invalid SB DMA %d\n\n",
sb_config->dma); sb_config->dma);
if (!E_C_SB_IRQ_translate[sb_config->irq]) if (!E_C_SB_IRQ_translate[sb_config->irq])
printk("\n\nPAS16 Warning: Invalid SB IRQ %d\n\n", printk ("\n\nPAS16 Warning: Invalid SB IRQ %d\n\n",
sb_config->irq); sb_config->irq);
irq_dma = E_C_SB_DMA_translate[sb_config->dma] | irq_dma = E_C_SB_DMA_translate[sb_config->dma] |
E_C_SB_IRQ_translate[sb_config->irq]; E_C_SB_IRQ_translate[sb_config->irq];
pas_write(irq_dma, EMULATION_CONFIGURATION); pas_write (irq_dma, EMULATION_CONFIGURATION);
} }
} }
#endif #endif
if (!ok) if (!ok)
...@@ -327,11 +327,11 @@ attach_pas_card (long mem_start, struct address_info *hw_config) ...@@ -327,11 +327,11 @@ attach_pas_card (long mem_start, struct address_info *hw_config)
mem_start = pas_pcm_init (mem_start, hw_config); mem_start = pas_pcm_init (mem_start, hw_config);
#endif #endif
# if !defined(EXCLUDE_SB_EMULATION) && !defined(EXCLUDE_SB) #if !defined(EXCLUDE_SB_EMULATION) && !defined(EXCLUDE_SB)
sb_dsp_disable_midi (); /* The SB emulation don't support sb_dsp_disable_midi (); /* The SB emulation don't support
* midi */ * midi */
# endif #endif
#ifndef EXCLUDE_YM3812 #ifndef EXCLUDE_YM3812
enable_opl3_mode (0x388, 0x38a, 0); enable_opl3_mode (0x388, 0x38a, 0);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -144,7 +144,7 @@ static void freeary (int id) ...@@ -144,7 +144,7 @@ static void freeary (int id)
wake_up (&sma->eventn); wake_up (&sma->eventn);
schedule(); schedule();
} }
kfree_s (sma, sizeof (*sma) + sma->sem_nsems * sizeof (struct sem)); kfree(sma);
return; return;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment