summaryrefslogtreecommitdiffstats
path: root/drivers/sound/lowlevel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
commit27cfca1ec98e91261b1a5355d10a8996464b63af (patch)
tree8e895a53e372fa682b4c0a585b9377d67ed70d0e /drivers/sound/lowlevel
parent6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff)
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'drivers/sound/lowlevel')
-rw-r--r--drivers/sound/lowlevel/.cvsignore1
-rw-r--r--drivers/sound/lowlevel/Config.tmpl16
-rw-r--r--drivers/sound/lowlevel/Makefile7
-rw-r--r--drivers/sound/lowlevel/README.aedsp1631
-rw-r--r--drivers/sound/lowlevel/aci.c1
-rw-r--r--drivers/sound/lowlevel/aedsp16.c239
-rw-r--r--drivers/sound/lowlevel/awe_version.h11
-rw-r--r--drivers/sound/lowlevel/init.c2
8 files changed, 192 insertions, 116 deletions
diff --git a/drivers/sound/lowlevel/.cvsignore b/drivers/sound/lowlevel/.cvsignore
index 4671378ae..857dd22e9 100644
--- a/drivers/sound/lowlevel/.cvsignore
+++ b/drivers/sound/lowlevel/.cvsignore
@@ -1 +1,2 @@
.depend
+.*.flags
diff --git a/drivers/sound/lowlevel/Config.tmpl b/drivers/sound/lowlevel/Config.tmpl
index a3864b96f..e3ad81dbb 100644
--- a/drivers/sound/lowlevel/Config.tmpl
+++ b/drivers/sound/lowlevel/Config.tmpl
@@ -14,10 +14,10 @@ if [ "$CONFIG_LOWLEVEL_SOUND" = "y" ]; then
if [ "$CONFIG_AEDSP16_SBPRO" = "y" ]; then
comment 'Audio Excel DSP 16 [Sound Blaster Pro]'
hex 'I/O base for Audio Excel DSP 16 220 or 240' \
- AEDSP16_BASE $SBC_BASE
+ CONFIG_AEDSP16_BASE $CONFIG_SB_BASE
int 'Audio Excel DSP 16 IRQ 5, 7, 9, 10, 11' \
- AEDSP16_SBC_IRQ $SBC_IRQ
- int 'Audio Excel DSP 16 DMA 0, 1 or 3' AEDSP16_SBC_DMA $SBC_DMA
+ CONFIG_AEDSP16_SB_IRQ $CONFIG_SB_IRQ
+ int 'Audio Excel DSP 16 DMA 0, 1 or 3' CONFIG_AEDSP16_SB_DMA $CONFIG_SB_DMA
fi
fi
@@ -25,10 +25,10 @@ if [ "$CONFIG_LOWLEVEL_SOUND" = "y" ]; then
bool 'Audio Excel DSP 16 (MSS emulation)' CONFIG_AEDSP16_MSS
if [ "$CONFIG_AEDSP16_MSS" = "y" ]; then
comment 'Audio Excel DSP 16 [Microsoft Sound System]'
- hex 'I/O base for Audio Excel DSP 16 220 or 240' AEDSP16_BASE 220
+ hex 'I/O base for Audio Excel DSP 16 220 or 240' CONFIG_AEDSP16_BASE 220
int 'Audio Excel DSP 16 IRQ 5, 7, 9, 10, 11' \
- AEDSP16_MSS_IRQ $MSS_IRQ
- int 'Audio Excel DSP 16 DMA 0, 1 or 3' AEDSP16_MSS_DMA $MSS_DMA
+ CONFIG_AEDSP16_MSS_IRQ $CONFIG_MSS_IRQ
+ int 'Audio Excel DSP 16 DMA 0, 1 or 3' CONFIG_AEDSP16_MSS_DMA $CONFIG_MSS_DMA
fi
fi
@@ -38,10 +38,10 @@ if [ "$CONFIG_LOWLEVEL_SOUND" = "y" ]; then
comment 'Audio Excel DSP 16 [MPU-401]'
if [ "$CONFIG_AEDSP16_SBPRO" != "y" \
-a "$CONFIG_AEDSP16_MSS" != "y" ]; then
- hex 'I/O base for Audio Excel DSP 16 220 or 240' AEDSP16_BASE 220
+ hex 'I/O base for Audio Excel DSP 16 220 or 240' CONFIG_AEDSP16_BASE 220
fi
int 'MPU401 IRQ for Audio Excel DSP 16 5, 7, 9, 10 or 0 (disable)' \
- AEDSP16_MPU_IRQ $MPU_IRQ
+ CONFIG_AEDSP16_MPU_IRQ $CONFIG_MPU_IRQ
fi
fi
diff --git a/drivers/sound/lowlevel/Makefile b/drivers/sound/lowlevel/Makefile
index 1a4c6a396..0340b37b9 100644
--- a/drivers/sound/lowlevel/Makefile
+++ b/drivers/sound/lowlevel/Makefile
@@ -16,6 +16,10 @@ else
endif
ifeq ($(CONFIG_AEDSP16),y)
OBJS := $(OBJS) aedsp16.o
+else
+ ifeq ($(CONFIG_AEDSP16),m)
+ MX_OBJS := $(MX_OBJS) aedsp16.o
+ endif
endif
endif
@@ -23,9 +27,6 @@ ifndef TOPDIR
TOPDIR=/usr/src/linux
endif
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
lowlevel.o: $(OBJS)
$(LD) -r -o lowlevel.o $(OBJS)
diff --git a/drivers/sound/lowlevel/README.aedsp16 b/drivers/sound/lowlevel/README.aedsp16
index 7b61363a3..8f5b05afd 100644
--- a/drivers/sound/lowlevel/README.aedsp16
+++ b/drivers/sound/lowlevel/README.aedsp16
@@ -20,6 +20,37 @@ I you own a Gallant's audio card based on SC-6600, activate the SC-6600 support.
If you want to change the configuration of the sound board, be sure to
check off all the configuration items before re-configure it.
+Module parameters
+-----------------
+To use this driver as a module, you must configure some module parameters, to
+set up I/O addresses, IRQ lines and DMA channels. Some parameters are
+mandatory while some others are optional. Here a list of parameters you can
+use with this module:
+
+Name Description
+==== ===========
+MANDATORY
+io I/O base address (0x220 or 0x240)
+irq irq line (5, 7, 9, 10 or 11)
+dma dma channel (0, 1 or 3)
+
+OPTIONAL
+mss_base I/O base address for activate MSS mode (default SBPRO)
+ (0x530 or 0xE80)
+mpu_base I/O base address for activate MPU-401 mode
+ (0x300, 0x310, 0x320 or 0x330)
+mpu_irq MPU-401 irq line (5, 7, 9, 10 or 0)
+
+The /etc/conf.modules will have a line like this:
+
+options aedsp16 io=0x220 irq=10 dma=3 mss_base=0x530
+
+Of course, you must write the 'options' for all other subsequent modules,
+opl3, ad1848, adlib_card, sb
+
+Then you must load the sound modules stack in this order:
+sound -> aedsp16 -> [ ad1848, opl3 ]
+
Sound cards supported
---------------------
This driver supports the SC-6000 and SC-6600 based Gallant's sound card.
diff --git a/drivers/sound/lowlevel/aci.c b/drivers/sound/lowlevel/aci.c
index 7599d5a6c..84d5c73c2 100644
--- a/drivers/sound/lowlevel/aci.c
+++ b/drivers/sound/lowlevel/aci.c
@@ -58,6 +58,7 @@
*
*/
+#include <linux/config.h> /* for CONFIG_ACI_MIXER */
#include "lowlevel.h"
#include "../sound_config.h"
#include "lowlevel.h"
diff --git a/drivers/sound/lowlevel/aedsp16.c b/drivers/sound/lowlevel/aedsp16.c
index 93db242a1..cb919507e 100644
--- a/drivers/sound/lowlevel/aedsp16.c
+++ b/drivers/sound/lowlevel/aedsp16.c
@@ -1,8 +1,8 @@
/*
- sound/aedsp16.c
+ drivers/sound/lowlevel/aedsp16.c
Audio Excel DSP 16 software configuration routines
- Copyright (C) 1995 Riccardo Facchetti (riccardo@cdc8g5.cdc.polimi.it)
+ Copyright (C) 1995,1996,1997,1998 Riccardo Facchetti (fizban@tin.it)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,13 +24,24 @@
* headers needed by this source.
*/
#include <linux/config.h>
-#include "../sound_config.h"
#include <linux/delay.h>
+#include <linux/module.h>
+#include "../sound_config.h"
+#include "../soundmodule.h"
+
+/*
+ * Sanity checks
+ */
-#ifndef AEDSP16_BASE
-#undef CONFIG_AEDSP16
+#if !defined(CONFIG_AEDSP16_BASE)
+# undef CONFIG_AEDSP16
+#else
+# if defined(MODULE) && defined(CONFIG_AEDSP16_MODULE)
+# define CONFIG_AEDSP16 1
+# endif
#endif
+
#if defined(CONFIG_AEDSP16)
#if defined(CONFIG_AEDSP16_SBPRO) && defined(CONFIG_AEDSP16_MSS)
@@ -232,6 +243,11 @@
- Prep for merging with OSS Lite and Linux kernel 2.1.13
- Corrected a bug in request/check/release region calls (thanks to the
new kernel exception handling).
+ v1.1
+ - Revamped for integration with new modularized sound drivers: to enhance
+ the flexibility of modular version, I have removed all the conditional
+ compilation for SBPRO, MPU and MSS code. Now it is all managed with
+ the ae_config structure.
Known Problems:
- Audio Excel DSP 16 III don't work with this driver.
@@ -243,7 +259,7 @@
*/
-#define VERSION "1.0.0" /* Version of Audio Excel DSP 16 driver */
+#define VERSION "1.1" /* Version of Audio Excel DSP 16 driver */
#undef AEDSP16_DEBUG 1 /* Define this to enable debug code */
#undef AEDSP16_DEBUG_MORE 1 /* Define this to enable more debug */
@@ -439,6 +455,8 @@ struct aedsp16_info {
int irq; /* irq value for DSP I/O */
int mpu_irq; /* irq for mpu401 interface I/O */
int dma; /* dma value for DSP I/O */
+ int mss_base; /* base I/O for Microsoft Sound System */
+ int mpu_base; /* base I/O for MPU-401 emulation */
int init; /* Initialization status of the card */
};
@@ -477,6 +495,8 @@ static struct aedsp16_info ae_config = {
DEF_AEDSP16_IRQ,
DEF_AEDSP16_MRQ,
DEF_AEDSP16_DMA,
+ -1,
+ -1,
INIT_NONE
};
@@ -619,13 +639,9 @@ void aedsp16_hard_decode(void) {
/*
* Now set up the real kernel configuration.
*/
- decoded_hcfg.iobase = AEDSP16_BASE;
-#if defined(CONFIG_AEDSP16_MSS)
- decoded_hcfg.wssbase = MSS_BASE;
-#endif
-#if defined(CONFIG_AEDSP16_MPU401)
- decoded_hcfg.mpubase = MPU_BASE;
-#endif
+ decoded_hcfg.iobase = ae_config.base_io;
+ decoded_hcfg.wssbase = ae_config.mss_base;
+ decoded_hcfg.mpubase = ae_config.mpu_base;
#if defined(CONFIG_SC6600_JOY)
decoded_hcfg.joystick = CONFIG_SC6600_JOY; /* Enable */
@@ -805,8 +821,6 @@ static int aedsp16_cfg_write(int port) {
return TRUE;
}
-#if defined(CONFIG_AEDSP16_MSS)
-
static int aedsp16_init_mss(int port)
{
DBG(("aedsp16_init_mss:\n"));
@@ -824,15 +838,13 @@ static int aedsp16_init_mss(int port)
if (aedsp16_cfg_write(port) == FALSE)
return FALSE;
- outb(soft_cfg_1, MSS_BASE);
+ outb(soft_cfg_1, ae_config.mss_base);
DBG(("success.\n"));
return TRUE;
}
-#endif /* CONFIG_AEDSP16_MSS */
-
static int aedsp16_setup_board(int port) {
int loop = RETRY;
@@ -1082,15 +1094,15 @@ static int aedsp16_init_board(void)
return FALSE;
}
-#if defined(CONFIG_AEDSP16_MSS)
- if (ae_config.init & INIT_MSS) {
- if (aedsp16_init_mss(ae_config.base_io) == FALSE) {
- printk(
- "[AEDSP16] Can not initialize Microsoft Sound System mode.\n");
- return FALSE;
+ if (ae_config.mss_base != -1) {
+ if (ae_config.init & INIT_MSS) {
+ if (aedsp16_init_mss(ae_config.base_io) == FALSE) {
+ printk("[AEDSP16] Can not initialize"
+ "Microsoft Sound System mode.\n");
+ return FALSE;
+ }
}
}
-#endif
#if !defined(MODULE) || defined(AEDSP16_INFO) || defined(AEDSP16_DEBUG)
@@ -1098,27 +1110,26 @@ static int aedsp16_init_board(void)
VERSION, DSPCopyright,
DSPVersion);
-#if defined(CONFIG_AEDSP16_MPU401)
- if (ae_config.init & INIT_MPU401) {
- printk("MPU401");
- if ((ae_config.init & INIT_MSS) ||
- (ae_config.init & INIT_SBPRO))
- printk(" ");
+ if (ae_config.mpu_base != -1) {
+ if (ae_config.init & INIT_MPU401) {
+ printk("MPU401");
+ if ((ae_config.init & INIT_MSS) ||
+ (ae_config.init & INIT_SBPRO))
+ printk(" ");
+ }
}
-#endif
-#if defined(CONFIG_AEDSP16_SBPRO)
- if (ae_config.init & INIT_SBPRO) {
- printk("SBPro");
- if (ae_config.init & INIT_MSS)
- printk(" ");
+ if (ae_config.mss_base == -1) {
+ if (ae_config.init & INIT_SBPRO) {
+ printk("SBPro");
+ if (ae_config.init & INIT_MSS)
+ printk(" ");
+ }
}
-#endif
-#if defined(CONFIG_AEDSP16_MSS)
- if (ae_config.init & INIT_MSS)
- printk("MSS");
-#endif
+ if (ae_config.mss_base != -1)
+ if (ae_config.init & INIT_MSS)
+ printk("MSS");
printk("]\n");
#endif /* MODULE || AEDSP16_INFO || AEDSP16_DEBUG */
@@ -1128,8 +1139,6 @@ static int aedsp16_init_board(void)
return TRUE;
}
-#if defined(CONFIG_AEDSP16_SBPRO)
-
static int init_aedsp16_sb(void)
{
DBG(("init_aedsp16_sb: "));
@@ -1158,9 +1167,6 @@ static void uninit_aedsp16_sb(void)
DBG(("done.\n"));
}
-#endif
-
-#if defined(CONFIG_AEDSP16_MSS)
static int init_aedsp16_mss(void)
{
@@ -1175,8 +1181,8 @@ static int init_aedsp16_mss(void)
if (ae_config.init & INIT_MSS)
return FALSE;
/*
- * We must check the AEDSP16_BASE region too because these are the I/O ports
- * to access card's control registers.
+ * We must check the CONFIG_AEDSP16_BASE region too because these are the I/O
+ * ports to access card's control registers.
*/
if (!(ae_config.init & INIT_MPU401)) {
if (check_region(ae_config.base_io, IOBASE_REGION_SIZE)) {
@@ -1187,8 +1193,8 @@ static int init_aedsp16_mss(void)
}
/*
- * We must allocate the AEDSP16_BASE region too because these are the I/O ports
- * to access card's control registers.
+ * We must allocate the CONFIG_AEDSP16_BASE region too because these are the
+ * I/O ports to access card's control registers.
*/
if (!(ae_config.init & INIT_MPU401))
request_region(ae_config.base_io, IOBASE_REGION_SIZE,
@@ -1214,9 +1220,6 @@ static void uninit_aedsp16_mss(void)
ae_config.init &= ~INIT_MSS;
DBG(("done.\n"));
}
-#endif
-
-#if defined(CONFIG_AEDSP16_MPU401)
static int init_aedsp16_mpu(void)
{
@@ -1226,8 +1229,8 @@ static int init_aedsp16_mpu(void)
return FALSE;
/*
- * We must check the AEDSP16_BASE region too because these are the I/O ports
- * to access card's control registers.
+ * We must check the CONFIG_AEDSP16_BASE region too because these are the I/O
+ * ports to access card's control registers.
*/
if (!(ae_config.init & (INIT_MSS | INIT_SBPRO))) {
if (check_region(ae_config.base_io, IOBASE_REGION_SIZE)) {
@@ -1262,43 +1265,45 @@ static void uninit_aedsp16_mpu(void)
DBG(("done.\n"));
}
-#endif
int init_aedsp16(void)
{
int initialized = FALSE;
- ae_config.base_io = AEDSP16_BASE;
+#if !defined(MODULE)
+ ae_config.base_io = CONFIG_AEDSP16_BASE;
#if defined(CONFIG_AEDSP16_SBPRO)
- ae_config.irq = AEDSP16_SBC_IRQ;
- ae_config.dma = AEDSP16_SBC_DMA;
+ ae_config.irq = CONFIG_AEDSP16_SB_IRQ;
+ ae_config.dma = CONFIG_AEDSP16_SB_DMA;
#endif
#if defined(CONFIG_AEDSP16_MSS)
- ae_config.irq = AEDSP16_MSS_IRQ;
- ae_config.dma = AEDSP16_MSS_DMA;
+ ae_config.mss_base = CONFIG_MSS_BASE;
+ ae_config.irq = CONFIG_AEDSP16_MSS_IRQ;
+ ae_config.dma = CONFIG_AEDSP16_MSS_DMA;
#endif
#if defined(CONFIG_AEDSP16_MPU401)
- ae_config.mpu_irq = AEDSP16_MPU_IRQ;
+ ae_config.mpu_base = CONFIG_MPU_BASE;
+ ae_config.mpu_irq = CONFIG_AEDSP16_MPU_IRQ;
#endif
-
+#endif /* !MODULE */
DBG(("Initializing BASE[0x%x] IRQ[%d] DMA[%d] MIRQ[%d]\n",
ae_config.base_io,ae_config.irq,ae_config.dma,ae_config.mpu_irq));
-#if defined(CONFIG_AEDSP16_SBPRO)
- if (init_aedsp16_sb() == FALSE)
- uninit_aedsp16_sb();
- else
- initialized = TRUE;
-#endif
-
-#if defined(CONFIG_AEDSP16_MPU401)
- if (init_aedsp16_mpu() == FALSE)
- uninit_aedsp16_mpu();
- else
- initialized = TRUE;
-#endif
+ if (ae_config.mss_base == -1) {
+ if (init_aedsp16_sb() == FALSE) {
+ uninit_aedsp16_sb();
+ } else {
+ initialized = TRUE;
+ }
+ }
-#if defined(CONFIG_AEDSP16_MSS)
+ if (ae_config.mpu_base != -1) {
+ if (init_aedsp16_mpu() == FALSE) {
+ uninit_aedsp16_mpu();
+ } else {
+ initialized = TRUE;
+ }
+ }
/*
* In the sequence of init routines, the MSS init MUST be the last!
@@ -1306,11 +1311,13 @@ int init_aedsp16(void)
* A board reset would disable the MSS mode restoring the default SBPRO
* mode.
*/
- if (init_aedsp16_mss() == FALSE)
- uninit_aedsp16_mss();
- else
- initialized = TRUE;
-#endif
+ if (ae_config.mss_base != -1) {
+ if (init_aedsp16_mss() == FALSE) {
+ uninit_aedsp16_mss();
+ } else {
+ initialized = TRUE;
+ }
+ }
if (initialized)
initialized = aedsp16_init_board();
@@ -1319,16 +1326,62 @@ int init_aedsp16(void)
void uninit_aedsp16(void)
{
-#if defined(CONFIG_AEDSP16_MSS)
- uninit_aedsp16_mss();
-#endif
+ if (ae_config.mss_base != -1)
+ uninit_aedsp16_mss();
+ else
+ uninit_aedsp16_sb();
+ if (ae_config.mpu_base != -1)
+ uninit_aedsp16_mpu();
+}
-#if defined(CONFIG_AEDSP16_SBPRO)
- uninit_aedsp16_sb();
-#endif
+#if defined(MODULE)
-#if defined(CONFIG_AEDSP16_MPU401)
- uninit_aedsp16_mpu();
-#endif
+int io = -1;
+int irq = -1;
+int dma = -1;
+int mpu_irq = -1;
+int mss_base = -1;
+int mpu_base = -1;
+
+
+MODULE_PARM(io,"i");
+MODULE_PARM(irq,"i");
+MODULE_PARM(dma,"i");
+MODULE_PARM(mpu_irq,"i");
+MODULE_PARM(mss_base,"i");
+MODULE_PARM(mpu_base,"i");
+
+int init_module(void) {
+ printk("Audio Excel DSP 16 init driver Copyright (C) Riccardo Facchetti 1995-98\n");
+ if (io == -1 || dma == -1 || irq == -1) {
+ printk(KERN_INFO "aedsp16: I/O, IRQ and DMA are mandatory\n");
+ return -EINVAL;
+ }
+
+ ae_config.base_io = io;
+ ae_config.irq = irq;
+ ae_config.dma = dma;
+
+ ae_config.mss_base = mss_base;
+ ae_config.mpu_base = mpu_base;
+ ae_config.mpu_irq = mpu_irq;
+
+ if (init_aedsp16() == FALSE) {
+ printk(KERN_ERR "aedsp16: initialization failed\n");
+ /*
+ * XXX
+ * What error should we return here ?
+ */
+ return -EINVAL;
+ }
+ SOUND_LOCK;
+ return 0;
}
-#endif /* CONFIG_AEDSP16 */
+
+void cleanup_module(void) {
+ uninit_aedsp16();
+ SOUND_LOCK_END;
+}
+#endif /* MODULE */
+
+#endif /* CONFIG_AEDSP16 */
diff --git a/drivers/sound/lowlevel/awe_version.h b/drivers/sound/lowlevel/awe_version.h
index a579b09ef..c1de31715 100644
--- a/drivers/sound/lowlevel/awe_version.h
+++ b/drivers/sound/lowlevel/awe_version.h
@@ -10,15 +10,4 @@
#define AWE_TINY_VERSION(id) ((id) & 0xff)
#endif
-/* AWE32 driver version number */
-#ifndef AWE_VERSION_H_DEF
-#define AWE_VERSION_H_DEF
-
-#define AWE_VERSION_NUMBER 0x00040202
-#define AWEDRV_VERSION "0.4.2b"
-#define AWE_MAJOR_VERSION(id) (((id) >> 16) & 0xff)
-#define AWE_MINOR_VERSION(id) (((id) >> 8) & 0xff)
-#define AWE_TINY_VERSION(id) ((id) & 0xff)
-
-#endif
diff --git a/drivers/sound/lowlevel/init.c b/drivers/sound/lowlevel/init.c
index 4b96bf032..d2e9242e4 100644
--- a/drivers/sound/lowlevel/init.c
+++ b/drivers/sound/lowlevel/init.c
@@ -28,7 +28,7 @@ extern void uninit_aedsp16(void);
void
sound_preinit_lowlevel_drivers(void)
{
-#ifdef CONFIG_AEDSP16
+#if defined(CONFIG_AEDSP16) && !defined(MODULE)
init_aedsp16();
#endif
}