aboutsummaryrefslogtreecommitdiff
path: root/sound/isa/sb
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/sb')
-rw-r--r--sound/isa/sb/Makefile31
-rw-r--r--sound/isa/sb/emu8000.c61
-rw-r--r--sound/isa/sb/emu8000_callback.c3
-rw-r--r--sound/isa/sb/emu8000_local.h1
-rw-r--r--sound/isa/sb/emu8000_patch.c5
-rw-r--r--sound/isa/sb/emu8000_pcm.c10
-rw-r--r--sound/isa/sb/emu8000_synth.c3
-rw-r--r--sound/isa/sb/es968.c266
-rw-r--r--sound/isa/sb/jazz16.c401
-rw-r--r--sound/isa/sb/sb16.c231
-rw-r--r--sound/isa/sb/sb16_csp.c132
-rw-r--r--sound/isa/sb/sb16_csp_codecs.h949
-rw-r--r--sound/isa/sb/sb16_main.c23
-rw-r--r--sound/isa/sb/sb8.c115
-rw-r--r--sound/isa/sb/sb8_main.c134
-rw-r--r--sound/isa/sb/sb8_midi.c23
-rw-r--r--sound/isa/sb/sb_common.c31
-rw-r--r--sound/isa/sb/sb_mixer.c440
18 files changed, 1040 insertions, 1819 deletions
diff --git a/sound/isa/sb/Makefile b/sound/isa/sb/Makefile
index fd9d9c5726f..08b9fb97465 100644
--- a/sound/isa/sb/Makefile
+++ b/sound/isa/sb/Makefile
@@ -1,6 +1,6 @@
#
# Makefile for ALSA
-# Copyright (c) 2001 by Jaroslav Kysela <perex@suse.cz>
+# Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz>
#
snd-sb-common-objs := sb_common.o sb_mixer.o
@@ -11,29 +11,18 @@ snd-sb8-objs := sb8.o
snd-sb16-objs := sb16.o
snd-sbawe-objs := sbawe.o emu8000.o
snd-emu8000-synth-objs := emu8000_synth.o emu8000_callback.o emu8000_patch.o emu8000_pcm.o
-snd-es968-objs := es968.o
-
-#
-# this function returns:
-# "m" - CONFIG_SND_SEQUENCER is m
-# <empty string> - CONFIG_SND_SEQUENCER is undefined
-# otherwise parameter #1 value
-#
-sequencer = $(if $(subst y,,$(CONFIG_SND_SEQUENCER)),$(if $(1),m),$(if $(CONFIG_SND_SEQUENCER),$(1)))
+snd-jazz16-objs := jazz16.o
# Toplevel Module Dependency
-obj-$(CONFIG_SND_ALS100) += snd-sb16-dsp.o snd-sb-common.o
-obj-$(CONFIG_SND_CMI8330) += snd-sb16-dsp.o snd-sb-common.o
-obj-$(CONFIG_SND_DT019X) += snd-sb16-dsp.o snd-sb-common.o
-obj-$(CONFIG_SND_SB8) += snd-sb8.o snd-sb8-dsp.o snd-sb-common.o
-obj-$(CONFIG_SND_SB16) += snd-sb16.o snd-sb16-dsp.o snd-sb-common.o
-obj-$(CONFIG_SND_SBAWE) += snd-sbawe.o snd-sb16-dsp.o snd-sb-common.o
-obj-$(CONFIG_SND_ES968) += snd-es968.o snd-sb8-dsp.o snd-sb-common.o
-obj-$(CONFIG_SND_ALS4000) += snd-sb-common.o
+obj-$(CONFIG_SND_SB_COMMON) += snd-sb-common.o
+obj-$(CONFIG_SND_SB16_DSP) += snd-sb16-dsp.o
+obj-$(CONFIG_SND_SB8_DSP) += snd-sb8-dsp.o
+obj-$(CONFIG_SND_SB8) += snd-sb8.o
+obj-$(CONFIG_SND_SB16) += snd-sb16.o
+obj-$(CONFIG_SND_SBAWE) += snd-sbawe.o
+obj-$(CONFIG_SND_JAZZ16) += snd-jazz16.o
ifeq ($(CONFIG_SND_SB16_CSP),y)
obj-$(CONFIG_SND_SB16) += snd-sb16-csp.o
obj-$(CONFIG_SND_SBAWE) += snd-sb16-csp.o
endif
-obj-$(call sequencer,$(CONFIG_SND_SBAWE)) += snd-emu8000-synth.o
-
-obj-m := $(sort $(obj-m))
+obj-$(CONFIG_SND_SBAWE_SEQ) += snd-emu8000-synth.o
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c
index c0b8d61b75e..45fcdff611f 100644
--- a/sound/isa/sb/emu8000.c
+++ b/sound/isa/sb/emu8000.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* and (c) 1999 Steve Ratcliffe <steve@parabola.demon.co.uk>
* Copyright (C) 1999-2000 Takashi Iwai <tiwai@suse.de>
*
@@ -20,11 +20,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <sound/driver.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/ioport.h>
+#include <linux/export.h>
#include <linux/delay.h>
#include <sound/core.h>
#include <sound/emu8000.h>
@@ -131,7 +131,7 @@ snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode)
/*
*/
-static void __init
+static void
snd_emu8000_read_wait(struct snd_emu8000 *emu)
{
while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) {
@@ -143,7 +143,7 @@ snd_emu8000_read_wait(struct snd_emu8000 *emu)
/*
*/
-static void __init
+static void
snd_emu8000_write_wait(struct snd_emu8000 *emu)
{
while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
@@ -156,7 +156,7 @@ snd_emu8000_write_wait(struct snd_emu8000 *emu)
/*
* detect a card at the given port
*/
-static int __init
+static int
snd_emu8000_detect(struct snd_emu8000 *emu)
{
/* Initialise */
@@ -182,7 +182,7 @@ snd_emu8000_detect(struct snd_emu8000 *emu)
/*
* intiailize audio channels
*/
-static void __init
+static void
init_audio(struct snd_emu8000 *emu)
{
int ch;
@@ -223,7 +223,7 @@ init_audio(struct snd_emu8000 *emu)
/*
* initialize DMA address
*/
-static void __init
+static void
init_dma(struct snd_emu8000 *emu)
{
EMU8000_SMALR_WRITE(emu, 0);
@@ -235,7 +235,7 @@ init_dma(struct snd_emu8000 *emu)
/*
* initialization arrays; from ADIP
*/
-static unsigned short init1[128] /*__devinitdata*/ = {
+static unsigned short init1[128] = {
0x03ff, 0x0030, 0x07ff, 0x0130, 0x0bff, 0x0230, 0x0fff, 0x0330,
0x13ff, 0x0430, 0x17ff, 0x0530, 0x1bff, 0x0630, 0x1fff, 0x0730,
0x23ff, 0x0830, 0x27ff, 0x0930, 0x2bff, 0x0a30, 0x2fff, 0x0b30,
@@ -257,7 +257,7 @@ static unsigned short init1[128] /*__devinitdata*/ = {
0xf3ff, 0x0c30, 0xf7ff, 0x0d30, 0xfbff, 0x0e30, 0xffff, 0x0f30,
};
-static unsigned short init2[128] /*__devinitdata*/ = {
+static unsigned short init2[128] = {
0x03ff, 0x8030, 0x07ff, 0x8130, 0x0bff, 0x8230, 0x0fff, 0x8330,
0x13ff, 0x8430, 0x17ff, 0x8530, 0x1bff, 0x8630, 0x1fff, 0x8730,
0x23ff, 0x8830, 0x27ff, 0x8930, 0x2bff, 0x8a30, 0x2fff, 0x8b30,
@@ -279,7 +279,7 @@ static unsigned short init2[128] /*__devinitdata*/ = {
0xf3ff, 0x8c30, 0xf7ff, 0x8d30, 0xfbff, 0x8e30, 0xffff, 0x8f30,
};
-static unsigned short init3[128] /*__devinitdata*/ = {
+static unsigned short init3[128] = {
0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5,
0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x8F7C, 0x167E, 0xF254,
0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x8BAA, 0x1B6D, 0xF234,
@@ -301,7 +301,7 @@ static unsigned short init3[128] /*__devinitdata*/ = {
0x1342, 0xD36E, 0x3EC7, 0xB3FF, 0x0000, 0x8365, 0x1420, 0x9570,
};
-static unsigned short init4[128] /*__devinitdata*/ = {
+static unsigned short init4[128] = {
0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5,
0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x0F7C, 0x167E, 0x7254,
0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x0BAA, 0x1B6D, 0x7234,
@@ -327,7 +327,7 @@ static unsigned short init4[128] /*__devinitdata*/ = {
* Taken from the oss driver, not obvious from the doc how this
* is meant to work
*/
-static void __init
+static void
send_array(struct snd_emu8000 *emu, unsigned short *data, int size)
{
int i;
@@ -349,7 +349,7 @@ send_array(struct snd_emu8000 *emu, unsigned short *data, int size)
* Send initialization arrays to start up, this just follows the
* initialisation sequence in the adip.
*/
-static void __init
+static void
init_arrays(struct snd_emu8000 *emu)
{
send_array(emu, init1, ARRAY_SIZE(init1)/4);
@@ -371,19 +371,20 @@ init_arrays(struct snd_emu8000 *emu)
/*
* Size the onboard memory.
- * This is written so as not to need arbitary delays after the write. It
+ * This is written so as not to need arbitrary delays after the write. It
* seems that the only way to do this is to use the one channel and keep
* reallocating between read and write.
*/
-static void __init
+static void
size_dram(struct snd_emu8000 *emu)
{
- int i, size;
+ int i, size, detected_size;
if (emu->dram_checked)
return;
size = 0;
+ detected_size = 0;
/* write out a magic number */
snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE);
@@ -415,8 +416,7 @@ size_dram(struct snd_emu8000 *emu)
/*snd_emu8000_read_wait(emu);*/
EMU8000_SMLD_READ(emu); /* discard stale data */
if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2)
- break; /* we must have wrapped around */
-
+ break; /* no memory at this address */
snd_emu8000_read_wait(emu);
/*
@@ -429,6 +429,18 @@ size_dram(struct snd_emu8000 *emu)
if (EMU8000_SMLD_READ(emu) != UNIQUE_ID1)
break; /* we must have wrapped around */
snd_emu8000_read_wait(emu);
+
+ /* Otherwise, it's valid memory. */
+ detected_size = size + 512 * 1024;
+ }
+
+ /* Distinguish 512 KiB from 0. */
+ if (detected_size == 0) {
+ snd_emu8000_read_wait(emu);
+ EMU8000_SMALR_WRITE(emu, EMU8000_DRAM_OFFSET);
+ EMU8000_SMLD_READ(emu); /* discard stale data */
+ if (EMU8000_SMLD_READ(emu) == UNIQUE_ID1)
+ detected_size = 512 * 1024;
}
/* wait until FULL bit in SMAxW register is false */
@@ -443,9 +455,9 @@ size_dram(struct snd_emu8000 *emu)
snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE);
snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n",
- emu->port1, size/1024);
+ emu->port1, detected_size/1024);
- emu->mem_size = size;
+ emu->mem_size = detected_size;
emu->dram_checked = 1;
}
@@ -500,7 +512,7 @@ snd_emu8000_init_fm(struct snd_emu8000 *emu)
/*
* The main initialization routine.
*/
-static void __init
+static void
snd_emu8000_init_hw(struct snd_emu8000 *emu)
{
int i;
@@ -1019,12 +1031,13 @@ static struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = {
/*
* create and attach mixer elements for WaveTable treble/bass controls
*/
-static int __init
+static int
snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu)
{
int i, err = 0;
- snd_assert(emu != NULL && card != NULL, return -EINVAL);
+ if (snd_BUG_ON(!emu || !card))
+ return -EINVAL;
spin_lock_init(&emu->control_lock);
@@ -1069,7 +1082,7 @@ static int snd_emu8000_dev_free(struct snd_device *device)
/*
* initialize and register emu8000 synth device.
*/
-int __init
+int
snd_emu8000_new(struct snd_card *card, int index, long port, int seq_ports,
struct snd_seq_device **awe_ret)
{
diff --git a/sound/isa/sb/emu8000_callback.c b/sound/isa/sb/emu8000_callback.c
index 9a3c71cc2e0..72a9ac5efb4 100644
--- a/sound/isa/sb/emu8000_callback.c
+++ b/sound/isa/sb/emu8000_callback.c
@@ -20,6 +20,7 @@
*/
#include "emu8000_local.h"
+#include <linux/export.h>
#include <sound/asoundef.h>
/*
@@ -174,7 +175,7 @@ get_voice(struct snd_emux *emu, struct snd_emux_port *port)
hw = emu->hw;
for (i = 0; i < END; i++) {
- best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */;
+ best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */
best[i].voice = -1;
}
diff --git a/sound/isa/sb/emu8000_local.h b/sound/isa/sb/emu8000_local.h
index 2ac77f10bb4..7e87c349272 100644
--- a/sound/isa/sb/emu8000_local.h
+++ b/sound/isa/sb/emu8000_local.h
@@ -21,7 +21,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <sound/driver.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/slab.h>
diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c
index 80b1cf84a1a..c99c6078be3 100644
--- a/sound/isa/sb/emu8000_patch.c
+++ b/sound/isa/sb/emu8000_patch.c
@@ -23,7 +23,7 @@
#include <asm/uaccess.h>
#include <linux/moduleparam.h>
-static int emu8000_reset_addr = 0;
+static int emu8000_reset_addr;
module_param(emu8000_reset_addr, int, 0444);
MODULE_PARM_DESC(emu8000_reset_addr, "reset write address at each time (makes slowdown)");
@@ -156,7 +156,8 @@ snd_emu8000_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
struct snd_emu8000 *emu;
emu = rec->hw;
- snd_assert(sp != NULL, return -EINVAL);
+ if (snd_BUG_ON(!sp))
+ return -EINVAL;
if (sp->v.size == 0)
return 0;
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c
index 91dc3d83e2c..2f85c66f8e3 100644
--- a/sound/isa/sb/emu8000_pcm.c
+++ b/sound/isa/sb/emu8000_pcm.c
@@ -20,6 +20,7 @@
#include "emu8000_local.h"
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/initval.h>
#include <sound/pcm.h>
@@ -432,7 +433,8 @@ static int emu8k_transfer_block(struct snd_emu8000 *emu, int offset, unsigned sh
while (count > 0) {
unsigned short sval;
CHECK_SCHEDULER();
- get_user(sval, buf);
+ if (get_user(sval, buf))
+ return -EFAULT;
EMU8000_SMLD_WRITE(emu, sval);
buf++;
count--;
@@ -524,12 +526,14 @@ static int emu8k_pcm_copy(struct snd_pcm_substream *subs,
while (count-- > 0) {
unsigned short sval;
CHECK_SCHEDULER();
- get_user(sval, buf);
+ if (get_user(sval, buf))
+ return -EFAULT;
EMU8000_SMLD_WRITE(emu, sval);
buf++;
if (rec->voices > 1) {
CHECK_SCHEDULER();
- get_user(sval, buf);
+ if (get_user(sval, buf))
+ return -EFAULT;
EMU8000_SMRD_WRITE(emu, sval);
buf++;
}
diff --git a/sound/isa/sb/emu8000_synth.c b/sound/isa/sb/emu8000_synth.c
index 3d72742b342..4e3fcfb15ad 100644
--- a/sound/isa/sb/emu8000_synth.c
+++ b/sound/isa/sb/emu8000_synth.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* and (c) 1999 Steve Ratcliffe <steve@parabola.demon.co.uk>
* Copyright (C) 1999-2000 Takashi Iwai <tiwai@suse.de>
*
@@ -22,6 +22,7 @@
#include "emu8000_local.h"
#include <linux/init.h>
+#include <linux/module.h>
#include <sound/initval.h>
MODULE_AUTHOR("Takashi Iwai, Steve Ratcliffe");
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c
deleted file mode 100644
index 9da80bfa302..00000000000
--- a/sound/isa/sb/es968.c
+++ /dev/null
@@ -1,266 +0,0 @@
-
-/*
- card-es968.c - driver for ESS AudioDrive ES968 based soundcards.
- Copyright (C) 1999 by Massimo Piccioni <dafastidio@libero.it>
-
- Thanks to Pierfrancesco 'qM2' Passerini.
-
- 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
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <sound/driver.h>
-#include <linux/init.h>
-#include <linux/time.h>
-#include <linux/pnp.h>
-#include <linux/moduleparam.h>
-#include <sound/core.h>
-#include <sound/initval.h>
-#include <sound/sb.h>
-
-#define PFX "es968: "
-
-MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
-MODULE_DESCRIPTION("ESS AudioDrive ES968");
-MODULE_LICENSE("GPL");
-MODULE_SUPPORTED_DEVICE("{{ESS,AudioDrive ES968}}");
-
-static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
-static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
-static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
-static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* Pnp setup */
-static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* PnP setup */
-
-module_param_array(index, int, NULL, 0444);
-MODULE_PARM_DESC(index, "Index value for es968 based soundcard.");
-module_param_array(id, charp, NULL, 0444);
-MODULE_PARM_DESC(id, "ID string for es968 based soundcard.");
-module_param_array(enable, bool, NULL, 0444);
-MODULE_PARM_DESC(enable, "Enable es968 based soundcard.");
-module_param_array(port, long, NULL, 0444);
-MODULE_PARM_DESC(port, "Port # for es968 driver.");
-module_param_array(irq, int, NULL, 0444);
-MODULE_PARM_DESC(irq, "IRQ # for es968 driver.");
-module_param_array(dma8, int, NULL, 0444);
-MODULE_PARM_DESC(dma8, "8-bit DMA # for es968 driver.");
-
-struct snd_card_es968 {
- struct pnp_dev *dev;
- struct snd_sb *chip;
-};
-
-static struct pnp_card_device_id snd_es968_pnpids[] = {
- { .id = "ESS0968", .devs = { { "@@@0968" }, } },
- { .id = "", } /* end */
-};
-
-MODULE_DEVICE_TABLE(pnp_card, snd_es968_pnpids);
-
-#define DRIVER_NAME "snd-card-es968"
-
-static irqreturn_t snd_card_es968_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
-{
- struct snd_sb *chip = dev_id;
-
- if (chip->open & SB_OPEN_PCM) {
- return snd_sb8dsp_interrupt(chip);
- } else {
- return snd_sb8dsp_midi_interrupt(chip);
- }
-}
-
-static int __devinit snd_card_es968_pnp(int dev, struct snd_card_es968 *acard,
- struct pnp_card_link *card,
- const struct pnp_card_device_id *id)
-{
- struct pnp_dev *pdev;
- struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
- int err;
- if (!cfg)
- return -ENOMEM;
- acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
- if (acard->dev == NULL) {
- kfree(cfg);
- return -ENODEV;
- }
-
- pdev = acard->dev;
-
- pnp_init_resource_table(cfg);
-
- /* override resources */
- if (port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[0], port[dev], 16);
- if (dma8[dev] != SNDRV_AUTO_DMA)
- pnp_resource_change(&cfg->dma_resource[0], dma8[dev], 1);
- if (irq[dev] != SNDRV_AUTO_IRQ)
- pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
- if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
- snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
- err = pnp_activate_dev(pdev);
- if (err < 0) {
- snd_printk(KERN_ERR PFX "AUDIO pnp configure failure\n");
- kfree(cfg);
- return err;
- }
- port[dev] = pnp_port_start(pdev, 0);
- dma8[dev] = pnp_dma(pdev, 1);
- irq[dev] = pnp_irq(pdev, 0);
-
- kfree(cfg);
- return 0;
-}
-
-static int __init snd_card_es968_probe(int dev,
- struct pnp_card_link *pcard,
- const struct pnp_card_device_id *pid)
-{
- int error;
- struct snd_sb *chip;
- struct snd_card *card;
- struct snd_card_es968 *acard;
-
- if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
- sizeof(struct snd_card_es968))) == NULL)
- return -ENOMEM;
- acard = card->private_data;
- if ((error = snd_card_es968_pnp(dev, acard, pcard, pid))) {
- snd_card_free(card);
- return error;
- }
- snd_card_set_dev(card, &pcard->card->dev);
-
- if ((error = snd_sbdsp_create(card, port[dev],
- irq[dev],
- snd_card_es968_interrupt,
- dma8[dev],
- -1,
- SB_HW_AUTO, &chip)) < 0) {
- snd_card_free(card);
- return error;
- }
- acard->chip = chip;
-
- if ((error = snd_sb8dsp_pcm(chip, 0, NULL)) < 0) {
- snd_card_free(card);
- return error;
- }
-
- if ((error = snd_sbmixer_new(chip)) < 0) {
- snd_card_free(card);
- return error;
- }
-
- if ((error = snd_sb8dsp_midi(chip, 0, NULL)) < 0) {
- snd_card_free(card);
- return error;
- }
-
- strcpy(card->driver, "ES968");
- strcpy(card->shortname, "ESS ES968");
- sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d",
- card->shortname, chip->name, chip->port, irq[dev], dma8[dev]);
-
- if ((error = snd_card_register(card)) < 0) {
- snd_card_free(card);
- return error;
- }
- pnp_set_card_drvdata(pcard, card);
- return 0;
-}
-
-static int __devinit snd_es968_pnp_detect(struct pnp_card_link *card,
- const struct pnp_card_device_id *id)
-{
- static int dev;
- int res;
-
- for ( ; dev < SNDRV_CARDS; dev++) {
- if (!enable[dev])
- continue;
- res = snd_card_es968_probe(dev, card, id);
- if (res < 0)
- return res;
- dev++;
- return 0;
- }
- return -ENODEV;
-}
-
-static void __devexit snd_es968_pnp_remove(struct pnp_card_link * pcard)
-{
- snd_card_free(pnp_get_card_drvdata(pcard));
- pnp_set_card_drvdata(pcard, NULL);
-}
-
-#ifdef CONFIG_PM
-static int snd_es968_pnp_suspend(struct pnp_card_link *pcard, pm_message_t state)
-{
- struct snd_card *card = pnp_get_card_drvdata(pcard);
- struct snd_card_es968 *acard = card->private_data;
- struct snd_sb *chip = acard->chip;
-
- snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
- snd_pcm_suspend_all(chip->pcm);
- snd_sbmixer_suspend(chip);
- return 0;
-}
-
-static int snd_es968_pnp_resume(struct pnp_card_link *pcard)
-{
- struct snd_card *card = pnp_get_card_drvdata(pcard);
- struct snd_card_es968 *acard = card->private_data;
- struct snd_sb *chip = acard->chip;
-
- snd_sbdsp_reset(chip);
- snd_sbmixer_resume(chip);
- snd_power_change_state(card, SNDRV_CTL_POWER_D0);
- return 0;
-}
-#endif
-
-static struct pnp_card_driver es968_pnpc_driver = {
- .flags = PNP_DRIVER_RES_DISABLE,
- .name = "es968",
- .id_table = snd_es968_pnpids,
- .probe = snd_es968_pnp_detect,
- .remove = __devexit_p(snd_es968_pnp_remove),
-#ifdef CONFIG_PM
- .suspend = snd_es968_pnp_suspend,
- .resume = snd_es968_pnp_resume,
-#endif
-};
-
-static int __init alsa_card_es968_init(void)
-{
- int cards = pnp_register_card_driver(&es968_pnpc_driver);
- if (cards <= 0) {
- pnp_unregister_card_driver(&es968_pnpc_driver);
-#ifdef MODULE
- snd_printk(KERN_ERR "no ES968 based soundcards found\n");
-#endif
- return -ENODEV;
- }
- return 0;
-}
-
-static void __exit alsa_card_es968_exit(void)
-{
- pnp_unregister_card_driver(&es968_pnpc_driver);
-}
-
-module_init(alsa_card_es968_init)
-module_exit(alsa_card_es968_exit)
diff --git a/sound/isa/sb/jazz16.c b/sound/isa/sb/jazz16.c
new file mode 100644
index 00000000000..90d2eba549e
--- /dev/null
+++ b/sound/isa/sb/jazz16.c
@@ -0,0 +1,401 @@
+
+/*
+ * jazz16.c - driver for Media Vision Jazz16 based soundcards.
+ * Copyright (C) 2009 Krzysztof Helt <krzysztof.h1@wp.pl>
+ * Based on patches posted by Rask Ingemann Lambertsen and Rene Herman.
+ * Based on OSS Sound Blaster driver.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive for
+ * more details.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <asm/dma.h>
+#include <linux/isa.h>
+#include <sound/core.h>
+#include <sound/mpu401.h>
+#include <sound/opl3.h>
+#include <sound/sb.h>
+#define SNDRV_LEGACY_FIND_FREE_IRQ
+#define SNDRV_LEGACY_FIND_FREE_DMA
+#include <sound/initval.h>
+
+#define PFX "jazz16: "
+
+MODULE_DESCRIPTION("Media Vision Jazz16");
+MODULE_SUPPORTED_DEVICE("{{Media Vision ??? },"
+ "{RTL,RTL3000}}");
+
+MODULE_AUTHOR("Krzysztof Helt <krzysztof.h1@wp.pl>");
+MODULE_LICENSE("GPL");
+
+static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
+static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
+static unsigned long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
+static unsigned long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
+static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
+static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
+static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
+static int dma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
+
+module_param_array(index, int, NULL, 0444);
+MODULE_PARM_DESC(index, "Index value for Media Vision Jazz16 based soundcard.");
+module_param_array(id, charp, NULL, 0444);
+MODULE_PARM_DESC(id, "ID string for Media Vision Jazz16 based soundcard.");
+module_param_array(enable, bool, NULL, 0444);
+MODULE_PARM_DESC(enable, "Enable Media Vision Jazz16 based soundcard.");
+module_param_array(port, long, NULL, 0444);
+MODULE_PARM_DESC(port, "Port # for jazz16 driver.");
+module_param_array(mpu_port, long, NULL, 0444);
+MODULE_PARM_DESC(mpu_port, "MPU-401 port # for jazz16 driver.");
+module_param_array(irq, int, NULL, 0444);
+MODULE_PARM_DESC(irq, "IRQ # for jazz16 driver.");
+module_param_array(mpu_irq, int, NULL, 0444);
+MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for jazz16 driver.");
+module_param_array(dma8, int, NULL, 0444);
+MODULE_PARM_DESC(dma8, "DMA8 # for jazz16 driver.");
+module_param_array(dma16, int, NULL, 0444);
+MODULE_PARM_DESC(dma16, "DMA16 # for jazz16 driver.");
+
+#define SB_JAZZ16_WAKEUP 0xaf
+#define SB_JAZZ16_SET_PORTS 0x50
+#define SB_DSP_GET_JAZZ_BRD_REV 0xfa
+#define SB_JAZZ16_SET_DMAINTR 0xfb
+#define SB_DSP_GET_JAZZ_MODEL 0xfe
+
+struct snd_card_jazz16 {
+ struct snd_sb *chip;
+};
+
+static irqreturn_t jazz16_interrupt(int irq, void *chip)
+{
+ return snd_sb8dsp_interrupt(chip);
+}
+
+static int jazz16_configure_ports(unsigned long port,
+ unsigned long mpu_port, int idx)
+{
+ unsigned char val;
+
+ if (!request_region(0x201, 1, "jazz16 config")) {
+ snd_printk(KERN_ERR "config port region is already in use.\n");
+ return -EBUSY;
+ }
+ outb(SB_JAZZ16_WAKEUP - idx, 0x201);
+ udelay(100);
+ outb(SB_JAZZ16_SET_PORTS + idx, 0x201);
+ udelay(100);
+ val = port & 0x70;
+ val |= (mpu_port & 0x30) >> 4;
+ outb(val, 0x201);
+
+ release_region(0x201, 1);
+ return 0;
+}
+
+static int jazz16_detect_board(unsigned long port,
+ unsigned long mpu_port)
+{
+ int err;
+ int val;
+ struct snd_sb chip;
+
+ if (!request_region(port, 0x10, "jazz16")) {
+ snd_printk(KERN_ERR "I/O port region is already in use.\n");
+ return -EBUSY;
+ }
+ /* just to call snd_sbdsp_command/reset/get_byte() */
+ chip.port = port;
+
+ err = snd_sbdsp_reset(&chip);
+ if (err < 0)
+ for (val = 0; val < 4; val++) {
+ err = jazz16_configure_ports(port, mpu_port, val);
+ if (err < 0)
+ break;
+
+ err = snd_sbdsp_reset(&chip);
+ if (!err)
+ break;
+ }
+ if (err < 0) {
+ err = -ENODEV;
+ goto err_unmap;
+ }
+ if (!snd_sbdsp_command(&chip, SB_DSP_GET_JAZZ_BRD_REV)) {
+ err = -EBUSY;
+ goto err_unmap;
+ }
+ val = snd_sbdsp_get_byte(&chip);
+ if (val >= 0x30)
+ snd_sbdsp_get_byte(&chip);
+
+ if ((val & 0xf0) != 0x10) {
+ err = -ENODEV;
+ goto err_unmap;
+ }
+ if (!snd_sbdsp_command(&chip, SB_DSP_GET_JAZZ_MODEL)) {
+ err = -EBUSY;
+ goto err_unmap;
+ }
+ snd_sbdsp_get_byte(&chip);
+ err = snd_sbdsp_get_byte(&chip);
+ snd_printd("Media Vision Jazz16 board detected: rev 0x%x, model 0x%x\n",
+ val, err);
+
+ err = 0;
+
+err_unmap:
+ release_region(port, 0x10);
+ return err;
+}
+
+static int jazz16_configure_board(struct snd_sb *chip, int mpu_irq)
+{
+ static unsigned char jazz_irq_bits[] = { 0, 0, 2, 3, 0, 1, 0, 4,
+ 0, 2, 5, 0, 0, 0, 0, 6 };
+ static unsigned char jazz_dma_bits[] = { 0, 1, 0, 2, 0, 3, 0, 4 };
+
+ if (jazz_dma_bits[chip->dma8] == 0 ||
+ jazz_dma_bits[chip->dma16] == 0 ||
+ jazz_irq_bits[chip->irq] == 0)
+ return -EINVAL;
+
+ if (!snd_sbdsp_command(chip, SB_JAZZ16_SET_DMAINTR))
+ return -EBUSY;
+
+ if (!snd_sbdsp_command(chip,
+ jazz_dma_bits[chip->dma8] |
+ (jazz_dma_bits[chip->dma16] << 4)))
+ return -EBUSY;
+
+ if (!snd_sbdsp_command(chip,
+ jazz_irq_bits[chip->irq] |
+ (jazz_irq_bits[mpu_irq] << 4)))
+ return -EBUSY;
+
+ return 0;
+}
+
+static int snd_jazz16_match(struct device *devptr, unsigned int dev)
+{
+ if (!enable[dev])
+ return 0;
+ if (port[dev] == SNDRV_AUTO_PORT) {
+ snd_printk(KERN_ERR "please specify port\n");
+ return 0;
+ } else if (port[dev] == 0x200 || (port[dev] & ~0x270)) {
+ snd_printk(KERN_ERR "incorrect port specified\n");
+ return 0;
+ }
+ if (dma8[dev] != SNDRV_AUTO_DMA &&
+ dma8[dev] != 1 && dma8[dev] != 3) {
+ snd_printk(KERN_ERR "dma8 must be 1 or 3\n");
+ return 0;
+ }
+ if (dma16[dev] != SNDRV_AUTO_DMA &&
+ dma16[dev] != 5 && dma16[dev] != 7) {
+ snd_printk(KERN_ERR "dma16 must be 5 or 7\n");
+ return 0;
+ }
+ if (mpu_port[dev] != SNDRV_AUTO_PORT &&
+ (mpu_port[dev] & ~0x030) != 0x300) {
+ snd_printk(KERN_ERR "incorrect mpu_port specified\n");
+ return 0;
+ }
+ if (mpu_irq[dev] != SNDRV_AUTO_DMA &&
+ mpu_irq[dev] != 2 && mpu_irq[dev] != 3 &&
+ mpu_irq[dev] != 5 && mpu_irq[dev] != 7) {
+ snd_printk(KERN_ERR "mpu_irq must be 2, 3, 5 or 7\n");
+ return 0;
+ }
+ return 1;
+}
+
+static int snd_jazz16_probe(struct device *devptr, unsigned int dev)
+{
+ struct snd_card *card;
+ struct snd_card_jazz16 *jazz16;
+ struct snd_sb *chip;
+ struct snd_opl3 *opl3;
+ static int possible_irqs[] = {2, 3, 5, 7, 9, 10, 15, -1};
+ static int possible_dmas8[] = {1, 3, -1};
+ static int possible_dmas16[] = {5, 7, -1};
+ int err, xirq, xdma8, xdma16, xmpu_port, xmpu_irq;
+
+ err = snd_card_new(devptr, index[dev], id[dev], THIS_MODULE,
+ sizeof(struct snd_card_jazz16), &card);
+ if (err < 0)
+ return err;
+
+ jazz16 = card->private_data;
+
+ xirq = irq[dev];
+ if (xirq == SNDRV_AUTO_IRQ) {
+ xirq = snd_legacy_find_free_irq(possible_irqs);
+ if (xirq < 0) {
+ snd_printk(KERN_ERR "unable to find a free IRQ\n");
+ err = -EBUSY;
+ goto err_free;
+ }
+ }
+ xdma8 = dma8[dev];
+ if (xdma8 == SNDRV_AUTO_DMA) {
+ xdma8 = snd_legacy_find_free_dma(possible_dmas8);
+ if (xdma8 < 0) {
+ snd_printk(KERN_ERR "unable to find a free DMA8\n");
+ err = -EBUSY;
+ goto err_free;
+ }
+ }
+ xdma16 = dma16[dev];
+ if (xdma16 == SNDRV_AUTO_DMA) {
+ xdma16 = snd_legacy_find_free_dma(possible_dmas16);
+ if (xdma16 < 0) {
+ snd_printk(KERN_ERR "unable to find a free DMA16\n");
+ err = -EBUSY;
+ goto err_free;
+ }
+ }
+
+ xmpu_port = mpu_port[dev];
+ if (xmpu_port == SNDRV_AUTO_PORT)
+ xmpu_port = 0;
+ err = jazz16_detect_board(port[dev], xmpu_port);
+ if (err < 0) {
+ printk(KERN_ERR "Media Vision Jazz16 board not detected\n");
+ goto err_free;
+ }
+ err = snd_sbdsp_create(card, port[dev], irq[dev],
+ jazz16_interrupt,
+ dma8[dev], dma16[dev],
+ SB_HW_JAZZ16,
+ &chip);
+ if (err < 0)
+ goto err_free;
+
+ xmpu_irq = mpu_irq[dev];
+ if (xmpu_irq == SNDRV_AUTO_IRQ || mpu_port[dev] == SNDRV_AUTO_PORT)
+ xmpu_irq = 0;
+ err = jazz16_configure_board(chip, xmpu_irq);
+ if (err < 0) {
+ printk(KERN_ERR "Media Vision Jazz16 configuration failed\n");
+ goto err_free;
+ }
+
+ jazz16->chip = chip;
+
+ strcpy(card->driver, "jazz16");
+ strcpy(card->shortname, "Media Vision Jazz16");
+ sprintf(card->longname,
+ "Media Vision Jazz16 at 0x%lx, irq %d, dma8 %d, dma16 %d",
+ port[dev], xirq, xdma8, xdma16);
+
+ err = snd_sb8dsp_pcm(chip, 0, NULL);
+ if (err < 0)
+ goto err_free;
+ err = snd_sbmixer_new(chip);
+ if (err < 0)
+ goto err_free;
+
+ err = snd_opl3_create(card, chip->port, chip->port + 2,
+ OPL3_HW_AUTO, 1, &opl3);
+ if (err < 0)
+ snd_printk(KERN_WARNING "no OPL device at 0x%lx-0x%lx\n",
+ chip->port, chip->port + 2);
+ else {
+ err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
+ if (err < 0)
+ goto err_free;
+ }
+ if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
+ if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
+ mpu_irq[dev] = -1;
+
+ if (snd_mpu401_uart_new(card, 0,
+ MPU401_HW_MPU401,
+ mpu_port[dev], 0,
+ mpu_irq[dev],
+ NULL) < 0)
+ snd_printk(KERN_ERR "no MPU-401 device at 0x%lx\n",
+ mpu_port[dev]);
+ }
+
+ err = snd_card_register(card);
+ if (err < 0)
+ goto err_free;
+
+ dev_set_drvdata(devptr, card);
+ return 0;
+
+err_free:
+ snd_card_free(card);
+ return err;
+}
+
+static int snd_jazz16_remove(struct device *devptr, unsigned int dev)
+{
+ struct snd_card *card = dev_get_drvdata(devptr);
+
+ snd_card_free(card);
+ return 0;
+}
+
+#ifdef CONFIG_PM
+static int snd_jazz16_suspend(struct device *pdev, unsigned int n,
+ pm_message_t state)
+{
+ struct snd_card *card = dev_get_drvdata(pdev);
+ struct snd_card_jazz16 *acard = card->private_data;
+ struct snd_sb *chip = acard->chip;
+
+ snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+ snd_pcm_suspend_all(chip->pcm);
+ snd_sbmixer_suspend(chip);
+ return 0;
+}
+
+static int snd_jazz16_resume(struct device *pdev, unsigned int n)
+{
+ struct snd_card *card = dev_get_drvdata(pdev);
+ struct snd_card_jazz16 *acard = card->private_data;
+ struct snd_sb *chip = acard->chip;
+
+ snd_sbdsp_reset(chip);
+ snd_sbmixer_resume(chip);
+ snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+ return 0;
+}
+#endif
+
+static struct isa_driver snd_jazz16_driver = {
+ .match = snd_jazz16_match,
+ .probe = snd_jazz16_probe,
+ .remove = snd_jazz16_remove,
+#ifdef CONFIG_PM
+ .suspend = snd_jazz16_suspend,
+ .resume = snd_jazz16_resume,
+#endif
+ .driver = {
+ .name = "jazz16"
+ },
+};
+
+static int __init alsa_card_jazz16_init(void)
+{
+ return isa_register_driver(&snd_jazz16_driver, SNDRV_CARDS);
+}
+
+static void __exit alsa_card_jazz16_exit(void)
+{
+ isa_unregister_driver(&snd_jazz16_driver);
+}
+
+module_init(alsa_card_jazz16_init)
+module_exit(alsa_card_jazz16_exit)
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index c0be7a5a342..3f694543a7e 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -1,6 +1,6 @@
/*
* Driver for SoundBlaster 16/AWE32/AWE64 soundcards
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,14 +19,12 @@
*
*/
-#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
-#include <linux/slab.h>
#include <linux/pnp.h>
#include <linux/err.h>
-#include <linux/platform_device.h>
-#include <linux/moduleparam.h>
+#include <linux/isa.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/sb16_csp.h>
@@ -44,7 +42,7 @@
#define PFX "sb16: "
#endif
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_LICENSE("GPL");
#ifndef SNDRV_SBAWE
MODULE_DESCRIPTION("Sound Blaster 16");
@@ -70,9 +68,9 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32},"
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
#ifdef CONFIG_PNP
-static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
+static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
#endif
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */
static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */
@@ -85,7 +83,7 @@ static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3 */
static int dma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 5,6,7 */
static int mic_agc[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
#ifdef CONFIG_SND_SB16_CSP
-static int csp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int csp[SNDRV_CARDS];
#endif
#ifdef SNDRV_SBAWE_EMU8000
static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
@@ -128,8 +126,8 @@ module_param_array(seq_ports, int, NULL, 0444);
MODULE_PARM_DESC(seq_ports, "Number of sequencer ports for WaveTable synth.");
#endif
-static struct platform_device *platform_devices[SNDRV_CARDS];
#ifdef CONFIG_PNP
+static int isa_registered;
static int pnp_registered;
#endif
@@ -179,6 +177,8 @@ static struct pnp_card_device_id snd_sb16_pnpids[] = {
{ .id = "CTL0086", .devs = { { "CTL0041" } } },
/* Sound Blaster Vibra16X */
{ .id = "CTL00f0", .devs = { { "CTL0043" } } },
+ /* Sound Blaster 16 (Virtual PC 2004) */
+ { .id = "tBA03b0", .devs = { {.id="PNPb003" } } },
#else /* SNDRV_SBAWE defined */
/* Sound Blaster AWE 32 PnP */
{ .id = "CTL0035", .devs = { { "CTL0031" }, { "CTL0021" } } },
@@ -235,8 +235,6 @@ static struct pnp_card_device_id snd_sb16_pnpids[] = {
{ .id = "CTLXXXX" , .devs = { { "CTL0044" }, { "CTL0023" } } },
{ .id = "CTLXXXX" , .devs = { { "CTL0045" }, { "CTL0022" } } },
#endif /* SNDRV_SBAWE */
- /* Sound Blaster 16 PnP (Virtual PC 2004)*/
- { .id = "tBA03b0", .devs = { { "PNPb003" } } },
{ .id = "", }
};
@@ -252,49 +250,26 @@ MODULE_DEVICE_TABLE(pnp_card, snd_sb16_pnpids);
#ifdef CONFIG_PNP
-static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard,
- struct pnp_card_link *card,
- const struct pnp_card_device_id *id)
+static int snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard,
+ struct pnp_card_link *card,
+ const struct pnp_card_device_id *id)
{
struct pnp_dev *pdev;
- struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
int err;
- if (!cfg)
- return -ENOMEM;
acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
- if (acard->dev == NULL) {
- kfree(cfg);
+ if (acard->dev == NULL)
return -ENODEV;
- }
+
#ifdef SNDRV_SBAWE_EMU8000
acard->devwt = pnp_request_card_device(card, id->devs[1].id, acard->dev);
#endif
/* Audio initialization */
pdev = acard->dev;
- pnp_init_resource_table(cfg);
-
- /* override resources */
-
- if (port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[0], port[dev], 16);
- if (mpu_port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[1], mpu_port[dev], 2);
- if (fm_port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[2], fm_port[dev], 4);
- if (dma8[dev] != SNDRV_AUTO_DMA)
- pnp_resource_change(&cfg->dma_resource[0], dma8[dev], 1);
- if (dma16[dev] != SNDRV_AUTO_DMA)
- pnp_resource_change(&cfg->dma_resource[1], dma16[dev], 1);
- if (irq[dev] != SNDRV_AUTO_IRQ)
- pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
- if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
- snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev);
if (err < 0) {
snd_printk(KERN_ERR PFX "AUDIO pnp configure failure\n");
- kfree(cfg);
return err;
}
port[dev] = pnp_port_start(pdev, 0);
@@ -311,23 +286,13 @@ static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard,
/* WaveTable initialization */
pdev = acard->devwt;
if (pdev != NULL) {
- pnp_init_resource_table(cfg);
-
- /* override resources */
-
- if (awe_port[dev] != SNDRV_AUTO_PORT) {
- pnp_resource_change(&cfg->port_resource[0], awe_port[dev], 4);
- pnp_resource_change(&cfg->port_resource[1], awe_port[dev] + 0x400, 4);
- pnp_resource_change(&cfg->port_resource[2], awe_port[dev] + 0x800, 4);
- }
- if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
- snd_printk(KERN_ERR PFX "WaveTable the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev);
if (err < 0) {
goto __wt_error;
}
awe_port[dev] = pnp_port_start(pdev, 0);
- snd_printdd("pnp SB16: wavetable port=0x%lx\n", pnp_port_start(pdev, 0));
+ snd_printdd("pnp SB16: wavetable port=0x%llx\n",
+ (unsigned long long)pnp_port_start(pdev, 0));
} else {
__wt_error:
if (pdev) {
@@ -338,7 +303,6 @@ __wt_error:
awe_port[dev] = -1;
}
#endif
- kfree(cfg);
return 0;
}
@@ -359,17 +323,22 @@ static void snd_sb16_free(struct snd_card *card)
#define is_isapnp_selected(dev) 0
#endif
-static struct snd_card *snd_sb16_card_new(int dev)
+static int snd_sb16_card_new(struct device *devptr, int dev,
+ struct snd_card **cardp)
{
- struct snd_card *card = snd_card_new(index[dev], id[dev], THIS_MODULE,
- sizeof(struct snd_card_sb16));
- if (card == NULL)
- return NULL;
+ struct snd_card *card;
+ int err;
+
+ err = snd_card_new(devptr, index[dev], id[dev], THIS_MODULE,
+ sizeof(struct snd_card_sb16), &card);
+ if (err < 0)
+ return err;
card->private_free = snd_sb16_free;
- return card;
+ *cardp = card;
+ return 0;
}
-static int __init snd_sb16_probe(struct snd_card *card, int dev)
+static int snd_sb16_probe(struct snd_card *card, int dev)
{
int xirq, xdma8, xdma16;
struct snd_sb *chip;
@@ -426,8 +395,9 @@ static int __init snd_sb16_probe(struct snd_card *card, int dev)
if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SB,
- chip->mpu_port, 0,
- xirq, 0, &chip->rmidi)) < 0)
+ chip->mpu_port,
+ MPU401_INFO_IRQ_HOOK, -1,
+ &chip->rmidi)) < 0)
return err;
chip->rmidi_callback = snd_mpu401_uart_interrupt;
}
@@ -518,15 +488,15 @@ static int snd_sb16_resume(struct snd_card *card)
}
#endif
-static int __init snd_sb16_nonpnp_probe1(int dev, struct platform_device *devptr)
+static int snd_sb16_isa_probe1(int dev, struct device *pdev)
{
struct snd_card_sb16 *acard;
struct snd_card *card;
int err;
- card = snd_sb16_card_new(dev);
- if (! card)
- return -ENOMEM;
+ err = snd_sb16_card_new(pdev, dev, &card);
+ if (err < 0)
+ return err;
acard = card->private_data;
/* non-PnP FM port address is hardwired with base port address */
@@ -538,19 +508,22 @@ static int __init snd_sb16_nonpnp_probe1(int dev, struct platform_device *devptr
awe_port[dev] = port[dev] + 0x400;
#endif
- snd_card_set_dev(card, &devptr->dev);
if ((err = snd_sb16_probe(card, dev)) < 0) {
snd_card_free(card);
return err;
}
- platform_set_drvdata(devptr, card);
+ dev_set_drvdata(pdev, card);
return 0;
}
-static int __init snd_sb16_nonpnp_probe(struct platform_device *pdev)
+static int snd_sb16_isa_match(struct device *pdev, unsigned int dev)
+{
+ return enable[dev] && !is_isapnp_selected(dev);
+}
+
+static int snd_sb16_isa_probe(struct device *pdev, unsigned int dev)
{
- int dev = pdev->id;
int err;
static int possible_irqs[] = {5, 9, 10, 7, -1};
static int possible_dmas8[] = {1, 3, 0, -1};
@@ -576,13 +549,13 @@ static int __init snd_sb16_nonpnp_probe(struct platform_device *pdev)
}
if (port[dev] != SNDRV_AUTO_PORT)
- return snd_sb16_nonpnp_probe1(dev, pdev);
+ return snd_sb16_isa_probe1(dev, pdev);
else {
static int possible_ports[] = {0x220, 0x240, 0x260, 0x280};
int i;
for (i = 0; i < ARRAY_SIZE(possible_ports); i++) {
port[dev] = possible_ports[i];
- err = snd_sb16_nonpnp_probe1(dev, pdev);
+ err = snd_sb16_isa_probe1(dev, pdev);
if (! err)
return 0;
}
@@ -590,48 +563,48 @@ static int __init snd_sb16_nonpnp_probe(struct platform_device *pdev)
}
}
-static int __devexit snd_sb16_nonpnp_remove(struct platform_device *devptr)
+static int snd_sb16_isa_remove(struct device *pdev, unsigned int dev)
{
- snd_card_free(platform_get_drvdata(devptr));
- platform_set_drvdata(devptr, NULL);
+ snd_card_free(dev_get_drvdata(pdev));
return 0;
}
#ifdef CONFIG_PM
-static int snd_sb16_nonpnp_suspend(struct platform_device *dev, pm_message_t state)
+static int snd_sb16_isa_suspend(struct device *dev, unsigned int n,
+ pm_message_t state)
{
- return snd_sb16_suspend(platform_get_drvdata(dev), state);
+ return snd_sb16_suspend(dev_get_drvdata(dev), state);
}
-static int snd_sb16_nonpnp_resume(struct platform_device *dev)
+static int snd_sb16_isa_resume(struct device *dev, unsigned int n)
{
- return snd_sb16_resume(platform_get_drvdata(dev));
+ return snd_sb16_resume(dev_get_drvdata(dev));
}
#endif
#ifdef SNDRV_SBAWE
-#define SND_SB16_DRIVER "snd_sbawe"
+#define DEV_NAME "sbawe"
#else
-#define SND_SB16_DRIVER "snd_sb16"
+#define DEV_NAME "sb16"
#endif
-static struct platform_driver snd_sb16_nonpnp_driver = {
- .probe = snd_sb16_nonpnp_probe,
- .remove = __devexit_p(snd_sb16_nonpnp_remove),
+static struct isa_driver snd_sb16_isa_driver = {
+ .match = snd_sb16_isa_match,
+ .probe = snd_sb16_isa_probe,
+ .remove = snd_sb16_isa_remove,
#ifdef CONFIG_PM
- .suspend = snd_sb16_nonpnp_suspend,
- .resume = snd_sb16_nonpnp_resume,
+ .suspend = snd_sb16_isa_suspend,
+ .resume = snd_sb16_isa_resume,
#endif
.driver = {
- .name = SND_SB16_DRIVER
+ .name = DEV_NAME
},
};
#ifdef CONFIG_PNP
-
-static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard,
- const struct pnp_card_device_id *pid)
+static int snd_sb16_pnp_detect(struct pnp_card_link *pcard,
+ const struct pnp_card_device_id *pid)
{
static int dev;
struct snd_card *card;
@@ -640,10 +613,9 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard,
for ( ; dev < SNDRV_CARDS; dev++) {
if (!enable[dev] || !isapnp[dev])
continue;
- card = snd_sb16_card_new(dev);
- if (! card)
- return -ENOMEM;
- snd_card_set_dev(card, &pcard->card->dev);
+ res = snd_sb16_card_new(&pcard->card->dev, dev, &card);
+ if (res < 0)
+ return res;
if ((res = snd_card_sb16_pnp(dev, card->private_data, pcard, pid)) < 0 ||
(res = snd_sb16_probe(card, dev)) < 0) {
snd_card_free(card);
@@ -657,7 +629,7 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard,
return -ENODEV;
}
-static void __devexit snd_sb16_pnp_remove(struct pnp_card_link * pcard)
+static void snd_sb16_pnp_remove(struct pnp_card_link *pcard)
{
snd_card_free(pnp_get_card_drvdata(pcard));
pnp_set_card_drvdata(pcard, NULL);
@@ -683,7 +655,7 @@ static struct pnp_card_driver sb16_pnpc_driver = {
#endif
.id_table = snd_sb16_pnpids,
.probe = snd_sb16_pnp_detect,
- .remove = __devexit_p(snd_sb16_pnp_remove),
+ .remove = snd_sb16_pnp_remove,
#ifdef CONFIG_PM
.suspend = snd_sb16_pnp_suspend,
.resume = snd_sb16_pnp_resume,
@@ -692,70 +664,33 @@ static struct pnp_card_driver sb16_pnpc_driver = {
#endif /* CONFIG_PNP */
-static void __init_or_module snd_sb16_unregister_all(void)
-{
- int i;
-
-#ifdef CONFIG_PNP
- if (pnp_registered)
- pnp_unregister_card_driver(&sb16_pnpc_driver);
-#endif
- for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
- platform_device_unregister(platform_devices[i]);
- platform_driver_unregister(&snd_sb16_nonpnp_driver);
-}
-
static int __init alsa_card_sb16_init(void)
{
- int i, err, cards = 0;
-
- if ((err = platform_driver_register(&snd_sb16_nonpnp_driver)) < 0)
- return err;
+ int err;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
- struct platform_device *device;
- if (is_isapnp_selected(i))
- continue;
- device = platform_device_register_simple(SND_SB16_DRIVER,
- i, NULL, 0);
- if (IS_ERR(device)) {
- err = PTR_ERR(device);
- goto errout;
- }
- platform_devices[i] = device;
- cards++;
- }
+ err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS);
#ifdef CONFIG_PNP
- /* PnP cards at last */
- i = pnp_register_card_driver(&sb16_pnpc_driver);
- if (i >= 0) {
+ if (!err)
+ isa_registered = 1;
+
+ err = pnp_register_card_driver(&sb16_pnpc_driver);
+ if (!err)
pnp_registered = 1;
- cards += i;
- }
-#endif
- if (!cards) {
-#ifdef MODULE
- snd_printk(KERN_ERR "Sound Blaster 16 soundcard not found or device busy\n");
-#ifdef SNDRV_SBAWE_EMU8000
- snd_printk(KERN_ERR "In case, if you have non-AWE card, try snd-sb16 module\n");
-#else
- snd_printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n");
-#endif
+ if (isa_registered)
+ err = 0;
#endif
- err = -ENODEV;
- goto errout;
- }
- return 0;
-
- errout:
- snd_sb16_unregister_all();
return err;
}
static void __exit alsa_card_sb16_exit(void)
{
- snd_sb16_unregister_all();
+#ifdef CONFIG_PNP
+ if (pnp_registered)
+ pnp_unregister_card_driver(&sb16_pnpc_driver);
+ if (isa_registered)
+#endif
+ isa_unregister_driver(&snd_sb16_isa_driver);
}
module_init(alsa_card_sb16_init)
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index 9c2b5efbacb..48da2276683 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -23,10 +23,10 @@
*
*/
-#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
@@ -36,6 +36,11 @@
MODULE_AUTHOR("Uros Bizjak <uros@kss-loka.si>");
MODULE_DESCRIPTION("ALSA driver for SB16 Creative Signal Processor");
MODULE_LICENSE("GPL");
+MODULE_FIRMWARE("sb16/mulaw_main.csp");
+MODULE_FIRMWARE("sb16/alaw_main.csp");
+MODULE_FIRMWARE("sb16/ima_adpcm_init.csp");
+MODULE_FIRMWARE("sb16/ima_adpcm_playback.csp");
+MODULE_FIRMWARE("sb16/ima_adpcm_capture.csp");
#ifdef SNDRV_LITTLE_ENDIAN
#define CSP_HDR_VALUE(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
@@ -111,7 +116,8 @@ static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep)
{
struct snd_sb_csp *p;
- int version, err;
+ int uninitialized_var(version);
+ int err;
struct snd_hwdep *hw;
if (rhwdep)
@@ -138,7 +144,7 @@ int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep)
p->ops.csp_stop = snd_sb_csp_stop;
p->ops.csp_qsound_transfer = snd_sb_csp_qsound_transfer;
- init_MUTEX(&p->access_mutex);
+ mutex_init(&p->access_mutex);
sprintf(hw->name, "CSP v%d.%d", (version >> 4), (version & 0x0f));
hw->iface = SNDRV_HWDEP_IFACE_SB16CSP;
hw->private_data = p;
@@ -161,10 +167,13 @@ int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep)
*/
static void snd_sb_csp_free(struct snd_hwdep *hwdep)
{
+ int i;
struct snd_sb_csp *p = hwdep->private_data;
if (p) {
if (p->running & SNDRV_SB_CSP_ST_RUNNING)
snd_sb_csp_stop(p);
+ for (i = 0; i < ARRAY_SIZE(p->csp_programs); ++i)
+ release_firmware(p->csp_programs[i]);
kfree(p);
}
}
@@ -190,7 +199,8 @@ static int snd_sb_csp_ioctl(struct snd_hwdep * hw, struct file *file, unsigned i
struct snd_sb_csp_start start_info;
int err;
- snd_assert(p != NULL, return -EINVAL);
+ if (snd_BUG_ON(!p))
+ return -EINVAL;
if (snd_sb_csp_check_version(p))
return -ENODEV;
@@ -198,6 +208,7 @@ static int snd_sb_csp_ioctl(struct snd_hwdep * hw, struct file *file, unsigned i
switch (cmd) {
/* get information */
case SNDRV_SB_CSP_IOCTL_INFO:
+ memset(&info, 0, sizeof(info));
*info.codec_name = *p->codec_name;
info.func_nr = p->func_nr;
info.acc_format = p->acc_format;
@@ -265,13 +276,13 @@ static int snd_sb_csp_release(struct snd_hwdep * hw, struct file *file)
*/
static int snd_sb_csp_use(struct snd_sb_csp * p)
{
- down(&p->access_mutex);
+ mutex_lock(&p->access_mutex);
if (p->used) {
- up(&p->access_mutex);
+ mutex_unlock(&p->access_mutex);
return -EAGAIN;
}
p->used++;
- up(&p->access_mutex);
+ mutex_unlock(&p->access_mutex);
return 0;
@@ -282,9 +293,9 @@ static int snd_sb_csp_use(struct snd_sb_csp * p)
*/
static int snd_sb_csp_unuse(struct snd_sb_csp * p)
{
- down(&p->access_mutex);
+ mutex_lock(&p->access_mutex);
p->used--;
- up(&p->access_mutex);
+ mutex_unlock(&p->access_mutex);
return 0;
}
@@ -317,7 +328,7 @@ static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
return -EFAULT;
if ((file_h.name != RIFF_HEADER) ||
(le32_to_cpu(file_h.len) >= SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE - sizeof(file_h))) {
- snd_printd("%s: Invalid RIFF header\n", __FUNCTION__);
+ snd_printd("%s: Invalid RIFF header\n", __func__);
return -EINVAL;
}
data_ptr += sizeof(file_h);
@@ -326,7 +337,7 @@ static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
if (copy_from_user(&item_type, data_ptr, sizeof(item_type)))
return -EFAULT;
if (item_type != CSP__HEADER) {
- snd_printd("%s: Invalid RIFF file type\n", __FUNCTION__);
+ snd_printd("%s: Invalid RIFF file type\n", __func__);
return -EINVAL;
}
data_ptr += sizeof (item_type);
@@ -381,7 +392,7 @@ static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
return -EFAULT;
if (code_h.name != MAIN_HEADER) {
- snd_printd("%s: Missing 'main' microcode\n", __FUNCTION__);
+ snd_printd("%s: Missing 'main' microcode\n", __func__);
return -EINVAL;
}
data_ptr += sizeof(code_h);
@@ -425,7 +436,7 @@ static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
p->acc_format = p->acc_width = p->acc_rates = 0;
p->mode = 0;
snd_printd("%s: Unsupported CSP codec type: 0x%04x\n",
- __FUNCTION__,
+ __func__,
le16_to_cpu(funcdesc_h.VOC_type));
return -EINVAL;
}
@@ -444,7 +455,7 @@ static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
return 0;
}
}
- snd_printd("%s: Function #%d not found\n", __FUNCTION__, info.func_req);
+ snd_printd("%s: Function #%d not found\n", __func__, info.func_req);
return -EINVAL;
}
@@ -598,7 +609,7 @@ static int get_version(struct snd_sb *chip)
static int snd_sb_csp_check_version(struct snd_sb_csp * p)
{
if (p->version < 0x10 || p->version > 0x1f) {
- snd_printd("%s: Invalid CSP version: 0x%x\n", __FUNCTION__, p->version);
+ snd_printd("%s: Invalid CSP version: 0x%x\n", __func__, p->version);
return 1;
}
return 0;
@@ -617,7 +628,7 @@ static int snd_sb_csp_load(struct snd_sb_csp * p, const unsigned char *buf, int
spin_lock_irqsave(&p->chip->reg_lock, flags);
snd_sbdsp_command(p->chip, 0x01); /* CSP download command */
if (snd_sbdsp_get_byte(p->chip)) {
- snd_printd("%s: Download command failed\n", __FUNCTION__);
+ snd_printd("%s: Download command failed\n", __func__);
goto __fail;
}
/* Send CSP low byte (size - 1) */
@@ -644,7 +655,7 @@ static int snd_sb_csp_load(struct snd_sb_csp * p, const unsigned char *buf, int
udelay (10);
}
if (status != 0x55) {
- snd_printd("%s: Microcode initialization failed\n", __FUNCTION__);
+ snd_printd("%s: Microcode initialization failed\n", __func__);
goto __fail;
}
} else {
@@ -675,19 +686,41 @@ static int snd_sb_csp_load(struct snd_sb_csp * p, const unsigned char *buf, int
static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags)
{
- int err = -ENOMEM;
- unsigned char *kbuf = kmalloc(size, GFP_KERNEL);
- if (kbuf) {
- if (copy_from_user(kbuf, buf, size))
- err = -EFAULT;
- else
- err = snd_sb_csp_load(p, kbuf, size, load_flags);
- kfree(kbuf);
- }
+ int err;
+ unsigned char *kbuf;
+
+ kbuf = memdup_user(buf, size);
+ if (IS_ERR(kbuf))
+ return PTR_ERR(kbuf);
+
+ err = snd_sb_csp_load(p, kbuf, size, load_flags);
+
+ kfree(kbuf);
return err;
}
-#include "sb16_csp_codecs.h"
+static int snd_sb_csp_firmware_load(struct snd_sb_csp *p, int index, int flags)
+{
+ static const char *const names[] = {
+ "sb16/mulaw_main.csp",
+ "sb16/alaw_main.csp",
+ "sb16/ima_adpcm_init.csp",
+ "sb16/ima_adpcm_playback.csp",
+ "sb16/ima_adpcm_capture.csp",
+ };
+ const struct firmware *program;
+
+ BUILD_BUG_ON(ARRAY_SIZE(names) != CSP_PROGRAM_COUNT);
+ program = p->csp_programs[index];
+ if (!program) {
+ int err = request_firmware(&program, names[index],
+ p->chip->card->dev);
+ if (err < 0)
+ return err;
+ p->csp_programs[index] = program;
+ }
+ return snd_sb_csp_load(p, program->data, program->size, flags);
+}
/*
* autoload hardware codec if necessary
@@ -708,27 +741,27 @@ static int snd_sb_csp_autoload(struct snd_sb_csp * p, int pcm_sfmt, int play_rec
} else {
switch (pcm_sfmt) {
case SNDRV_PCM_FORMAT_MU_LAW:
- err = snd_sb_csp_load(p, &mulaw_main[0], sizeof(mulaw_main), 0);
+ err = snd_sb_csp_firmware_load(p, CSP_PROGRAM_MULAW, 0);
p->acc_format = SNDRV_PCM_FMTBIT_MU_LAW;
p->mode = SNDRV_SB_CSP_MODE_DSP_READ | SNDRV_SB_CSP_MODE_DSP_WRITE;
break;
case SNDRV_PCM_FORMAT_A_LAW:
- err = snd_sb_csp_load(p, &alaw_main[0], sizeof(alaw_main), 0);
+ err = snd_sb_csp_firmware_load(p, CSP_PROGRAM_ALAW, 0);
p->acc_format = SNDRV_PCM_FMTBIT_A_LAW;
p->mode = SNDRV_SB_CSP_MODE_DSP_READ | SNDRV_SB_CSP_MODE_DSP_WRITE;
break;
case SNDRV_PCM_FORMAT_IMA_ADPCM:
- err = snd_sb_csp_load(p, &ima_adpcm_init[0], sizeof(ima_adpcm_init),
- SNDRV_SB_CSP_LOAD_INITBLOCK);
+ err = snd_sb_csp_firmware_load(p, CSP_PROGRAM_ADPCM_INIT,
+ SNDRV_SB_CSP_LOAD_INITBLOCK);
if (err)
break;
if (play_rec_mode == SNDRV_SB_CSP_MODE_DSP_WRITE) {
- err = snd_sb_csp_load(p, &ima_adpcm_playback[0],
- sizeof(ima_adpcm_playback), 0);
+ err = snd_sb_csp_firmware_load
+ (p, CSP_PROGRAM_ADPCM_PLAYBACK, 0);
p->mode = SNDRV_SB_CSP_MODE_DSP_WRITE;
} else {
- err = snd_sb_csp_load(p, &ima_adpcm_capture[0],
- sizeof(ima_adpcm_capture), 0);
+ err = snd_sb_csp_firmware_load
+ (p, CSP_PROGRAM_ADPCM_CAPTURE, 0);
p->mode = SNDRV_SB_CSP_MODE_DSP_READ;
}
p->acc_format = SNDRV_PCM_FMTBIT_IMA_ADPCM;
@@ -773,19 +806,19 @@ static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channel
unsigned long flags;
if (!(p->running & (SNDRV_SB_CSP_ST_LOADED | SNDRV_SB_CSP_ST_AUTO))) {
- snd_printd("%s: Microcode not loaded\n", __FUNCTION__);
+ snd_printd("%s: Microcode not loaded\n", __func__);
return -ENXIO;
}
if (p->running & SNDRV_SB_CSP_ST_RUNNING) {
- snd_printd("%s: CSP already running\n", __FUNCTION__);
+ snd_printd("%s: CSP already running\n", __func__);
return -EBUSY;
}
if (!(sample_width & p->acc_width)) {
- snd_printd("%s: Unsupported PCM sample width\n", __FUNCTION__);
+ snd_printd("%s: Unsupported PCM sample width\n", __func__);
return -EINVAL;
}
if (!(channels & p->acc_channels)) {
- snd_printd("%s: Invalid number of channels\n", __FUNCTION__);
+ snd_printd("%s: Invalid number of channels\n", __func__);
return -EINVAL;
}
@@ -807,11 +840,11 @@ static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channel
s_type |= 0x22; /* 00dX 00dX (d = 1 if 8 bit samples) */
if (set_codec_parameter(p->chip, 0x81, s_type)) {
- snd_printd("%s: Set sample type command failed\n", __FUNCTION__);
+ snd_printd("%s: Set sample type command failed\n", __func__);
goto __fail;
}
if (set_codec_parameter(p->chip, 0x80, 0x00)) {
- snd_printd("%s: Codec start command failed\n", __FUNCTION__);
+ snd_printd("%s: Codec start command failed\n", __func__);
goto __fail;
}
p->run_width = sample_width;
@@ -928,14 +961,7 @@ static int snd_sb_csp_restart(struct snd_sb_csp * p)
* QSound mixer control for PCM
*/
-static int snd_sb_qsound_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
-{
- uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
- uinfo->count = 1;
- uinfo->value.integer.min = 0;
- uinfo->value.integer.max = 1;
- return 0;
-}
+#define snd_sb_qsound_switch_info snd_ctl_boolean_mono_info
static int snd_sb_qsound_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
@@ -1024,7 +1050,8 @@ static int snd_sb_qsound_build(struct snd_sb_csp * p)
struct snd_card *card;
int err;
- snd_assert(p != NULL, return -EINVAL);
+ if (snd_BUG_ON(!p))
+ return -EINVAL;
card = p->chip->card;
p->qpos_left = p->qpos_right = SNDRV_SB_CSP_QSOUND_MAX_RIGHT / 2;
@@ -1049,7 +1076,8 @@ static void snd_sb_qsound_destroy(struct snd_sb_csp * p)
struct snd_card *card;
unsigned long flags;
- snd_assert(p != NULL, return);
+ if (snd_BUG_ON(!p))
+ return;
card = p->chip->card;
@@ -1101,7 +1129,7 @@ static int init_proc_entry(struct snd_sb_csp * p, int device)
struct snd_info_entry *entry;
sprintf(name, "cspD%d", device);
if (! snd_card_proc_new(p->chip->card, name, &entry))
- snd_info_set_text_ops(entry, p, 1024, info_read);
+ snd_info_set_text_ops(entry, p, info_read);
return 0;
}
diff --git a/sound/isa/sb/sb16_csp_codecs.h b/sound/isa/sb/sb16_csp_codecs.h
deleted file mode 100644
index f0e8b0dcb57..00000000000
--- a/sound/isa/sb/sb16_csp_codecs.h
+++ /dev/null
@@ -1,949 +0,0 @@
-/*
- * Copyright (c) 1994 Creative Technology Ltd.
- * Microcode files for SB16 Advanced Signal Processor
- *
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-static unsigned char mulaw_main[] = {
- 0x00, 0x10, 0x00, 0x44, 0x08, 0x00, 0x00, 0x44,
- 0x00, 0xb1, 0x00, 0x44, 0x00, 0x61, 0x00, 0x44,
- 0x08, 0x50, 0x00, 0x44, 0x0d, 0xf2, 0x61, 0xa8,
- 0x44, 0x04, 0x04, 0x19, 0x00, 0x00, 0x40, 0x45,
- 0x40, 0x49, 0x39, 0xac, 0x55, 0x55, 0x71, 0x8b,
- 0x50, 0x05, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0xff, 0x2e, 0x21, 0x49, 0xff, 0x0f, 0xd4, 0x49,
- 0x20, 0x01, 0x09, 0x0e, 0x20, 0x00, 0x71, 0x8b,
- 0xa8, 0x01, 0xa8, 0x80, 0x88, 0x01, 0xa8, 0x80,
- 0xa8, 0x00, 0x00, 0x80, 0xd2, 0x00, 0x71, 0x8b,
- 0x88, 0x00, 0xa8, 0x80, 0xa8, 0x04, 0xb3, 0x80,
- 0x20, 0x07, 0xb3, 0x80, 0x88, 0x03, 0xb1, 0x80,
- 0xc0, 0x00, 0x09, 0x5c, 0xc2, 0x01, 0x00, 0x82,
- 0xa1, 0x00, 0x71, 0x8b, 0xcd, 0x00, 0x04, 0x19,
- 0xa2, 0x20, 0x71, 0x8b, 0xcf, 0x00, 0x04, 0x19,
- 0x00, 0x00, 0xb1, 0x80, 0xc2, 0x00, 0x04, 0x19,
- 0x00, 0x40, 0x00, 0x14, 0x08, 0x40, 0x04, 0x24,
- 0x00, 0x00, 0x34, 0x49, 0x0c, 0x40, 0x00, 0x44,
- 0x44, 0x04, 0x04, 0x39, 0x00, 0x00, 0x40, 0x45,
- 0x32, 0x00, 0x09, 0x5c, 0x00, 0x00, 0x0c, 0x39,
- 0x00, 0x00, 0x40, 0x45, 0x40, 0x40, 0x09, 0xef,
- 0xff, 0x20, 0x09, 0xcf, 0x00, 0x04, 0x63, 0xa1,
- 0x50, 0x03, 0x33, 0x80, 0x00, 0x04, 0xa3, 0x80,
- 0x00, 0xff, 0xc2, 0x8b, 0x00, 0xd0, 0x04, 0x54,
- 0x04, 0xe0, 0x00, 0xc4, 0x20, 0x03, 0x80, 0xc0,
- 0x30, 0x00, 0x00, 0x88, 0x00, 0x00, 0x7a, 0x0a,
- 0xd0, 0x01, 0x00, 0x82, 0x00, 0x60, 0x00, 0x44,
- 0xc0, 0x00, 0x00, 0x99, 0x00, 0x60, 0x00, 0x44,
- 0x00, 0xff, 0xc2, 0x8b, 0x20, 0x00, 0x00, 0x80,
- 0x00, 0x0d, 0x42, 0x8b, 0x08, 0x32, 0x00, 0xc4,
- 0x00, 0x0e, 0x42, 0x8b, 0x00, 0xa2, 0x00, 0xc4,
- 0x00, 0x1e, 0x42, 0x8b, 0x0c, 0xb2, 0x00, 0xc4,
- 0x00, 0x8e, 0x42, 0x8b, 0x00, 0x62, 0x00, 0xc4,
- 0x00, 0x9e, 0x42, 0x8b, 0x08, 0x52, 0x00, 0xc4,
- 0x00, 0xbe, 0x42, 0x8b, 0x08, 0x52, 0x00, 0xc4,
- 0x00, 0x04, 0x42, 0x8b, 0x04, 0x72, 0x00, 0xc4,
- 0x00, 0x24, 0x42, 0x8b, 0x00, 0xd2, 0x00, 0xc4,
- 0x00, 0x55, 0x42, 0x8b, 0x00, 0x60, 0x00, 0xc4,
- 0x00, 0x00, 0x40, 0x45, 0x20, 0x01, 0x79, 0x80,
- 0x00, 0x30, 0x42, 0x8b, 0x08, 0x82, 0x00, 0xc4,
- 0x00, 0x00, 0x40, 0x45, 0x00, 0x00, 0x71, 0x8b,
- 0x40, 0x01, 0x00, 0x80, 0x00, 0x60, 0x00, 0x44,
- 0xff, 0x00, 0xe2, 0xab, 0x00, 0xb2, 0x00, 0xc4,
- 0x0f, 0xf2, 0xa8, 0xa8, 0x20, 0x00, 0xb1, 0x88,
- 0x00, 0x00, 0x41, 0x02, 0x4d, 0xf2, 0x00, 0x39,
- 0xc0, 0x01, 0x00, 0x82, 0x00, 0x60, 0x00, 0x44,
- 0x0d, 0xf2, 0xa3, 0xa8, 0x4d, 0xf2, 0x00, 0x39,
- 0x00, 0x60, 0x00, 0x44, 0xff, 0x00, 0xe2, 0xab,
- 0x20, 0x00, 0x00, 0x88, 0x00, 0x00, 0x61, 0x02,
- 0x4d, 0xf2, 0x04, 0x19, 0x00, 0x60, 0x00, 0x44,
- 0xff, 0x00, 0xe2, 0xab, 0xa0, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x61, 0x10, 0x4d, 0xf2, 0x04, 0x19,
- 0x00, 0x60, 0x00, 0x44, 0xff, 0x20, 0xe2, 0xab,
- 0x60, 0x00, 0x00, 0x88, 0x00, 0x00, 0x71, 0xc0,
- 0x4d, 0xf2, 0x04, 0x19, 0x00, 0x60, 0x00, 0x44,
- 0x00, 0x00, 0x79, 0x80, 0x00, 0xe2, 0x00, 0x84,
- 0x03, 0x03, 0x04, 0x49, 0x08, 0xc2, 0x00, 0x54,
- 0x00, 0x60, 0x04, 0x64, 0x00, 0x60, 0x00, 0x44,
- 0x00, 0x00, 0x63, 0x80, 0x00, 0x00, 0x06, 0x19,
- 0x03, 0x00, 0x04, 0x49, 0x00, 0x60, 0x00, 0x44,
- 0x20, 0x01, 0x63, 0x80, 0x00, 0x00, 0x06, 0x19,
- 0x00, 0x20, 0xe2, 0x8b, 0x0c, 0xf2, 0x00, 0x84,
- 0x3e, 0x00, 0x51, 0x8b, 0xc0, 0x20, 0x00, 0x39,
- 0x08, 0x01, 0x00, 0x44, 0x6c, 0x00, 0x51, 0x8b,
- 0xc0, 0x20, 0x00, 0x39, 0x00, 0x02, 0xe2, 0x8b,
- 0x04, 0x21, 0x00, 0x84, 0xfd, 0x00, 0x51, 0x8b,
- 0xc2, 0x20, 0x00, 0x39, 0x00, 0x11, 0x00, 0x44,
- 0xfe, 0x00, 0x51, 0x8b, 0xc2, 0x20, 0x00, 0x39,
- 0xe5, 0x00, 0x71, 0x8b, 0xcd, 0x00, 0x00, 0x39,
- 0x00, 0x00, 0xb1, 0x80, 0xc9, 0x20, 0x04, 0x19,
- 0xcb, 0x20, 0x04, 0x19, 0xc1, 0x20, 0x04, 0x19,
- 0xc3, 0x20, 0x04, 0x19, 0x10, 0x00, 0x71, 0x8b,
- 0xc7, 0x20, 0x04, 0x19, 0x5e, 0x00, 0x71, 0x8b,
- 0xcf, 0x00, 0x00, 0x39, 0x00, 0x00, 0xb1, 0x80,
- 0xc4, 0x20, 0x04, 0x19, 0xc6, 0x20, 0x04, 0x19,
- 0xc8, 0x20, 0x04, 0x19, 0xca, 0x20, 0x04, 0x19,
- 0x20, 0x00, 0x71, 0x8b, 0xcc, 0x20, 0x04, 0x19,
- 0x03, 0x00, 0x04, 0x49, 0x00, 0x60, 0x00, 0x44,
- 0x09, 0x04, 0x61, 0xa8, 0xc1, 0x00, 0x04, 0x19,
- 0x0b, 0x04, 0x61, 0xa8, 0xca, 0x00, 0x04, 0x19,
- 0x04, 0x60, 0x00, 0xd4, 0x0d, 0x00, 0x61, 0x0a,
- 0x90, 0x40, 0x09, 0x8f, 0x00, 0x01, 0x00, 0x45,
- 0x0f, 0x00, 0x61, 0x0a, 0x00, 0x40, 0x09, 0x8f,
- 0x00, 0x01, 0x00, 0x45, 0x82, 0x00, 0x09, 0x2e,
- 0x80, 0x40, 0x09, 0xcf, 0x02, 0x00, 0x61, 0x22,
- 0x43, 0x25, 0x61, 0x22, 0x40, 0x33, 0x00, 0x80,
- 0x08, 0xa8, 0x00, 0x44, 0x20, 0x31, 0x49, 0x5c,
- 0x92, 0x00, 0x09, 0x4e, 0x02, 0x03, 0x09, 0x2e,
- 0x00, 0x00, 0xa3, 0x02, 0xc0, 0x00, 0x71, 0xc0,
- 0x20, 0x00, 0xeb, 0x80, 0x00, 0x04, 0xc2, 0x8b,
- 0x20, 0x04, 0x61, 0x80, 0x00, 0x04, 0x7a, 0x02,
- 0xcb, 0x00, 0xa8, 0x58, 0xb0, 0x05, 0xf3, 0x80,
- 0x20, 0x04, 0xa8, 0x10, 0x00, 0x00, 0x10, 0x39,
- 0xb0, 0x00, 0xe0, 0x8b, 0x20, 0x01, 0x00, 0x80,
- 0x00, 0x00, 0x63, 0xcb, 0x00, 0x00, 0x7a, 0x02,
- 0x40, 0x00, 0x01, 0x5b, 0x20, 0x00, 0x00, 0x80,
- 0x00, 0x00, 0x4a, 0xcb, 0x20, 0x00, 0x13, 0x80,
- 0x20, 0x00, 0x7a, 0x80, 0xe0, 0x21, 0x00, 0xc0,
- 0x08, 0x00, 0x08, 0x49, 0x10, 0x41, 0x09, 0x8e,
- 0xff, 0xff, 0x62, 0x8b, 0x00, 0x04, 0x61, 0x22,
- 0x00, 0x03, 0x00, 0x45, 0x22, 0x01, 0x33, 0x80,
- 0x20, 0x01, 0xa3, 0x02, 0x00, 0x00, 0x7a, 0x80,
- 0xc0, 0x00, 0x00, 0x82, 0x07, 0x20, 0x40, 0x0a,
- 0x08, 0x83, 0x00, 0x84, 0x40, 0x21, 0x00, 0x80,
- 0x40, 0x05, 0x93, 0x10, 0xc7, 0x20, 0x00, 0x39,
- 0x00, 0x00, 0x40, 0x45, 0x07, 0x20, 0x40, 0x0a,
- 0x0c, 0xa3, 0x00, 0x84, 0x08, 0x00, 0x00, 0x82,
- 0x0c, 0x24, 0x61, 0x50, 0x40, 0x01, 0x00, 0x80,
- 0xc7, 0x20, 0x00, 0x39, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x04, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0x42, 0x01, 0x09, 0x0e, 0x02, 0x20, 0x61, 0x0a,
- 0x00, 0x01, 0x00, 0x45, 0x0c, 0x20, 0x60, 0x0a,
- 0x00, 0x73, 0x00, 0x84, 0x00, 0x04, 0xb1, 0x80,
- 0x00, 0x00, 0x06, 0x39, 0x0c, 0x61, 0x04, 0xd4,
- 0x00, 0x24, 0x71, 0xc0, 0x20, 0x33, 0x33, 0xc0,
- 0xe0, 0x01, 0xa3, 0x82, 0x22, 0x03, 0x7a, 0x02,
- 0xc3, 0x01, 0xa3, 0x82, 0x20, 0x01, 0x33, 0x80,
- 0x00, 0x00, 0x7a, 0x80, 0xc2, 0x01, 0xb3, 0x50,
- 0xcc, 0x20, 0x00, 0x39, 0x00, 0x00, 0x71, 0x80,
- 0x00, 0xf3, 0x00, 0x44, 0x0c, 0x20, 0x60, 0x0a,
- 0x00, 0xd3, 0x00, 0x84, 0x00, 0x04, 0xb1, 0x80,
- 0x00, 0x00, 0x06, 0x39, 0x0c, 0x61, 0x04, 0xd4,
- 0x00, 0x00, 0xb3, 0x10, 0xcc, 0x20, 0x00, 0x39,
- 0x00, 0x00, 0x71, 0xc0, 0x00, 0xf3, 0x00, 0x44,
- 0xcc, 0x20, 0x00, 0x39, 0x00, 0x20, 0x71, 0xc0,
- 0x00, 0x30, 0x71, 0xc0, 0x00, 0xf3, 0x00, 0x44,
- 0x20, 0x01, 0x00, 0x80, 0xff, 0xff, 0x62, 0x8b,
- 0x20, 0x01, 0x33, 0x80, 0x00, 0x00, 0x83, 0x80,
- 0x20, 0x00, 0x7a, 0x80, 0x20, 0xe1, 0x09, 0x5c,
- 0x82, 0x00, 0x09, 0x2f, 0x80, 0x4a, 0x09, 0x8e,
- 0xe0, 0x01, 0xb3, 0x82, 0x20, 0x04, 0xa3, 0x80,
- 0x00, 0x00, 0x7a, 0xcb, 0x03, 0x00, 0xa8, 0x18,
- 0x00, 0x00, 0x10, 0x39, 0x08, 0x04, 0xea, 0x10,
- 0x08, 0x04, 0x7a, 0x10, 0x20, 0x00, 0x00, 0x80,
- 0x40, 0x00, 0x21, 0xcb, 0x0c, 0x00, 0xe8, 0x10,
- 0x00, 0x00, 0x41, 0x02, 0x0c, 0x00, 0xeb, 0x10,
- 0xf2, 0x01, 0x00, 0x82, 0x40, 0x21, 0x33, 0x02,
- 0x08, 0x20, 0x61, 0x0a, 0xc4, 0x00, 0x04, 0x19,
- 0xc7, 0x00, 0x00, 0x99, 0x02, 0x00, 0x61, 0x0a,
- 0x0c, 0xe8, 0x04, 0x14, 0x01, 0x00, 0x61, 0x0a,
- 0x03, 0x00, 0x48, 0x0a, 0x00, 0xb8, 0x04, 0x54,
- 0xc3, 0x00, 0x04, 0x19, 0x0c, 0xb8, 0x00, 0x44,
- 0x08, 0x00, 0xc8, 0x0a, 0x0c, 0xb8, 0x04, 0x54,
- 0xc8, 0x00, 0x04, 0x19, 0x0a, 0x00, 0x61, 0x0a,
- 0x09, 0x00, 0x48, 0x0a, 0x00, 0x68, 0x04, 0x54,
- 0xc9, 0x00, 0x04, 0x19, 0x0c, 0x68, 0x00, 0x44,
- 0x0b, 0x00, 0xc8, 0x0a, 0x0c, 0x68, 0x04, 0x54,
- 0xcb, 0x00, 0x04, 0x19, 0x04, 0x00, 0x61, 0x0a,
- 0x06, 0x00, 0x48, 0x0a, 0x00, 0x78, 0x04, 0x54,
- 0xc6, 0x00, 0x04, 0x19, 0x0c, 0x78, 0x00, 0x44,
- 0x05, 0x00, 0xc8, 0x0a, 0x0c, 0x78, 0x04, 0x54,
- 0xc5, 0x00, 0x04, 0x19, 0x07, 0x00, 0x61, 0x0a,
- 0x0c, 0x00, 0x48, 0x0a, 0x00, 0xe8, 0x04, 0x54,
- 0xcc, 0x00, 0x04, 0x19, 0x0c, 0xe8, 0x00, 0x44,
- 0x0e, 0x00, 0xc8, 0x0a, 0x0c, 0xe8, 0x04, 0x54,
- 0xce, 0x00, 0x04, 0x19, 0x00, 0x00, 0x40, 0x45,
- 0x20, 0x10, 0x71, 0x8b, 0x09, 0x3f, 0x07, 0x00
-};
-
-static unsigned char alaw_main[] = {
- 0x00, 0x10, 0x00, 0x44, 0x08, 0x00, 0x00, 0x44,
- 0x00, 0xb1, 0x00, 0x44, 0x00, 0x61, 0x00, 0x44,
- 0x08, 0x50, 0x00, 0x44, 0x0d, 0xf2, 0x61, 0xa8,
- 0x44, 0x04, 0x04, 0x19, 0x00, 0x00, 0x40, 0x45,
- 0x40, 0x49, 0x39, 0xac, 0x55, 0x55, 0x71, 0x8b,
- 0x50, 0x05, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0xff, 0x2e, 0x21, 0x49, 0xff, 0x0f, 0xd4, 0x49,
- 0x20, 0x01, 0x09, 0x0e, 0x20, 0x00, 0x71, 0x8b,
- 0xa8, 0x01, 0xa8, 0x80, 0x88, 0x01, 0xa8, 0x80,
- 0xa8, 0x00, 0x00, 0x80, 0xd2, 0x00, 0x71, 0x8b,
- 0x88, 0x00, 0xa8, 0x80, 0xa8, 0x04, 0xb3, 0x80,
- 0x20, 0x07, 0xb3, 0x80, 0x88, 0x03, 0xb1, 0x80,
- 0xc0, 0x00, 0x09, 0x5c, 0xc2, 0x01, 0x00, 0x82,
- 0xa1, 0x00, 0x71, 0x8b, 0xcd, 0x00, 0x04, 0x19,
- 0x21, 0x20, 0x71, 0x8b, 0xcf, 0x00, 0x04, 0x19,
- 0x00, 0x00, 0xb1, 0x80, 0xc2, 0x00, 0x04, 0x19,
- 0x00, 0x40, 0x00, 0x14, 0x08, 0x40, 0x04, 0x24,
- 0x00, 0x00, 0x34, 0x49, 0x0c, 0x40, 0x00, 0x44,
- 0x44, 0x04, 0x04, 0x39, 0x00, 0x00, 0x40, 0x45,
- 0x32, 0x00, 0x09, 0x5c, 0x00, 0x00, 0x0c, 0x39,
- 0x00, 0x00, 0x40, 0x45, 0x40, 0x40, 0x09, 0xef,
- 0xff, 0x20, 0x09, 0xcf, 0x00, 0x04, 0x63, 0xa1,
- 0x50, 0x03, 0x33, 0x80, 0x00, 0x04, 0xa3, 0x80,
- 0x00, 0xff, 0xc2, 0x8b, 0x00, 0xd0, 0x04, 0x54,
- 0x04, 0xe0, 0x00, 0xc4, 0x20, 0x03, 0x80, 0xc0,
- 0x30, 0x00, 0x00, 0x88, 0x00, 0x00, 0x7a, 0x0a,
- 0xd0, 0x01, 0x00, 0x82, 0x00, 0x60, 0x00, 0x44,
- 0xc0, 0x00, 0x00, 0x99, 0x00, 0x60, 0x00, 0x44,
- 0x00, 0xff, 0xc2, 0x8b, 0x20, 0x00, 0x00, 0x80,
- 0x00, 0x0d, 0x42, 0x8b, 0x08, 0x32, 0x00, 0xc4,
- 0x00, 0x0e, 0x42, 0x8b, 0x00, 0xa2, 0x00, 0xc4,
- 0x00, 0x1e, 0x42, 0x8b, 0x0c, 0xb2, 0x00, 0xc4,
- 0x00, 0x8e, 0x42, 0x8b, 0x00, 0x62, 0x00, 0xc4,
- 0x00, 0x9e, 0x42, 0x8b, 0x08, 0x52, 0x00, 0xc4,
- 0x00, 0xbe, 0x42, 0x8b, 0x08, 0x52, 0x00, 0xc4,
- 0x00, 0x04, 0x42, 0x8b, 0x04, 0x72, 0x00, 0xc4,
- 0x00, 0x24, 0x42, 0x8b, 0x00, 0xd2, 0x00, 0xc4,
- 0x00, 0x55, 0x42, 0x8b, 0x00, 0x60, 0x00, 0xc4,
- 0x00, 0x00, 0x40, 0x45, 0x20, 0x01, 0x79, 0x80,
- 0x00, 0x30, 0x42, 0x8b, 0x08, 0x82, 0x00, 0xc4,
- 0x00, 0x00, 0x40, 0x45, 0x00, 0x00, 0x71, 0x8b,
- 0x40, 0x01, 0x00, 0x80, 0x00, 0x60, 0x00, 0x44,
- 0xff, 0x00, 0xe2, 0xab, 0x00, 0xb2, 0x00, 0xc4,
- 0x0f, 0xf2, 0xa8, 0xa8, 0x20, 0x00, 0xb1, 0x88,
- 0x00, 0x00, 0x41, 0x02, 0x4d, 0xf2, 0x00, 0x39,
- 0xc0, 0x01, 0x00, 0x82, 0x00, 0x60, 0x00, 0x44,
- 0x0d, 0xf2, 0xa3, 0xa8, 0x4d, 0xf2, 0x00, 0x39,
- 0x00, 0x60, 0x00, 0x44, 0xff, 0x00, 0xe2, 0xab,
- 0x20, 0x00, 0x00, 0x88, 0x00, 0x00, 0x61, 0x02,
- 0x4d, 0xf2, 0x04, 0x19, 0x00, 0x60, 0x00, 0x44,
- 0xff, 0x00, 0xe2, 0xab, 0xa0, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x61, 0x10, 0x4d, 0xf2, 0x04, 0x19,
- 0x00, 0x60, 0x00, 0x44, 0xff, 0x20, 0xe2, 0xab,
- 0x60, 0x00, 0x00, 0x88, 0x00, 0x00, 0x71, 0xc0,
- 0x4d, 0xf2, 0x04, 0x19, 0x00, 0x60, 0x00, 0x44,
- 0x00, 0x00, 0x79, 0x80, 0x00, 0xe2, 0x00, 0x84,
- 0x03, 0x03, 0x04, 0x49, 0x04, 0xc2, 0x00, 0x54,
- 0x00, 0x60, 0x04, 0x64, 0x00, 0x60, 0x00, 0x44,
- 0x00, 0x00, 0x63, 0x80, 0x00, 0x00, 0x06, 0x19,
- 0x03, 0x00, 0x04, 0x49, 0x00, 0x60, 0x00, 0x44,
- 0x20, 0x01, 0x63, 0x80, 0x00, 0x00, 0x06, 0x19,
- 0x00, 0x20, 0xe2, 0x8b, 0x0c, 0xf2, 0x00, 0x84,
- 0xbe, 0x00, 0x51, 0x8b, 0xc0, 0x20, 0x00, 0x39,
- 0x08, 0x01, 0x00, 0x44, 0xec, 0x00, 0x51, 0x8b,
- 0xc0, 0x20, 0x00, 0x39, 0x00, 0x02, 0xe2, 0x8b,
- 0x04, 0x21, 0x00, 0x84, 0x3f, 0x00, 0x51, 0x8b,
- 0xc2, 0x20, 0x00, 0x39, 0x00, 0x11, 0x00, 0x44,
- 0x3d, 0x00, 0x51, 0x8b, 0xc2, 0x20, 0x00, 0x39,
- 0xe5, 0x00, 0x71, 0x8b, 0xcd, 0x00, 0x00, 0x39,
- 0x00, 0x00, 0xb1, 0x80, 0xc9, 0x20, 0x04, 0x19,
- 0xcb, 0x20, 0x04, 0x19, 0xc1, 0x20, 0x04, 0x19,
- 0xc3, 0x20, 0x04, 0x19, 0x10, 0x00, 0x71, 0x8b,
- 0xc7, 0x20, 0x04, 0x19, 0xde, 0x00, 0x51, 0x8b,
- 0xcf, 0x00, 0x00, 0x39, 0x00, 0x01, 0xb1, 0x80,
- 0xc4, 0x20, 0x04, 0x19, 0xc6, 0x20, 0x04, 0x19,
- 0xc8, 0x20, 0x04, 0x19, 0xca, 0x20, 0x04, 0x19,
- 0x20, 0x00, 0x71, 0x8b, 0xcc, 0x20, 0x04, 0x19,
- 0x03, 0x00, 0x04, 0x49, 0x00, 0x60, 0x00, 0x44,
- 0x09, 0x04, 0x61, 0xa8, 0xc1, 0x00, 0x04, 0x19,
- 0x0b, 0x04, 0x61, 0xa8, 0xca, 0x00, 0x04, 0x19,
- 0x04, 0x60, 0x00, 0xd4, 0x0d, 0x00, 0x61, 0x0a,
- 0x90, 0x40, 0x09, 0x8f, 0x00, 0x01, 0x00, 0x45,
- 0x0f, 0x00, 0x61, 0x0a, 0x00, 0x40, 0x09, 0x8f,
- 0x00, 0x01, 0x00, 0x45, 0x82, 0x00, 0x09, 0x2e,
- 0x80, 0x40, 0x09, 0xcf, 0x02, 0x00, 0x61, 0x22,
- 0x43, 0x25, 0x61, 0x22, 0x40, 0x33, 0x00, 0x80,
- 0x08, 0x48, 0x00, 0x44, 0x20, 0xb1, 0x49, 0x5c,
- 0x92, 0x00, 0x09, 0x4e, 0x02, 0x03, 0x09, 0x2e,
- 0x00, 0x00, 0xa3, 0x02, 0xc0, 0x00, 0x71, 0xc0,
- 0x20, 0x00, 0xeb, 0x80, 0x00, 0x04, 0xc2, 0x8b,
- 0x20, 0x04, 0x61, 0x80, 0x00, 0x04, 0x7a, 0x02,
- 0xc0, 0x00, 0x00, 0x82, 0x0c, 0xc3, 0x08, 0x49,
- 0xb0, 0x01, 0xf3, 0x80, 0x00, 0x00, 0x10, 0x39,
- 0x20, 0x00, 0x0c, 0x89, 0x0c, 0x88, 0x08, 0x49,
- 0x03, 0x00, 0xa8, 0x18, 0x00, 0x00, 0x10, 0x39,
- 0xbd, 0xff, 0x62, 0x8b, 0x20, 0x01, 0x00, 0x80,
- 0x00, 0x00, 0x63, 0xcb, 0x00, 0x00, 0x7a, 0x02,
- 0x40, 0x00, 0x01, 0x5b, 0x20, 0x00, 0x00, 0x80,
- 0x00, 0x00, 0x4a, 0xcb, 0x20, 0x00, 0x13, 0x80,
- 0x20, 0x00, 0x7a, 0x80, 0xe0, 0x21, 0x00, 0xc0,
- 0x08, 0x00, 0x08, 0x49, 0x10, 0x41, 0x09, 0x8e,
- 0xae, 0xae, 0x62, 0x8b, 0x00, 0x04, 0x61, 0x22,
- 0x00, 0x03, 0x00, 0x45, 0x22, 0x01, 0x33, 0x80,
- 0x20, 0x01, 0xa3, 0x02, 0x00, 0x00, 0x7a, 0x80,
- 0xc0, 0x00, 0x00, 0x82, 0x07, 0x20, 0x40, 0x0a,
- 0x08, 0xa3, 0x00, 0x84, 0x40, 0x21, 0x00, 0x80,
- 0x40, 0x05, 0x93, 0x10, 0xc7, 0x20, 0x00, 0x39,
- 0x00, 0x00, 0x40, 0x45, 0x07, 0x20, 0x40, 0x0a,
- 0x0c, 0x93, 0x00, 0x84, 0x08, 0x00, 0x00, 0x82,
- 0x0c, 0x24, 0x61, 0x50, 0x40, 0x01, 0x00, 0x80,
- 0xc7, 0x20, 0x00, 0x39, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x04, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0x42, 0x01, 0x09, 0x0e, 0x02, 0x20, 0x61, 0x0a,
- 0x00, 0x01, 0x00, 0x45, 0x0c, 0x20, 0x60, 0x0a,
- 0x00, 0xc3, 0x00, 0x84, 0x00, 0x04, 0xb1, 0x80,
- 0x00, 0x00, 0x06, 0x39, 0x0c, 0x61, 0x04, 0xd4,
- 0x00, 0x24, 0x71, 0xc0, 0x20, 0x33, 0x33, 0xc0,
- 0xe0, 0x01, 0xa3, 0x82, 0x22, 0x03, 0x7a, 0x02,
- 0xc3, 0x01, 0xa3, 0x82, 0x20, 0x01, 0x33, 0x80,
- 0x00, 0x00, 0x7a, 0x80, 0xc2, 0x01, 0xb3, 0x50,
- 0xcc, 0x20, 0x00, 0x39, 0x00, 0x00, 0x71, 0x80,
- 0x00, 0x08, 0x00, 0x44, 0x0c, 0x20, 0x60, 0x0a,
- 0x00, 0xf3, 0x00, 0x84, 0x00, 0x04, 0xb1, 0x80,
- 0x00, 0x00, 0x06, 0x39, 0x0c, 0x61, 0x04, 0xd4,
- 0x00, 0x00, 0x71, 0xc0, 0x00, 0x00, 0x93, 0x10,
- 0xcc, 0x20, 0x00, 0x39, 0x00, 0x08, 0x00, 0x44,
- 0xcc, 0x20, 0x00, 0x39, 0x00, 0x20, 0x00, 0xc0,
- 0x00, 0x30, 0x71, 0xc0, 0x00, 0x08, 0x00, 0x44,
- 0x20, 0x01, 0x00, 0x80, 0xae, 0xae, 0x62, 0x8b,
- 0x20, 0x01, 0x33, 0x80, 0x00, 0x00, 0x83, 0x80,
- 0x20, 0x00, 0x7a, 0x80, 0x20, 0xa1, 0x49, 0x5c,
- 0x82, 0x00, 0x09, 0x6e, 0x80, 0x4a, 0x09, 0x8e,
- 0xe0, 0x01, 0xb3, 0x82, 0x20, 0x04, 0xa3, 0x80,
- 0x00, 0x00, 0x7a, 0xcb, 0x28, 0x04, 0xea, 0x10,
- 0x0c, 0x04, 0x7a, 0x10, 0x70, 0x00, 0xc0, 0x8b,
- 0x00, 0x00, 0x10, 0x39, 0x90, 0x03, 0x00, 0x80,
- 0x40, 0x00, 0x21, 0x5b, 0x90, 0x00, 0x61, 0x80,
- 0x0c, 0x8a, 0x08, 0x49, 0x00, 0x00, 0x1c, 0x19,
- 0x40, 0x00, 0x08, 0x5b, 0x08, 0x00, 0x08, 0x49,
- 0x20, 0x02, 0x00, 0x80, 0x03, 0x00, 0xa8, 0x18,
- 0x00, 0x00, 0x14, 0x19, 0x40, 0x00, 0x21, 0xcb,
- 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0xeb, 0x80,
- 0xf2, 0x01, 0x00, 0x82, 0x40, 0x21, 0x33, 0x02,
- 0x08, 0x20, 0x61, 0x0a, 0xc4, 0x00, 0x04, 0x19,
- 0xc7, 0x00, 0x00, 0x99, 0x02, 0x00, 0x61, 0x0a,
- 0x0c, 0x0a, 0x04, 0x14, 0x01, 0x00, 0x61, 0x0a,
- 0x03, 0x00, 0x48, 0x0a, 0x00, 0x58, 0x04, 0x54,
- 0xc3, 0x00, 0x04, 0x19, 0x0c, 0x58, 0x00, 0x44,
- 0x08, 0x00, 0xc8, 0x0a, 0x0c, 0x58, 0x04, 0x54,
- 0xc8, 0x00, 0x04, 0x19, 0x0a, 0x00, 0x61, 0x0a,
- 0x09, 0x00, 0x48, 0x0a, 0x00, 0xc8, 0x04, 0x54,
- 0xc9, 0x00, 0x04, 0x19, 0x0c, 0xc8, 0x00, 0x44,
- 0x0b, 0x00, 0xc8, 0x0a, 0x0c, 0xc8, 0x04, 0x54,
- 0xcb, 0x00, 0x04, 0x19, 0x04, 0x00, 0x61, 0x0a,
- 0x06, 0x00, 0x48, 0x0a, 0x00, 0xd8, 0x04, 0x54,
- 0xc6, 0x00, 0x04, 0x19, 0x0c, 0xd8, 0x00, 0x44,
- 0x05, 0x00, 0xc8, 0x0a, 0x0c, 0xd8, 0x04, 0x54,
- 0xc5, 0x00, 0x04, 0x19, 0x07, 0x00, 0x61, 0x0a,
- 0x0c, 0x00, 0x48, 0x0a, 0x00, 0x0a, 0x04, 0x54,
- 0xcc, 0x00, 0x04, 0x19, 0x0c, 0x0a, 0x00, 0x44,
- 0x0e, 0x00, 0xc8, 0x0a, 0x0c, 0x0a, 0x04, 0x54,
- 0xce, 0x00, 0x04, 0x19, 0x00, 0x00, 0x40, 0x45,
- 0x20, 0x10, 0x71, 0x8b, 0x08, 0x42, 0x06, 0x00
-};
-
-
-static unsigned char ima_adpcm_init[] = {
- 0x00, 0x10, 0x00, 0x44, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x00, 0x40, 0x45, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x00, 0x40, 0x45, 0xaa, 0xaa, 0x71, 0x8b,
- 0x44, 0x04, 0x04, 0x19, 0x00, 0x00, 0x40, 0x45,
- 0xff, 0x6e, 0x21, 0x49, 0xff, 0x0f, 0xd4, 0x49,
- 0x40, 0x49, 0x39, 0xac, 0x55, 0x55, 0x71, 0x8b,
- 0x50, 0x05, 0xb1, 0x80, 0x62, 0x00, 0x19, 0x0e,
- 0x21, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xb0, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x40, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x60, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x50, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x70, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xc0, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xe0, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xd0, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x02, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x22, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x32, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xa2, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xb2, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x62, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xc2, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xf2, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x11, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xa1, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x61, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xe1, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x13, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xb3, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xc3, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x18, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x68, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x0a, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x4a, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x29, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x79, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x9b, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x14, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xf4, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xe6, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xe5, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xd7, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x2e, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x9d, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xef, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xb2, 0x20, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x33, 0x20, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x2a, 0x20, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x3b, 0x20, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x46, 0x20, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x2c, 0x20, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xdd, 0x20, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x01, 0x10, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x9a, 0x10, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x16, 0x10, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x8e, 0x10, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xc2, 0x30, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xc9, 0x30, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x3c, 0x30, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x81, 0x80, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xd4, 0x80, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x10, 0xa0, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x34, 0xa0, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x02, 0x90, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x75, 0x90, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x9a, 0xb0, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x12, 0x40, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x0d, 0x40, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x3c, 0x60, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xe7, 0x50, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x0e, 0x70, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xff, 0xc0, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xc8, 0xd0, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x57, 0xf0, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xc8, 0x22, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xb0, 0x32, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xdd, 0x82, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x90, 0xb2, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x8a, 0x62, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xce, 0x72, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xa5, 0xd2, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x97, 0x21, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xa2, 0xa1, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x5c, 0x41, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xfe, 0xc1, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x7a, 0x23, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x78, 0x93, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x67, 0x73, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x17, 0x28, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x88, 0x48, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xdb, 0xf8, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x2b, 0xba, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xf1, 0x09, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xdc, 0x69, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x19, 0x8b, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0xff, 0xfb, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x20, 0x00, 0x71, 0x8b, 0x88, 0x00, 0x00, 0x80,
- 0x52, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0xff, 0xff, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0xc2, 0x00, 0x00, 0x82, 0xc2, 0x00, 0x00, 0x82,
- 0xc2, 0x00, 0x00, 0x82, 0x10, 0x00, 0x71, 0x8b,
- 0xc2, 0x00, 0x00, 0x82, 0x80, 0x00, 0x71, 0x8b,
- 0xc2, 0x00, 0x00, 0x82, 0x90, 0x00, 0x71, 0x8b,
- 0xc2, 0x00, 0x00, 0x82, 0x40, 0x00, 0x71, 0x8b,
- 0xc2, 0x00, 0x00, 0x82, 0xff, 0xff, 0x71, 0x8b,
- 0xc2, 0x00, 0x00, 0x82, 0xc2, 0x00, 0x00, 0x82,
- 0xc2, 0x00, 0x00, 0x82, 0xc2, 0x00, 0x00, 0x82,
- 0x10, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0x80, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0x90, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0x40, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0xff, 0xfb, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0x00, 0x04, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0x4a, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0x00, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0x00, 0x00, 0x71, 0x8b, 0xc2, 0x00, 0x00, 0x82,
- 0xc2, 0x00, 0x00, 0x82, 0xc2, 0x30, 0x04, 0x19,
- 0x10, 0x00, 0x09, 0x4f, 0xc2, 0x01, 0x00, 0x82,
- 0xc2, 0x01, 0x00, 0x82, 0xc2, 0x01, 0x00, 0x82,
- 0xc2, 0x01, 0x00, 0x82, 0xc2, 0x01, 0x00, 0x82,
- 0xc2, 0x01, 0x00, 0x82, 0xc2, 0x01, 0x00, 0x82,
- 0xc2, 0x01, 0x00, 0x82, 0xc2, 0x01, 0x00, 0x82,
- 0xc2, 0x01, 0x00, 0x82, 0xc2, 0x01, 0x00, 0x82,
- 0xc2, 0x01, 0x00, 0x82, 0xc2, 0x01, 0x00, 0x82,
- 0x00, 0x10, 0x71, 0x8b, 0xc1, 0x30, 0x04, 0x19,
- 0x93, 0x00, 0x01, 0x4f, 0xcd, 0x30, 0x00, 0x09,
- 0xcf, 0x30, 0x00, 0x09, 0x00, 0x00, 0x34, 0x49,
- 0x00, 0x08, 0x00, 0x44, 0xc8, 0x54, 0x11, 0x00
-};
-
-static unsigned char ima_adpcm_playback[] = {
- 0x00, 0x10, 0x00, 0x44, 0x08, 0x00, 0x00, 0x44,
- 0x0c, 0x50, 0x00, 0x44, 0x00, 0x70, 0x00, 0x44,
- 0x04, 0x70, 0x00, 0x44, 0x0d, 0xf2, 0x61, 0xa8,
- 0x44, 0x04, 0x04, 0x19, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x04, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0xff, 0x2e, 0x21, 0x49, 0xff, 0x0d, 0xd4, 0x49,
- 0x40, 0x49, 0x39, 0xac, 0x55, 0x55, 0x71, 0x8b,
- 0x50, 0x01, 0xb1, 0x80, 0x00, 0x01, 0xb1, 0x80,
- 0xc9, 0x20, 0x04, 0x19, 0x51, 0x00, 0x71, 0x8b,
- 0xcd, 0x00, 0x04, 0x19, 0xe4, 0x20, 0x71, 0x8b,
- 0xcf, 0x00, 0x04, 0x19, 0x80, 0x00, 0x71, 0x8b,
- 0xcb, 0x20, 0x04, 0x19, 0x10, 0x00, 0x71, 0x8b,
- 0xc4, 0x20, 0x04, 0x19, 0x65, 0x00, 0x51, 0x8b,
- 0xc2, 0x20, 0x00, 0x39, 0x00, 0x00, 0xb1, 0x80,
- 0xc2, 0x30, 0x04, 0x19, 0x00, 0x00, 0x63, 0x80,
- 0xc1, 0xa0, 0x04, 0x19, 0x93, 0x00, 0x01, 0x4f,
- 0xcd, 0x30, 0x00, 0x09, 0xcf, 0x30, 0x00, 0x09,
- 0x04, 0x40, 0x00, 0x14, 0x0c, 0x40, 0x00, 0x14,
- 0x00, 0x04, 0x61, 0xa8, 0x02, 0x04, 0x61, 0xa8,
- 0x04, 0x60, 0x04, 0x24, 0x00, 0x00, 0x34, 0x49,
- 0x00, 0x50, 0x00, 0x44, 0x44, 0x04, 0x04, 0x39,
- 0x00, 0x00, 0x40, 0x45, 0x00, 0x00, 0x40, 0x45,
- 0x0f, 0x00, 0x61, 0x0a, 0x00, 0x01, 0x00, 0x45,
- 0x40, 0x40, 0x09, 0xef, 0xff, 0x20, 0x09, 0xcf,
- 0x00, 0x04, 0x63, 0xa1, 0x50, 0x03, 0x33, 0x80,
- 0x00, 0x04, 0xa3, 0x80, 0x00, 0xff, 0xc2, 0x8b,
- 0x08, 0xf0, 0x04, 0x54, 0x0c, 0xd0, 0x00, 0xc4,
- 0x20, 0x03, 0x80, 0xc0, 0x30, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x7a, 0x0a, 0xd0, 0x01, 0x00, 0x82,
- 0x08, 0x50, 0x00, 0x44, 0xc0, 0x00, 0x00, 0x99,
- 0x08, 0x50, 0x00, 0x44, 0x00, 0xff, 0xc2, 0x8b,
- 0x20, 0x00, 0x00, 0x80, 0x00, 0x0d, 0x42, 0x8b,
- 0x00, 0xa2, 0x00, 0xc4, 0x00, 0x0e, 0x42, 0x8b,
- 0x0c, 0x92, 0x00, 0xc4, 0x00, 0x1e, 0x42, 0x8b,
- 0x04, 0x62, 0x00, 0xc4, 0x00, 0x8e, 0x42, 0x8b,
- 0x0c, 0x52, 0x00, 0xc4, 0x00, 0x9e, 0x42, 0x8b,
- 0x00, 0xc2, 0x00, 0xc4, 0x00, 0xbe, 0x42, 0x8b,
- 0x00, 0xc2, 0x00, 0xc4, 0x00, 0x04, 0x42, 0x8b,
- 0x00, 0xf2, 0x00, 0xc4, 0x00, 0x24, 0x42, 0x8b,
- 0x00, 0x91, 0x00, 0xc4, 0x00, 0x55, 0x42, 0x8b,
- 0x08, 0x50, 0x00, 0xc4, 0x00, 0x3f, 0x42, 0x8b,
- 0x08, 0xe2, 0x00, 0xc4, 0x00, 0x00, 0x40, 0x45,
- 0x20, 0x01, 0x79, 0x80, 0x00, 0x30, 0x42, 0x8b,
- 0x00, 0x92, 0x00, 0xc4, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x00, 0x71, 0x8b, 0x40, 0x01, 0x00, 0x80,
- 0x08, 0x50, 0x00, 0x44, 0xff, 0x00, 0xe2, 0xab,
- 0x0c, 0x42, 0x00, 0xc4, 0x0f, 0xf2, 0xa8, 0xa8,
- 0x20, 0x00, 0xb1, 0x88, 0x00, 0x00, 0x41, 0x02,
- 0x4d, 0xf2, 0x00, 0x39, 0xc0, 0x01, 0x00, 0x82,
- 0x08, 0x50, 0x00, 0x44, 0x0d, 0xf2, 0xa3, 0xa8,
- 0x4d, 0xf2, 0x00, 0x39, 0x08, 0x50, 0x00, 0x44,
- 0xff, 0x00, 0xe2, 0xab, 0x20, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x61, 0x02, 0x4d, 0xf2, 0x04, 0x19,
- 0x08, 0x50, 0x00, 0x44, 0xff, 0x00, 0xe2, 0xab,
- 0xa0, 0x00, 0x00, 0x88, 0x00, 0x00, 0x61, 0x10,
- 0x4d, 0xf2, 0x04, 0x19, 0x08, 0x50, 0x00, 0x44,
- 0xff, 0x20, 0xe2, 0xab, 0x60, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x71, 0xc0, 0x4d, 0xf2, 0x04, 0x19,
- 0x08, 0x50, 0x00, 0x44, 0x00, 0x00, 0x7a, 0x0a,
- 0x20, 0x01, 0xf0, 0x80, 0x01, 0xa0, 0x41, 0x0a,
- 0x04, 0xd2, 0x00, 0xc4, 0x20, 0x01, 0xf0, 0x80,
- 0xc1, 0x30, 0x04, 0x19, 0x08, 0x50, 0x00, 0x44,
- 0x00, 0x00, 0x79, 0x80, 0x00, 0xa1, 0x00, 0x84,
- 0xb5, 0x00, 0x51, 0x8b, 0xcf, 0x00, 0x00, 0x39,
- 0x00, 0x01, 0xb1, 0x80, 0x88, 0x00, 0x04, 0x19,
- 0x8a, 0x00, 0x04, 0x19, 0xc8, 0x20, 0x04, 0x19,
- 0xca, 0x20, 0x04, 0x19, 0xc2, 0x30, 0x04, 0x19,
- 0xcd, 0x10, 0x04, 0x19, 0xcf, 0x10, 0x04, 0x19,
- 0xb0, 0x00, 0x71, 0x8b, 0x8c, 0x00, 0x04, 0x19,
- 0x8e, 0x00, 0x04, 0x19, 0x10, 0x00, 0x71, 0x8b,
- 0xc4, 0x20, 0x04, 0x19, 0x93, 0x00, 0x01, 0x4f,
- 0xcd, 0x30, 0x00, 0x09, 0xcf, 0x30, 0x00, 0x09,
- 0x03, 0x03, 0x04, 0x49, 0x04, 0x81, 0x00, 0x54,
- 0x08, 0x50, 0x04, 0x64, 0x08, 0x50, 0x00, 0x44,
- 0x00, 0x00, 0x63, 0x80, 0x00, 0x00, 0x06, 0x19,
- 0x03, 0x00, 0x04, 0x49, 0x08, 0x50, 0x00, 0x44,
- 0x20, 0x01, 0x63, 0x80, 0x00, 0x00, 0x06, 0x19,
- 0x00, 0x02, 0xe2, 0x8b, 0x08, 0x41, 0x00, 0x84,
- 0x65, 0x00, 0x51, 0x8b, 0xc2, 0x20, 0x00, 0x39,
- 0x00, 0x00, 0x63, 0x80, 0xc1, 0xa0, 0x04, 0x19,
- 0x08, 0x61, 0x00, 0x44, 0x2d, 0x00, 0x51, 0x8b,
- 0xc2, 0x20, 0x00, 0x39, 0x00, 0x00, 0xb1, 0x80,
- 0xc1, 0xa0, 0x04, 0x19, 0x03, 0x00, 0x04, 0x49,
- 0x08, 0x50, 0x00, 0x44, 0x02, 0x20, 0x61, 0x0a,
- 0x00, 0x01, 0x00, 0x45, 0x02, 0x30, 0x61, 0x0a,
- 0x04, 0x03, 0x00, 0xc4, 0x05, 0xb0, 0xc8, 0x18,
- 0x04, 0x71, 0x00, 0xc4, 0x00, 0x13, 0x00, 0x44,
- 0x00, 0x79, 0x08, 0x44, 0x00, 0x04, 0x79, 0x80,
- 0x00, 0x49, 0x00, 0xc4, 0xca, 0x20, 0x04, 0x19,
- 0x4a, 0x04, 0x04, 0x19, 0xff, 0x00, 0xe2, 0x8b,
- 0x0c, 0xf9, 0x08, 0x44, 0xcf, 0x10, 0x04, 0x19,
- 0x0c, 0x2b, 0x08, 0x44, 0x8e, 0x00, 0x04, 0x19,
- 0x03, 0x30, 0x61, 0x0a, 0xc8, 0x20, 0x00, 0x39,
- 0x48, 0x04, 0x00, 0x39, 0x0a, 0x30, 0x61, 0x0a,
- 0x0c, 0xf9, 0x08, 0x44, 0xcd, 0x10, 0x04, 0x19,
- 0x0c, 0x2b, 0x08, 0x44, 0x8c, 0x00, 0x04, 0x19,
- 0x0c, 0xd9, 0x08, 0x44, 0x0c, 0x5a, 0x00, 0x44,
- 0x00, 0x79, 0x08, 0x44, 0x00, 0x04, 0x79, 0x80,
- 0x00, 0x49, 0x00, 0xc4, 0xc3, 0x30, 0x04, 0x19,
- 0xca, 0x30, 0x00, 0x99, 0x0c, 0xd9, 0x08, 0x44,
- 0x42, 0x0a, 0x09, 0x0e, 0x00, 0x01, 0x33, 0x11,
- 0x8c, 0x01, 0xa3, 0x80, 0x00, 0x01, 0x7a, 0x10,
- 0x80, 0x05, 0xb1, 0x80, 0x05, 0xb0, 0xe0, 0x18,
- 0x00, 0x93, 0x00, 0x84, 0x00, 0x79, 0x08, 0x44,
- 0x00, 0x04, 0x79, 0x80, 0x00, 0x49, 0x00, 0xc4,
- 0x0c, 0x1b, 0x08, 0x44, 0x88, 0x00, 0x04, 0x19,
- 0x8a, 0x00, 0x00, 0x99, 0x0c, 0xd9, 0x08, 0x44,
- 0x42, 0x0a, 0x09, 0x0e, 0x80, 0x00, 0x71, 0x8b,
- 0xc0, 0x04, 0xb1, 0x82, 0x10, 0x00, 0xe0, 0x0b,
- 0x00, 0x43, 0x00, 0x84, 0x02, 0x30, 0x61, 0x0a,
- 0x01, 0x30, 0xc8, 0x0a, 0x00, 0x43, 0x00, 0x84,
- 0x00, 0x00, 0xb1, 0x80, 0xc2, 0x30, 0x04, 0x19,
- 0x0c, 0xa8, 0x00, 0x44, 0x02, 0x30, 0x61, 0x0a,
- 0x00, 0xd3, 0x00, 0xc4, 0x05, 0xb0, 0xc8, 0x18,
- 0x04, 0x63, 0x00, 0xc4, 0x08, 0xf3, 0x00, 0x44,
- 0x00, 0x79, 0x08, 0x44, 0x00, 0x04, 0x79, 0x80,
- 0x00, 0x49, 0x00, 0xc4, 0x20, 0x00, 0x04, 0x19,
- 0xff, 0x00, 0xe2, 0x8b, 0x0c, 0xf9, 0x08, 0x44,
- 0xcd, 0x10, 0x04, 0x19, 0xcf, 0x10, 0x04, 0x19,
- 0x0c, 0x2b, 0x08, 0x44, 0x8c, 0x00, 0x04, 0x19,
- 0x8e, 0x00, 0x04, 0x19, 0x03, 0x30, 0x61, 0x0a,
- 0xc8, 0x20, 0x00, 0x39, 0xca, 0x20, 0x00, 0x39,
- 0x48, 0x04, 0x00, 0x39, 0x4a, 0x04, 0x00, 0x39,
- 0x0c, 0xd9, 0x08, 0x44, 0x0c, 0x5a, 0x00, 0x44,
- 0x00, 0x79, 0x08, 0x44, 0x00, 0x04, 0x79, 0x80,
- 0x00, 0x49, 0x00, 0xc4, 0xc3, 0x30, 0x04, 0x19,
- 0x0c, 0xd9, 0x08, 0x44, 0x42, 0x0a, 0x09, 0x0e,
- 0x05, 0xb0, 0xe0, 0x18, 0x00, 0x18, 0x00, 0x84,
- 0x00, 0x79, 0x08, 0x44, 0x00, 0x04, 0x79, 0x80,
- 0x00, 0x49, 0x00, 0xc4, 0x0c, 0x1b, 0x08, 0x44,
- 0x80, 0x01, 0x00, 0x80, 0x0c, 0xd9, 0x08, 0x44,
- 0x42, 0x0a, 0x09, 0x0e, 0x80, 0x00, 0x71, 0x8b,
- 0xc0, 0x04, 0xb1, 0x82, 0x10, 0x00, 0xe0, 0x0b,
- 0x00, 0x88, 0x00, 0x84, 0x02, 0x30, 0x61, 0x0a,
- 0x01, 0x30, 0xc8, 0x0a, 0x00, 0x88, 0x00, 0x84,
- 0x00, 0x00, 0xb1, 0x80, 0xc2, 0x30, 0x04, 0x19,
- 0x00, 0x01, 0x00, 0x11, 0x00, 0x0f, 0xe2, 0x8b,
- 0x00, 0x00, 0x41, 0xcb, 0x8c, 0x00, 0x00, 0x80,
- 0x00, 0x00, 0x48, 0xcb, 0x20, 0x00, 0x7a, 0x80,
- 0x80, 0x01, 0x00, 0x80, 0x82, 0x0c, 0x09, 0x6e,
- 0x03, 0x08, 0x09, 0x0e, 0x80, 0x40, 0x09, 0xcf,
- 0x00, 0x01, 0x71, 0xc2, 0x00, 0x08, 0xc2, 0x1b,
- 0x04, 0xb8, 0x00, 0xc4, 0x20, 0x05, 0xa8, 0x80,
- 0x20, 0x01, 0xf0, 0x80, 0x00, 0x01, 0xc2, 0x1b,
- 0x04, 0x48, 0x00, 0xc4, 0x20, 0x05, 0xa8, 0x80,
- 0x20, 0x01, 0xf0, 0x80, 0x00, 0x02, 0xc2, 0x1b,
- 0x04, 0x68, 0x00, 0xc4, 0x20, 0x05, 0xa8, 0x80,
- 0x20, 0x01, 0xf0, 0x80, 0x20, 0x03, 0xa8, 0x80,
- 0x00, 0x01, 0x00, 0x11, 0x00, 0x04, 0xc2, 0x8b,
- 0x08, 0x78, 0x00, 0xc4, 0x00, 0x00, 0xe9, 0x80,
- 0x05, 0xb0, 0xa8, 0x18, 0x00, 0x00, 0x4a, 0xcb,
- 0x20, 0x00, 0xa8, 0x22, 0xd0, 0x01, 0x00, 0x82,
- 0x40, 0x01, 0x00, 0x80, 0xc4, 0x00, 0x04, 0x19,
- 0xb0, 0x00, 0xe2, 0x8b, 0x06, 0x20, 0xa8, 0x0a,
- 0x2d, 0x10, 0x61, 0x0a, 0xd1, 0x08, 0x09, 0x2e,
- 0x00, 0x01, 0xa8, 0x02, 0x0c, 0xf9, 0x08, 0x44,
- 0xcd, 0x10, 0x04, 0x19, 0x0c, 0x2b, 0x08, 0x44,
- 0x03, 0x08, 0x09, 0x0e, 0x9a, 0x25, 0xb1, 0x60,
- 0xa2, 0x0e, 0x09, 0x6e, 0x03, 0x00, 0x09, 0x0f,
- 0x00, 0x01, 0x71, 0x82, 0x20, 0x01, 0x00, 0x80,
- 0x00, 0x00, 0x61, 0xcb, 0x80, 0x01, 0x00, 0x80,
- 0x03, 0x00, 0x09, 0x0f, 0x00, 0x01, 0x71, 0xc2,
- 0x00, 0x08, 0xc2, 0x1b, 0x0c, 0x2a, 0x00, 0xc4,
- 0x20, 0x05, 0xa8, 0x80, 0x20, 0x01, 0xf0, 0x80,
- 0x00, 0x01, 0xc2, 0x1b, 0x0c, 0x1a, 0x00, 0xc4,
- 0x20, 0x05, 0xa8, 0x80, 0x20, 0x01, 0xf0, 0x80,
- 0x00, 0x02, 0xc2, 0x1b, 0x0c, 0x3a, 0x00, 0xc4,
- 0x20, 0x05, 0xa8, 0x80, 0x20, 0x01, 0xf0, 0x80,
- 0x20, 0x03, 0xa8, 0x80, 0x00, 0x01, 0x00, 0x11,
- 0x00, 0x04, 0xc2, 0x8b, 0x04, 0xaa, 0x00, 0xc4,
- 0x00, 0x00, 0xe9, 0x80, 0x05, 0xb0, 0xa8, 0x18,
- 0x00, 0x00, 0x4a, 0xcb, 0x20, 0x00, 0xa8, 0x22,
- 0xd0, 0x01, 0x00, 0x82, 0x40, 0x01, 0x00, 0x80,
- 0xc7, 0x00, 0x04, 0x19, 0xb0, 0x00, 0xe2, 0x8b,
- 0x06, 0x20, 0xa8, 0x0a, 0x2f, 0x10, 0x61, 0x0a,
- 0xf1, 0x08, 0x09, 0x2e, 0x00, 0x01, 0xa8, 0x02,
- 0x0c, 0xf9, 0x08, 0x44, 0xcf, 0x10, 0x04, 0x19,
- 0x0c, 0x2b, 0x08, 0x44, 0x9f, 0x35, 0xb1, 0x60,
- 0x03, 0x08, 0x09, 0x0e, 0x00, 0x01, 0x71, 0x82,
- 0x20, 0x01, 0x00, 0x80, 0x00, 0x00, 0x61, 0xcb,
- 0x80, 0x01, 0x00, 0x80, 0xe4, 0x20, 0x71, 0x8b,
- 0x00, 0x01, 0x00, 0x45, 0x90, 0x40, 0x09, 0x8f,
- 0x00, 0x05, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0x08, 0x19, 0x04, 0xd4, 0x93, 0x00, 0x01, 0x4f,
- 0xe7, 0x00, 0x01, 0x6f, 0x0d, 0x30, 0x61, 0x0a,
- 0x20, 0x04, 0x61, 0xa8, 0xc2, 0x00, 0x00, 0x82,
- 0x02, 0x04, 0x61, 0xa8, 0xc2, 0x00, 0x00, 0x82,
- 0xcd, 0x30, 0x00, 0x09, 0x02, 0x00, 0x00, 0x02,
- 0x02, 0x00, 0x00, 0x02, 0xc0, 0x80, 0x00, 0x09,
- 0x20, 0x00, 0x09, 0x49, 0x0f, 0x30, 0x61, 0x0a,
- 0x0d, 0x30, 0xc8, 0x0a, 0x00, 0x29, 0x00, 0xc4,
- 0x00, 0x80, 0xc8, 0x0a, 0x00, 0x29, 0x00, 0xc4,
- 0x00, 0x04, 0xb1, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0xc9, 0x20, 0x04, 0x39, 0x00, 0x39, 0x00, 0x44,
- 0x00, 0x04, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0x00, 0x04, 0xb1, 0x80, 0xc9, 0x20, 0x04, 0x39,
- 0x00, 0x39, 0x00, 0x44, 0x09, 0x20, 0x23, 0x0a,
- 0x00, 0x00, 0x06, 0x19, 0xc9, 0x20, 0x04, 0x19,
- 0x00, 0x00, 0x40, 0x45, 0x02, 0x00, 0x61, 0x0a,
- 0x0c, 0xb9, 0x04, 0x14, 0x04, 0x00, 0x61, 0x0a,
- 0x06, 0x00, 0x48, 0x0a, 0x00, 0xa9, 0x04, 0x54,
- 0xc6, 0x00, 0x04, 0x19, 0x0c, 0xa9, 0x00, 0x44,
- 0x05, 0x00, 0xc8, 0x0a, 0x0c, 0xa9, 0x04, 0x54,
- 0xc5, 0x00, 0x04, 0x19, 0x07, 0x00, 0x61, 0x0a,
- 0x0c, 0x00, 0x48, 0x0a, 0x00, 0xb9, 0x04, 0x54,
- 0xcc, 0x00, 0x04, 0x19, 0x0c, 0xb9, 0x00, 0x44,
- 0x0e, 0x00, 0xc8, 0x0a, 0x0c, 0xb9, 0x04, 0x54,
- 0xce, 0x00, 0x04, 0x19, 0x0c, 0x5a, 0x00, 0x44,
- 0x82, 0x0d, 0x09, 0x2e, 0x80, 0x40, 0x09, 0xcf,
- 0x00, 0xdf, 0x71, 0x8b, 0x80, 0x01, 0x00, 0x80,
- 0x02, 0xc1, 0x00, 0x22, 0x03, 0xc1, 0x00, 0x22,
- 0x00, 0x01, 0x65, 0x80, 0xd2, 0x05, 0x65, 0x82,
- 0x40, 0x21, 0x00, 0x80, 0xd3, 0x03, 0x00, 0x82,
- 0x40, 0x33, 0x00, 0x80, 0x0c, 0x5a, 0x00, 0x44,
- 0x0f, 0x30, 0x61, 0x0a, 0x0d, 0x30, 0xc8, 0x0a,
- 0x08, 0xd9, 0x00, 0xc4, 0x93, 0x00, 0x01, 0x4f,
- 0xe7, 0x00, 0x01, 0x6f, 0x0f, 0x30, 0x61, 0x0a,
- 0x20, 0x00, 0x00, 0x88, 0x02, 0x00, 0x61, 0x02,
- 0x02, 0x00, 0x00, 0x03, 0xcf, 0x30, 0x00, 0x09,
- 0x20, 0x00, 0x09, 0x49, 0x00, 0x04, 0x63, 0x80,
- 0x04, 0xd9, 0x00, 0x44, 0x00, 0x04, 0xb1, 0x80,
- 0x00, 0x00, 0x00, 0x46, 0x02, 0x30, 0x61, 0x0a,
- 0x05, 0xb0, 0xa8, 0x18, 0xc2, 0x30, 0x04, 0x19,
- 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0xc8, 0x0a,
- 0x0c, 0x0b, 0x04, 0x14, 0x0e, 0x10, 0x61, 0x0a,
- 0x04, 0x2b, 0x00, 0x44, 0x0c, 0x10, 0xc8, 0x0a,
- 0x04, 0x2b, 0x04, 0x54, 0x0c, 0x10, 0x61, 0x0a,
- 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0xa8, 0x18,
- 0xa0, 0x00, 0x00, 0x88, 0x00, 0x01, 0x71, 0x82,
- 0x00, 0x00, 0x00, 0x46, 0x00, 0x04, 0x33, 0x80,
- 0x00, 0x00, 0x83, 0x80, 0x20, 0x04, 0x7a, 0x80,
- 0x20, 0x01, 0x33, 0x80, 0x00, 0x00, 0x83, 0x80,
- 0x20, 0x00, 0x7a, 0x80, 0x20, 0x03, 0x00, 0x80,
- 0x00, 0x00, 0x00, 0x46, 0x16, 0xce, 0x11, 0x00
-};
-
-static unsigned char ima_adpcm_capture[] = {
- 0x00, 0x10, 0x00, 0x44, 0x08, 0x00, 0x00, 0x44,
- 0x00, 0x70, 0x00, 0x44, 0x08, 0xd0, 0x00, 0x44,
- 0x00, 0xf0, 0x00, 0x44, 0x0d, 0xf2, 0x61, 0xa8,
- 0x44, 0x04, 0x04, 0x19, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x04, 0x63, 0x80, 0x00, 0x00, 0x06, 0x39,
- 0xff, 0x2e, 0x21, 0x49, 0xff, 0x0c, 0xd4, 0x49,
- 0x40, 0x49, 0x39, 0xac, 0x55, 0x55, 0x71, 0x8b,
- 0x50, 0x01, 0xb1, 0x80, 0x00, 0x00, 0x71, 0x8b,
- 0xc2, 0x30, 0x04, 0x19, 0xc0, 0xa0, 0x04, 0x19,
- 0xc2, 0xa0, 0x04, 0x19, 0x89, 0x00, 0x71, 0x8b,
- 0xc8, 0x30, 0x04, 0x19, 0x71, 0x00, 0x71, 0x8b,
- 0xcd, 0x00, 0x04, 0x19, 0xcf, 0x00, 0x04, 0x19,
- 0x80, 0x00, 0x71, 0x8b, 0xcb, 0x20, 0x04, 0x19,
- 0x20, 0x00, 0x71, 0x8b, 0xc4, 0x20, 0x04, 0x19,
- 0x47, 0x00, 0x51, 0x8b, 0xc0, 0x20, 0x00, 0x39,
- 0x00, 0x00, 0x63, 0x80, 0xc1, 0xa0, 0x04, 0x19,
- 0x93, 0x00, 0x01, 0x4f, 0xcd, 0x30, 0x00, 0x09,
- 0xcf, 0x30, 0x00, 0x09, 0x0c, 0x40, 0x00, 0x14,
- 0x00, 0x60, 0x00, 0x14, 0x00, 0x04, 0x61, 0xa8,
- 0x02, 0x04, 0x61, 0xa8, 0x0c, 0x60, 0x04, 0x24,
- 0x00, 0x00, 0x34, 0x49, 0x08, 0x50, 0x00, 0x44,
- 0x44, 0x04, 0x04, 0x39, 0x00, 0x00, 0x40, 0x45,
- 0x08, 0x30, 0x61, 0x0a, 0x05, 0xb0, 0xe8, 0x18,
- 0x0c, 0xc0, 0x04, 0x54, 0xc8, 0x30, 0x04, 0x19,
- 0x09, 0x04, 0x00, 0xa8, 0x0b, 0x04, 0x00, 0xa8,
- 0x00, 0x00, 0x40, 0x45, 0x09, 0x04, 0x61, 0xa8,
- 0xc1, 0x00, 0x04, 0x19, 0x0b, 0x04, 0x61, 0xa8,
- 0xca, 0x00, 0x04, 0x19, 0x0d, 0x00, 0x61, 0x0a,
- 0x00, 0x01, 0x00, 0x45, 0x0f, 0x00, 0x61, 0x0a,
- 0x00, 0x40, 0x09, 0x8f, 0x00, 0x01, 0x00, 0x45,
- 0x40, 0x40, 0x09, 0xef, 0xff, 0x20, 0x09, 0xcf,
- 0x00, 0x04, 0x63, 0xa1, 0x50, 0x03, 0x33, 0x80,
- 0x00, 0x04, 0xa3, 0x80, 0x00, 0xff, 0xc2, 0x8b,
- 0x0c, 0x12, 0x04, 0x54, 0x08, 0x12, 0x00, 0xc4,
- 0x20, 0x03, 0x80, 0xc0, 0x30, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x7a, 0x0a, 0xd0, 0x01, 0x00, 0x82,
- 0x04, 0x50, 0x00, 0x44, 0xc0, 0x00, 0x00, 0x99,
- 0x04, 0x50, 0x00, 0x44, 0x00, 0xff, 0xc2, 0x8b,
- 0x20, 0x00, 0x00, 0x80, 0x00, 0x0d, 0x42, 0x8b,
- 0x04, 0x42, 0x00, 0xc4, 0x00, 0x0e, 0x42, 0x8b,
- 0x08, 0x52, 0x00, 0xc4, 0x00, 0x1e, 0x42, 0x8b,
- 0x00, 0xe2, 0x00, 0xc4, 0x00, 0x8e, 0x42, 0x8b,
- 0x08, 0xd2, 0x00, 0xc4, 0x00, 0x9e, 0x42, 0x8b,
- 0x04, 0xf2, 0x00, 0xc4, 0x00, 0xbe, 0x42, 0x8b,
- 0x04, 0xf2, 0x00, 0xc4, 0x00, 0x04, 0x42, 0x8b,
- 0x04, 0x11, 0x00, 0xc4, 0x00, 0x24, 0x42, 0x8b,
- 0x0c, 0x61, 0x00, 0xc4, 0x00, 0x55, 0x42, 0x8b,
- 0x04, 0x50, 0x00, 0xc4, 0x00, 0x3f, 0x42, 0x8b,
- 0x0c, 0x01, 0x00, 0xc4, 0x00, 0x00, 0x40, 0x45,
- 0x20, 0x01, 0x79, 0x80, 0x00, 0x30, 0x42, 0x8b,
- 0x04, 0x62, 0x00, 0xc4, 0x00, 0x00, 0x40, 0x45,
- 0x00, 0x00, 0x71, 0x8b, 0x40, 0x01, 0x00, 0x80,
- 0x04, 0x50, 0x00, 0x44, 0xff, 0x00, 0xe2, 0xab,
- 0x08, 0xc2, 0x00, 0xc4, 0x0f, 0xf2, 0xa8, 0xa8,
- 0x20, 0x00, 0xb1, 0x88, 0x00, 0x00, 0x41, 0x02,
- 0x4d, 0xf2, 0x00, 0x39, 0xc0, 0x01, 0x00, 0x82,
- 0x04, 0x50, 0x00, 0x44, 0x0d, 0xf2, 0xa3, 0xa8,
- 0x4d, 0xf2, 0x00, 0x39, 0x04, 0x50, 0x00, 0x44,
- 0xff, 0x00, 0xe2, 0xab, 0x20, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x61, 0x02, 0x4d, 0xf2, 0x04, 0x19,
- 0x04, 0x50, 0x00, 0x44, 0xff, 0x00, 0xe2, 0xab,
- 0xa0, 0x00, 0x00, 0x88, 0x00, 0x00, 0x61, 0x10,
- 0x4d, 0xf2, 0x04, 0x19, 0x04, 0x50, 0x00, 0x44,
- 0xff, 0x20, 0xe2, 0xab, 0x60, 0x00, 0x00, 0x88,
- 0x00, 0x00, 0x71, 0xc0, 0x4d, 0xf2, 0x04, 0x19,
- 0x04, 0x50, 0x00, 0x44, 0x00, 0x00, 0x7a, 0x0a,
- 0x20, 0x01, 0xf0, 0x80, 0x01, 0xa0, 0x41, 0x0a,
- 0x00, 0x11, 0x00, 0xc4, 0x20, 0x01, 0xf0, 0x80,
- 0xc1, 0x30, 0x04, 0x19, 0x04, 0x50, 0x00, 0x44,
- 0x00, 0x00, 0x79, 0x80, 0x0c, 0x41, 0x00, 0x84,
- 0x89, 0x00, 0x71, 0x8b, 0xc8, 0x30, 0x04, 0x19,
- 0x97, 0x00, 0x71, 0x8b, 0xcd, 0x00, 0x00, 0x39,
- 0x00, 0x01, 0xb1, 0x80, 0x80, 0x00, 0x04, 0x19,
- 0x82, 0x00, 0x04, 0x19, 0xc1, 0x20, 0x04, 0x19,
- 0xc3, 0x20, 0x04, 0x19, 0xc2, 0x30, 0x04, 0x19,
- 0xcd, 0x10, 0x04, 0x19, 0xcf, 0x10, 0x04, 0x19,
- 0xb0, 0x00, 0x71, 0x8b, 0x84, 0x00, 0x04, 0x19,
- 0x86, 0x00, 0x04, 0x19, 0x80, 0x00, 0x71, 0x8b,
- 0xcb, 0x20, 0x04, 0x19, 0x93, 0x00, 0x01, 0x4f,
- 0xcd, 0x30, 0x00, 0x09, 0xcf, 0x30, 0x00, 0x09,
- 0x03, 0x02, 0x04, 0x49, 0x08, 0x41, 0x00, 0x14,
- 0x04, 0x50, 0x00, 0x44, 0x00, 0x00, 0x63, 0x80,
- 0x00, 0x00, 0x06, 0x19, 0x03, 0x00, 0x04, 0x49,
- 0x04, 0x50, 0x00, 0x44, 0x20, 0x01, 0x63, 0x80,
- 0x00, 0x00, 0x06, 0x19, 0x00, 0x20, 0xe2, 0x8b,
- 0x00, 0xc1, 0x00, 0x84, 0x47, 0x00, 0x51, 0x8b,
- 0xc0, 0x20, 0x00, 0x39, 0x00, 0x00, 0x63, 0x80,
- 0xc1, 0xa0, 0x04, 0x19, 0x00, 0xe1, 0x00, 0x44,
- 0xbd, 0x00, 0x51, 0x8b, 0xc0, 0x20, 0x00, 0x39,
- 0x00, 0x00, 0xb1, 0x80, 0xc1, 0xa0, 0x04, 0x19,
- 0x03, 0x00, 0x04, 0x49, 0x04, 0x50, 0x00, 0x44,
- 0x00, 0x20, 0x61, 0x0a, 0x00, 0x01, 0x00, 0x45,
- 0x02, 0x30, 0x61, 0x0a, 0x0c, 0x83, 0x00, 0xc4,
- 0x0c, 0x78, 0x08, 0x44, 0x04, 0x5a, 0x08, 0x44,
- 0xb2, 0x00, 0x09, 0x4f, 0x10, 0x42, 0x09, 0x8e,
- 0x05, 0xb0, 0xe0, 0x18, 0x04, 0x23, 0x00, 0x84,
- 0x0c, 0x01, 0x00, 0x11, 0x08, 0x05, 0x61, 0x10,
- 0x00, 0x49, 0x08, 0x44, 0x00, 0x48, 0x08, 0x44,
- 0xb2, 0x00, 0x09, 0x4f, 0x80, 0x00, 0x71, 0x8b,
- 0xc0, 0x00, 0x00, 0x82, 0x0c, 0x01, 0x33, 0x10,
- 0x28, 0x01, 0xa3, 0x10, 0x00, 0x01, 0x7a, 0x80,
- 0x8c, 0x01, 0x00, 0x80, 0x02, 0x30, 0x61, 0x0a,
- 0x20, 0x00, 0x04, 0x19, 0x0c, 0x83, 0x00, 0xc4,
- 0x05, 0xb0, 0xc8, 0x18, 0x08, 0x43, 0x00, 0xc4,
- 0x01, 0x30, 0xc8, 0x0a, 0x0c, 0x38, 0x00, 0xc4,
- 0x08, 0x88, 0x00, 0x44, 0x0c, 0x78, 0x08, 0x44,
- 0x04, 0x5a, 0x08, 0x44, 0x00, 0x00, 0xa3, 0x18,
- 0x80, 0x00, 0x04, 0x19, 0x0b, 0x04, 0x61, 0xa8,
- 0xc3, 0x20, 0x00, 0x39, 0xc3, 0x30, 0x04, 0x19,
- 0x0f, 0x10, 0x61, 0x0a, 0xca, 0x30, 0x04, 0x19,
- 0x09, 0x04, 0x41, 0xa8, 0xe1, 0x20, 0x00, 0x39,
- 0xd1, 0x00, 0x09, 0x4f, 0x00, 0x04, 0x61, 0x02,
- 0x08, 0x63, 0x00, 0x44, 0x03, 0x30, 0x41, 0x0a,
- 0x20, 0x00, 0x00, 0x39, 0xa3, 0x00, 0x09, 0x4f,
- 0x00, 0x04, 0x61, 0x02, 0x00, 0x48, 0x08, 0x44,
- 0x08, 0x88, 0x00, 0x44, 0x02, 0x30, 0x61, 0x0a,
- 0x00, 0x08, 0x00, 0xc4, 0x0c, 0x78, 0x08, 0x44,
- 0x04, 0x5a, 0x08, 0x44, 0xb2, 0x00, 0x09, 0x0f,
- 0x10, 0x40, 0x09, 0x8e, 0x00, 0x00, 0x68, 0x5b,
- 0x20, 0x04, 0xb1, 0x80, 0x02, 0x00, 0x61, 0x5b,
- 0x88, 0x03, 0x7a, 0x80, 0xac, 0x01, 0x00, 0x80,
- 0x05, 0xb0, 0xe0, 0x18, 0x00, 0xd3, 0x00, 0x84,
- 0x00, 0x49, 0x08, 0x44, 0x00, 0x48, 0x08, 0x44,
- 0xb2, 0x00, 0x09, 0x0f, 0x80, 0x00, 0x71, 0x8b,
- 0xc0, 0x00, 0x00, 0x82, 0x02, 0x30, 0x61, 0x0a,
- 0x00, 0x08, 0x00, 0xc4, 0x05, 0xb0, 0xc8, 0x18,
- 0x0c, 0x18, 0x00, 0xc4, 0x01, 0x30, 0xc8, 0x0a,
- 0x0c, 0x38, 0x00, 0xc4, 0x08, 0x88, 0x00, 0x44,
- 0x0c, 0x78, 0x08, 0x44, 0x00, 0x00, 0x61, 0x18,
- 0x20, 0x05, 0xb1, 0x80, 0x00, 0x00, 0x68, 0xcb,
- 0x80, 0x00, 0x04, 0x19, 0x0d, 0x10, 0x61, 0x0a,
- 0xc3, 0x30, 0x04, 0x19, 0x0b, 0x04, 0x41, 0xa8,
- 0x09, 0x04, 0x41, 0xa8, 0xe1, 0x20, 0x00, 0x39,
- 0x08, 0x38, 0x00, 0x44, 0x03, 0x30, 0x41, 0x0a,
- 0x20, 0x04, 0xb1, 0x80, 0x00, 0x48, 0x08, 0x44,
- 0x08, 0x88, 0x00, 0x44, 0x00, 0x00, 0xb1, 0x80,
- 0xc2, 0x30, 0x04, 0x19, 0x0c, 0xb8, 0x00, 0xd4,
- 0x0f, 0x30, 0x61, 0x0a, 0x0d, 0x30, 0xc8, 0x0a,
- 0x0c, 0xb8, 0x00, 0xc4, 0x93, 0x00, 0x01, 0x4f,
- 0xe7, 0x00, 0x01, 0x6f, 0x0f, 0x30, 0x61, 0x0a,
- 0x20, 0x00, 0x00, 0x88, 0x02, 0x00, 0x61, 0x02,
- 0x41, 0x04, 0x04, 0x19, 0x02, 0x04, 0x61, 0x02,
- 0x43, 0x04, 0x04, 0x39, 0xcf, 0x30, 0x00, 0x09,
- 0x20, 0x00, 0x09, 0x49, 0x00, 0x59, 0x00, 0x44,
- 0x93, 0x00, 0x01, 0x4f, 0xe7, 0x00, 0x01, 0x6f,
- 0x0d, 0x30, 0x61, 0x0a, 0x20, 0x00, 0x61, 0x88,
- 0xc2, 0x00, 0x00, 0x82, 0xc2, 0x03, 0x00, 0x82,
- 0xcd, 0x30, 0x00, 0x09, 0x20, 0x00, 0x09, 0x49,
- 0x0f, 0x30, 0x61, 0x0a, 0x0d, 0x30, 0xc8, 0x0a,
- 0x0c, 0x58, 0x00, 0x84, 0x02, 0x30, 0x61, 0x0a,
- 0x05, 0xb0, 0xa8, 0x18, 0xc2, 0x30, 0x04, 0x19,
- 0x00, 0x00, 0x00, 0x46, 0x90, 0x40, 0x09, 0x8f,
- 0x12, 0x04, 0x09, 0x6e, 0x03, 0x00, 0x09, 0x0e,
- 0x00, 0x01, 0x71, 0x82, 0x20, 0x01, 0x00, 0x80,
- 0x00, 0x00, 0x61, 0xcb, 0x80, 0x04, 0xb1, 0x80,
- 0x00, 0x01, 0xe0, 0x60, 0x0c, 0xd8, 0x04, 0x14,
- 0x00, 0x01, 0xeb, 0x80, 0x40, 0x00, 0x52, 0x1b,
- 0x80, 0x00, 0x79, 0x80, 0xc0, 0x01, 0x71, 0xc2,
- 0x20, 0x00, 0xc0, 0x80, 0x08, 0x0a, 0x04, 0x54,
- 0xc0, 0x04, 0xa8, 0x82, 0x80, 0x00, 0x72, 0x1b,
- 0x80, 0x00, 0x00, 0x80, 0x00, 0x01, 0xf0, 0x80,
- 0x20, 0x00, 0xc0, 0x80, 0x0c, 0x2a, 0x04, 0x54,
- 0xc0, 0x04, 0xa8, 0x82, 0x10, 0x00, 0x72, 0x1b,
- 0x80, 0x00, 0x00, 0x80, 0x00, 0x01, 0xf0, 0x80,
- 0x20, 0x00, 0xc0, 0x80, 0x08, 0x3a, 0x04, 0x54,
- 0xc0, 0x04, 0xa8, 0x82, 0x20, 0x00, 0x72, 0x1b,
- 0x80, 0x00, 0x00, 0x80, 0xc0, 0x03, 0xf0, 0x82,
- 0x20, 0x00, 0xa0, 0x80, 0x00, 0x01, 0x00, 0x11,
- 0x40, 0x00, 0xc2, 0x8b, 0x00, 0xaa, 0x00, 0xc4,
- 0x00, 0x00, 0xe9, 0x80, 0x05, 0xb0, 0xa8, 0x18,
- 0x00, 0x01, 0xa8, 0x22, 0xd0, 0x01, 0x00, 0x82,
- 0xf0, 0x00, 0xe2, 0x1b, 0x06, 0x20, 0xa8, 0x0a,
- 0x2d, 0x10, 0x61, 0x0a, 0xd1, 0x00, 0x09, 0x2e,
- 0x00, 0x01, 0xa8, 0x02, 0x0e, 0x10, 0xc8, 0x0a,
- 0x0c, 0xba, 0x04, 0x14, 0x0e, 0x10, 0x61, 0x0a,
- 0x04, 0x4a, 0x00, 0x44, 0x0c, 0x10, 0xc8, 0x0a,
- 0x04, 0x4a, 0x04, 0x54, 0x0c, 0x10, 0x61, 0x0a,
- 0xd0, 0x01, 0x00, 0x82, 0x00, 0x10, 0xa8, 0x18,
- 0xa0, 0x00, 0x00, 0x88, 0x00, 0x01, 0x71, 0x82,
- 0x03, 0x00, 0x09, 0x0e, 0x9a, 0x01, 0x00, 0x60,
- 0x32, 0x00, 0x09, 0x2e, 0x00, 0x00, 0x00, 0x46,
- 0x00, 0x01, 0x71, 0x82, 0x20, 0x01, 0x00, 0x80,
- 0x00, 0x00, 0x61, 0xcb, 0x80, 0x24, 0xb1, 0xc0,
- 0x00, 0x31, 0xe0, 0x60, 0x0c, 0xca, 0x04, 0x14,
- 0x00, 0x01, 0xeb, 0x80, 0x40, 0x00, 0x52, 0x1b,
- 0x80, 0x00, 0x79, 0x80, 0xc0, 0x01, 0x71, 0xc2,
- 0x20, 0x00, 0xc0, 0x80, 0x08, 0xda, 0x04, 0x54,
- 0xc0, 0x04, 0xa8, 0x82, 0x80, 0x00, 0x72, 0x1b,
- 0x80, 0x00, 0x00, 0x80, 0x00, 0x01, 0xf0, 0x80,
- 0x20, 0x00, 0xc0, 0x80, 0x0c, 0xfa, 0x04, 0x54,
- 0xc0, 0x04, 0xa8, 0x82, 0x10, 0x00, 0x72, 0x1b,
- 0x80, 0x00, 0x00, 0x80, 0x00, 0x01, 0xf0, 0x80,
- 0x20, 0x00, 0xc0, 0x80, 0x08, 0x29, 0x04, 0x54,
- 0xc0, 0x04, 0xa8, 0x82, 0x20, 0x00, 0x72, 0x1b,
- 0x80, 0x00, 0x00, 0x80, 0xc0, 0x03, 0xf0, 0x82,
- 0x20, 0x00, 0xa0, 0x80, 0x00, 0x01, 0x00, 0x11,
- 0x40, 0x00, 0xc2, 0x8b, 0x00, 0x39, 0x00, 0xc4,
- 0x00, 0x00, 0xe9, 0x80, 0x05, 0xb0, 0xa8, 0x18,
- 0x00, 0x01, 0xa8, 0x22, 0xd0, 0x01, 0x00, 0x82,
- 0xb0, 0x00, 0xe2, 0x1b, 0x06, 0x20, 0xa8, 0x0a,
- 0x2f, 0x10, 0x61, 0x0a, 0xf1, 0x00, 0x09, 0x2e,
- 0x00, 0x01, 0xa8, 0x02, 0x0e, 0x10, 0xc8, 0x0a,
- 0x0c, 0xa9, 0x04, 0x14, 0x0e, 0x10, 0x61, 0x0a,
- 0x04, 0x99, 0x00, 0x44, 0x0c, 0x10, 0xc8, 0x0a,
- 0x04, 0x99, 0x04, 0x54, 0x0c, 0x10, 0x61, 0x0a,
- 0xd0, 0x01, 0x00, 0x82, 0x00, 0x10, 0xa8, 0x18,
- 0xa0, 0x00, 0x00, 0x88, 0x00, 0x01, 0x71, 0x82,
- 0x9f, 0x01, 0x00, 0x60, 0x00, 0x00, 0x00, 0x46,
- 0x00, 0x00, 0x33, 0x80, 0x00, 0x00, 0x83, 0x80,
- 0x20, 0x00, 0x7a, 0x80, 0x20, 0x07, 0x33, 0x80,
- 0x00, 0x00, 0x83, 0x80, 0x20, 0x04, 0x7a, 0x80,
- 0x20, 0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x46,
- 0x02, 0x00, 0x61, 0x0a, 0x04, 0x1b, 0x04, 0x14,
- 0x01, 0x00, 0x61, 0x0a, 0x03, 0x00, 0x48, 0x0a,
- 0x0c, 0x79, 0x04, 0x54, 0xc3, 0x00, 0x04, 0x19,
- 0x04, 0xc9, 0x00, 0x44, 0x08, 0x00, 0xc8, 0x0a,
- 0x04, 0xc9, 0x04, 0x54, 0xc8, 0x00, 0x04, 0x19,
- 0x0a, 0x00, 0x61, 0x0a, 0x09, 0x00, 0x48, 0x0a,
- 0x0c, 0xe9, 0x04, 0x54, 0xc9, 0x00, 0x04, 0x19,
- 0x04, 0xd9, 0x00, 0x44, 0x0b, 0x00, 0xc8, 0x0a,
- 0x04, 0xd9, 0x04, 0x54, 0xcb, 0x00, 0x04, 0x19,
- 0x04, 0x00, 0x61, 0x0a, 0x06, 0x00, 0x48, 0x0a,
- 0x0c, 0xf9, 0x04, 0x54, 0xc6, 0x00, 0x04, 0x19,
- 0x04, 0x0b, 0x00, 0x44, 0x05, 0x00, 0xc8, 0x0a,
- 0x04, 0x0b, 0x04, 0x54, 0xc5, 0x00, 0x04, 0x19,
- 0x07, 0x00, 0x61, 0x0a, 0x0c, 0x00, 0x48, 0x0a,
- 0x0c, 0x2b, 0x04, 0x54, 0xcc, 0x00, 0x04, 0x19,
- 0x04, 0x1b, 0x00, 0x44, 0x0e, 0x00, 0xc8, 0x0a,
- 0x04, 0x1b, 0x04, 0x54, 0xce, 0x00, 0x04, 0x19,
- 0x00, 0x00, 0x40, 0x45, 0x92, 0x20, 0x71, 0x8b,
- 0xa6, 0xc5, 0x11, 0x00
-};
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index f183f1845a3..0bbcd4714d2 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* Routines for control of 16-bit SoundBlaster cards and clones
* Note: This is very ugly hardware which uses one 8-bit DMA channel and
* second 16-bit DMA channel. Unfortunately 8-bit DMA channel can't
@@ -33,11 +33,11 @@
*
*/
-#include <sound/driver.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/init.h>
#include <linux/time.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/sb16_csp.h>
@@ -45,7 +45,7 @@
#include <sound/control.h>
#include <sound/info.h>
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("Routines for control of 16-bit SoundBlaster cards and clones");
MODULE_LICENSE("GPL");
@@ -395,7 +395,7 @@ static int snd_sb16_capture_trigger(struct snd_pcm_substream *substream,
return result;
}
-irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id)
{
struct snd_sb *chip = dev_id;
unsigned char status;
@@ -405,7 +405,7 @@ irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
status = snd_sbmixer_read(chip, SB_DSP4_IRQSTATUS);
spin_unlock(&chip->mixer_lock);
if ((status & SB_IRQTYPE_MPUIN) && chip->rmidi_callback)
- chip->rmidi_callback(irq, chip->rmidi->private_data, regs);
+ chip->rmidi_callback(irq, chip->rmidi->private_data);
if (status & SB_IRQTYPE_8BIT) {
ok = 0;
if (chip->mode & SB_MODE_PLAYBACK_8) {
@@ -563,6 +563,11 @@ static int snd_sb16_playback_open(struct snd_pcm_substream *substream)
__open_ok:
if (chip->hardware == SB_HW_ALS100)
runtime->hw.rate_max = 48000;
+ if (chip->hardware == SB_HW_CS5530) {
+ runtime->hw.buffer_bytes_max = 32 * 1024;
+ runtime->hw.periods_min = 2;
+ runtime->hw.rate_min = 44100;
+ }
if (chip->mode & SB_RATE_LOCK)
runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate;
chip->playback_substream = substream;
@@ -633,6 +638,11 @@ static int snd_sb16_capture_open(struct snd_pcm_substream *substream)
__open_ok:
if (chip->hardware == SB_HW_ALS100)
runtime->hw.rate_max = 48000;
+ if (chip->hardware == SB_HW_CS5530) {
+ runtime->hw.buffer_bytes_max = 32 * 1024;
+ runtime->hw.periods_min = 2;
+ runtime->hw.rate_min = 44100;
+ }
if (chip->mode & SB_RATE_LOCK)
runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate;
chip->capture_substream = substream;
@@ -660,7 +670,8 @@ static int snd_sb16_capture_close(struct snd_pcm_substream *substream)
static int snd_sb16_set_dma_mode(struct snd_sb *chip, int what)
{
if (chip->dma8 < 0 || chip->dma16 < 0) {
- snd_assert(what == 0, return -EINVAL);
+ if (snd_BUG_ON(what))
+ return -EINVAL;
return 0;
}
if (what == 0) {
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 60ee79cd14a..6c32b3aa34a 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -1,6 +1,6 @@
/*
* Driver for SoundBlaster 1.0/2.0/Pro soundcards and compatible
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,26 +19,24 @@
*
*/
-#include <sound/driver.h>
#include <linux/init.h>
#include <linux/err.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
+#include <linux/isa.h>
#include <linux/ioport.h>
-#include <linux/moduleparam.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/opl3.h>
#include <sound/initval.h>
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("Sound Blaster 1.0/2.0/Pro");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 1.0/SB 2.0/SB Pro}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3 */
@@ -56,14 +54,12 @@ MODULE_PARM_DESC(irq, "IRQ # for SB8 driver.");
module_param_array(dma8, int, NULL, 0444);
MODULE_PARM_DESC(dma8, "8-bit DMA # for SB8 driver.");
-static struct platform_device *devices[SNDRV_CARDS];
-
struct snd_sb8 {
struct resource *fm_res; /* used to block FM i/o region for legacy cards */
struct snd_sb *chip;
};
-static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id)
{
struct snd_sb *chip = dev_id;
@@ -76,26 +72,40 @@ static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id, struct pt_regs *regs
static void snd_sb8_free(struct snd_card *card)
{
- struct snd_sb8 *acard = (struct snd_sb8 *)card->private_data;
+ struct snd_sb8 *acard = card->private_data;
if (acard == NULL)
return;
release_and_free_resource(acard->fm_res);
}
-static int __init snd_sb8_probe(struct platform_device *pdev)
+static int snd_sb8_match(struct device *pdev, unsigned int dev)
+{
+ if (!enable[dev])
+ return 0;
+ if (irq[dev] == SNDRV_AUTO_IRQ) {
+ dev_err(pdev, "please specify irq\n");
+ return 0;
+ }
+ if (dma8[dev] == SNDRV_AUTO_DMA) {
+ dev_err(pdev, "please specify dma8\n");
+ return 0;
+ }
+ return 1;
+}
+
+static int snd_sb8_probe(struct device *pdev, unsigned int dev)
{
- int dev = pdev->id;
struct snd_sb *chip;
struct snd_card *card;
struct snd_sb8 *acard;
struct snd_opl3 *opl3;
int err;
- card = snd_card_new(index[dev], id[dev], THIS_MODULE,
- sizeof(struct snd_sb8));
- if (card == NULL)
- return -ENOMEM;
+ err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
+ sizeof(struct snd_sb8), &card);
+ if (err < 0)
+ return err;
acard = card->private_data;
card->private_free = snd_sb8_free;
@@ -129,8 +139,10 @@ static int __init snd_sb8_probe(struct platform_device *pdev)
break;
}
}
- if (i >= ARRAY_SIZE(possible_ports))
+ if (i >= ARRAY_SIZE(possible_ports)) {
+ err = -EINVAL;
goto _err;
+ }
}
acard->chip = chip;
@@ -180,12 +192,10 @@ static int __init snd_sb8_probe(struct platform_device *pdev)
chip->port,
irq[dev], dma8[dev]);
- snd_card_set_dev(card, &pdev->dev);
-
if ((err = snd_card_register(card)) < 0)
goto _err;
- platform_set_drvdata(pdev, card);
+ dev_set_drvdata(pdev, card);
return 0;
_err:
@@ -193,17 +203,17 @@ static int __init snd_sb8_probe(struct platform_device *pdev)
return err;
}
-static int snd_sb8_remove(struct platform_device *pdev)
+static int snd_sb8_remove(struct device *pdev, unsigned int dev)
{
- snd_card_free(platform_get_drvdata(pdev));
- platform_set_drvdata(pdev, NULL);
+ snd_card_free(dev_get_drvdata(pdev));
return 0;
}
#ifdef CONFIG_PM
-static int snd_sb8_suspend(struct platform_device *dev, pm_message_t state)
+static int snd_sb8_suspend(struct device *dev, unsigned int n,
+ pm_message_t state)
{
- struct snd_card *card = platform_get_drvdata(dev);
+ struct snd_card *card = dev_get_drvdata(dev);
struct snd_sb8 *acard = card->private_data;
struct snd_sb *chip = acard->chip;
@@ -213,9 +223,9 @@ static int snd_sb8_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}
-static int snd_sb8_resume(struct platform_device *dev)
+static int snd_sb8_resume(struct device *dev, unsigned int n)
{
- struct snd_card *card = platform_get_drvdata(dev);
+ struct snd_card *card = dev_get_drvdata(dev);
struct snd_sb8 *acard = card->private_data;
struct snd_sb *chip = acard->chip;
@@ -226,9 +236,10 @@ static int snd_sb8_resume(struct platform_device *dev)
}
#endif
-#define SND_SB8_DRIVER "snd_sb8"
+#define DEV_NAME "sb8"
-static struct platform_driver snd_sb8_driver = {
+static struct isa_driver snd_sb8_driver = {
+ .match = snd_sb8_match,
.probe = snd_sb8_probe,
.remove = snd_sb8_remove,
#ifdef CONFIG_PM
@@ -236,56 +247,18 @@ static struct platform_driver snd_sb8_driver = {
.resume = snd_sb8_resume,
#endif
.driver = {
- .name = SND_SB8_DRIVER
+ .name = DEV_NAME
},
};
-static void __init_or_module snd_sb8_unregister_all(void)
-{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(devices); ++i)
- platform_device_unregister(devices[i]);
- platform_driver_unregister(&snd_sb8_driver);
-}
-
static int __init alsa_card_sb8_init(void)
{
- int i, cards, err;
-
- err = platform_driver_register(&snd_sb8_driver);
- if (err < 0)
- return err;
-
- cards = 0;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
- struct platform_device *device;
- device = platform_device_register_simple(SND_SB8_DRIVER,
- i, NULL, 0);
- if (IS_ERR(device)) {
- err = PTR_ERR(device);
- goto errout;
- }
- devices[i] = device;
- cards++;
- }
- if (!cards) {
-#ifdef MODULE
- snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
-#endif
- err = -ENODEV;
- goto errout;
- }
- return 0;
-
- errout:
- snd_sb8_unregister_all();
- return err;
+ return isa_register_driver(&snd_sb8_driver, SNDRV_CARDS);
}
static void __exit alsa_card_sb8_exit(void)
{
- snd_sb8_unregister_all();
+ isa_unregister_driver(&snd_sb8_driver);
}
module_init(alsa_card_sb8_init)
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index aea9e5ec7b3..24d4121ab0e 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* Uros Bizjak <uros@kss-loka.si>
*
* Routines for control of 8-bit SoundBlaster cards and clones
@@ -30,15 +30,15 @@
* Cleaned up and rewrote lowlevel routines.
*/
-#include <sound/driver.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/init.h>
#include <linux/time.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/sb.h>
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Uros Bizjak <uros@kss-loka.si>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Uros Bizjak <uros@kss-loka.si>");
MODULE_DESCRIPTION("Routines for control of 8-bit SoundBlaster cards and clones");
MODULE_LICENSE("GPL");
@@ -107,12 +107,26 @@ static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream)
struct snd_sb *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned int mixreg, rate, size, count;
+ unsigned char format;
+ unsigned char stereo = runtime->channels > 1;
+ int dma;
rate = runtime->rate;
switch (chip->hardware) {
+ case SB_HW_JAZZ16:
+ if (runtime->format == SNDRV_PCM_FORMAT_S16_LE) {
+ if (chip->mode & SB_MODE_CAPTURE_16)
+ return -EBUSY;
+ else
+ chip->mode |= SB_MODE_PLAYBACK_16;
+ }
+ chip->playback_format = SB_DSP_LO_OUTPUT_AUTO;
+ break;
case SB_HW_PRO:
if (runtime->channels > 1) {
- snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL);
+ if (snd_BUG_ON(rate != SB8_RATE(11025) &&
+ rate != SB8_RATE(22050)))
+ return -EINVAL;
chip->playback_format = SB_DSP_HI_OUTPUT_AUTO;
break;
}
@@ -132,11 +146,21 @@ static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream)
default:
return -EINVAL;
}
+ if (chip->mode & SB_MODE_PLAYBACK_16) {
+ format = stereo ? SB_DSP_STEREO_16BIT : SB_DSP_MONO_16BIT;
+ dma = chip->dma16;
+ } else {
+ format = stereo ? SB_DSP_STEREO_8BIT : SB_DSP_MONO_8BIT;
+ chip->mode |= SB_MODE_PLAYBACK_8;
+ dma = chip->dma8;
+ }
size = chip->p_dma_size = snd_pcm_lib_buffer_bytes(substream);
count = chip->p_period_size = snd_pcm_lib_period_bytes(substream);
spin_lock_irqsave(&chip->reg_lock, flags);
snd_sbdsp_command(chip, SB_DSP_SPEAKER_ON);
- if (runtime->channels > 1) {
+ if (chip->hardware == SB_HW_JAZZ16)
+ snd_sbdsp_command(chip, format);
+ else if (stereo) {
/* set playback stereo mode */
spin_lock(&chip->mixer_lock);
mixreg = snd_sbmixer_read(chip, SB_DSP_STEREO_SW);
@@ -146,15 +170,14 @@ static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream)
/* Soundblaster hardware programming reference guide, 3-23 */
snd_sbdsp_command(chip, SB_DSP_DMA8_EXIT);
runtime->dma_area[0] = 0x80;
- snd_dma_program(chip->dma8, runtime->dma_addr, 1, DMA_MODE_WRITE);
+ snd_dma_program(dma, runtime->dma_addr, 1, DMA_MODE_WRITE);
/* force interrupt */
- chip->mode = SB_MODE_HALT;
snd_sbdsp_command(chip, SB_DSP_OUTPUT);
snd_sbdsp_command(chip, 0);
snd_sbdsp_command(chip, 0);
}
snd_sbdsp_command(chip, SB_DSP_SAMPLE_RATE);
- if (runtime->channels > 1) {
+ if (stereo) {
snd_sbdsp_command(chip, 256 - runtime->rate_den / 2);
spin_lock(&chip->mixer_lock);
/* save output filter status and turn it off */
@@ -167,13 +190,15 @@ static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream)
snd_sbdsp_command(chip, 256 - runtime->rate_den);
}
if (chip->playback_format != SB_DSP_OUTPUT) {
+ if (chip->mode & SB_MODE_PLAYBACK_16)
+ count /= 2;
count--;
snd_sbdsp_command(chip, SB_DSP_BLOCK_SIZE);
snd_sbdsp_command(chip, count & 0xff);
snd_sbdsp_command(chip, count >> 8);
}
spin_unlock_irqrestore(&chip->reg_lock, flags);
- snd_dma_program(chip->dma8, runtime->dma_addr,
+ snd_dma_program(dma, runtime->dma_addr,
size, DMA_MODE_WRITE | DMA_AUTOINIT);
return 0;
}
@@ -211,7 +236,6 @@ static int snd_sb8_playback_trigger(struct snd_pcm_substream *substream,
snd_sbdsp_command(chip, SB_DSP_SPEAKER_OFF);
}
spin_unlock_irqrestore(&chip->reg_lock, flags);
- chip->mode = (cmd == SNDRV_PCM_TRIGGER_START) ? SB_MODE_PLAYBACK_8 : SB_MODE_HALT;
return 0;
}
@@ -233,12 +257,26 @@ static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream)
struct snd_sb *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned int mixreg, rate, size, count;
+ unsigned char format;
+ unsigned char stereo = runtime->channels > 1;
+ int dma;
rate = runtime->rate;
switch (chip->hardware) {
+ case SB_HW_JAZZ16:
+ if (runtime->format == SNDRV_PCM_FORMAT_S16_LE) {
+ if (chip->mode & SB_MODE_PLAYBACK_16)
+ return -EBUSY;
+ else
+ chip->mode |= SB_MODE_CAPTURE_16;
+ }
+ chip->capture_format = SB_DSP_LO_INPUT_AUTO;
+ break;
case SB_HW_PRO:
if (runtime->channels > 1) {
- snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL);
+ if (snd_BUG_ON(rate != SB8_RATE(11025) &&
+ rate != SB8_RATE(22050)))
+ return -EINVAL;
chip->capture_format = SB_DSP_HI_INPUT_AUTO;
break;
}
@@ -259,14 +297,24 @@ static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream)
default:
return -EINVAL;
}
+ if (chip->mode & SB_MODE_CAPTURE_16) {
+ format = stereo ? SB_DSP_STEREO_16BIT : SB_DSP_MONO_16BIT;
+ dma = chip->dma16;
+ } else {
+ format = stereo ? SB_DSP_STEREO_8BIT : SB_DSP_MONO_8BIT;
+ chip->mode |= SB_MODE_CAPTURE_8;
+ dma = chip->dma8;
+ }
size = chip->c_dma_size = snd_pcm_lib_buffer_bytes(substream);
count = chip->c_period_size = snd_pcm_lib_period_bytes(substream);
spin_lock_irqsave(&chip->reg_lock, flags);
snd_sbdsp_command(chip, SB_DSP_SPEAKER_OFF);
- if (runtime->channels > 1)
+ if (chip->hardware == SB_HW_JAZZ16)
+ snd_sbdsp_command(chip, format);
+ else if (stereo)
snd_sbdsp_command(chip, SB_DSP_STEREO_8BIT);
snd_sbdsp_command(chip, SB_DSP_SAMPLE_RATE);
- if (runtime->channels > 1) {
+ if (stereo) {
snd_sbdsp_command(chip, 256 - runtime->rate_den / 2);
spin_lock(&chip->mixer_lock);
/* save input filter status and turn it off */
@@ -278,14 +326,16 @@ static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream)
} else {
snd_sbdsp_command(chip, 256 - runtime->rate_den);
}
- if (chip->capture_format != SB_DSP_OUTPUT) {
+ if (chip->capture_format != SB_DSP_INPUT) {
+ if (chip->mode & SB_MODE_PLAYBACK_16)
+ count /= 2;
count--;
snd_sbdsp_command(chip, SB_DSP_BLOCK_SIZE);
snd_sbdsp_command(chip, count & 0xff);
snd_sbdsp_command(chip, count >> 8);
}
spin_unlock_irqrestore(&chip->reg_lock, flags);
- snd_dma_program(chip->dma8, runtime->dma_addr,
+ snd_dma_program(dma, runtime->dma_addr,
size, DMA_MODE_READ | DMA_AUTOINIT);
return 0;
}
@@ -325,7 +375,6 @@ static int snd_sb8_capture_trigger(struct snd_pcm_substream *substream,
snd_sbdsp_command(chip, SB_DSP_SPEAKER_OFF);
}
spin_unlock_irqrestore(&chip->reg_lock, flags);
- chip->mode = (cmd == SNDRV_PCM_TRIGGER_START) ? SB_MODE_CAPTURE_8 : SB_MODE_HALT;
return 0;
}
@@ -336,13 +385,21 @@ irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip)
snd_sb_ack_8bit(chip);
switch (chip->mode) {
- case SB_MODE_PLAYBACK_8: /* ok.. playback is active */
+ case SB_MODE_PLAYBACK_16: /* ok.. playback is active */
+ if (chip->hardware != SB_HW_JAZZ16)
+ break;
+ /* fallthru */
+ case SB_MODE_PLAYBACK_8:
substream = chip->playback_substream;
runtime = substream->runtime;
if (chip->playback_format == SB_DSP_OUTPUT)
snd_sb8_playback_trigger(substream, SNDRV_PCM_TRIGGER_START);
snd_pcm_period_elapsed(substream);
break;
+ case SB_MODE_CAPTURE_16:
+ if (chip->hardware != SB_HW_JAZZ16)
+ break;
+ /* fallthru */
case SB_MODE_CAPTURE_8:
substream = chip->capture_substream;
runtime = substream->runtime;
@@ -358,10 +415,15 @@ static snd_pcm_uframes_t snd_sb8_playback_pointer(struct snd_pcm_substream *subs
{
struct snd_sb *chip = snd_pcm_substream_chip(substream);
size_t ptr;
+ int dma;
- if (chip->mode != SB_MODE_PLAYBACK_8)
+ if (chip->mode & SB_MODE_PLAYBACK_8)
+ dma = chip->dma8;
+ else if (chip->mode & SB_MODE_PLAYBACK_16)
+ dma = chip->dma16;
+ else
return 0;
- ptr = snd_dma_pointer(chip->dma8, chip->p_dma_size);
+ ptr = snd_dma_pointer(dma, chip->p_dma_size);
return bytes_to_frames(substream->runtime, ptr);
}
@@ -369,10 +431,15 @@ static snd_pcm_uframes_t snd_sb8_capture_pointer(struct snd_pcm_substream *subst
{
struct snd_sb *chip = snd_pcm_substream_chip(substream);
size_t ptr;
+ int dma;
- if (chip->mode != SB_MODE_CAPTURE_8)
+ if (chip->mode & SB_MODE_CAPTURE_8)
+ dma = chip->dma8;
+ else if (chip->mode & SB_MODE_CAPTURE_16)
+ dma = chip->dma16;
+ else
return 0;
- ptr = snd_dma_pointer(chip->dma8, chip->c_dma_size);
+ ptr = snd_dma_pointer(dma, chip->c_dma_size);
return bytes_to_frames(substream->runtime, ptr);
}
@@ -443,6 +510,14 @@ static int snd_sb8_open(struct snd_pcm_substream *substream)
runtime->hw = snd_sb8_capture;
}
switch (chip->hardware) {
+ case SB_HW_JAZZ16:
+ if (chip->dma16 == 5 || chip->dma16 == 7)
+ runtime->hw.formats |= SNDRV_PCM_FMTBIT_S16_LE;
+ runtime->hw.rates |= SNDRV_PCM_RATE_8000_48000;
+ runtime->hw.rate_min = 4000;
+ runtime->hw.rate_max = 50000;
+ runtime->hw.channels_max = 2;
+ break;
case SB_HW_PRO:
runtime->hw.rate_max = 44100;
runtime->hw.channels_max = 2;
@@ -465,6 +540,14 @@ static int snd_sb8_open(struct snd_pcm_substream *substream)
}
snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_clock);
+ if (chip->dma8 > 3 || chip->dma16 >= 0) {
+ snd_pcm_hw_constraint_step(runtime, 0,
+ SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 2);
+ snd_pcm_hw_constraint_step(runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 2);
+ runtime->hw.buffer_bytes_max = 128 * 1024 * 1024;
+ runtime->hw.period_bytes_max = 128 * 1024 * 1024;
+ }
return 0;
}
@@ -477,6 +560,10 @@ static int snd_sb8_close(struct snd_pcm_substream *substream)
chip->capture_substream = NULL;
spin_lock_irqsave(&chip->open_lock, flags);
chip->open &= ~SB_OPEN_PCM;
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ chip->mode &= ~SB_MODE_PLAYBACK;
+ else
+ chip->mode &= ~SB_MODE_CAPTURE;
spin_unlock_irqrestore(&chip->open_lock, flags);
return 0;
}
@@ -512,6 +599,7 @@ int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm)
struct snd_card *card = chip->card;
struct snd_pcm *pcm;
int err;
+ size_t max_prealloc = 64 * 1024;
if (rpcm)
*rpcm = NULL;
@@ -524,9 +612,11 @@ int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb8_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb8_capture_ops);
+ if (chip->dma8 > 3 || chip->dma16 >= 0)
+ max_prealloc = 128 * 1024;
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_isa_data(),
- 64*1024, 64*1024);
+ 64*1024, max_prealloc);
if (rpcm)
*rpcm = pcm;
diff --git a/sound/isa/sb/sb8_midi.c b/sound/isa/sb/sb8_midi.c
index c549aceea29..988a8b73475 100644
--- a/sound/isa/sb/sb8_midi.c
+++ b/sound/isa/sb/sb8_midi.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* Routines for control of SoundBlaster cards - MIDI interface
*
* This program is free software; you can redistribute it and/or modify
@@ -26,26 +26,27 @@
* Added full duplex UART mode for DSP version 2.0 and later.
*/
-#include <sound/driver.h>
#include <asm/io.h>
#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
-/*
-
- */
-irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb * chip)
+irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip)
{
struct snd_rawmidi *rmidi;
int max = 64;
char byte;
- if (chip == NULL || (rmidi = chip->rmidi) == NULL) {
+ if (!chip)
+ return IRQ_NONE;
+
+ rmidi = chip->rmidi;
+ if (!rmidi) {
inb(SBP(chip, DATA_AVAIL)); /* ack interrupt */
return IRQ_NONE;
}
+
spin_lock(&chip->midi_input_lock);
while (max-- > 0) {
if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
@@ -59,10 +60,6 @@ irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb * chip)
return IRQ_HANDLED;
}
-/*
-
- */
-
static int snd_sb8dsp_midi_input_open(struct snd_rawmidi_substream *substream)
{
unsigned long flags;
@@ -252,10 +249,6 @@ static void snd_sb8dsp_midi_output_trigger(struct snd_rawmidi_substream *substre
snd_sb8dsp_midi_output_write(substream);
}
-/*
-
- */
-
static struct snd_rawmidi_ops snd_sb8dsp_midi_output =
{
.open = snd_sb8dsp_midi_output_open,
diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
index f343a8211d2..3ef990602cd 100644
--- a/sound/isa/sb/sb_common.c
+++ b/sound/isa/sb/sb_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* Uros Bizjak <uros@kss-loka.si>
*
* Lowlevel routines for control of Sound Blaster cards
@@ -20,12 +20,12 @@
*
*/
-#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/ioport.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/initval.h>
@@ -33,7 +33,7 @@
#include <asm/io.h>
#include <asm/dma.h>
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("ALSA lowlevel driver for Sound Blaster cards");
MODULE_LICENSE("GPL");
@@ -52,7 +52,7 @@ int snd_sbdsp_command(struct snd_sb *chip, unsigned char val)
outb(val, SBP(chip, COMMAND));
return 1;
}
- snd_printd("%s [0x%lx]: timeout (0x%x)\n", __FUNCTION__, chip->port, val);
+ snd_printd("%s [0x%lx]: timeout (0x%x)\n", __func__, chip->port, val);
return 0;
}
@@ -69,7 +69,7 @@ int snd_sbdsp_get_byte(struct snd_sb *chip)
return val;
}
}
- snd_printd("%s [0x%lx]: timeout\n", __FUNCTION__, chip->port);
+ snd_printd("%s [0x%lx]: timeout\n", __func__, chip->port);
return -ENODEV;
}
@@ -88,7 +88,7 @@ int snd_sbdsp_reset(struct snd_sb *chip)
else
break;
}
- snd_printdd("%s [0x%lx] failed...\n", __FUNCTION__, chip->port);
+ snd_printdd("%s [0x%lx] failed...\n", __func__, chip->port);
return -ENODEV;
}
@@ -128,7 +128,7 @@ static int snd_sbdsp_probe(struct snd_sb * chip)
minor = version & 0xff;
snd_printdd("SB [0x%lx]: DSP chip found, version = %i.%i\n",
chip->port, major, minor);
-
+
switch (chip->hardware) {
case SB_HW_AUTO:
switch (major) {
@@ -168,6 +168,12 @@ static int snd_sbdsp_probe(struct snd_sb * chip)
case SB_HW_DT019X:
str = "(DT019X/ALS007)";
break;
+ case SB_HW_CS5530:
+ str = "16 (CS5530)";
+ break;
+ case SB_HW_JAZZ16:
+ str = "Pro (Jazz16)";
+ break;
default:
return -ENODEV;
}
@@ -205,7 +211,7 @@ static int snd_sbdsp_dev_free(struct snd_device *device)
int snd_sbdsp_create(struct snd_card *card,
unsigned long port,
int irq,
- irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
+ irq_handler_t irq_handler,
int dma8,
int dma16,
unsigned short hardware,
@@ -217,7 +223,8 @@ int snd_sbdsp_create(struct snd_card *card,
.dev_free = snd_sbdsp_dev_free,
};
- snd_assert(r_chip != NULL, return -EINVAL);
+ if (snd_BUG_ON(!r_chip))
+ return -EINVAL;
*r_chip = NULL;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
@@ -231,8 +238,10 @@ int snd_sbdsp_create(struct snd_card *card,
chip->dma16 = -1;
chip->port = port;
- if (request_irq(irq, irq_handler, hardware == SB_HW_ALS4000 ?
- SA_INTERRUPT | SA_SHIRQ : SA_INTERRUPT,
+ if (request_irq(irq, irq_handler,
+ (hardware == SB_HW_ALS4000 ||
+ hardware == SB_HW_CS5530) ?
+ IRQF_SHARED : 0,
"SoundBlaster", (void *) chip)) {
snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
snd_sbdsp_free(chip);
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index 1a6ee344ddd..1ff78ec9f0a 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
* Routines for Sound Blaster mixer control
*
*
@@ -19,7 +19,6 @@
*
*/
-#include <sound/driver.h>
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/time.h>
@@ -183,7 +182,7 @@ static int snd_sbmixer_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_
static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
- static char *texts[5] = {
+ static const char *texts[5] = {
"CD", "Mic", "Line", "Synth", "Master"
};
@@ -270,12 +269,73 @@ static int snd_dt019x_input_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl
}
/*
+ * ALS4000 mono recording control switch
+ */
+
+static int snd_als4k_mono_capture_route_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char *texts[3] = {
+ "L chan only", "R chan only", "L ch/2 + R ch/2"
+ };
+
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+ uinfo->count = 1;
+ uinfo->value.enumerated.items = 3;
+ if (uinfo->value.enumerated.item > 2)
+ uinfo->value.enumerated.item = 2;
+ strcpy(uinfo->value.enumerated.name,
+ texts[uinfo->value.enumerated.item]);
+ return 0;
+}
+
+static int snd_als4k_mono_capture_route_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
+ unsigned long flags;
+ unsigned char oval;
+
+ spin_lock_irqsave(&sb->mixer_lock, flags);
+ oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL);
+ spin_unlock_irqrestore(&sb->mixer_lock, flags);
+ oval >>= 6;
+ if (oval > 2)
+ oval = 2;
+
+ ucontrol->value.enumerated.item[0] = oval;
+ return 0;
+}
+
+static int snd_als4k_mono_capture_route_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
+ unsigned long flags;
+ int change;
+ unsigned char nval, oval;
+
+ if (ucontrol->value.enumerated.item[0] > 2)
+ return -EINVAL;
+ spin_lock_irqsave(&sb->mixer_lock, flags);
+ oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL);
+
+ nval = (oval & ~(3 << 6))
+ | (ucontrol->value.enumerated.item[0] << 6);
+ change = nval != oval;
+ if (change)
+ snd_sbmixer_write(sb, SB_ALS4000_MONO_IO_CTRL, nval);
+ spin_unlock_irqrestore(&sb->mixer_lock, flags);
+ return change;
+}
+
+/*
* SBPRO input multiplexer
*/
static int snd_sb8mixer_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
- static char *texts[3] = {
+ static const char *texts[3] = {
"Mic", "CD", "Line"
};
@@ -443,6 +503,12 @@ int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int ty
.get = snd_dt019x_input_sw_get,
.put = snd_dt019x_input_sw_put,
},
+ [SB_MIX_MONO_CAPTURE_ALS4K] = {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .info = snd_als4k_mono_capture_route_info,
+ .get = snd_als4k_mono_capture_route_get,
+ .put = snd_als4k_mono_capture_route_put,
+ },
};
struct snd_kcontrol *ctl;
int err;
@@ -453,10 +519,8 @@ int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int ty
strlcpy(ctl->id.name, name, sizeof(ctl->id.name));
ctl->id.index = index;
ctl->private_value = value;
- if ((err = snd_ctl_add(chip->card, ctl)) < 0) {
- snd_ctl_free_one(ctl);
+ if ((err = snd_ctl_add(chip->card, ctl)) < 0)
return err;
- }
return 0;
}
@@ -464,20 +528,11 @@ int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int ty
* SB 2.0 specific mixer elements
*/
-static struct sbmix_elem snd_sb20_ctl_master_play_vol =
- SB_SINGLE("Master Playback Volume", SB_DSP20_MASTER_DEV, 1, 7);
-static struct sbmix_elem snd_sb20_ctl_pcm_play_vol =
- SB_SINGLE("PCM Playback Volume", SB_DSP20_PCM_DEV, 1, 3);
-static struct sbmix_elem snd_sb20_ctl_synth_play_vol =
- SB_SINGLE("Synth Playback Volume", SB_DSP20_FM_DEV, 1, 7);
-static struct sbmix_elem snd_sb20_ctl_cd_play_vol =
- SB_SINGLE("CD Playback Volume", SB_DSP20_CD_DEV, 1, 7);
-
-static struct sbmix_elem *snd_sb20_controls[] = {
- &snd_sb20_ctl_master_play_vol,
- &snd_sb20_ctl_pcm_play_vol,
- &snd_sb20_ctl_synth_play_vol,
- &snd_sb20_ctl_cd_play_vol
+static struct sbmix_elem snd_sb20_controls[] = {
+ SB_SINGLE("Master Playback Volume", SB_DSP20_MASTER_DEV, 1, 7),
+ SB_SINGLE("PCM Playback Volume", SB_DSP20_PCM_DEV, 1, 3),
+ SB_SINGLE("Synth Playback Volume", SB_DSP20_FM_DEV, 1, 7),
+ SB_SINGLE("CD Playback Volume", SB_DSP20_CD_DEV, 1, 7)
};
static unsigned char snd_sb20_init_values[][2] = {
@@ -488,41 +543,24 @@ static unsigned char snd_sb20_init_values[][2] = {
/*
* SB Pro specific mixer elements
*/
-static struct sbmix_elem snd_sbpro_ctl_master_play_vol =
- SB_DOUBLE("Master Playback Volume", SB_DSP_MASTER_DEV, SB_DSP_MASTER_DEV, 5, 1, 7);
-static struct sbmix_elem snd_sbpro_ctl_pcm_play_vol =
- SB_DOUBLE("PCM Playback Volume", SB_DSP_PCM_DEV, SB_DSP_PCM_DEV, 5, 1, 7);
-static struct sbmix_elem snd_sbpro_ctl_pcm_play_filter =
- SB_SINGLE("PCM Playback Filter", SB_DSP_PLAYBACK_FILT, 5, 1);
-static struct sbmix_elem snd_sbpro_ctl_synth_play_vol =
- SB_DOUBLE("Synth Playback Volume", SB_DSP_FM_DEV, SB_DSP_FM_DEV, 5, 1, 7);
-static struct sbmix_elem snd_sbpro_ctl_cd_play_vol =
- SB_DOUBLE("CD Playback Volume", SB_DSP_CD_DEV, SB_DSP_CD_DEV, 5, 1, 7);
-static struct sbmix_elem snd_sbpro_ctl_line_play_vol =
- SB_DOUBLE("Line Playback Volume", SB_DSP_LINE_DEV, SB_DSP_LINE_DEV, 5, 1, 7);
-static struct sbmix_elem snd_sbpro_ctl_mic_play_vol =
- SB_SINGLE("Mic Playback Volume", SB_DSP_MIC_DEV, 1, 3);
-static struct sbmix_elem snd_sbpro_ctl_capture_source =
+static struct sbmix_elem snd_sbpro_controls[] = {
+ SB_DOUBLE("Master Playback Volume",
+ SB_DSP_MASTER_DEV, SB_DSP_MASTER_DEV, 5, 1, 7),
+ SB_DOUBLE("PCM Playback Volume",
+ SB_DSP_PCM_DEV, SB_DSP_PCM_DEV, 5, 1, 7),
+ SB_SINGLE("PCM Playback Filter", SB_DSP_PLAYBACK_FILT, 5, 1),
+ SB_DOUBLE("Synth Playback Volume",
+ SB_DSP_FM_DEV, SB_DSP_FM_DEV, 5, 1, 7),
+ SB_DOUBLE("CD Playback Volume", SB_DSP_CD_DEV, SB_DSP_CD_DEV, 5, 1, 7),
+ SB_DOUBLE("Line Playback Volume",
+ SB_DSP_LINE_DEV, SB_DSP_LINE_DEV, 5, 1, 7),
+ SB_SINGLE("Mic Playback Volume", SB_DSP_MIC_DEV, 1, 3),
{
.name = "Capture Source",
.type = SB_MIX_CAPTURE_PRO
- };
-static struct sbmix_elem snd_sbpro_ctl_capture_filter =
- SB_SINGLE("Capture Filter", SB_DSP_CAPTURE_FILT, 5, 1);
-static struct sbmix_elem snd_sbpro_ctl_capture_low_filter =
- SB_SINGLE("Capture Low-Pass Filter", SB_DSP_CAPTURE_FILT, 3, 1);
-
-static struct sbmix_elem *snd_sbpro_controls[] = {
- &snd_sbpro_ctl_master_play_vol,
- &snd_sbpro_ctl_pcm_play_vol,
- &snd_sbpro_ctl_pcm_play_filter,
- &snd_sbpro_ctl_synth_play_vol,
- &snd_sbpro_ctl_cd_play_vol,
- &snd_sbpro_ctl_line_play_vol,
- &snd_sbpro_ctl_mic_play_vol,
- &snd_sbpro_ctl_capture_source,
- &snd_sbpro_ctl_capture_filter,
- &snd_sbpro_ctl_capture_low_filter
+ },
+ SB_SINGLE("Capture Filter", SB_DSP_CAPTURE_FILT, 5, 1),
+ SB_SINGLE("Capture Low-Pass Filter", SB_DSP_CAPTURE_FILT, 3, 1)
};
static unsigned char snd_sbpro_init_values[][2] = {
@@ -534,68 +572,42 @@ static unsigned char snd_sbpro_init_values[][2] = {
/*
* SB16 specific mixer elements
*/
-static struct sbmix_elem snd_sb16_ctl_master_play_vol =
- SB_DOUBLE("Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31);
-static struct sbmix_elem snd_sb16_ctl_3d_enhance_switch =
- SB_SINGLE("3D Enhancement Switch", SB_DSP4_3DSE, 0, 1);
-static struct sbmix_elem snd_sb16_ctl_tone_bass =
- SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15);
-static struct sbmix_elem snd_sb16_ctl_tone_treble =
- SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15);
-static struct sbmix_elem snd_sb16_ctl_pcm_play_vol =
- SB_DOUBLE("PCM Playback Volume", SB_DSP4_PCM_DEV, (SB_DSP4_PCM_DEV + 1), 3, 3, 31);
-static struct sbmix_elem snd_sb16_ctl_synth_capture_route =
- SB16_INPUT_SW("Synth Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 6, 5);
-static struct sbmix_elem snd_sb16_ctl_synth_play_vol =
- SB_DOUBLE("Synth Playback Volume", SB_DSP4_SYNTH_DEV, (SB_DSP4_SYNTH_DEV + 1), 3, 3, 31);
-static struct sbmix_elem snd_sb16_ctl_cd_capture_route =
- SB16_INPUT_SW("CD Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 2, 1);
-static struct sbmix_elem snd_sb16_ctl_cd_play_switch =
- SB_DOUBLE("CD Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 2, 1, 1);
-static struct sbmix_elem snd_sb16_ctl_cd_play_vol =
- SB_DOUBLE("CD Playback Volume", SB_DSP4_CD_DEV, (SB_DSP4_CD_DEV + 1), 3, 3, 31);
-static struct sbmix_elem snd_sb16_ctl_line_capture_route =
- SB16_INPUT_SW("Line Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 4, 3);
-static struct sbmix_elem snd_sb16_ctl_line_play_switch =
- SB_DOUBLE("Line Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 4, 3, 1);
-static struct sbmix_elem snd_sb16_ctl_line_play_vol =
- SB_DOUBLE("Line Playback Volume", SB_DSP4_LINE_DEV, (SB_DSP4_LINE_DEV + 1), 3, 3, 31);
-static struct sbmix_elem snd_sb16_ctl_mic_capture_route =
- SB16_INPUT_SW("Mic Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 0, 0);
-static struct sbmix_elem snd_sb16_ctl_mic_play_switch =
- SB_SINGLE("Mic Playback Switch", SB_DSP4_OUTPUT_SW, 0, 1);
-static struct sbmix_elem snd_sb16_ctl_mic_play_vol =
- SB_SINGLE("Mic Playback Volume", SB_DSP4_MIC_DEV, 3, 31);
-static struct sbmix_elem snd_sb16_ctl_pc_speaker_vol =
- SB_SINGLE("PC Speaker Volume", SB_DSP4_SPEAKER_DEV, 6, 3);
-static struct sbmix_elem snd_sb16_ctl_capture_vol =
- SB_DOUBLE("Capture Volume", SB_DSP4_IGAIN_DEV, (SB_DSP4_IGAIN_DEV + 1), 6, 6, 3);
-static struct sbmix_elem snd_sb16_ctl_play_vol =
- SB_DOUBLE("Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6, 3);
-static struct sbmix_elem snd_sb16_ctl_auto_mic_gain =
- SB_SINGLE("Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1);
-
-static struct sbmix_elem *snd_sb16_controls[] = {
- &snd_sb16_ctl_master_play_vol,
- &snd_sb16_ctl_3d_enhance_switch,
- &snd_sb16_ctl_tone_bass,
- &snd_sb16_ctl_tone_treble,
- &snd_sb16_ctl_pcm_play_vol,
- &snd_sb16_ctl_synth_capture_route,
- &snd_sb16_ctl_synth_play_vol,
- &snd_sb16_ctl_cd_capture_route,
- &snd_sb16_ctl_cd_play_switch,
- &snd_sb16_ctl_cd_play_vol,
- &snd_sb16_ctl_line_capture_route,
- &snd_sb16_ctl_line_play_switch,
- &snd_sb16_ctl_line_play_vol,
- &snd_sb16_ctl_mic_capture_route,
- &snd_sb16_ctl_mic_play_switch,
- &snd_sb16_ctl_mic_play_vol,
- &snd_sb16_ctl_pc_speaker_vol,
- &snd_sb16_ctl_capture_vol,
- &snd_sb16_ctl_play_vol,
- &snd_sb16_ctl_auto_mic_gain
+static struct sbmix_elem snd_sb16_controls[] = {
+ SB_DOUBLE("Master Playback Volume",
+ SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31),
+ SB_DOUBLE("PCM Playback Volume",
+ SB_DSP4_PCM_DEV, (SB_DSP4_PCM_DEV + 1), 3, 3, 31),
+ SB16_INPUT_SW("Synth Capture Route",
+ SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 6, 5),
+ SB_DOUBLE("Synth Playback Volume",
+ SB_DSP4_SYNTH_DEV, (SB_DSP4_SYNTH_DEV + 1), 3, 3, 31),
+ SB16_INPUT_SW("CD Capture Route",
+ SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 2, 1),
+ SB_DOUBLE("CD Playback Switch",
+ SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 2, 1, 1),
+ SB_DOUBLE("CD Playback Volume",
+ SB_DSP4_CD_DEV, (SB_DSP4_CD_DEV + 1), 3, 3, 31),
+ SB16_INPUT_SW("Mic Capture Route",
+ SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 0, 0),
+ SB_SINGLE("Mic Playback Switch", SB_DSP4_OUTPUT_SW, 0, 1),
+ SB_SINGLE("Mic Playback Volume", SB_DSP4_MIC_DEV, 3, 31),
+ SB_SINGLE("Beep Volume", SB_DSP4_SPEAKER_DEV, 6, 3),
+ SB_DOUBLE("Capture Volume",
+ SB_DSP4_IGAIN_DEV, (SB_DSP4_IGAIN_DEV + 1), 6, 6, 3),
+ SB_DOUBLE("Playback Volume",
+ SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6, 3),
+ SB16_INPUT_SW("Line Capture Route",
+ SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 4, 3),
+ SB_DOUBLE("Line Playback Switch",
+ SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 4, 3, 1),
+ SB_DOUBLE("Line Playback Volume",
+ SB_DSP4_LINE_DEV, (SB_DSP4_LINE_DEV + 1), 3, 3, 31),
+ SB_SINGLE("Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1),
+ SB_SINGLE("3D Enhancement Switch", SB_DSP4_3DSE, 0, 1),
+ SB_DOUBLE("Tone Control - Bass",
+ SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15),
+ SB_DOUBLE("Tone Control - Treble",
+ SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15)
};
static unsigned char snd_sb16_init_values[][2] = {
@@ -614,44 +626,34 @@ static unsigned char snd_sb16_init_values[][2] = {
/*
* DT019x specific mixer elements
*/
-static struct sbmix_elem snd_dt019x_ctl_master_play_vol =
- SB_DOUBLE("Master Playback Volume", SB_DT019X_MASTER_DEV, SB_DT019X_MASTER_DEV, 4,0, 15);
-static struct sbmix_elem snd_dt019x_ctl_pcm_play_vol =
- SB_DOUBLE("PCM Playback Volume", SB_DT019X_PCM_DEV, SB_DT019X_PCM_DEV, 4,0, 15);
-static struct sbmix_elem snd_dt019x_ctl_synth_play_vol =
- SB_DOUBLE("Synth Playback Volume", SB_DT019X_SYNTH_DEV, SB_DT019X_SYNTH_DEV, 4,0, 15);
-static struct sbmix_elem snd_dt019x_ctl_cd_play_vol =
- SB_DOUBLE("CD Playback Volume", SB_DT019X_CD_DEV, SB_DT019X_CD_DEV, 4,0, 15);
-static struct sbmix_elem snd_dt019x_ctl_mic_play_vol =
- SB_SINGLE("Mic Playback Volume", SB_DT019X_MIC_DEV, 4, 7);
-static struct sbmix_elem snd_dt019x_ctl_pc_speaker_vol =
- SB_SINGLE("PC Speaker Volume", SB_DT019X_SPKR_DEV, 0, 7);
-static struct sbmix_elem snd_dt019x_ctl_line_play_vol =
- SB_DOUBLE("Line Playback Volume", SB_DT019X_LINE_DEV, SB_DT019X_LINE_DEV, 4,0, 15);
-static struct sbmix_elem snd_dt019x_ctl_pcm_play_switch =
- SB_DOUBLE("PCM Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 2,1, 1);
-static struct sbmix_elem snd_dt019x_ctl_synth_play_switch =
- SB_DOUBLE("Synth Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 4,3, 1);
-static struct sbmix_elem snd_dt019x_ctl_capture_source =
+static struct sbmix_elem snd_dt019x_controls[] = {
+ /* ALS4000 below has some parts which we might be lacking,
+ * e.g. snd_als4000_ctl_mono_playback_switch - check it! */
+ SB_DOUBLE("Master Playback Volume",
+ SB_DT019X_MASTER_DEV, SB_DT019X_MASTER_DEV, 4, 0, 15),
+ SB_DOUBLE("PCM Playback Switch",
+ SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 2, 1, 1),
+ SB_DOUBLE("PCM Playback Volume",
+ SB_DT019X_PCM_DEV, SB_DT019X_PCM_DEV, 4, 0, 15),
+ SB_DOUBLE("Synth Playback Switch",
+ SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 4, 3, 1),
+ SB_DOUBLE("Synth Playback Volume",
+ SB_DT019X_SYNTH_DEV, SB_DT019X_SYNTH_DEV, 4, 0, 15),
+ SB_DOUBLE("CD Playback Switch",
+ SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 2, 1, 1),
+ SB_DOUBLE("CD Playback Volume",
+ SB_DT019X_CD_DEV, SB_DT019X_CD_DEV, 4, 0, 15),
+ SB_SINGLE("Mic Playback Switch", SB_DSP4_OUTPUT_SW, 0, 1),
+ SB_SINGLE("Mic Playback Volume", SB_DT019X_MIC_DEV, 4, 7),
+ SB_SINGLE("Beep Volume", SB_DT019X_SPKR_DEV, 0, 7),
+ SB_DOUBLE("Line Playback Switch",
+ SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 4, 3, 1),
+ SB_DOUBLE("Line Playback Volume",
+ SB_DT019X_LINE_DEV, SB_DT019X_LINE_DEV, 4, 0, 15),
{
.name = "Capture Source",
.type = SB_MIX_CAPTURE_DT019X
- };
-
-static struct sbmix_elem *snd_dt019x_controls[] = {
- &snd_dt019x_ctl_master_play_vol,
- &snd_dt019x_ctl_pcm_play_vol,
- &snd_dt019x_ctl_synth_play_vol,
- &snd_dt019x_ctl_cd_play_vol,
- &snd_dt019x_ctl_mic_play_vol,
- &snd_dt019x_ctl_pc_speaker_vol,
- &snd_dt019x_ctl_line_play_vol,
- &snd_sb16_ctl_mic_play_switch,
- &snd_sb16_ctl_cd_play_switch,
- &snd_sb16_ctl_line_play_switch,
- &snd_dt019x_ctl_pcm_play_switch,
- &snd_dt019x_ctl_synth_play_switch,
- &snd_dt019x_ctl_capture_source
+ }
};
static unsigned char snd_dt019x_init_values[][2] = {
@@ -669,74 +671,37 @@ static unsigned char snd_dt019x_init_values[][2] = {
/*
* ALS4000 specific mixer elements
*/
-/* FIXME: SB_ALS4000_MONO_IO_CTRL needs output select ctrl! */
-static struct sbmix_elem snd_als4000_ctl_master_mono_playback_switch =
- SB_SINGLE("Master Mono Playback Switch", SB_ALS4000_MONO_IO_CTRL, 5, 1);
-static struct sbmix_elem snd_als4000_ctl_master_mono_capture_route =
- SB_SINGLE("Master Mono Capture Route", SB_ALS4000_MONO_IO_CTRL, 6, 0x03);
-/* FIXME: mono playback switch also available on DT019X? */
-static struct sbmix_elem snd_als4000_ctl_mono_playback_switch =
- SB_SINGLE("Mono Playback Switch", SB_DT019X_OUTPUT_SW2, 0, 1);
-static struct sbmix_elem snd_als4000_ctl_mic_20db_boost =
- SB_SINGLE("Mic Boost (+20dB)", SB_ALS4000_MIC_IN_GAIN, 0, 0x03);
-static struct sbmix_elem snd_als4000_ctl_mixer_loopback =
- SB_SINGLE("Analog Loopback", SB_ALS4000_MIC_IN_GAIN, 7, 0x01);
-/* FIXME: functionality of 3D controls might be swapped, I didn't find
- * a description of how to identify what is supposed to be what */
-static struct sbmix_elem snd_als4000_3d_control_switch =
- SB_SINGLE("3D Control - Switch", SB_ALS4000_3D_SND_FX, 6, 0x01);
-static struct sbmix_elem snd_als4000_3d_control_ratio =
- SB_SINGLE("3D Control - Level", SB_ALS4000_3D_SND_FX, 0, 0x07);
-static struct sbmix_elem snd_als4000_3d_control_freq =
+static struct sbmix_elem snd_als4000_controls[] = {
+ SB_DOUBLE("PCM Playback Switch",
+ SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 2, 1, 1),
+ SB_DOUBLE("Synth Playback Switch",
+ SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 4, 3, 1),
+ SB_SINGLE("Mic Boost (+20dB)", SB_ALS4000_MIC_IN_GAIN, 0, 0x03),
+ SB_SINGLE("Master Mono Playback Switch", SB_ALS4000_MONO_IO_CTRL, 5, 1),
+ {
+ .name = "Master Mono Capture Route",
+ .type = SB_MIX_MONO_CAPTURE_ALS4K
+ },
+ SB_SINGLE("Mono Playback Switch", SB_DT019X_OUTPUT_SW2, 0, 1),
+ SB_SINGLE("Analog Loopback Switch", SB_ALS4000_MIC_IN_GAIN, 7, 0x01),
+ SB_SINGLE("3D Control - Switch", SB_ALS4000_3D_SND_FX, 6, 0x01),
+ SB_SINGLE("Digital Loopback Switch",
+ SB_ALS4000_CR3_CONFIGURATION, 7, 0x01),
+ /* FIXME: functionality of 3D controls might be swapped, I didn't find
+ * a description of how to identify what is supposed to be what */
+ SB_SINGLE("3D Control - Level", SB_ALS4000_3D_SND_FX, 0, 0x07),
/* FIXME: maybe there's actually some standard 3D ctrl name for it?? */
- SB_SINGLE("3D Control - Freq", SB_ALS4000_3D_SND_FX, 4, 0x03);
-static struct sbmix_elem snd_als4000_3d_control_delay =
+ SB_SINGLE("3D Control - Freq", SB_ALS4000_3D_SND_FX, 4, 0x03),
/* FIXME: ALS4000a.pdf mentions BBD (Bucket Brigade Device) time delay,
* but what ALSA 3D attribute is that actually? "Center", "Depth",
* "Wide" or "Space" or even "Level"? Assuming "Wide" for now... */
- SB_SINGLE("3D Control - Wide", SB_ALS4000_3D_TIME_DELAY, 0, 0x0f);
-static struct sbmix_elem snd_als4000_3d_control_poweroff_switch =
- SB_SINGLE("3D PowerOff Switch", SB_ALS4000_3D_TIME_DELAY, 4, 0x01);
-#ifdef NOT_AVAILABLE
-static struct sbmix_elem snd_als4000_ctl_fmdac =
- SB_SINGLE("FMDAC Switch (Option ?)", SB_ALS4000_FMDAC, 0, 0x01);
-static struct sbmix_elem snd_als4000_ctl_qsound =
- SB_SINGLE("QSound Mode", SB_ALS4000_QSOUND, 1, 0x1f);
-#endif
-
-static struct sbmix_elem *snd_als4000_controls[] = {
- &snd_sb16_ctl_master_play_vol,
- &snd_dt019x_ctl_pcm_play_switch,
- &snd_sb16_ctl_pcm_play_vol,
- &snd_sb16_ctl_synth_capture_route,
- &snd_dt019x_ctl_synth_play_switch,
- &snd_sb16_ctl_synth_play_vol,
- &snd_sb16_ctl_cd_capture_route,
- &snd_sb16_ctl_cd_play_switch,
- &snd_sb16_ctl_cd_play_vol,
- &snd_sb16_ctl_line_capture_route,
- &snd_sb16_ctl_line_play_switch,
- &snd_sb16_ctl_line_play_vol,
- &snd_sb16_ctl_mic_capture_route,
- &snd_als4000_ctl_mic_20db_boost,
- &snd_sb16_ctl_auto_mic_gain,
- &snd_sb16_ctl_mic_play_switch,
- &snd_sb16_ctl_mic_play_vol,
- &snd_sb16_ctl_pc_speaker_vol,
- &snd_sb16_ctl_capture_vol,
- &snd_sb16_ctl_play_vol,
- &snd_als4000_ctl_master_mono_playback_switch,
- &snd_als4000_ctl_master_mono_capture_route,
- &snd_als4000_ctl_mono_playback_switch,
- &snd_als4000_ctl_mixer_loopback,
- &snd_als4000_3d_control_switch,
- &snd_als4000_3d_control_ratio,
- &snd_als4000_3d_control_freq,
- &snd_als4000_3d_control_delay,
- &snd_als4000_3d_control_poweroff_switch,
+ SB_SINGLE("3D Control - Wide", SB_ALS4000_3D_TIME_DELAY, 0, 0x0f),
+ SB_SINGLE("3D PowerOff Switch", SB_ALS4000_3D_TIME_DELAY, 4, 0x01),
+ SB_SINGLE("Master Playback 8kHz / 20kHz LPF Switch",
+ SB_ALS4000_FMDAC, 5, 0x01),
#ifdef NOT_AVAILABLE
- &snd_als4000_ctl_fmdac,
- &snd_als4000_ctl_qsound,
+ SB_SINGLE("FMDAC Switch (Option ?)", SB_ALS4000_FMDAC, 0, 0x01),
+ SB_SINGLE("QSound Mode", SB_ALS4000_QSOUND, 1, 0x1f),
#endif
};
@@ -755,11 +720,10 @@ static unsigned char snd_als4000_init_values[][2] = {
{ SB_ALS4000_MIC_IN_GAIN, 0 },
};
-
/*
*/
static int snd_sbmixer_init(struct snd_sb *chip,
- struct sbmix_elem **controls,
+ struct sbmix_elem *controls,
int controls_count,
unsigned char map[][2],
int map_count,
@@ -782,7 +746,8 @@ static int snd_sbmixer_init(struct snd_sb *chip,
}
for (idx = 0; idx < controls_count; idx++) {
- if ((err = snd_sbmixer_add_ctl_elem(chip, controls[idx])) < 0)
+ err = snd_sbmixer_add_ctl_elem(chip, &controls[idx]);
+ if (err < 0)
return err;
}
snd_component_add(card, name);
@@ -795,7 +760,8 @@ int snd_sbmixer_new(struct snd_sb *chip)
struct snd_card *card;
int err;
- snd_assert(chip != NULL && chip->card != NULL, return -EINVAL);
+ if (snd_BUG_ON(!chip || !chip->card))
+ return -EINVAL;
card = chip->card;
@@ -813,6 +779,7 @@ int snd_sbmixer_new(struct snd_sb *chip)
return err;
break;
case SB_HW_PRO:
+ case SB_HW_JAZZ16:
if ((err = snd_sbmixer_init(chip,
snd_sbpro_controls,
ARRAY_SIZE(snd_sbpro_controls),
@@ -823,6 +790,7 @@ int snd_sbmixer_new(struct snd_sb *chip)
break;
case SB_HW_16:
case SB_HW_ALS100:
+ case SB_HW_CS5530:
if ((err = snd_sbmixer_init(chip,
snd_sb16_controls,
ARRAY_SIZE(snd_sb16_controls),
@@ -832,6 +800,15 @@ int snd_sbmixer_new(struct snd_sb *chip)
return err;
break;
case SB_HW_ALS4000:
+ /* use only the first 16 controls from SB16 */
+ err = snd_sbmixer_init(chip,
+ snd_sb16_controls,
+ 16,
+ snd_sb16_init_values,
+ ARRAY_SIZE(snd_sb16_init_values),
+ "ALS4000");
+ if (err < 0)
+ return err;
if ((err = snd_sbmixer_init(chip,
snd_als4000_controls,
ARRAY_SIZE(snd_als4000_controls),
@@ -841,12 +818,14 @@ int snd_sbmixer_new(struct snd_sb *chip)
return err;
break;
case SB_HW_DT019X:
- if ((err = snd_sbmixer_init(chip,
- snd_dt019x_controls,
- ARRAY_SIZE(snd_dt019x_controls),
- snd_dt019x_init_values,
- ARRAY_SIZE(snd_dt019x_init_values),
- "DT019X")) < 0)
+ err = snd_sbmixer_init(chip,
+ snd_dt019x_controls,
+ ARRAY_SIZE(snd_dt019x_controls),
+ snd_dt019x_init_values,
+ ARRAY_SIZE(snd_dt019x_init_values),
+ "DT019X");
+ if (err < 0)
+ return err;
break;
default:
strcpy(card->mixername, "???");
@@ -906,13 +885,14 @@ static unsigned char dt019x_saved_regs[] = {
};
static unsigned char als4000_saved_regs[] = {
+ /* please verify in dsheet whether regs to be added
+ are actually real H/W or just dummy */
SB_DSP4_MASTER_DEV, SB_DSP4_MASTER_DEV + 1,
SB_DSP4_OUTPUT_SW,
SB_DSP4_PCM_DEV, SB_DSP4_PCM_DEV + 1,
SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT,
SB_DSP4_SYNTH_DEV, SB_DSP4_SYNTH_DEV + 1,
SB_DSP4_CD_DEV, SB_DSP4_CD_DEV + 1,
- SB_DSP4_MIC_AGC,
SB_DSP4_MIC_DEV,
SB_DSP4_SPEAKER_DEV,
SB_DSP4_IGAIN_DEV, SB_DSP4_IGAIN_DEV + 1,
@@ -920,14 +900,17 @@ static unsigned char als4000_saved_regs[] = {
SB_DT019X_OUTPUT_SW2,
SB_ALS4000_MONO_IO_CTRL,
SB_ALS4000_MIC_IN_GAIN,
+ SB_ALS4000_FMDAC,
SB_ALS4000_3D_SND_FX,
SB_ALS4000_3D_TIME_DELAY,
+ SB_ALS4000_CR3_CONFIGURATION,
};
static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
{
unsigned char *val = chip->saved_regs;
- snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
+ if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
+ return;
for (; num_regs; num_regs--)
*val++ = snd_sbmixer_read(chip, *regs++);
}
@@ -935,7 +918,8 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
{
unsigned char *val = chip->saved_regs;
- snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return);
+ if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
+ return;
for (; num_regs; num_regs--)
snd_sbmixer_write(chip, *regs++, *val++);
}
@@ -948,10 +932,12 @@ void snd_sbmixer_suspend(struct snd_sb *chip)
save_mixer(chip, sb20_saved_regs, ARRAY_SIZE(sb20_saved_regs));
break;
case SB_HW_PRO:
+ case SB_HW_JAZZ16:
save_mixer(chip, sbpro_saved_regs, ARRAY_SIZE(sbpro_saved_regs));
break;
case SB_HW_16:
case SB_HW_ALS100:
+ case SB_HW_CS5530:
save_mixer(chip, sb16_saved_regs, ARRAY_SIZE(sb16_saved_regs));
break;
case SB_HW_ALS4000:
@@ -973,10 +959,12 @@ void snd_sbmixer_resume(struct snd_sb *chip)
restore_mixer(chip, sb20_saved_regs, ARRAY_SIZE(sb20_saved_regs));
break;
case SB_HW_PRO:
+ case SB_HW_JAZZ16:
restore_mixer(chip, sbpro_saved_regs, ARRAY_SIZE(sbpro_saved_regs));
break;
case SB_HW_16:
case SB_HW_ALS100:
+ case SB_HW_CS5530:
restore_mixer(chip, sb16_saved_regs, ARRAY_SIZE(sb16_saved_regs));
break;
case SB_HW_ALS4000: