summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2002-02-18 22:56:03 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-02-18 22:56:03 -0800
commit2c2aed67f4c899580db67f4d8c78061b025e902f (patch)
treed1f4251a0674a07def9ac5547032ca5427294f43
parentc9d7526809c977edd639e990d629a9336df317d2 (diff)
parent56eab47da5d7380b728987d3d9c90d4e07712763 (diff)
Merge in CVS ALSA tree..
-rw-r--r--include/sound/asound.h23
-rw-r--r--include/sound/core.h35
-rw-r--r--include/sound/cs46xx.h4
-rw-r--r--include/sound/emu8000.h2
-rw-r--r--include/sound/emux_synth.h2
-rw-r--r--include/sound/gus.h3
-rw-r--r--include/sound/opl3.h1
-rw-r--r--include/sound/pcm.h6
-rw-r--r--include/sound/pcm_params.h2
-rw-r--r--include/sound/seq_kernel.h1
-rw-r--r--include/sound/trident.h4
-rw-r--r--include/sound/version.h3
-rw-r--r--include/sound/wavefront.h255
-rw-r--r--include/sound/ymfpci.h6
-rw-r--r--sound/Config.in4
-rw-r--r--sound/Makefile5
-rw-r--r--sound/core/Config.in22
-rw-r--r--sound/core/control.c58
-rw-r--r--sound/core/device.c2
-rw-r--r--sound/core/hwdep.c4
-rw-r--r--sound/core/info.c14
-rw-r--r--sound/core/info_oss.c2
-rw-r--r--sound/core/init.c7
-rw-r--r--sound/core/isadma.c4
-rw-r--r--sound/core/memory.c82
-rw-r--r--sound/core/misc.c2
-rw-r--r--sound/core/oss/copy.c1
-rw-r--r--sound/core/oss/io.c1
-rw-r--r--sound/core/oss/linear.c1
-rw-r--r--sound/core/oss/mixer_oss.c2
-rw-r--r--sound/core/oss/mulaw.c1
-rw-r--r--sound/core/oss/pcm_oss.c12
-rw-r--r--sound/core/oss/pcm_plugin.c3
-rw-r--r--sound/core/oss/rate.c17
-rw-r--r--sound/core/oss/route.c10
-rw-r--r--sound/core/pcm.c7
-rw-r--r--sound/core/pcm_lib.c2
-rw-r--r--sound/core/pcm_memory.c59
-rw-r--r--sound/core/pcm_misc.c1
-rw-r--r--sound/core/pcm_native.c50
-rw-r--r--sound/core/pcm_timer.c1
-rw-r--r--sound/core/rawmidi.c4
-rw-r--r--sound/core/rtctimer.c1
-rw-r--r--sound/core/seq/instr/ainstr_fm.c1
-rw-r--r--sound/core/seq/instr/ainstr_gf1.c2
-rw-r--r--sound/core/seq/instr/ainstr_iw.c2
-rw-r--r--sound/core/seq/instr/ainstr_simple.c2
-rw-r--r--sound/core/seq/oss/seq_oss_device.h4
-rw-r--r--sound/core/seq/seq_clientmgr.c7
-rw-r--r--sound/core/seq/seq_device.c1
-rw-r--r--sound/core/seq/seq_fifo.c1
-rw-r--r--sound/core/seq/seq_instr.c1
-rw-r--r--sound/core/seq/seq_lock.h2
-rw-r--r--sound/core/seq/seq_memory.c2
-rw-r--r--sound/core/seq/seq_midi.c3
-rw-r--r--sound/core/seq/seq_midi_emul.c1
-rw-r--r--sound/core/seq/seq_midi_event.c1
-rw-r--r--sound/core/seq/seq_ports.c1
-rw-r--r--sound/core/seq/seq_prioq.c2
-rw-r--r--sound/core/seq/seq_queue.c1
-rw-r--r--sound/core/seq/seq_timer.c1
-rw-r--r--sound/core/seq/seq_virmidi.c3
-rw-r--r--sound/core/sound.c8
-rw-r--r--sound/core/sound_oss.c4
-rw-r--r--sound/core/timer.c2
-rw-r--r--sound/drivers/Config.in5
-rw-r--r--sound/drivers/dummy.c4
-rw-r--r--sound/drivers/mpu401/mpu401.c3
-rw-r--r--sound/drivers/mpu401/mpu401_uart.c3
-rw-r--r--sound/drivers/mtpav.c9
-rw-r--r--sound/drivers/opl3/opl3_lib.c5
-rw-r--r--sound/drivers/opl3/opl3_oss.c1
-rw-r--r--sound/drivers/serial-u16550.c3
-rw-r--r--sound/drivers/virmidi.c2
-rw-r--r--sound/i2c/cs8427.c1
-rw-r--r--sound/i2c/i2c.c1
-rw-r--r--sound/i2c/tea6330t.c1
-rw-r--r--sound/isa/Config.in7
-rw-r--r--sound/isa/ad1816a/ad1816a.c7
-rw-r--r--sound/isa/ad1816a/ad1816a_lib.c31
-rw-r--r--sound/isa/ad1848/ad1848.c3
-rw-r--r--sound/isa/ad1848/ad1848_lib.c9
-rw-r--r--sound/isa/als100.c8
-rw-r--r--sound/isa/azt2320.c7
-rw-r--r--sound/isa/cmi8330.c1
-rw-r--r--sound/isa/cs423x/cs4231.c2
-rw-r--r--sound/isa/cs423x/cs4231_lib.c11
-rw-r--r--sound/isa/cs423x/cs4236.c8
-rw-r--r--sound/isa/cs423x/cs4236_lib.c2
-rw-r--r--sound/isa/dt0197h.c7
-rw-r--r--sound/isa/es1688/es1688.c2
-rw-r--r--sound/isa/es1688/es1688_lib.c11
-rw-r--r--sound/isa/es18xx.c124
-rw-r--r--sound/isa/gus/gus_dma.c9
-rw-r--r--sound/isa/gus/gus_dram.c1
-rw-r--r--sound/isa/gus/gus_instr.c1
-rw-r--r--sound/isa/gus/gus_io.c1
-rw-r--r--sound/isa/gus/gus_main.c6
-rw-r--r--sound/isa/gus/gus_mem.c1
-rw-r--r--sound/isa/gus/gus_mem_proc.c1
-rw-r--r--sound/isa/gus/gus_mixer.c2
-rw-r--r--sound/isa/gus/gus_pcm.c8
-rw-r--r--sound/isa/gus/gus_reset.c1
-rw-r--r--sound/isa/gus/gus_sample.c1
-rw-r--r--sound/isa/gus/gus_simple.c1
-rw-r--r--sound/isa/gus/gus_synth.c1
-rw-r--r--sound/isa/gus/gus_timer.c1
-rw-r--r--sound/isa/gus/gus_uart.c1
-rw-r--r--sound/isa/gus/gus_volume.c1
-rw-r--r--sound/isa/gus/gusclassic.c2
-rw-r--r--sound/isa/gus/gusextreme.c2
-rw-r--r--sound/isa/gus/gusmax.c2
-rw-r--r--sound/isa/gus/interwave.c8
-rw-r--r--sound/isa/opl3sa2.c24
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c17
-rw-r--r--sound/isa/sb/emu8000.c11
-rw-r--r--sound/isa/sb/emu8000_local.h5
-rw-r--r--sound/isa/sb/es968.c6
-rw-r--r--sound/isa/sb/sb16.c8
-rw-r--r--sound/isa/sb/sb16_csp.c37
-rw-r--r--sound/isa/sb/sb16_main.c7
-rw-r--r--sound/isa/sb/sb8.c3
-rw-r--r--sound/isa/sb/sb8_main.c9
-rw-r--r--sound/isa/sb/sb8_midi.c1
-rw-r--r--sound/isa/sb/sb_common.c11
-rw-r--r--sound/isa/sb/sb_mixer.c1
-rw-r--r--sound/isa/sgalaxy.c2
-rw-r--r--sound/isa/wavefront/wavefront.c196
-rw-r--r--sound/isa/wavefront/wavefront_fx.c41
-rw-r--r--sound/isa/wavefront/wavefront_midi.c2
-rw-r--r--sound/isa/wavefront/wavefront_synth.c96
-rw-r--r--sound/last.c6
-rw-r--r--sound/pci/Config.in8
-rw-r--r--sound/pci/ac97/Makefile2
-rw-r--r--sound/pci/ac97/ac97_codec.c1
-rw-r--r--sound/pci/ac97/ak4531_codec.c1
-rw-r--r--sound/pci/ali5451/ali5451.c3
-rw-r--r--sound/pci/als4000.c5
-rw-r--r--sound/pci/cmipci.c9
-rw-r--r--sound/pci/cs4281.c5
-rw-r--r--sound/pci/cs46xx/cs46xx.c13
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c21
-rw-r--r--sound/pci/emu10k1/emu10k1.c1
-rw-r--r--sound/pci/emu10k1/emu10k1_callback.c9
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c4
-rw-r--r--sound/pci/emu10k1/emu10k1_synth_local.h1
-rw-r--r--sound/pci/emu10k1/emufx.c1
-rw-r--r--sound/pci/emu10k1/emumixer.c1
-rw-r--r--sound/pci/emu10k1/emumpu401.c1
-rw-r--r--sound/pci/emu10k1/emupcm.c2
-rw-r--r--sound/pci/emu10k1/emuproc.c1
-rw-r--r--sound/pci/emu10k1/io.c1
-rw-r--r--sound/pci/emu10k1/irq.c1
-rw-r--r--sound/pci/emu10k1/memory.c1
-rw-r--r--sound/pci/emu10k1/voice.c1
-rw-r--r--sound/pci/ens1370.c7
-rw-r--r--sound/pci/es1938.c11
-rw-r--r--sound/pci/es1968.c127
-rw-r--r--sound/pci/fm801.c3
-rw-r--r--sound/pci/ice1712.c14
-rw-r--r--sound/pci/intel8x0.c125
-rw-r--r--sound/pci/korg1212/korg1212.c237
-rw-r--r--sound/pci/maestro3.c25
-rw-r--r--sound/pci/nm256/nm256.c25
-rw-r--r--sound/pci/rme96.c7
-rw-r--r--sound/pci/rme9652/rme9652.c10
-rw-r--r--sound/pci/sonicvibes.c13
-rw-r--r--sound/pci/trident/trident.c9
-rw-r--r--sound/pci/trident/trident_main.c16
-rw-r--r--sound/pci/trident/trident_memory.c2
-rw-r--r--sound/pci/trident/trident_synth.c1
-rw-r--r--sound/pci/via686.c70
-rw-r--r--sound/pci/via8233.c3
-rw-r--r--sound/pci/ymfpci/ymfpci.c57
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c133
-rw-r--r--sound/ppc/Config.in5
-rw-r--r--sound/ppc/awacs.c2
-rw-r--r--sound/ppc/pmac.c1
-rw-r--r--sound/ppc/tumbler.c1
-rw-r--r--sound/synth/emux/emux.c5
-rw-r--r--sound/synth/emux/emux_effect.c1
-rw-r--r--sound/synth/emux/emux_proc.c5
-rw-r--r--sound/synth/emux/emux_seq.c1
-rw-r--r--sound/synth/emux/emux_synth.c2
-rw-r--r--sound/synth/emux/emux_voice.h4
-rw-r--r--sound/synth/emux/soundfont.c1
-rw-r--r--sound/synth/util_mem.c1
187 files changed, 1638 insertions, 969 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h
index f613dbddac7a..013e59fb6eb4 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -24,7 +24,24 @@
#define __SOUND_ASOUND_H
#if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
+
#include <linux/ioctl.h>
+
+#ifdef __KERNEL__
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#if __LITTLE_ENDIAN == 1234
+#define SNDRV_LITTLE_ENDIAN
+#elif __BIG_ENDIAN == 4321
+#define SNDRV_BIG_ENDIAN
+#else
+#error "Unsupported endian..."
+#endif
+
+#else /* !__KERNEL__ */
+
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define SNDRV_LITTLE_ENDIAN
@@ -33,7 +50,11 @@
#else
#error "Unsupported endian..."
#endif
-#endif
+
+#endif /* __KERNEL **/
+
+#endif /* LINUX */
+
#ifndef __KERNEL__
#include <sys/time.h>
#include <sys/types.h>
diff --git a/include/sound/core.h b/include/sound/core.h
index e216c6ba1efc..ebd845c0191b 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -132,7 +132,7 @@ struct _snd_card {
int (*set_power_state) (snd_card_t *card, unsigned int state);
void *power_state_private_data;
unsigned int power_state; /* power state */
- unsigned int power_lock; /* power lock */
+ struct semaphore power_lock; /* power lock */
wait_queue_head_t power_sleep;
#endif
@@ -143,22 +143,17 @@ struct _snd_card {
};
#ifdef CONFIG_PM
-static inline void snd_power_lock(snd_card_t *card, int can_schedule)
+static inline void snd_power_lock(snd_card_t *card)
{
- while (test_and_set_bit(0, &card->power_lock)) {
- if (can_schedule) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
- }
+ down(&card->power_lock);
}
static inline void snd_power_unlock(snd_card_t *card)
{
- clear_bit(0, &card->power_lock);
+ up(&card->power_lock);
}
-void snd_power_wait(snd_card_t *card, int can_schedule);
+void snd_power_wait(snd_card_t *card);
static inline unsigned int snd_power_get_state(snd_card_t *card)
{
@@ -171,9 +166,9 @@ static inline void snd_power_change_state(snd_card_t *card, unsigned int state)
wake_up(&card->power_sleep);
}
#else
-#define snd_power_lock(card, can_schedule) do { ; } while (0)
+#define snd_power_lock(card) do { ; } while (0)
#define snd_power_unlock(card) do { ; } while (0)
-#define snd_power_wait(card, can_schedule) do { ; } while (0)
+#define snd_power_wait(card) do { ; } while (0)
#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
#define snd_power_change_state(card, state) do { ; } while (0)
#endif
@@ -236,18 +231,26 @@ void *snd_hidden_vmalloc(unsigned long size);
void snd_hidden_vfree(void *obj);
#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags)
#define kfree(obj) snd_hidden_kfree(obj)
+#define kfree_nocheck(obj) snd_wrapper_kfree(obj)
#define vmalloc(size) snd_hidden_vmalloc(size)
#define vfree(obj) snd_hidden_vfree(obj)
+#else
+#define kfree_nocheck(obj) kfree(obj)
#endif
void *snd_kcalloc(size_t size, int flags);
char *snd_kmalloc_strdup(const char *string, int flags);
void *snd_malloc_pages(unsigned long size, unsigned int dma_flags);
void *snd_malloc_pages_fallback(unsigned long size, unsigned int dma_flags, unsigned long *res_size);
void snd_free_pages(void *ptr, unsigned long size);
+#ifdef CONFIG_ISA
+void *snd_malloc_isa_pages(unsigned long size, dma_addr_t *dma_addr);
+void *snd_malloc_isa_pages_fallback(unsigned long size, dma_addr_t *dma_addr, unsigned long *res_size);
+#define snd_free_isa_pages(size, ptr, dma_addr) snd_free_pages(ptr, size)
+#endif
#ifdef CONFIG_PCI
-void *snd_malloc_pci_pages(struct pci_dev *pci, unsigned long size, dma_addr_t *dmaaddr);
-void *snd_malloc_pci_pages_fallback(struct pci_dev *pci, unsigned long size, dma_addr_t *dmaaddr, unsigned long *res_size);
-void snd_free_pci_pages(struct pci_dev *pci, unsigned long size, void *ptr, dma_addr_t dmaaddr);
+void *snd_malloc_pci_pages(struct pci_dev *pci, unsigned long size, dma_addr_t *dma_addr);
+void *snd_malloc_pci_pages_fallback(struct pci_dev *pci, unsigned long size, dma_addr_t *dma_addr, unsigned long *res_size);
+void snd_free_pci_pages(struct pci_dev *pci, unsigned long size, void *ptr, dma_addr_t dma_addr);
#endif
int copy_to_user_fromio(void *dst, unsigned long src, size_t count);
int copy_from_user_toio(unsigned long dst, const void *src, size_t count);
@@ -282,7 +285,7 @@ int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd);
#define DMA_MODE_NO_ENABLE 0x0100
-void snd_dma_program(unsigned long dma, const void *buf, unsigned int size, unsigned short mode);
+void snd_dma_program(unsigned long dma, unsigned long addr, unsigned int size, unsigned short mode);
void snd_dma_disable(unsigned long dma);
unsigned int snd_dma_residue(unsigned long dma);
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 97176de0ab50..f900efa6b8c4 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1713,8 +1713,8 @@ int snd_cs46xx_mixer(cs46xx_t *chip);
int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi);
#ifdef CONFIG_PM
-void snd_cs46xx_suspend(cs46xx_t *chip, int can_schedule);
-void snd_cs46xx_resume(cs46xx_t *chip, int can_schedule);
+void snd_cs46xx_suspend(cs46xx_t *chip);
+void snd_cs46xx_resume(cs46xx_t *chip);
#endif
#endif /* __SOUND_CS46XX_H */
diff --git a/include/sound/emu8000.h b/include/sound/emu8000.h
index abd21a616307..78d84750db2e 100644
--- a/include/sound/emu8000.h
+++ b/include/sound/emu8000.h
@@ -21,8 +21,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "driver.h"
-#include "core.h"
#include "emux_synth.h"
#include "seq_kernel.h"
diff --git a/include/sound/emux_synth.h b/include/sound/emux_synth.h
index 25c43395100b..09ce125b782a 100644
--- a/include/sound/emux_synth.h
+++ b/include/sound/emux_synth.h
@@ -21,8 +21,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "driver.h"
-#include "core.h"
#include "seq_kernel.h"
#include "seq_device.h"
#include "soundfont.h"
diff --git a/include/sound/gus.h b/include/sound/gus.h
index c24de2d59d88..2e84f2687588 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -216,6 +216,7 @@ typedef struct _snd_gf1_mem {
typedef struct snd_gf1_dma_block {
void *buffer; /* buffer in computer's RAM */
+ unsigned long buf_addr; /* buffer address */
unsigned int addr; /* address in onboard memory */
unsigned int count; /* count in bytes */
unsigned int cmd; /* DMA command (format) */
@@ -605,7 +606,7 @@ int snd_gf1_mem_proc_done(snd_gus_card_t * gus);
/* gus_dma.c */
void snd_gf1_dma_program(snd_gus_card_t * gus, unsigned int addr,
- const void *buf, unsigned int count,
+ unsigned long buf_addr, unsigned int count,
unsigned int cmd);
void snd_gf1_dma_ack(snd_gus_card_t * gus);
int snd_gf1_dma_init(snd_gus_card_t * gus);
diff --git a/include/sound/opl3.h b/include/sound/opl3.h
index d2cf59f12517..c3c6218aac71 100644
--- a/include/sound/opl3.h
+++ b/include/sound/opl3.h
@@ -52,6 +52,7 @@
*/
#include "driver.h"
+#include <linux/time.h>
#include "core.h"
#include "hwdep.h"
#include "timer.h"
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 945313c4e82c..3d24d3c04273 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -832,11 +832,9 @@ int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream);
#ifdef CONFIG_ISA
int snd_pcm_lib_preallocate_isa_pages(snd_pcm_substream_t *substream,
- size_t size, size_t max,
- unsigned int flags);
+ size_t size, size_t max);
int snd_pcm_lib_preallocate_isa_pages_for_all(snd_pcm_t *pcm,
- size_t size, size_t max,
- unsigned int flags);
+ size_t size, size_t max);
#endif
#ifdef CONFIG_PCI
int snd_pcm_lib_preallocate_pci_pages(struct pci_dev *pci,
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index 769d8738f2fd..9d008650e5f2 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -22,6 +22,8 @@
*
*/
+#include <linux/bitops.h>
+
extern int snd_pcm_hw_param_mask(snd_pcm_substream_t *pcm, snd_pcm_hw_params_t *params,
snd_pcm_hw_param_t var, const snd_mask_t *val);
extern unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params,
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index a0e630210215..69a7acf1590f 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -21,6 +21,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+#include <linux/time.h>
#include "asequencer.h"
typedef sndrv_seq_tick_time_t snd_seq_tick_time_t;
diff --git a/include/sound/trident.h b/include/sound/trident.h
index 572cc323a8bf..1d8b1c3d7931 100644
--- a/include/sound/trident.h
+++ b/include/sound/trident.h
@@ -469,8 +469,8 @@ int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk,
/* Power Management */
#ifdef CONFIG_PM
-void snd_trident_suspend(trident_t *trident, int can_schedule);
-void snd_trident_resume(trident_t *trident, int can_schedule);
+void snd_trident_suspend(trident_t *trident);
+void snd_trident_resume(trident_t *trident);
#endif
#endif /* __SOUND_TRIDENT_H */
diff --git a/include/sound/version.h b/include/sound/version.h
index cb3edc7cff9b..eac7e72f5513 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,2 +1,3 @@
/* include/version.h. Generated automatically by configure. */
-#define CONFIG_SND_VERSION "0.9.0beta10"
+#define CONFIG_SND_VERSION "0.9.0beta11"
+#define CONFIG_SND_DATE " (Tue Feb 19 08:14:59 2002 UTC)"
diff --git a/include/sound/wavefront.h b/include/sound/wavefront.h
index 1062084d55ae..79ff3b4b1da4 100644
--- a/include/sound/wavefront.h
+++ b/include/sound/wavefront.h
@@ -64,12 +64,21 @@
between a 16-bit view of the world and a 32-bit one.
*/
-typedef short INT16;
-typedef unsigned short UINT16;
-typedef int INT32;
-typedef unsigned int UINT32;
-typedef char CHAR8;
-typedef unsigned char UCHAR8;
+#ifndef __KERNEL__
+/* keep them for compatibility */
+typedef short s16;
+typedef unsigned short u16;
+typedef int s32;
+typedef unsigned int u32;
+typedef char s8;
+typedef unsigned char u8;
+typedef s16 INT16;
+typedef u16 UINT16;
+typedef s32 INT32;
+typedef u32 UINT32;
+typedef s8 CHAR8;
+typedef u8 UCHAR8;
+#endif
/* Pseudo-commands not part of the WaveFront command set.
These are used for various driver controls and direct
@@ -197,111 +206,111 @@ typedef unsigned char UCHAR8;
struct wf_envelope
{
- UCHAR8 attack_time:7;
- UCHAR8 Unused1:1;
+ u8 attack_time:7;
+ u8 Unused1:1;
- UCHAR8 decay1_time:7;
- UCHAR8 Unused2:1;
+ u8 decay1_time:7;
+ u8 Unused2:1;
- UCHAR8 decay2_time:7;
- UCHAR8 Unused3:1;
+ u8 decay2_time:7;
+ u8 Unused3:1;
- UCHAR8 sustain_time:7;
- UCHAR8 Unused4:1;
+ u8 sustain_time:7;
+ u8 Unused4:1;
- UCHAR8 release_time:7;
- UCHAR8 Unused5:1;
+ u8 release_time:7;
+ u8 Unused5:1;
- UCHAR8 release2_time:7;
- UCHAR8 Unused6:1;
+ u8 release2_time:7;
+ u8 Unused6:1;
- CHAR8 attack_level;
- CHAR8 decay1_level;
- CHAR8 decay2_level;
- CHAR8 sustain_level;
- CHAR8 release_level;
+ s8 attack_level;
+ s8 decay1_level;
+ s8 decay2_level;
+ s8 sustain_level;
+ s8 release_level;
- UCHAR8 attack_velocity:7;
- UCHAR8 Unused7:1;
+ u8 attack_velocity:7;
+ u8 Unused7:1;
- UCHAR8 volume_velocity:7;
- UCHAR8 Unused8:1;
+ u8 volume_velocity:7;
+ u8 Unused8:1;
- UCHAR8 keyboard_scaling:7;
- UCHAR8 Unused9:1;
+ u8 keyboard_scaling:7;
+ u8 Unused9:1;
};
typedef struct wf_envelope wavefront_envelope;
struct wf_lfo
{
- UCHAR8 sample_number;
+ u8 sample_number;
- UCHAR8 frequency:7;
- UCHAR8 Unused1:1;
+ u8 frequency:7;
+ u8 Unused1:1;
- UCHAR8 am_src:4;
- UCHAR8 fm_src:4;
+ u8 am_src:4;
+ u8 fm_src:4;
- CHAR8 fm_amount;
- CHAR8 am_amount;
- CHAR8 start_level;
- CHAR8 end_level;
+ s8 fm_amount;
+ s8 am_amount;
+ s8 start_level;
+ s8 end_level;
- UCHAR8 ramp_delay:7;
- UCHAR8 wave_restart:1; /* for LFO2 only */
+ u8 ramp_delay:7;
+ u8 wave_restart:1; /* for LFO2 only */
- UCHAR8 ramp_time:7;
- UCHAR8 Unused2:1;
+ u8 ramp_time:7;
+ u8 Unused2:1;
};
typedef struct wf_lfo wavefront_lfo;
struct wf_patch
{
- INT16 frequency_bias; /* ** THIS IS IN MOTOROLA FORMAT!! ** */
+ s16 frequency_bias; /* ** THIS IS IN MOTOROLA FORMAT!! ** */
- UCHAR8 amplitude_bias:7;
- UCHAR8 Unused1:1;
+ u8 amplitude_bias:7;
+ u8 Unused1:1;
- UCHAR8 portamento:7;
- UCHAR8 Unused2:1;
+ u8 portamento:7;
+ u8 Unused2:1;
- UCHAR8 sample_number;
+ u8 sample_number;
- UCHAR8 pitch_bend:4;
- UCHAR8 sample_msb:1;
- UCHAR8 Unused3:3;
+ u8 pitch_bend:4;
+ u8 sample_msb:1;
+ u8 Unused3:3;
- UCHAR8 mono:1;
- UCHAR8 retrigger:1;
- UCHAR8 nohold:1;
- UCHAR8 restart:1;
- UCHAR8 filterconfig:2; /* SDK says "not used" */
- UCHAR8 reuse:1;
- UCHAR8 reset_lfo:1;
+ u8 mono:1;
+ u8 retrigger:1;
+ u8 nohold:1;
+ u8 restart:1;
+ u8 filterconfig:2; /* SDK says "not used" */
+ u8 reuse:1;
+ u8 reset_lfo:1;
- UCHAR8 fm_src2:4;
- UCHAR8 fm_src1:4;
+ u8 fm_src2:4;
+ u8 fm_src1:4;
- CHAR8 fm_amount1;
- CHAR8 fm_amount2;
+ s8 fm_amount1;
+ s8 fm_amount2;
- UCHAR8 am_src:4;
- UCHAR8 Unused4:4;
+ u8 am_src:4;
+ u8 Unused4:4;
- CHAR8 am_amount;
+ s8 am_amount;
- UCHAR8 fc1_mode:4;
- UCHAR8 fc2_mode:4;
+ u8 fc1_mode:4;
+ u8 fc2_mode:4;
- CHAR8 fc1_mod_amount;
- CHAR8 fc1_keyboard_scaling;
- CHAR8 fc1_bias;
- CHAR8 fc2_mod_amount;
- CHAR8 fc2_keyboard_scaling;
- CHAR8 fc2_bias;
+ s8 fc1_mod_amount;
+ s8 fc1_keyboard_scaling;
+ s8 fc1_bias;
+ s8 fc2_mod_amount;
+ s8 fc2_keyboard_scaling;
+ s8 fc2_bias;
- UCHAR8 randomizer:7;
- UCHAR8 Unused5:1;
+ u8 randomizer:7;
+ u8 Unused5:1;
struct wf_envelope envelope1;
struct wf_envelope envelope2;
@@ -312,18 +321,18 @@ typedef struct wf_patch wavefront_patch;
struct wf_layer
{
- UCHAR8 patch_number;
+ u8 patch_number;
- UCHAR8 mix_level:7;
- UCHAR8 mute:1;
+ u8 mix_level:7;
+ u8 mute:1;
- UCHAR8 split_point:7;
- UCHAR8 play_below:1;
+ u8 split_point:7;
+ u8 play_below:1;
- UCHAR8 pan_mod_src:2;
- UCHAR8 pan_or_mod:1;
- UCHAR8 pan:4;
- UCHAR8 split_type:1;
+ u8 pan_mod_src:2;
+ u8 pan_or_mod:1;
+ u8 pan:4;
+ u8 split_type:1;
};
typedef struct wf_layer wavefront_layer;
@@ -335,9 +344,9 @@ typedef struct wf_program wavefront_program;
struct wf_sample_offset
{
- INT32 Fraction:4;
- INT32 Integer:20;
- INT32 Unused:8;
+ s32 Fraction:4;
+ s32 Integer:20;
+ s32 Unused:8;
};
typedef struct wf_sample_offset wavefront_sample_offset;
@@ -429,38 +438,38 @@ typedef struct wf_sample {
struct wf_sample_offset loopStartOffset;
struct wf_sample_offset loopEndOffset;
struct wf_sample_offset sampleEndOffset;
- INT16 FrequencyBias;
- UCHAR8 SampleResolution:2; /* sample_format */
- UCHAR8 Unused1:1;
- UCHAR8 Loop:1;
- UCHAR8 Bidirectional:1;
- UCHAR8 Unused2:1;
- UCHAR8 Reverse:1;
- UCHAR8 Unused3:1;
+ s16 FrequencyBias;
+ u8 SampleResolution:2; /* sample_format */
+ u8 Unused1:1;
+ u8 Loop:1;
+ u8 Bidirectional:1;
+ u8 Unused2:1;
+ u8 Reverse:1;
+ u8 Unused3:1;
} wavefront_sample;
typedef struct wf_multisample {
- INT16 NumberOfSamples; /* log2 of the number of samples */
- INT16 SampleNumber[NUM_MIDIKEYS];
+ s16 NumberOfSamples; /* log2 of the number of samples */
+ s16 SampleNumber[NUM_MIDIKEYS];
} wavefront_multisample;
typedef struct wf_alias {
- INT16 OriginalSample __attribute__ ((packed));
+ s16 OriginalSample __attribute__ ((packed));
struct wf_sample_offset sampleStartOffset __attribute__ ((packed));
struct wf_sample_offset loopStartOffset __attribute__ ((packed));
struct wf_sample_offset sampleEndOffset __attribute__ ((packed));
struct wf_sample_offset loopEndOffset __attribute__ ((packed));
- INT16 FrequencyBias __attribute__ ((packed));
+ s16 FrequencyBias __attribute__ ((packed));
- UCHAR8 SampleResolution:2 __attribute__ ((packed));
- UCHAR8 Unused1:1 __attribute__ ((packed));
- UCHAR8 Loop:1 __attribute__ ((packed));
- UCHAR8 Bidirectional:1 __attribute__ ((packed));
- UCHAR8 Unused2:1 __attribute__ ((packed));
- UCHAR8 Reverse:1 __attribute__ ((packed));
- UCHAR8 Unused3:1 __attribute__ ((packed));
+ u8 SampleResolution:2 __attribute__ ((packed));
+ u8 Unused1:1 __attribute__ ((packed));
+ u8 Loop:1 __attribute__ ((packed));
+ u8 Bidirectional:1 __attribute__ ((packed));
+ u8 Unused2:1 __attribute__ ((packed));
+ u8 Reverse:1 __attribute__ ((packed));
+ u8 Unused3:1 __attribute__ ((packed));
/* This structure is meant to be padded only to 16 bits on their
original. Of course, whoever wrote their documentation didn't
@@ -471,19 +480,19 @@ typedef struct wf_alias {
standard 16->32 bit issues.
*/
- UCHAR8 sixteen_bit_padding __attribute__ ((packed));
+ u8 sixteen_bit_padding __attribute__ ((packed));
} wavefront_alias;
typedef struct wf_drum {
- UCHAR8 PatchNumber;
- UCHAR8 MixLevel:7;
- UCHAR8 Unmute:1;
- UCHAR8 Group:4;
- UCHAR8 Unused1:4;
- UCHAR8 PanModSource:2;
- UCHAR8 PanModulated:1;
- UCHAR8 PanAmount:4;
- UCHAR8 Unused2:1;
+ u8 PatchNumber;
+ u8 MixLevel:7;
+ u8 Unmute:1;
+ u8 Group:4;
+ u8 Unused1:4;
+ u8 PanModSource:2;
+ u8 PanModulated:1;
+ u8 PanAmount:4;
+ u8 Unused2:1;
} wavefront_drum;
typedef struct wf_drumkit {
@@ -491,7 +500,7 @@ typedef struct wf_drumkit {
} wavefront_drumkit;
typedef struct wf_channel_programs {
- UCHAR8 Program[NUM_MIDICHANNELS];
+ u8 Program[NUM_MIDICHANNELS];
} wavefront_channel_programs;
/* How to get MIDI channel status from the data returned by
@@ -522,15 +531,15 @@ typedef struct wf_patch_info {
only, and are unused by the current user-level library.
*/
- INT16 key; /* Use WAVEFRONT_PATCH here */
- UINT16 devno; /* fill in when sending */
- UCHAR8 subkey; /* WF_ST_{SAMPLE,ALIAS,etc.} */
+ s16 key; /* Use WAVEFRONT_PATCH here */
+ u16 devno; /* fill in when sending */
+ u8 subkey; /* WF_ST_{SAMPLE,ALIAS,etc.} */
#define WAVEFRONT_FIND_FREE_SAMPLE_SLOT 999
- UINT16 number; /* patch/sample/prog number */
+ u16 number; /* patch/sample/prog number */
- UINT32 size; /* size of any data included in
+ u32 size; /* size of any data included in
one of the fields in `hdrptr', or
as `dataptr'.
@@ -546,7 +555,7 @@ typedef struct wf_patch_info {
*/
wavefront_any *hdrptr; /* user-space ptr to hdr bytes */
- UINT16 *dataptr; /* actual sample data */
+ u16 *dataptr; /* actual sample data */
wavefront_any hdr; /* kernel-space copy of hdr bytes */
} wavefront_patch_info;
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index bab03cc0fb7f..113f8a25a5de 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -285,6 +285,7 @@ struct _snd_ymfpci {
struct resource *res_reg_area;
unsigned short old_legacy_ctrl;
+ unsigned int joystick_port;
void *work_ptr;
dma_addr_t work_ptr_addr;
@@ -355,13 +356,14 @@ int snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
int snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
int snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t **rpcm);
int snd_ymfpci_mixer(ymfpci_t *chip);
+int snd_ymfpci_joystick(ymfpci_t *chip);
int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpci_voice_t **rvoice);
int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice);
#ifdef CONFIG_PM
-void snd_ymfpci_suspend(ymfpci_t *chip, int can_schedule);
-void snd_ymfpci_resume(ymfpci_t *chip, int can_schedule);
+void snd_ymfpci_suspend(ymfpci_t *chip);
+void snd_ymfpci_resume(ymfpci_t *chip);
#endif
#endif /* __SOUND_YMFPCI_H */
diff --git a/sound/Config.in b/sound/Config.in
index 449285a15921..2ff9b9ffb93b 100644
--- a/sound/Config.in
+++ b/sound/Config.in
@@ -4,7 +4,7 @@
mainmenu_option next_comment
comment 'Open Sound System'
-tristate 'Open Sound System' CONFIG_SOUND_PRIME
+dep_tristate 'Open Sound System' CONFIG_SOUND_PRIME $CONFIG_SOUND
if [ "$CONFIG_SOUND_PRIME" != "n" ]; then
source sound/oss/Config.in
fi
@@ -14,7 +14,7 @@ endmenu
mainmenu_option next_comment
comment 'Advanced Linux Sound Architecture'
-tristate 'Advanced Linux Sound Architecture' CONFIG_SND
+dep_tristate 'Advanced Linux Sound Architecture' CONFIG_SND $CONFIG_SOUND
if [ "$CONFIG_SND" != "n" ]; then
source sound/core/Config.in
source sound/drivers/Config.in
diff --git a/sound/Makefile b/sound/Makefile
index 291554b4d784..5f8ab0265f02 100644
--- a/sound/Makefile
+++ b/sound/Makefile
@@ -13,9 +13,12 @@ ifeq ($(CONFIG_SOUND_PRIME),y)
obj-y += oss/sounddrivers.o
endif
-subdir-$(CONFIG_SND) += core i2c drivers isa pci ppc synth
+_subdirs := core i2c drivers isa pci ppc synth
+
+subdir-$(CONFIG_SND) += $(_subdirs)
ifeq ($(CONFIG_SND),y)
+ subdir-m += $(_subdirs)
obj-y += core/core.o i2c/_i2c.o
obj-y += drivers/drivers.o \
drivers/mpu401/_mpu401.o \
diff --git a/sound/core/Config.in b/sound/core/Config.in
index 3f44f5484d60..bd5bf6c18bc5 100644
--- a/sound/core/Config.in
+++ b/sound/core/Config.in
@@ -1,21 +1,21 @@
# ALSA soundcard-configuration
-dep_tristate 'RTC Timer support' CONFIG_SND_RTCTIMER $CONFIG_SND
-dep_tristate 'Sequencer support' CONFIG_SND_SEQUENCER $CONFIG_SND
+dep_tristate ' RTC Timer support' CONFIG_SND_RTCTIMER $CONFIG_SND
+dep_tristate ' Sequencer support' CONFIG_SND_SEQUENCER $CONFIG_SND
if [ "$CONFIG_SND_SEQUENCER" != "n" ]; then
- dep_tristate 'Sequencer dummy client' CONFIG_SND_SEQ_DUMMY $CONFIG_SND_SEQUENCER
+ dep_tristate ' Sequencer dummy client' CONFIG_SND_SEQ_DUMMY $CONFIG_SND_SEQUENCER
fi
-bool 'OSS API emulation' CONFIG_SND_OSSEMUL $CONFIG_SND
+bool ' OSS API emulation' CONFIG_SND_OSSEMUL $CONFIG_SND
if [ "$CONFIG_SND_OSSEMUL" = "y" ]; then
- dep_tristate 'OSS Mixer API' CONFIG_SND_MIXER_OSS $CONFIG_SND
- dep_tristate 'OSS PCM API' CONFIG_SND_PCM_OSS $CONFIG_SND
+ dep_tristate ' OSS Mixer API' CONFIG_SND_MIXER_OSS $CONFIG_SND
+ dep_tristate ' OSS PCM API' CONFIG_SND_PCM_OSS $CONFIG_SND
if [ "$CONFIG_SND_SEQUENCER" != "n" ]; then
- dep_tristate 'OSS Sequencer API' CONFIG_SND_SEQUENCER_OSS $CONFIG_SND_SEQUENCER
+ dep_tristate ' OSS Sequencer API' CONFIG_SND_SEQUENCER_OSS $CONFIG_SND_SEQUENCER
fi
fi
-bool 'Debug' CONFIG_SND_DEBUG
+bool ' Debug' CONFIG_SND_DEBUG
if [ "$CONFIG_SND_DEBUG" = "y" ]; then
- bool 'Debug memory' CONFIG_SND_DEBUG_MEMORY
- bool 'Debug full' CONFIG_SND_DEBUG_FULL
- bool 'Debug detection' CONFIG_SND_DEBUG_DETECT
+ bool ' Debug memory' CONFIG_SND_DEBUG_MEMORY
+ bool ' Debug full' CONFIG_SND_DEBUG_FULL
+ bool ' Debug detection' CONFIG_SND_DEBUG_DETECT
fi
diff --git a/sound/core/control.c b/sound/core/control.c
index 5d103e3210d4..840b563d7156 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -22,6 +22,9 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/interrupt.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/info.h>
@@ -338,32 +341,45 @@ static int snd_ctl_elem_list(snd_card_t *card, snd_ctl_elem_list_t *_list)
struct list_head *plist;
snd_ctl_elem_list_t list;
snd_kcontrol_t *kctl;
- snd_ctl_elem_id_t *id;
+ snd_ctl_elem_id_t *dst, *id;
int offset, space;
if (copy_from_user(&list, _list, sizeof(list)))
return -EFAULT;
offset = list.offset;
space = list.space;
- read_lock(&card->control_rwlock);
- list.count = card->controls_count;
- plist = card->controls.next;
- while (offset-- > 0 && plist != &card->controls)
- plist = plist->next;
- list.used = 0;
- id = list.pids;
- while (space > 0 && plist != &card->controls) {
- kctl = snd_kcontrol(plist);
- if (copy_to_user(id, &kctl->id, sizeof(*id))) {
- read_unlock(&card->control_rwlock);
- return -EFAULT;
+ /* try limit maximum space */
+ if (space > 16384)
+ return -ENOMEM;
+ if (space > 0) {
+ /* allocate temporary buffer for atomic operation */
+ dst = vmalloc(space * sizeof(snd_ctl_elem_id_t));
+ if (dst == NULL)
+ return -ENOMEM;
+ read_lock(&card->control_rwlock);
+ list.count = card->controls_count;
+ plist = card->controls.next;
+ while (offset-- > 0 && plist != &card->controls)
+ plist = plist->next;
+ list.used = 0;
+ id = dst;
+ while (space > 0 && plist != &card->controls) {
+ kctl = snd_kcontrol(plist);
+ memcpy(id, &kctl->id, sizeof(snd_ctl_elem_id_t));
+ id++;
+ plist = plist->next;
+ space--;
+ list.used++;
}
- id++;
- plist = plist->next;
- space--;
- list.used++;
+ read_unlock(&card->control_rwlock);
+ if (list.used > 0 && copy_to_user(list.pids, dst, list.used * sizeof(snd_ctl_elem_id_t)))
+ return -EFAULT;
+ vfree(dst);
+ } else {
+ read_lock(&card->control_rwlock);
+ list.count = card->controls_count;
+ read_unlock(&card->control_rwlock);
}
- read_unlock(&card->control_rwlock);
if (copy_to_user(_list, &list, sizeof(list)))
return -EFAULT;
return 0;
@@ -662,12 +678,14 @@ static ssize_t snd_ctl_read(struct file *file, char *buffer, size_t count, loff_
ev.type = SNDRV_CTL_EVENT_ELEM;
ev.data.elem.mask = kev->mask;
ev.data.elem.id = kev->id;
+ list_del(&kev->list);
+ spin_unlock_irq(&ctl->read_lock);
+ kfree(kev);
if (copy_to_user(buffer, &ev, sizeof(snd_ctl_event_t))) {
err = -EFAULT;
goto __end;
}
- list_del(&kev->list);
- kfree(kev);
+ spin_lock_irq(&ctl->read_lock);
buffer += sizeof(snd_ctl_event_t);
count -= sizeof(snd_ctl_event_t);
result += sizeof(snd_ctl_event_t);
diff --git a/sound/core/device.c b/sound/core/device.c
index 6c78fc6848d7..a5d8efa4c9c0 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -21,6 +21,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
int snd_device_new(snd_card_t *card, snd_device_type_t type,
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index b5d0774782a7..5a860eaff819 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -20,9 +20,11 @@
*/
#include <sound/driver.h>
-#include <sound/core.h>
#include <linux/major.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
+#include <sound/core.h>
#include <sound/control.h>
#include <sound/minors.h>
#include <sound/hwdep.h>
diff --git a/sound/core/info.c b/sound/core/info.c
index 2d433234f52a..32874e26ee6e 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -22,6 +22,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/vmalloc.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/info.h>
@@ -276,7 +278,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
int mode, err;
down(&info_mutex);
- p = (struct proc_dir_entry *) inode->u.generic_ip;
+ p = PDE(inode);
entry = p == NULL ? NULL : (snd_info_entry_t *)p->data;
if (entry == NULL) {
up(&info_mutex);
@@ -539,7 +541,7 @@ static struct inode_operations snd_info_device_inode_operations =
static int snd_info_card_readlink(struct dentry *dentry,
char *buffer, int buflen)
{
- char *s = ((struct proc_dir_entry *) dentry->d_inode->u.generic_ip)->data;
+ char *s = PDE(dentry->d_inode)->data;
#ifndef LINUX_2_2
return vfs_readlink(dentry, buffer, buflen, s);
#else
@@ -560,7 +562,7 @@ static int snd_info_card_readlink(struct dentry *dentry,
static int snd_info_card_followlink(struct dentry *dentry,
struct nameidata *nd)
{
- char *s = ((struct proc_dir_entry *) dentry->d_inode->u.generic_ip)->data;
+ char *s = PDE(dentry->d_inode)->data;
return vfs_follow_link(nd, s);
}
#else
@@ -568,7 +570,7 @@ static struct dentry *snd_info_card_followlink(struct dentry *dentry,
struct dentry *base,
unsigned int follow)
{
- char *s = ((struct proc_dir_entry *) dentry->d_inode->u.generic_ip)->data;
+ char *s = PDE(dentry->d_inode)->data;
return lookup_dentry(s, base, follow);
}
#endif
@@ -843,7 +845,7 @@ static void snd_info_device_fill_inode(struct inode *inode, int fill)
return;
}
MOD_INC_USE_COUNT;
- de = (struct proc_dir_entry *) inode->u.generic_ip;
+ de = PDE(inode);
if (de == NULL)
return;
entry = (snd_info_entry_t *) de->data;
@@ -999,7 +1001,7 @@ static void snd_info_version_read(snd_info_entry_t *entry, snd_info_buffer_t * b
static char *kernel_version = UTS_RELEASE;
snd_iprintf(buffer,
- "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION ".\n"
+ "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"
"Compiled on " __DATE__ " for kernel %s"
#ifdef __SMP__
" (SMP)"
diff --git a/sound/core/info_oss.c b/sound/core/info_oss.c
index 2966b0a474ac..940882ff8531 100644
--- a/sound/core/info_oss.c
+++ b/sound/core/info_oss.c
@@ -21,6 +21,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/info.h>
diff --git a/sound/core/init.c b/sound/core/init.c
index 450ac6569b53..6d35d524320d 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -22,6 +22,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
@@ -87,6 +89,7 @@ snd_card_t *snd_card_new(int idx, const char *xid,
INIT_LIST_HEAD(&card->controls);
INIT_LIST_HEAD(&card->ctl_files);
#ifdef CONFIG_PM
+ init_MUTEX(&card->power_lock);
init_waitqueue_head(&card->power_sleep);
#endif
/* the control interface cannot be accessed from the user space until */
@@ -278,7 +281,7 @@ int snd_component_add(snd_card_t *card, const char *component)
#ifdef CONFIG_PM
/* the power lock must be active before call */
-void snd_power_wait(snd_card_t *card, int can_schedule)
+void snd_power_wait(snd_card_t *card)
{
wait_queue_t wait;
@@ -287,6 +290,6 @@ void snd_power_wait(snd_card_t *card, int can_schedule)
snd_power_unlock(card);
schedule_timeout(30 * HZ);
remove_wait_queue(&card->power_sleep, &wait);
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
}
#endif /* CONFIG_PM */
diff --git a/sound/core/isadma.c b/sound/core/isadma.c
index d1769701fa87..2961c7465749 100644
--- a/sound/core/isadma.c
+++ b/sound/core/isadma.c
@@ -38,7 +38,7 @@
*/
void snd_dma_program(unsigned long dma,
- const void *buf, unsigned int size,
+ unsigned long addr, unsigned int size,
unsigned short mode)
{
unsigned long flags;
@@ -47,7 +47,7 @@ void snd_dma_program(unsigned long dma,
disable_dma(dma);
clear_dma_ff(dma);
set_dma_mode(dma, mode);
- set_dma_addr(dma, isa_virt_to_bus((void *) buf));
+ set_dma_addr(dma, addr);
set_dma_count(dma, size);
if (!(mode & DMA_MODE_NO_ENABLE))
enable_dma(dma);
diff --git a/sound/core/memory.c b/sound/core/memory.c
index f701aa3b7b3b..0f051ef3896f 100644
--- a/sound/core/memory.c
+++ b/sound/core/memory.c
@@ -24,6 +24,8 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/info.h>
@@ -314,19 +316,79 @@ void snd_free_pages(void *ptr, unsigned long size)
#endif
}
+#ifdef CONFIG_ISA
+
+#ifndef CONFIG_ISA_USE_PCI_ALLOC_CONSISTENT
+#ifdef CONFIG_PCI
+#define CONFIG_ISA_USE_PCI_ALLOC_CONSISTENT
+#endif
+#endif
+
+void *snd_malloc_isa_pages(unsigned long size, dma_addr_t *dma_addr)
+{
+ void *dma_area;
+
+#ifndef CONFIG_ISA_USE_PCI_ALLOC_CONSISTENT
+ dma_area = snd_malloc_pages(size, GFP_ATOMIC|GFP_DMA);
+ *dma_addr = dma_area ? isa_virt_to_bus(dma_area) : 0UL;
+#else
+ {
+ int pg;
+ for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);
+ dma_area = pci_alloc_consistent(NULL, size, dma_addr);
+ if (dma_area != NULL) {
+ mem_map_t *page = virt_to_page(dma_area);
+ mem_map_t *last_page = page + (1 << pg);
+ while (page < last_page)
+ SetPageReserved(page++);
+#ifdef CONFIG_SND_DEBUG_MEMORY
+ snd_alloc_pages += 1 << pg;
+#endif
+ }
+ }
+#endif
+ return dma_area;
+}
+
+void *snd_malloc_isa_pages_fallback(unsigned long size,
+ dma_addr_t *dma_addr,
+ unsigned long *res_size)
+{
+ void *dma_area;
+
+#ifndef CONFIG_ISA_USE_PCI_ALLOC_CONSISTENT
+ dma_area = snd_malloc_pages_fallback(size, GFP_ATOMIC|GFP_DMA, res_size);
+ *dma_addr = dma_area ? isa_virt_to_bus(dma_area) : 0UL;
+ return dma_area;
+#else
+ snd_assert(size > 0, return NULL);
+ snd_assert(res_size != NULL, return NULL);
+ do {
+ if ((dma_area = snd_malloc_isa_pages(size, dma_addr)) != NULL) {
+ *res_size = size;
+ return dma_area;
+ }
+ size >>= 1;
+ } while (size >= PAGE_SIZE);
+ return NULL;
+#endif
+}
+
+#endif
+
#ifdef CONFIG_PCI
void *snd_malloc_pci_pages(struct pci_dev *pci,
unsigned long size,
- dma_addr_t *dmaaddr)
+ dma_addr_t *dma_addr)
{
int pg;
void *res;
snd_assert(size > 0, return NULL);
- snd_assert(dmaaddr != NULL, return NULL);
+ snd_assert(dma_addr != NULL, return NULL);
for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);
- res = pci_alloc_consistent(pci, PAGE_SIZE * (1 << pg), dmaaddr);
+ res = pci_alloc_consistent(pci, PAGE_SIZE * (1 << pg), dma_addr);
if (res != NULL) {
mem_map_t *page = virt_to_page(res);
mem_map_t *last_page = page + (1 << pg);
@@ -339,15 +401,16 @@ void *snd_malloc_pci_pages(struct pci_dev *pci,
return res;
}
-void *snd_malloc_pci_pages_fallback(struct pci_dev *pci, unsigned long size,
- dma_addr_t *dmaaddr,
+void *snd_malloc_pci_pages_fallback(struct pci_dev *pci,
+ unsigned long size,
+ dma_addr_t *dma_addr,
unsigned long *res_size)
{
void *res;
snd_assert(res_size != NULL, return NULL);
do {
- if ((res = snd_malloc_pci_pages(pci, size, dmaaddr)) != NULL) {
+ if ((res = snd_malloc_pci_pages(pci, size, dma_addr)) != NULL) {
*res_size = size;
return res;
}
@@ -356,7 +419,10 @@ void *snd_malloc_pci_pages_fallback(struct pci_dev *pci, unsigned long size,
return NULL;
}
-void snd_free_pci_pages(struct pci_dev *pci, unsigned long size, void *ptr, dma_addr_t dmaaddr)
+void snd_free_pci_pages(struct pci_dev *pci,
+ unsigned long size,
+ void *ptr,
+ dma_addr_t dma_addr)
{
int pg;
mem_map_t *page, *last_page;
@@ -368,7 +434,7 @@ void snd_free_pci_pages(struct pci_dev *pci, unsigned long size, void *ptr, dma_
last_page = page + (1 << pg);
while (page < last_page)
ClearPageReserved(page++);
- pci_free_consistent(pci, PAGE_SIZE * (1 << pg), ptr, dmaaddr);
+ pci_free_consistent(pci, PAGE_SIZE * (1 << pg), ptr, dma_addr);
#ifdef CONFIG_SND_DEBUG_MEMORY
snd_alloc_pages -= 1 << pg;
#endif
diff --git a/sound/core/misc.c b/sound/core/misc.c
index 8b6bc02fdae7..195552a6d2c4 100644
--- a/sound/core/misc.c
+++ b/sound/core/misc.c
@@ -22,6 +22,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/time.h>
#include <sound/core.h>
int snd_task_name(struct task_struct *task, char *name, size_t size)
diff --git a/sound/core/oss/copy.c b/sound/core/oss/copy.c
index 50095e49a57e..b8ca19c63d88 100644
--- a/sound/core/oss/copy.c
+++ b/sound/core/oss/copy.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
diff --git a/sound/core/oss/io.c b/sound/core/oss/io.c
index 938737a7525d..07196032ac06 100644
--- a/sound/core/oss/io.c
+++ b/sound/core/oss/io.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
diff --git a/sound/core/oss/linear.c b/sound/core/oss/linear.c
index 67dfcaf3a36a..64ec214dcb4d 100644
--- a/sound/core/oss/linear.c
+++ b/sound/core/oss/linear.c
@@ -22,6 +22,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 1a8e645b52c0..bb4057b10890 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -21,6 +21,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/control.h>
diff --git a/sound/core/oss/mulaw.c b/sound/core/oss/mulaw.c
index d81f03af82cb..4d365742bb28 100644
--- a/sound/core/oss/mulaw.c
+++ b/sound/core/oss/mulaw.c
@@ -23,6 +23,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 62630cd36d2d..57bcaa94802c 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -25,6 +25,9 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
+#include <linux/vmalloc.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/pcm.h>
@@ -1203,7 +1206,9 @@ static int snd_pcm_oss_get_odelay(snd_pcm_oss_file_t *pcm_oss_file)
if (runtime->oss.params || runtime->oss.prepare)
return 0;
err = snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay);
- if (err < 0)
+ if (err == -EPIPE)
+ delay = 0; /* hack for broken OSS applications */
+ else if (err < 0)
return err;
return snd_pcm_oss_bytes(substream, delay);
}
@@ -1764,8 +1769,11 @@ static int snd_pcm_oss_ioctl(struct inode *inode, struct file *file,
return -EIO;
case SNDCTL_DSP_GETODELAY:
res = snd_pcm_oss_get_odelay(pcm_oss_file);
- if (res < 0)
+ if (res < 0) {
+ /* it's for sure, some broken apps don't check for error codes */
+ put_user(0, (int *)arg);
return res;
+ }
return put_user(res, (int *)arg) ? -EFAULT : 0;
case SNDCTL_DSP_PROFILE:
return 0; /* silently ignore */
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index 1df4d0912cd2..24134a9fdbd2 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -26,6 +26,9 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
+#include <linux/time.h>
+#include <linux/vmalloc.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
diff --git a/sound/core/oss/rate.c b/sound/core/oss/rate.c
index 0c0091187bf5..646663a22a34 100644
--- a/sound/core/oss/rate.c
+++ b/sound/core/oss/rate.c
@@ -21,13 +21,14 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
#define SHIFT 11
#define BITS (1<<SHIFT)
-#define MASK (BITS-1)
+#define R_MASK (BITS-1)
/*
* Basic rate conversion plugin
@@ -108,19 +109,19 @@ static void resample_expand(snd_pcm_plugin_t *plugin,
dst_step = dst_channels[channel].area.step / 8;
src_frames1 = src_frames;
dst_frames1 = dst_frames;
- if (pos & ~MASK) {
+ if (pos & ~R_MASK) {
get_s16_end = &&after_get1;
goto *get;
after_get1:
- pos &= MASK;
+ pos &= R_MASK;
S1 = S2;
S2 = sample;
src += src_step;
- src_frames--;
+ src_frames1--;
}
while (dst_frames1-- > 0) {
- if (pos & ~MASK) {
- pos &= MASK;
+ if (pos & ~R_MASK) {
+ pos &= R_MASK;
S1 = S2;
if (src_frames1-- > 0) {
get_s16_end = &&after_get2;
@@ -203,8 +204,8 @@ static void resample_shrink(snd_pcm_plugin_t *plugin,
S2 = sample;
src += src_step;
}
- if (pos & ~MASK) {
- pos &= MASK;
+ if (pos & ~R_MASK) {
+ pos &= R_MASK;
val = S1 + ((S2 - S1) * (signed int)pos) / BITS;
if (val < -32768)
val = -32768;
diff --git a/sound/core/oss/route.c b/sound/core/oss/route.c
index 125744e688bf..d50eb06d984d 100644
--- a/sound/core/oss/route.c
+++ b/sound/core/oss/route.c
@@ -21,6 +21,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
@@ -58,7 +60,7 @@ struct ttable_dst {
};
struct route_private_data {
- enum {UINT32=0, UINT64=1, FLOAT=2} sum_type;
+ enum {R_UINT32=0, R_UINT64=1, R_FLOAT=2} sum_type;
int get, put;
int conv;
int src_sample_size;
@@ -558,12 +560,12 @@ int snd_pcm_plugin_build_route(snd_pcm_plug_t *plug,
data->conv = conv_index(src_format->format, dst_format->format);
#if ROUTE_PLUGIN_USE_FLOAT
- data->sum_type = FLOAT;
+ data->sum_type = R_FLOAT;
#else
if (snd_pcm_format_width(src_format->format) == 32)
- data->sum_type = UINT64;
+ data->sum_type = R_UINT64;
else
- data->sum_type = UINT32;
+ data->sum_type = R_UINT32;
#endif
data->src_sample_size = snd_pcm_format_width(src_format->format) / 8;
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 3dcd48555bbd..28f79db5373f 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -21,6 +21,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/pcm.h>
@@ -376,6 +378,9 @@ static void snd_pcm_substream_proc_status_read(snd_info_entry_t *entry, snd_info
snd_iprintf(buffer, "delay : %ld\n", status.delay);
snd_iprintf(buffer, "avail : %ld\n", status.avail);
snd_iprintf(buffer, "avail_max : %ld\n", status.avail_max);
+ snd_iprintf(buffer, "-----\n");
+ snd_iprintf(buffer, "hw_ptr : %ld\n", runtime->status->hw_ptr);
+ snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr);
}
static int snd_pcm_stream_proc_init(snd_pcm_str_t *pstr)
@@ -565,7 +570,7 @@ static int snd_pcm_new_stream(snd_pcm_t *pcm,
return err;
}
substream->dma_type = SNDRV_PCM_DMA_TYPE_ISA;
- substream->dma_private = (void *)(unsigned long)GFP_KERNEL;
+ substream->dma_private = NULL;
spin_lock_init(&substream->timer_lock);
prev = substream;
}
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 161812e90ba8..3bedabf0ab3c 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -22,6 +22,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index e213e4e4038a..dfc207c1af23 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -22,15 +22,12 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/io.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
#include <sound/initval.h>
-#ifdef CONFIG_ISA
-#define HAVE_ISA_VIRT_TO_BUS
-#endif
-
static int snd_preallocate_dma = 1;
MODULE_PARM(snd_preallocate_dma, "i");
MODULE_PARM_DESC(snd_preallocate_dma, "Preallocate DMA memory when the PCM devices are initialized.");
@@ -43,17 +40,20 @@ MODULE_PARM_SYNTAX(snd_maximum_substreams, SNDRV_BOOLEAN_TRUE_DESC);
static int snd_minimum_buffer = 16384;
+
static void snd_pcm_lib_preallocate_dma_free(snd_pcm_substream_t *substream)
{
if (substream->dma_area == NULL)
return;
switch (substream->dma_type) {
case SNDRV_PCM_DMA_TYPE_CONTINUOUS:
-#ifdef HAVE_ISA_VIRT_TO_BUS
- case SNDRV_PCM_DMA_TYPE_ISA:
-#endif
snd_free_pages(substream->dma_area, substream->dma_bytes);
break;
+#ifdef CONFIG_ISA
+ case SNDRV_PCM_DMA_TYPE_ISA:
+ snd_free_isa_pages(substream->dma_bytes, substream->dma_area, substream->dma_addr);
+ break;
+#endif
#ifdef CONFIG_PCI
case SNDRV_PCM_DMA_TYPE_PCI:
snd_free_pci_pages((struct pci_dev *)substream->dma_private, substream->dma_bytes, substream->dma_area, substream->dma_addr);
@@ -119,10 +119,9 @@ static void snd_pcm_lib_preallocate_proc_write(snd_info_entry_t *entry,
dma_area = snd_malloc_pages(size, (unsigned int)((unsigned long)substream->dma_private & 0xffffffff));
dma_addr = 0UL; /* not valid */
break;
-#ifdef HAVE_ISA_VIRT_TO_BUS
+#ifdef CONFIG_ISA
case SNDRV_PCM_DMA_TYPE_ISA:
- dma_area = snd_malloc_pages(size, (unsigned int)((unsigned long)substream->dma_private & 0xffffffff));
- dma_addr = isa_virt_to_bus(dma_area);
+ dma_area = snd_malloc_isa_pages(size, &dma_addr);
break;
#endif
#ifdef CONFIG_PCI
@@ -168,10 +167,9 @@ static int snd_pcm_lib_preallocate_pages1(snd_pcm_substream_t *substream,
dma_area = snd_malloc_pages_fallback(size, (unsigned int)((unsigned long)substream->dma_private & 0xffffffff), &rsize);
dma_addr = 0UL; /* not valid */
break;
-#ifdef HAVE_ISA_VIRT_TO_BUS
+#ifdef CONFIG_ISA
case SNDRV_PCM_DMA_TYPE_ISA:
- dma_area = snd_malloc_pages_fallback(size, (unsigned int)((unsigned long)substream->dma_private & 0xffffffff), &rsize);
- dma_addr = isa_virt_to_bus(dma_area);
+ dma_area = snd_malloc_isa_pages_fallback(size, &dma_addr, &rsize);
break;
#endif
#ifdef CONFIG_PCI
@@ -212,14 +210,9 @@ int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream,
size_t size, size_t max,
unsigned int flags)
{
-#ifdef HAVE_ISA_VIRT_TO_BUS
substream->dma_type = SNDRV_PCM_DMA_TYPE_CONTINUOUS;
substream->dma_private = (void *)(unsigned long)flags;
return snd_pcm_lib_preallocate_pages1(substream, size, max);
-#else
- snd_printk("this host has no isa_virt_to_bus!\n");
- return -ENXIO;
-#endif
}
int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm,
@@ -231,36 +224,29 @@ int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm,
for (stream = 0; stream < 2; stream++)
for (substream = pcm->streams[stream].substream; substream; substream = substream->next)
- if ((err = snd_pcm_lib_preallocate_isa_pages(substream, size, max, flags)) < 0)
+ if ((err = snd_pcm_lib_preallocate_pages(substream, size, max, flags)) < 0)
return err;
return 0;
}
#ifdef CONFIG_ISA
int snd_pcm_lib_preallocate_isa_pages(snd_pcm_substream_t *substream,
- size_t size, size_t max,
- unsigned int flags)
+ size_t size, size_t max)
{
-#ifdef HAVE_ISA_VIRT_TO_BUS
substream->dma_type = SNDRV_PCM_DMA_TYPE_ISA;
- substream->dma_private = (void *)(unsigned long)flags;
+ substream->dma_private = NULL;
return snd_pcm_lib_preallocate_pages1(substream, size, max);
-#else
- snd_printk("this host has no isa_virt_to_bus!\n");
- return -ENXIO;
-#endif
}
int snd_pcm_lib_preallocate_isa_pages_for_all(snd_pcm_t *pcm,
- size_t size, size_t max,
- unsigned int flags)
+ size_t size, size_t max)
{
snd_pcm_substream_t *substream;
int stream, err;
for (stream = 0; stream < 2; stream++)
for (substream = pcm->streams[stream].substream; substream; substream = substream->next)
- if ((err = snd_pcm_lib_preallocate_isa_pages(substream, size, max, flags)) < 0)
+ if ((err = snd_pcm_lib_preallocate_isa_pages(substream, size, max)) < 0)
return err;
return 0;
}
@@ -288,10 +274,13 @@ int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size)
dma_addr = substream->dma_addr;
} else {
switch (substream->dma_type) {
-#ifdef HAVE_ISA_VIRT_TO_BUS
- case SNDRV_PCM_DMA_TYPE_ISA:
+ case SNDRV_PCM_DMA_TYPE_CONTINUOUS:
dma_area = snd_malloc_pages(size, (unsigned int)((unsigned long)substream->dma_private & 0xffffffff));
- dma_addr = isa_virt_to_bus(dma_area);
+ dma_addr = 0UL; /* not valid */
+ break;
+#ifdef CONFIG_ISA
+ case SNDRV_PCM_DMA_TYPE_ISA:
+ dma_area = snd_malloc_isa_pages(size, &dma_addr);
break;
#endif
#ifdef CONFIG_PCI
@@ -322,9 +311,9 @@ int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream)
return 0;
if (runtime->dma_area != substream->dma_area) {
switch (substream->dma_type) {
-#ifdef HAVE_ISA_VIRT_TO_BUS
+#ifdef CONFIG_ISA
case SNDRV_PCM_DMA_TYPE_ISA:
- snd_free_pages(runtime->dma_area, runtime->dma_bytes);
+ snd_free_isa_pages(runtime->dma_bytes, runtime->dma_area, runtime->dma_addr);
break;
#endif
#ifdef CONFIG_PCI
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index 9c87715135dc..a43ba602ac7d 100644
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#define bswap_16 swab16
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 4cacd5fe9f57..3cacd998dcc4 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -23,6 +23,8 @@
#include <sound/driver.h>
#include <linux/mm.h>
#include <linux/file.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
@@ -810,13 +812,13 @@ static int snd_pcm_resume(snd_pcm_substream_t *substream)
snd_card_t *card = substream->pcm->card;
int res;
- snd_power_lock(card, 1);
+ snd_power_lock(card);
while (snd_power_get_state(card) != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
res = -EAGAIN;
goto _power_unlock;
}
- snd_power_wait(card, 1);
+ snd_power_wait(card);
}
_SND_PCM_ACTION(resume, substream, 0, res, 1);
@@ -908,13 +910,13 @@ int snd_pcm_prepare(snd_pcm_substream_t *substream)
{
int res;
snd_card_t *card = substream->pcm->card;
- snd_power_lock(card, 1);
+ snd_power_lock(card);
while (snd_power_get_state(card) != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
res = -EAGAIN;
goto _power_unlock;
}
- snd_power_wait(card, 1);
+ snd_power_wait(card);
}
_SND_PCM_ACTION(prepare, substream, 0, res, 0);
@@ -959,7 +961,7 @@ static int snd_pcm_playback_drain(snd_pcm_substream_t * substream)
runtime = substream->runtime;
card = substream->pcm->card;
- snd_power_lock(card, 1);
+ snd_power_lock(card);
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_PAUSED:
@@ -975,7 +977,7 @@ static int snd_pcm_playback_drain(snd_pcm_substream_t * substream)
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
@@ -1065,7 +1067,7 @@ static int snd_pcm_playback_drop(snd_pcm_substream_t *substream)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_t *card = substream->pcm->card;
int res = 0;
- snd_power_lock(card, 1);
+ snd_power_lock(card);
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_OPEN:
@@ -1095,7 +1097,7 @@ static int snd_pcm_playback_drop(snd_pcm_substream_t *substream)
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
@@ -1112,7 +1114,7 @@ static int snd_pcm_capture_drain(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_t *card = substream->pcm->card;
int res = 0;
- snd_power_lock(card, 1);
+ snd_power_lock(card);
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_OPEN:
@@ -1148,7 +1150,7 @@ static int snd_pcm_capture_drain(snd_pcm_substream_t * substream)
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
@@ -1164,7 +1166,7 @@ static int snd_pcm_capture_drop(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_t *card = substream->pcm->card;
int res = 0;
- snd_power_lock(card, 1);
+ snd_power_lock(card);
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_OPEN:
@@ -1185,7 +1187,7 @@ static int snd_pcm_capture_drop(snd_pcm_substream_t * substream)
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
/* Fall through */
@@ -1880,24 +1882,25 @@ static int snd_pcm_playback_delay(snd_pcm_substream_t *substream, snd_pcm_sframe
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_RUNNING:
+ case SNDRV_PCM_STATE_DRAINING:
if (snd_pcm_update_hw_ptr(substream) >= 0) {
n = snd_pcm_playback_hw_avail(runtime);
if (put_user(n, res))
err = -EFAULT;
break;
+ } else {
+ err = SNDRV_PCM_STATE_RUNNING ? -EPIPE : -EBADFD;
}
- /* Fall through */
- case SNDRV_PCM_STATE_XRUN:
- err = -EPIPE;
break;
- case SNDRV_PCM_STATE_DRAINING:
- if (snd_pcm_update_hw_ptr(substream) >= 0) {
+ case SNDRV_PCM_STATE_SUSPENDED:
+ if (runtime->status->suspended_state == SNDRV_PCM_STATE_RUNNING) {
n = snd_pcm_playback_hw_avail(runtime);
if (put_user(n, res))
err = -EFAULT;
- break;
+ } else {
+ err = -EBADFD;
}
- /* Fall through */
+ break;
default:
err = -EBADFD;
break;
@@ -1924,6 +1927,15 @@ static int snd_pcm_capture_delay(snd_pcm_substream_t *substream, snd_pcm_sframes
case SNDRV_PCM_STATE_XRUN:
err = -EPIPE;
break;
+ case SNDRV_PCM_STATE_SUSPENDED:
+ if (runtime->status->suspended_state == SNDRV_PCM_STATE_RUNNING) {
+ n = snd_pcm_capture_avail(runtime);
+ if (put_user(n, res))
+ err = -EFAULT;
+ } else {
+ err = -EBADFD;
+ }
+ break;
default:
err = -EBADFD;
break;
diff --git a/sound/core/pcm_timer.c b/sound/core/pcm_timer.c
index 69346b5928ee..72568cec3a6d 100644
--- a/sound/core/pcm_timer.c
+++ b/sound/core/pcm_timer.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/timer.h>
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 0054daa77f7c..18f681589acb 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -23,6 +23,10 @@
#include <sound/core.h>
#include <linux/major.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/rawmidi.h>
#include <sound/info.h>
#include <sound/control.h>
diff --git a/sound/core/rtctimer.c b/sound/core/rtctimer.c
index 17736141275e..db1452cca652 100644
--- a/sound/core/rtctimer.c
+++ b/sound/core/rtctimer.c
@@ -30,6 +30,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/timer.h>
#include <sound/info.h>
diff --git a/sound/core/seq/instr/ainstr_fm.c b/sound/core/seq/instr/ainstr_fm.c
index 2d6b8856dcae..17bf65151718 100644
--- a/sound/core/seq/instr/ainstr_fm.c
+++ b/sound/core/seq/instr/ainstr_fm.c
@@ -20,6 +20,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
#include <sound/core.h>
#include <sound/ainstr_fm.h>
#include <sound/initval.h>
diff --git a/sound/core/seq/instr/ainstr_gf1.c b/sound/core/seq/instr/ainstr_gf1.c
index 48c66aa9e7f2..c2b8f966ab66 100644
--- a/sound/core/seq/instr/ainstr_gf1.c
+++ b/sound/core/seq/instr/ainstr_gf1.c
@@ -20,6 +20,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ainstr_gf1.h>
#include <sound/initval.h>
diff --git a/sound/core/seq/instr/ainstr_iw.c b/sound/core/seq/instr/ainstr_iw.c
index a3cc91e184f9..8c21d06e37db 100644
--- a/sound/core/seq/instr/ainstr_iw.c
+++ b/sound/core/seq/instr/ainstr_iw.c
@@ -20,6 +20,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ainstr_iw.h>
#include <sound/initval.h>
diff --git a/sound/core/seq/instr/ainstr_simple.c b/sound/core/seq/instr/ainstr_simple.c
index ff961016db87..8cd604fb5da0 100644
--- a/sound/core/seq/instr/ainstr_simple.c
+++ b/sound/core/seq/instr/ainstr_simple.c
@@ -20,6 +20,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ainstr_simple.h>
#include <sound/initval.h>
diff --git a/sound/core/seq/oss/seq_oss_device.h b/sound/core/seq/oss/seq_oss_device.h
index 20cb799d2c4c..78dd40cd3cfa 100644
--- a/sound/core/seq/oss/seq_oss_device.h
+++ b/sound/core/seq/oss/seq_oss_device.h
@@ -22,6 +22,10 @@
#define __SEQ_OSS_DEVICE_H
#include <sound/driver.h>
+#include <linux/time.h>
+#include <linux/wait.h>
+#include <linux/slab.h>
+#include <linux/sched.h>
#include <sound/core.h>
#include <sound/seq_oss.h>
#include <sound/rawmidi.h>
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 05afbf632dbe..88be3ab57afd 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -24,6 +24,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <linux/kmod.h>
@@ -540,6 +541,8 @@ static int snd_seq_deliver_single_event(client_t *client,
int result = -ENOENT;
int direct, quoted = 0;
+ direct = snd_seq_ev_is_direct(event);
+
dest = get_event_dest_client(event, filter);
if (dest == NULL)
goto __skip;
@@ -553,8 +556,6 @@ static int snd_seq_deliver_single_event(client_t *client,
goto __skip;
}
- direct = snd_seq_ev_is_direct(event);
-
/* expand the quoted event */
if (event->type == SNDRV_SEQ_EVENT_KERNEL_QUOTE) {
quoted = 1;
@@ -587,7 +588,7 @@ static int snd_seq_deliver_single_event(client_t *client,
if (dest)
snd_seq_client_unlock(dest);
- if (result < 0) {
+ if (result < 0 && !direct) {
if (quoted) {
/* return directly to the original source */
dest = snd_seq_client_use_ptr(event->source.client);
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index c3195b829207..793bc164f934 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -43,6 +43,7 @@
#include <sound/seq_device.h>
#include <sound/initval.h>
#include <linux/kmod.h>
+#include <linux/slab.h>
MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
MODULE_DESCRIPTION("ALSA sequencer device management");
diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c
index d2c1db0f2ea2..94dd203c0f86 100644
--- a/sound/core/seq/seq_fifo.c
+++ b/sound/core/seq/seq_fifo.c
@@ -22,6 +22,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <sound/core.h>
+#include <linux/slab.h>
#include "seq_fifo.h"
#include "seq_lock.h"
diff --git a/sound/core/seq/seq_instr.c b/sound/core/seq/seq_instr.c
index 25383dc52f55..c7bb68388240 100644
--- a/sound/core/seq/seq_instr.c
+++ b/sound/core/seq/seq_instr.c
@@ -20,6 +20,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include "seq_clientmgr.h"
#include <sound/seq_instr.h>
diff --git a/sound/core/seq/seq_lock.h b/sound/core/seq/seq_lock.h
index 0d2e2f5ea6d6..79080cebc289 100644
--- a/sound/core/seq/seq_lock.h
+++ b/sound/core/seq/seq_lock.h
@@ -1,6 +1,8 @@
#ifndef __SND_SEQ_LOCK_H
#define __SND_SEQ_LOCK_H
+#include <linux/sched.h>
+
#if defined(__SMP__) || defined(CONFIG_SND_DEBUG)
typedef atomic_t snd_use_lock_t;
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
index 629accafb832..5a6e21dfd250 100644
--- a/sound/core/seq/seq_memory.c
+++ b/sound/core/seq/seq_memory.c
@@ -23,6 +23,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
#include <sound/core.h>
#include <sound/seq_kernel.h>
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index a51f08f24598..d451effca18f 100644
--- a/sound/core/seq/seq_midi.c
+++ b/sound/core/seq/seq_midi.c
@@ -28,6 +28,7 @@ Possible options for midisynth module:
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/rawmidi.h>
#include <sound/seq_kernel.h>
@@ -137,7 +138,7 @@ static int event_process_midi(snd_seq_event_t * ev, int direct,
snd_assert(msynth != NULL, return -EINVAL);
substream = msynth->output_rfile.output;
if (substream == NULL)
- return -EINVAL;
+ return -ENODEV;
if (ev->type == SNDRV_SEQ_EVENT_SYSEX) { /* special case, to save space */
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE) {
/* invalid event */
diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c
index 1f3a12126de9..eeaf4c03e64b 100644
--- a/sound/core/seq/seq_midi_emul.c
+++ b/sound/core/seq/seq_midi_emul.c
@@ -31,6 +31,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/seq_kernel.h>
#include <sound/seq_midi_emul.h>
diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c
index f5217dbbb6e2..b3ced9438d91 100644
--- a/sound/core/seq/seq_midi_event.c
+++ b/sound/core/seq/seq_midi_event.c
@@ -20,6 +20,7 @@
*/
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/seq_kernel.h>
#include <sound/seq_midi_event.h>
diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c
index c568730a86d9..9452ae22a6b3 100644
--- a/sound/core/seq/seq_ports.c
+++ b/sound/core/seq/seq_ports.c
@@ -23,6 +23,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <sound/core.h>
+#include <linux/slab.h>
#include "seq_system.h"
#include "seq_ports.h"
#include "seq_clientmgr.h"
diff --git a/sound/core/seq/seq_prioq.c b/sound/core/seq/seq_prioq.c
index e1789d97aa96..713dae03cb79 100644
--- a/sound/core/seq/seq_prioq.c
+++ b/sound/core/seq/seq_prioq.c
@@ -21,6 +21,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include "seq_timer.h"
#include "seq_prioq.h"
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c
index b806e9115ab9..52993503185a 100644
--- a/sound/core/seq/seq_queue.c
+++ b/sound/core/seq/seq_queue.c
@@ -38,6 +38,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include "seq_memory.h"
diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c
index 04644312a410..8c712d3ef08e 100644
--- a/sound/core/seq/seq_timer.c
+++ b/sound/core/seq/seq_timer.c
@@ -23,6 +23,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <sound/core.h>
+#include <linux/slab.h>
#include "seq_timer.h"
#include "seq_queue.h"
#include "seq_info.h"
diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c
index 33617ad9e23e..55b00688bf5c 100644
--- a/sound/core/seq/seq_virmidi.c
+++ b/sound/core/seq/seq_virmidi.c
@@ -37,6 +37,9 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/rawmidi.h>
#include <sound/info.h>
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 10aaa5127d14..583266fcbd98 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -21,6 +21,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/info.h>
@@ -347,7 +349,7 @@ static int __init alsa_sound_init(void)
}
#endif
#ifndef MODULE
- printk("Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION ".\n");
+ printk("Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n");
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)
pm_init();
@@ -424,6 +426,10 @@ EXPORT_SYMBOL(snd_kmalloc_strdup);
EXPORT_SYMBOL(snd_malloc_pages);
EXPORT_SYMBOL(snd_malloc_pages_fallback);
EXPORT_SYMBOL(snd_free_pages);
+#ifdef CONFIG_ISA
+EXPORT_SYMBOL(snd_malloc_isa_pages);
+EXPORT_SYMBOL(snd_malloc_isa_pages_fallback);
+#endif
#ifdef CONFIG_PCI
EXPORT_SYMBOL(snd_malloc_pci_pages);
EXPORT_SYMBOL(snd_malloc_pci_pages_fallback);
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c
index 7018c1201804..c3c363091fad 100644
--- a/sound/core/sound_oss.c
+++ b/sound/core/sound_oss.c
@@ -28,8 +28,10 @@
#error "Enable the OSS soundcore multiplexer (CONFIG_SOUND) in the kernel."
#endif
-#include <sound/core.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
+#include <sound/core.h>
#include <sound/minors.h>
#include <sound/info.h>
#include <linux/sound.h>
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 3282415bb6ea..0c6339716ac7 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -22,6 +22,8 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/timer.h>
#include <sound/control.h>
diff --git a/sound/drivers/Config.in b/sound/drivers/Config.in
index c32be8910d3e..76e1cd75e469 100644
--- a/sound/drivers/Config.in
+++ b/sound/drivers/Config.in
@@ -1,7 +1,12 @@
# ALSA generic drivers
+mainmenu_option next_comment
+comment 'Generic devices'
+
dep_tristate 'Dummy (/dev/null) soundcard' CONFIG_SND_DUMMY $CONFIG_SND
dep_tristate 'Virtual MIDI soundcard' CONFIG_SND_VIRMIDI $CONFIG_SND $CONFIG_SND_SEQUENCER
dep_tristate 'MOTU MidiTimePiece AV multiport MIDI' CONFIG_SND_MTPAV $CONFIG_SND
dep_tristate 'UART16550 - MIDI only driver' CONFIG_SND_SERIAL_U16550 $CONFIG_SND
dep_tristate 'Generic MPU-401 UART driver' CONFIG_SND_MPU401 $CONFIG_SND
+
+endmenu
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 9b9a3b4e1d6e..6a6d8fe7c935 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -20,6 +20,10 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index ed286f568ab3..37deb3638664 100644
--- a/sound/drivers/mpu401/mpu401.c
+++ b/sound/drivers/mpu401/mpu401.c
@@ -21,6 +21,9 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/mpu401.h>
#define SNDRV_GET_ID
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index 7bed3178db5c..8993ade328cf 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -27,6 +27,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/mpu401.h>
@@ -365,7 +366,7 @@ static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi)
free_irq(mpu->irq, (void *) mpu);
if (mpu->res) {
release_resource(mpu->res);
- kfree(mpu->res);
+ kfree_nocheck(mpu->res);
}
snd_magic_kfree(mpu);
}
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index e7c6af27f3a8..48ceaf178afc 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -53,6 +53,7 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#define SNDRV_GET_ID
#include <sound/initval.h>
@@ -89,13 +90,13 @@ MODULE_PARM_DESC(snd_id, "ID string for MotuMTPAV MIDI.");
MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
MODULE_PARM(snd_port, "l");
MODULE_PARM_DESC(snd_port, "Parallel port # for MotuMTPAV MIDI.");
-MODULE_PARM_SYNTAX(snd_port, "allows:{{0x378},{0x278}},dialog:list");
+MODULE_PARM_SYNTAX(snd_port, SNDRV_ENABLED ",allows:{{0x378},{0x278}},dialog:list");
MODULE_PARM(snd_irq, "i");
MODULE_PARM_DESC(snd_irq, "Parallel IRQ # for MotuMTPAV MIDI.");
-MODULE_PARM_SYNTAX(snd_irq, "allows:{{7},{5}},dialog:list");
+MODULE_PARM_SYNTAX(snd_irq, SNDRV_ENABLED ",allows:{{7},{5}},dialog:list");
MODULE_PARM(snd_hwports, "i");
MODULE_PARM_DESC(snd_hwports, "Hardware ports # for MotuMTPAV MIDI.");
-MODULE_PARM_SYNTAX(snd_hwports, "allows:{{1,8}},dialog:list");
+MODULE_PARM_SYNTAX(snd_hwports, SNDRV_ENABLED ",allows:{{1,8}},dialog:list");
/*
* defines
@@ -712,7 +713,7 @@ static void free_mtpav(mtpav_t * crd)
free_irq(crd->irq, (void *)crd);
if (crd->res_port) {
release_resource(crd->res_port);
- kfree(crd->res_port);
+ kfree_nocheck(crd->res_port);
}
if (crd != NULL)
kfree(crd);
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index 22eca04e5b81..8f8400bee5f3 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -27,6 +27,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/minors.h>
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Hannu Savolainen 1993-1996, Rob Hooft");
@@ -351,11 +352,11 @@ static int snd_opl3_free(opl3_t *opl3)
{
if (opl3->res_l_port) {
release_resource(opl3->res_l_port);
- kfree(opl3->res_l_port);
+ kfree_nocheck(opl3->res_l_port);
}
if (opl3->res_r_port) {
release_resource(opl3->res_r_port);
- kfree(opl3->res_r_port);
+ kfree_nocheck(opl3->res_r_port);
}
snd_magic_kfree(opl3);
return 0;
diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c
index 442f2fec0772..669e33a68a5e 100644
--- a/sound/drivers/opl3/opl3_oss.c
+++ b/sound/drivers/opl3/opl3_oss.c
@@ -20,6 +20,7 @@
#define __NO_VERSION__
#include "opl3_voice.h"
+#include <linux/slab.h>
static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure);
static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg);
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 1abf7070cf19..4801f7bd16ad 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -105,6 +105,7 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/rawmidi.h>
#define SNDRV_GET_ID
@@ -747,7 +748,7 @@ static int snd_uart16550_free(snd_uart16550_t *uart)
free_irq(uart->irq, (void *)uart);
if (uart->res_base) {
release_resource(uart->res_base);
- kfree(uart->res_base);
+ kfree_nocheck(uart->res_base);
}
snd_magic_kfree(uart);
return 0;
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index cd485586b92d..06d1f7146a26 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -43,6 +43,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
#include <sound/core.h>
#include <sound/seq_kernel.h>
#include <sound/seq_virmidi.h>
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c
index 830349428083..823290b392ad 100644
--- a/sound/i2c/cs8427.c
+++ b/sound/i2c/cs8427.c
@@ -21,6 +21,7 @@
*/
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c
index 2a8ecdf9a3a2..6bc7a9034e3a 100644
--- a/sound/i2c/i2c.c
+++ b/sound/i2c/i2c.c
@@ -22,6 +22,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/i2c.h>
diff --git a/sound/i2c/tea6330t.c b/sound/i2c/tea6330t.c
index 0c48bcefd379..0441d30833de 100644
--- a/sound/i2c/tea6330t.c
+++ b/sound/i2c/tea6330t.c
@@ -22,6 +22,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/tea6330t.h>
diff --git a/sound/isa/Config.in b/sound/isa/Config.in
index 939212e22045..9fc46d6c17a6 100644
--- a/sound/isa/Config.in
+++ b/sound/isa/Config.in
@@ -1,5 +1,8 @@
# ALSA ISA drivers
+mainmenu_option next_comment
+comment 'ISA devices'
+
dep_tristate 'Analog Devices SoundPort AD1816A' CONFIG_SND_AD1816A $CONFIG_SND
dep_tristate 'Generic AD1848/CS4248 driver' CONFIG_SND_AD1848 $CONFIG_SND
dep_tristate 'Generic Cirrus Logic CS4231 driver' CONFIG_SND_CS4231 $CONFIG_SND
@@ -20,7 +23,7 @@ dep_tristate 'Sound Blaster 1.0/2.0/Pro (8-bit)' CONFIG_SND_SB8 $CONFIG_SND
dep_tristate 'Sound Blaster 16 (PnP)' CONFIG_SND_SB16 $CONFIG_SND
dep_tristate 'Sound Blaster AWE (32,64) (PnP)' CONFIG_SND_SBAWE $CONFIG_SND
if [ "$CONFIG_SND_SB16" != "n" -o "$CONFIG_SND_SBAWE" != "n" ]; then
- dep_bool 'Sound Blaster 16/AWE CSP support' CONFIG_SND_SB16_CSP $CONFIG_SND
+ bool ' Sound Blaster 16/AWE CSP support' CONFIG_SND_SB16_CSP
fi
dep_tristate 'Turtle Beach Maui,Tropez,Tropez+ (Wavefront)' CONFIG_SND_WAVEFRONT $CONFIG_SND
dep_tristate 'Avance Logic ALS100/ALS120' CONFIG_SND_ALS100 $CONFIG_SND
@@ -29,3 +32,5 @@ dep_tristate 'C-Media CMI8330' CONFIG_SND_CMI8330 $CONFIG_SND
dep_tristate 'Diamond Technologies DT-0197H' CONFIG_SND_DT0197H $CONFIG_SND
dep_tristate 'Yamaha OPL3-SA2/SA3' CONFIG_SND_OPL3SA2 $CONFIG_SND
dep_tristate 'Aztech Sound Galaxy' CONFIG_SND_SGALAXY $CONFIG_SND
+
+endmenu
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index ad31a14fe2ec..d3fb93723f15 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -20,6 +20,13 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#define SNDRV_GET_ID
#include <sound/initval.h>
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index 4b1fb93736c6..2688d1bba07a 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -23,6 +23,7 @@
#include <asm/dma.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ad1816a.h>
@@ -240,7 +241,7 @@ static int snd_ad1816a_playback_prepare(snd_pcm_substream_t *substream)
snd_ad1816a_out_mask(chip, AD1816A_PLAYBACK_CONFIG,
AD1816A_PLAYBACK_ENABLE | AD1816A_PLAYBACK_PIO, 0x00);
- snd_dma_program(chip->dma1, runtime->dma_area, size,
+ snd_dma_program(chip->dma1, runtime->dma_addr, size,
DMA_MODE_WRITE | DMA_AUTOINIT);
snd_ad1816a_write(chip, AD1816A_PLAYBACK_SAMPLE_RATE, runtime->rate);
@@ -269,7 +270,7 @@ static int snd_ad1816a_capture_prepare(snd_pcm_substream_t *substream)
snd_ad1816a_out_mask(chip, AD1816A_CAPTURE_CONFIG,
AD1816A_CAPTURE_ENABLE | AD1816A_CAPTURE_PIO, 0x00);
- snd_dma_program(chip->dma2, runtime->dma_area, size,
+ snd_dma_program(chip->dma2, runtime->dma_addr, size,
DMA_MODE_READ | DMA_AUTOINIT);
snd_ad1816a_write(chip, AD1816A_CAPTURE_SAMPLE_RATE, runtime->rate);
@@ -446,6 +447,7 @@ static int snd_ad1816a_playback_open(snd_pcm_substream_t *substream)
runtime->hw = snd_ad1816a_playback;
snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.buffer_bytes_max);
snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.period_bytes_max);
+ chip->playback_substream = substream;
return 0;
}
@@ -461,6 +463,7 @@ static int snd_ad1816a_capture_open(snd_pcm_substream_t *substream)
runtime->hw = snd_ad1816a_capture;
snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max);
snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max);
+ chip->capture_substream = substream;
return 0;
}
@@ -531,7 +534,7 @@ static int snd_ad1816a_free(ad1816a_t *chip)
{
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
@@ -673,7 +676,7 @@ int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm)
strcpy(pcm->name, snd_ad1816a_chip_id(chip));
snd_ad1816a_init(chip);
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024);
chip->pcm = pcm;
if (rpcm)
@@ -892,26 +895,26 @@ static int snd_ad1816a_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
static snd_kcontrol_new_t snd_ad1816a_controls[] = {
AD1816A_DOUBLE("Master Playback Switch", AD1816A_MASTER_ATT, 15, 7, 1, 1),
-AD1816A_DOUBLE("Master Playback Volume", AD1816A_MASTER_ATT, 8, 0, 31, 0),
+AD1816A_DOUBLE("Master Playback Volume", AD1816A_MASTER_ATT, 8, 0, 31, 1),
AD1816A_DOUBLE("PCM Playback Switch", AD1816A_VOICE_ATT, 15, 7, 1, 1),
-AD1816A_DOUBLE("PCM Playback Volume", AD1816A_VOICE_ATT, 8, 0, 63, 0),
+AD1816A_DOUBLE("PCM Playback Volume", AD1816A_VOICE_ATT, 8, 0, 63, 1),
AD1816A_DOUBLE("Line Playback Switch", AD1816A_LINE_GAIN_ATT, 15, 7, 1, 1),
-AD1816A_DOUBLE("Line Playback Volume", AD1816A_LINE_GAIN_ATT, 8, 0, 31, 0),
+AD1816A_DOUBLE("Line Playback Volume", AD1816A_LINE_GAIN_ATT, 8, 0, 31, 1),
AD1816A_DOUBLE("CD Playback Switch", AD1816A_CD_GAIN_ATT, 15, 7, 1, 1),
-AD1816A_DOUBLE("CD Playback Volume", AD1816A_CD_GAIN_ATT, 8, 0, 31, 0),
+AD1816A_DOUBLE("CD Playback Volume", AD1816A_CD_GAIN_ATT, 8, 0, 31, 1),
AD1816A_DOUBLE("Synth Playback Switch", AD1816A_SYNTH_GAIN_ATT, 15, 7, 1, 1),
-AD1816A_DOUBLE("Synth Playback Volume", AD1816A_SYNTH_GAIN_ATT, 8, 0, 31, 0),
+AD1816A_DOUBLE("Synth Playback Volume", AD1816A_SYNTH_GAIN_ATT, 8, 0, 31, 1),
AD1816A_DOUBLE("FM Playback Switch", AD1816A_FM_ATT, 15, 7, 1, 1),
-AD1816A_DOUBLE("FM Playback Volume", AD1816A_FM_ATT, 8, 0, 63, 0),
+AD1816A_DOUBLE("FM Playback Volume", AD1816A_FM_ATT, 8, 0, 63, 1),
AD1816A_SINGLE("Mic Playback Switch", AD1816A_MIC_GAIN_ATT, 15, 1, 1),
-AD1816A_SINGLE("Mic Playback Volume", AD1816A_MIC_GAIN_ATT, 8, 63, 0),
+AD1816A_SINGLE("Mic Playback Volume", AD1816A_MIC_GAIN_ATT, 8, 63, 1),
AD1816A_SINGLE("Mic Boost", AD1816A_MIC_GAIN_ATT, 14, 1, 0),
AD1816A_DOUBLE("Video Playback Switch", AD1816A_VID_GAIN_ATT, 15, 7, 1, 1),
-AD1816A_DOUBLE("Video Playback Volume", AD1816A_VID_GAIN_ATT, 8, 0, 31, 0),
+AD1816A_DOUBLE("Video Playback Volume", AD1816A_VID_GAIN_ATT, 8, 0, 31, 1),
AD1816A_SINGLE("Phone Capture Switch", AD1816A_PHONE_IN_GAIN_ATT, 15, 1, 1),
-AD1816A_SINGLE("Phone Capture Volume", AD1816A_PHONE_IN_GAIN_ATT, 0, 31, 0),
+AD1816A_SINGLE("Phone Capture Volume", AD1816A_PHONE_IN_GAIN_ATT, 0, 15, 1),
AD1816A_SINGLE("Phone Playback Switch", AD1816A_PHONE_OUT_ATT, 7, 1, 1),
-AD1816A_SINGLE("Phone Playback Volume", AD1816A_PHONE_OUT_ATT, 0, 31, 0),
+AD1816A_SINGLE("Phone Playback Volume", AD1816A_PHONE_OUT_ATT, 0, 31, 1),
{
iface: SNDRV_CTL_ELEM_IFACE_MIXER,
name: "Capture Source",
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index ca73b7eecf67..6ec594af79b0 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -22,6 +22,9 @@
*/
#include <sound/driver.h>
+#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/ad1848.h>
#define SNDRV_GET_ID
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index 03f504639b64..9e69d06cd835 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -24,6 +24,7 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/delay.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ad1848.h>
@@ -525,7 +526,7 @@ static int snd_ad1848_playback_prepare(snd_pcm_substream_t * substream)
chip->dma_size = size;
chip->image[AD1848_IFACE_CTRL] &= ~(AD1848_PLAYBACK_ENABLE | AD1848_PLAYBACK_PIO);
- snd_dma_program(chip->dma, runtime->dma_area, size, DMA_MODE_WRITE | DMA_AUTOINIT);
+ snd_dma_program(chip->dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT);
count = snd_ad1848_get_count(chip->image[AD1848_DATA_FORMAT], count) - 1;
spin_lock_irqsave(&chip->reg_lock, flags);
snd_ad1848_out(chip, AD1848_DATA_LWR_CNT, (unsigned char) count);
@@ -569,7 +570,7 @@ static int snd_ad1848_capture_prepare(snd_pcm_substream_t * substream)
chip->dma_size = size;
chip->image[AD1848_IFACE_CTRL] &= ~(AD1848_CAPTURE_ENABLE | AD1848_CAPTURE_PIO);
- snd_dma_program(chip->dma, runtime->dma_area, size, DMA_MODE_READ | DMA_AUTOINIT);
+ snd_dma_program(chip->dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT);
count = snd_ad1848_get_count(chip->image[AD1848_DATA_FORMAT], count) - 1;
spin_lock_irqsave(&chip->reg_lock, flags);
snd_ad1848_out(chip, AD1848_DATA_LWR_CNT, (unsigned char) count);
@@ -786,7 +787,7 @@ static int snd_ad1848_free(ad1848_t *chip)
{
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
@@ -915,7 +916,7 @@ int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm)
pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
strcpy(pcm->name, snd_ad1848_chip_id(chip));
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma > 3 ? 128*1024 : 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma > 3 ? 128*1024 : 64*1024);
chip->pcm = pcm;
if (rpcm)
diff --git a/sound/isa/als100.c b/sound/isa/als100.c
index 77ee191f9cde..920209f04ebb 100644
--- a/sound/isa/als100.c
+++ b/sound/isa/als100.c
@@ -22,6 +22,14 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/time.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#define SNDRV_GET_ID
#include <sound/initval.h>
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c
index f6d4c19e4fb0..98c2d413402e 100644
--- a/sound/isa/azt2320.c
+++ b/sound/isa/azt2320.c
@@ -34,6 +34,13 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#define SNDRV_GET_ID
#include <sound/initval.h>
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index 4e2ef12d88ea..c9ed3cb45b2d 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -45,6 +45,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ad1848.h>
#include <sound/sb.h>
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index 53fe54b8f336..75ec75c67fc2 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -22,6 +22,8 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/cs4231.h>
#include <sound/mpu401.h>
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index 6c4637f78d87..659a5495ce99 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/cs423x/cs4231_lib.c
@@ -31,6 +31,7 @@
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/cs4231.h>
@@ -837,7 +838,7 @@ static int snd_cs4231_playback_prepare(snd_pcm_substream_t * substream)
spin_lock_irqsave(&chip->reg_lock, flags);
chip->p_dma_size = size;
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE | CS4231_PLAYBACK_PIO);
- snd_dma_program(chip->dma1, runtime->dma_area, size, DMA_MODE_WRITE | DMA_AUTOINIT);
+ snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT);
count = snd_cs4231_get_count(chip->image[CS4231_PLAYBK_FORMAT], count) - 1;
snd_cs4231_out(chip, CS4231_PLY_LWR_CNT, (unsigned char) count);
snd_cs4231_out(chip, CS4231_PLY_UPR_CNT, (unsigned char) (count >> 8));
@@ -879,7 +880,7 @@ static int snd_cs4231_capture_prepare(snd_pcm_substream_t * substream)
spin_lock_irqsave(&chip->reg_lock, flags);
chip->c_dma_size = size;
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_RECORD_ENABLE | CS4231_RECORD_PIO);
- snd_dma_program(chip->dma2, runtime->dma_area, size, DMA_MODE_READ | DMA_AUTOINIT);
+ snd_dma_program(chip->dma2, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT);
count = snd_cs4231_get_count(chip->image[CS4231_REC_FORMAT], count) - 1;
if (chip->single_dma && chip->hardware != CS4231_HW_INTERWAVE) {
snd_cs4231_out(chip, CS4231_PLY_LWR_CNT, (unsigned char) count);
@@ -1330,11 +1331,11 @@ static int snd_cs4231_free(cs4231_t *chip)
{
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->res_cport) {
release_resource(chip->res_cport);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->irq >= 0) {
disable_irq(chip->irq);
@@ -1531,7 +1532,7 @@ int snd_cs4231_pcm(cs4231_t *chip, int device, snd_pcm_t **rpcm)
pcm->info_flags |= SNDRV_PCM_INFO_JOINT_DUPLEX;
strcpy(pcm->name, snd_cs4231_chip_id(chip));
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024);
chip->pcm = pcm;
if (rpcm)
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 00e74ca94b43..5f3f80b484ec 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -21,6 +21,12 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#include <sound/cs4231.h>
#include <sound/mpu401.h>
@@ -387,7 +393,7 @@ static void snd_card_cs4236_free(snd_card_t *card)
#endif
if (acard->res_sb_port) {
release_resource(acard->res_sb_port);
- kfree(acard->res_sb_port);
+ kfree_nocheck(acard->res_sb_port);
}
}
}
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index 65c69601a624..cceebb15dca9 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -83,6 +83,8 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/cs4231.h>
#include <sound/asoundef.h>
diff --git a/sound/isa/dt0197h.c b/sound/isa/dt0197h.c
index 68396bcba5e8..93d23d03f5dc 100644
--- a/sound/isa/dt0197h.c
+++ b/sound/isa/dt0197h.c
@@ -20,6 +20,13 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/wait.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#define SNDRV_GET_ID
#include <sound/initval.h>
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 7e3858315f45..40b2aa33c020 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -22,6 +22,8 @@
#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/es1688.h>
#include <sound/mpu401.h>
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index feb651ad0c19..3102bf15d916 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -23,6 +23,8 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/es1688.h>
#include <sound/initval.h>
@@ -405,7 +407,7 @@ static int snd_es1688_playback_prepare(snd_pcm_substream_t * substream)
spin_unlock_irqrestore(&chip->reg_lock, flags);
/* --- */
count = -count;
- snd_dma_program(chip->dma8, runtime->dma_area, size, DMA_MODE_WRITE | DMA_AUTOINIT);
+ snd_dma_program(chip->dma8, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT);
spin_lock_irqsave(&chip->reg_lock, flags);
snd_es1688_write(chip, 0xa4, (unsigned char) count);
snd_es1688_write(chip, 0xa5, (unsigned char) (count >> 8));
@@ -462,7 +464,7 @@ static int snd_es1688_capture_prepare(snd_pcm_substream_t * substream)
spin_unlock_irqrestore(&chip->reg_lock, flags);
/* --- */
count = -count;
- snd_dma_program(chip->dma8, runtime->dma_area, size, DMA_MODE_READ | DMA_AUTOINIT);
+ snd_dma_program(chip->dma8, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT);
spin_lock_irqsave(&chip->reg_lock, flags);
snd_es1688_write(chip, 0xa4, (unsigned char) count);
snd_es1688_write(chip, 0xa5, (unsigned char) (count >> 8));
@@ -604,6 +606,7 @@ static int snd_es1688_free(es1688_t *chip)
if (chip->res_port) {
snd_es1688_init(chip, 0);
release_resource(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
@@ -742,10 +745,10 @@ int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm)
sprintf(pcm->name, snd_es1688_chip_id(chip));
chip->pcm = pcm;
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 64*1024);
if (rpcm)
- *rpcm = NULL;
+ *rpcm = pcm;
return 0;
}
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index f864bdbb70f7..61f4aba6c18e 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -68,6 +68,13 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/pm.h>
+#include <linux/slab.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -116,6 +123,10 @@ struct _snd_es18xx {
spinlock_t reg_lock;
spinlock_t mixer_lock;
spinlock_t ctrl_lock;
+#ifdef CONFIG_PM
+ struct pm_dev *pm_dev;
+ unsigned char pm_reg;
+#endif
};
#define AUDIO1_IRQ 0x01
@@ -136,6 +147,15 @@ struct _snd_es18xx {
#define ES18XX_MUTEREC 0x0400 /* Record source can be muted */
#define ES18XX_CONTROL 0x0800 /* Has control ports */
+/* Power Management */
+#define ES18XX_PM 0x07
+#define ES18XX_PM_GPO0 0x01
+#define ES18XX_PM_GPO1 0x02
+#define ES18XX_PM_PDR 0x03
+#define ES18XX_PM_ANA 0x04
+#define ES18XX_PM_FM 0x06
+#define ES18XX_PM_SUS 0x08
+
typedef struct _snd_es18xx es18xx_t;
#define chip_t es18xx_t
@@ -463,7 +483,7 @@ static int snd_es18xx_playback1_prepare(es18xx_t *chip,
(snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x04));
/* Set DMA controller */
- snd_dma_program(chip->dma2, runtime->dma_area, size, DMA_MODE_WRITE | DMA_AUTOINIT);
+ snd_dma_program(chip->dma2, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT);
return 0;
}
@@ -575,7 +595,7 @@ static int snd_es18xx_capture_prepare(snd_pcm_substream_t *substream)
(snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x20));
/* Set DMA controler */
- snd_dma_program(chip->dma1, runtime->dma_area, size, DMA_MODE_READ | DMA_AUTOINIT);
+ snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT);
return 0;
}
@@ -638,7 +658,7 @@ static int snd_es18xx_playback2_prepare(es18xx_t *chip,
(snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x20));
/* Set DMA controler */
- snd_dma_program(chip->dma1, runtime->dma_area, size, DMA_MODE_WRITE | DMA_AUTOINIT);
+ snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT);
return 0;
}
@@ -1580,26 +1600,105 @@ int __init snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpcm)
sprintf(pcm->name, "ESS AudioDrive ES%x", chip->version);
chip->pcm = pcm;
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024);
if (rpcm)
*rpcm = pcm;
return 0;
}
+/* Power Management support functions */
+#ifdef CONFIG_PM
+static void snd_es18xx_suspend(es18xx_t *chip)
+{
+ snd_card_t *card = chip->card;
+
+ snd_power_lock(card);
+ if (card->power_state == SNDRV_CTL_POWER_D3hot)
+ goto __skip;
+
+ snd_pcm_suspend_all(chip->pcm);
+
+ /* power down */
+ chip->pm_reg = (unsigned char)snd_es18xx_read(chip, ES18XX_PM);
+ chip->pm_reg |= (ES18XX_PM_FM | ES18XX_PM_SUS);
+ snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg);
+ snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg ^= ES18XX_PM_SUS);
+
+ snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+ __skip:
+ snd_power_unlock(card);
+}
+
+static void snd_es18xx_resume(es18xx_t *chip)
+{
+ snd_card_t *card = chip->card;
+
+ snd_power_lock(card);
+ if (card->power_state == SNDRV_CTL_POWER_D0)
+ goto __skip;
+
+ /* restore PM register, we won't wake till (not 0x07) i/o activity though */
+ snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg ^= ES18XX_PM_FM);
+
+ snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+ __skip:
+ snd_power_unlock(card);
+}
+
+/* callback for control API */
+static int snd_es18xx_set_power_state(snd_card_t *card, unsigned int power_state)
+{
+ es18xx_t *chip = (es18xx_t *) card->power_state_private_data;
+ switch (power_state) {
+ case SNDRV_CTL_POWER_D0:
+ case SNDRV_CTL_POWER_D1:
+ case SNDRV_CTL_POWER_D2:
+ snd_es18xx_resume(chip);
+ break;
+ case SNDRV_CTL_POWER_D3hot:
+ case SNDRV_CTL_POWER_D3cold:
+ snd_es18xx_suspend(chip);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int snd_es18xx_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+ es18xx_t *chip = snd_magic_cast(es18xx_t, dev->data, return 0);
+
+ switch (rqst) {
+ case PM_SUSPEND:
+ snd_es18xx_suspend(chip);
+ break;
+ case PM_RESUME:
+ snd_es18xx_resume(chip);
+ break;
+ }
+ return 0;
+}
+#endif /* CONFIG_PM */
+
static int snd_es18xx_free(es18xx_t *chip)
{
+#ifdef CONFIG_PM
+ if (chip->pm_dev)
+ pm_unregister(chip->pm_dev);
+#endif
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->res_ctrl_port) {
release_resource(chip->res_ctrl_port);
- kfree(chip->res_ctrl_port);
+ kfree_nocheck(chip->res_ctrl_port);
}
if (chip->res_mpu_port) {
release_resource(chip->res_mpu_port);
- kfree(chip->res_mpu_port);
+ kfree_nocheck(chip->res_mpu_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
@@ -2066,6 +2165,17 @@ static int __init snd_audiodrive_probe(int dev)
}
chip->rmidi = rmidi;
}
+
+#ifdef CONFIG_PM
+ /* Power Management */
+ chip->pm_dev = pm_register(PM_ISA_DEV, 0, snd_es18xx_pm_callback);
+ if (chip->pm_dev) {
+ chip->pm_dev->data = chip;
+ /* set control api callback */
+ card->set_power_state = snd_es18xx_set_power_state;
+ card->power_state_private_data = chip;
+ }
+#endif
sprintf(card->driver, "ES%x", chip->version);
sprintf(card->shortname, "ESS AudioDrive ES%x", chip->version);
sprintf(card->longname, "%s at 0x%lx, irq %d, dma1 %d, dma2 %d",
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index 1b64044aeb10..3281bdaf2c52 100644
--- a/sound/isa/gus/gus_dma.c
+++ b/sound/isa/gus/gus_dma.c
@@ -22,6 +22,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/dma.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/gus.h>
@@ -37,7 +38,7 @@ void snd_gf1_dma_ack(snd_gus_card_t * gus)
void snd_gf1_dma_program(snd_gus_card_t * gus,
unsigned int addr,
- const void *buf,
+ unsigned long buf_addr,
unsigned int count,
unsigned int cmd)
{
@@ -76,7 +77,7 @@ void snd_gf1_dma_program(snd_gus_card_t * gus,
count &= ~1; /* align */
}
snd_gf1_dma_ack(gus);
- snd_dma_program(gus->gf1.dma1, buf, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE);
+ snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE);
#if 0
snd_printk("address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", address << 1, count, dma_cmd);
#endif
@@ -140,7 +141,7 @@ static void snd_gf1_dma_interrupt(snd_gus_card_t * gus)
}
block = snd_gf1_dma_next_block(gus);
spin_unlock(&gus->dma_lock);
- snd_gf1_dma_program(gus, block->addr, block->buffer, block->count, (unsigned short) block->cmd);
+ snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
kfree(block);
#if 0
printk("program dma (IRQ) - addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", addr, (long) buffer, count, cmd);
@@ -235,7 +236,7 @@ int snd_gf1_dma_transfer_block(snd_gus_card_t * gus,
spin_unlock_irqrestore(&gus->dma_lock, flags);
if (block == NULL)
return 0;
- snd_gf1_dma_program(gus, block->addr, block->buffer, block->count, (unsigned short) block->cmd);
+ snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
kfree(block);
return 0;
}
diff --git a/sound/isa/gus/gus_dram.c b/sound/isa/gus/gus_dram.c
index 290611ae2974..7c45422c4a93 100644
--- a/sound/isa/gus/gus_dram.c
+++ b/sound/isa/gus/gus_dram.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
diff --git a/sound/isa/gus/gus_instr.c b/sound/isa/gus/gus_instr.c
index 0d66fb56a572..99164ccd1382 100644
--- a/sound/isa/gus/gus_instr.c
+++ b/sound/isa/gus/gus_instr.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
diff --git a/sound/isa/gus/gus_io.c b/sound/isa/gus/gus_io.c
index 7c815dcd3a71..b271f141c89c 100644
--- a/sound/isa/gus/gus_io.c
+++ b/sound/isa/gus/gus_io.c
@@ -22,6 +22,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index a0a29e095573..262f2c163946 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -22,6 +22,8 @@
#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/control.h>
@@ -122,11 +124,11 @@ static int snd_gus_free(snd_gus_card_t *gus)
__hw_end:
if (gus->gf1.res_port1) {
release_resource(gus->gf1.res_port1);
- kfree(gus->gf1.res_port1);
+ kfree_nocheck(gus->gf1.res_port1);
}
if (gus->gf1.res_port2) {
release_resource(gus->gf1.res_port2);
- kfree(gus->gf1.res_port2);
+ kfree_nocheck(gus->gf1.res_port2);
}
if (gus->gf1.irq >= 0)
free_irq(gus->gf1.irq, (void *) gus);
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c
index 348842fe7703..cfcbeaed1cc7 100644
--- a/sound/isa/gus/gus_mem.c
+++ b/sound/isa/gus/gus_mem.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
diff --git a/sound/isa/gus/gus_mem_proc.c b/sound/isa/gus/gus_mem_proc.c
index cf326fbc6457..066c8d6496d3 100644
--- a/sound/isa/gus/gus_mem_proc.c
+++ b/sound/isa/gus/gus_mem_proc.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
diff --git a/sound/isa/gus/gus_mixer.c b/sound/isa/gus/gus_mixer.c
index 354102eacdd1..6e50190b40d4 100644
--- a/sound/isa/gus/gus_mixer.c
+++ b/sound/isa/gus/gus_mixer.c
@@ -21,6 +21,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/gus.h>
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index 7e75e13cb196..6954f9153637 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -28,6 +28,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/dma.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/gus.h>
@@ -93,6 +94,7 @@ static int snd_gf1_pcm_block_change(snd_pcm_substream_t * substream,
block.cmd |= SNDRV_GF1_DMA_16BIT;
block.addr = addr & ~31;
block.buffer = runtime->dma_area + offset;
+ block.buf_addr = runtime->dma_addr + offset;
block.count = count;
block.private_data = pcmp;
block.ack = snd_gf1_pcm_block_change_ack;
@@ -570,7 +572,7 @@ static int snd_gf1_pcm_capture_prepare(snd_pcm_substream_t * substream)
snd_gf1_i_write8(gus, SNDRV_GF1_GB_RECORD_RATE, runtime->rate_den - 2);
snd_gf1_i_write8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL, 0); /* disable sampling */
snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL); /* Sampling Control Register */
- snd_dma_program(gus->gf1.dma2, &runtime->dma_area, gus->c_period_size, DMA_MODE_READ);
+ snd_dma_program(gus->gf1.dma2, runtime->dma_addr, gus->c_period_size, DMA_MODE_READ);
return 0;
}
@@ -860,7 +862,7 @@ int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pc
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_gf1_pcm_playback_ops);
for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next)
- snd_pcm_lib_preallocate_isa_pages(substream, 64*1024, gus->gf1.dma1 > 3 ? 128*1024 : 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages(substream, 64*1024, gus->gf1.dma1 > 3 ? 128*1024 : 64*1024);
pcm->info_flags = 0;
pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
@@ -868,7 +870,7 @@ int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pc
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_gf1_pcm_capture_ops);
if (gus->gf1.dma2 == gus->gf1.dma1)
pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX;
- snd_pcm_lib_preallocate_isa_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, 64*1024, gus->gf1.dma2 > 3 ? 128*1024 : 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, 64*1024, gus->gf1.dma2 > 3 ? 128*1024 : 64*1024);
}
strcpy(pcm->name, pcm->id);
if (gus->interwave) {
diff --git a/sound/isa/gus/gus_reset.c b/sound/isa/gus/gus_reset.c
index 53c09825f62b..3ad688acc1f5 100644
--- a/sound/isa/gus/gus_reset.c
+++ b/sound/isa/gus/gus_reset.c
@@ -22,6 +22,7 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
diff --git a/sound/isa/gus/gus_sample.c b/sound/isa/gus/gus_sample.c
index 4bddddc5f621..b38f434593ca 100644
--- a/sound/isa/gus/gus_sample.c
+++ b/sound/isa/gus/gus_sample.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
diff --git a/sound/isa/gus/gus_simple.c b/sound/isa/gus/gus_simple.c
index c514721b0e85..b0f9f0808a4c 100644
--- a/sound/isa/gus/gus_simple.c
+++ b/sound/isa/gus/gus_simple.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include "gus_tables.h"
diff --git a/sound/isa/gus/gus_synth.c b/sound/isa/gus/gus_synth.c
index 310ed316791e..d65fe7b727e0 100644
--- a/sound/isa/gus/gus_synth.c
+++ b/sound/isa/gus/gus_synth.c
@@ -21,6 +21,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/seq_device.h>
diff --git a/sound/isa/gus/gus_timer.c b/sound/isa/gus/gus_timer.c
index 628738c00632..290d45d2a771 100644
--- a/sound/isa/gus/gus_timer.c
+++ b/sound/isa/gus/gus_timer.c
@@ -23,6 +23,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
diff --git a/sound/isa/gus/gus_uart.c b/sound/isa/gus/gus_uart.c
index d862e534828d..814b81e1871e 100644
--- a/sound/isa/gus/gus_uart.c
+++ b/sound/isa/gus/gus_uart.c
@@ -23,6 +23,7 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
diff --git a/sound/isa/gus/gus_volume.c b/sound/isa/gus/gus_volume.c
index a5ad3cbfa947..665d9cbad8d5 100644
--- a/sound/isa/gus/gus_volume.c
+++ b/sound/isa/gus/gus_volume.c
@@ -20,6 +20,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#define __GUS_TABLES_ALLOC__
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 8ace303affe7..701a3210894b 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -22,6 +22,8 @@
#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#define SNDRV_LEGACY_AUTO_PROBE
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index fb72dde132c8..37ea104f27c1 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -22,6 +22,8 @@
#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/es1688.h>
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index b0ce30b95aba..1553e1230e6d 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -22,6 +22,8 @@
#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/cs4231.h>
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index f8e78685ebb1..68d54e1edaf1 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -26,6 +26,12 @@
#include <asm/dma.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/cs4231.h>
@@ -688,7 +694,7 @@ static void snd_interwave_free(snd_card_t *card)
#ifdef SNDRV_STB
if (iwcard->i2c_res) {
release_resource(iwcard->i2c_res);
- kfree(iwcard->i2c_res);
+ kfree_nocheck(iwcard->i2c_res);
}
#endif
if (iwcard->irq >= 0)
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index eb1632a0c210..c92701db9229 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -23,6 +23,12 @@
#include <asm/io.h>
#include <linux/init.h>
#include <linux/pm.h>
+#include <linux/slab.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#include <sound/cs4231.h>
#include <sound/mpu401.h>
@@ -540,11 +546,11 @@ static int __init snd_opl3sa2_mixer(opl3sa2_t *chip)
/* Power Management support functions */
#ifdef CONFIG_PM
-static void snd_opl3sa2_suspend(opl3sa2_t *chip, int can_schedule)
+static void snd_opl3sa2_suspend(opl3sa2_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
@@ -560,12 +566,12 @@ static void snd_opl3sa2_suspend(opl3sa2_t *chip, int can_schedule)
snd_power_unlock(card);
}
-static void snd_opl3sa2_resume(opl3sa2_t *chip, int can_schedule)
+static void snd_opl3sa2_resume(opl3sa2_t *chip)
{
snd_card_t *card = chip->card;
int i;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -597,11 +603,11 @@ static int snd_opl3sa2_set_power_state(snd_card_t *card, unsigned int power_stat
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- snd_opl3sa2_resume(chip, 1);
+ snd_opl3sa2_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- snd_opl3sa2_suspend(chip, 1);
+ snd_opl3sa2_suspend(chip);
break;
default:
return -EINVAL;
@@ -615,10 +621,10 @@ static int snd_opl3sa2_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *
switch (rqst) {
case PM_SUSPEND:
- snd_opl3sa2_suspend(chip, 0);
+ snd_opl3sa2_suspend(chip);
break;
case PM_RESUME:
- snd_opl3sa2_resume(chip, 0);
+ snd_opl3sa2_resume(chip);
break;
}
return 0;
@@ -699,7 +705,7 @@ static int snd_opl3sa2_free(opl3sa2_t *chip)
free_irq(chip->irq, (void *)chip);
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
snd_magic_kfree(chip);
return 0;
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index f122123814bf..ea99fc598394 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -22,11 +22,18 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#include <sound/driver.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#ifdef CS4231
#include <sound/cs4231.h>
@@ -1021,7 +1028,7 @@ static int snd_opti93x_playback_prepare(snd_pcm_substream_t * substream)
OPTi93X_PLAYBACK_ENABLE | OPTi93X_PLAYBACK_PIO,
~(OPTi93X_PLAYBACK_ENABLE | OPTi93X_PLAYBACK_PIO));
- snd_dma_program(chip->dma1, runtime->dma_area, size,
+ snd_dma_program(chip->dma1, runtime->dma_addr, size,
DMA_MODE_WRITE | DMA_AUTOINIT);
format = snd_opti93x_get_freq(runtime->rate);
@@ -1054,7 +1061,7 @@ static int snd_opti93x_capture_prepare(snd_pcm_substream_t *substream)
OPTi93X_CAPTURE_ENABLE | OPTi93X_CAPTURE_PIO,
(unsigned char)~(OPTi93X_CAPTURE_ENABLE | OPTi93X_CAPTURE_PIO));
- snd_dma_program(chip->dma2, runtime->dma_area, size,
+ snd_dma_program(chip->dma2, runtime->dma_addr, size,
DMA_MODE_READ | DMA_AUTOINIT);
format = snd_opti93x_get_freq(runtime->rate);
@@ -1243,7 +1250,7 @@ static int snd_opti93x_free(opti93x_t *chip)
{
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->dma1 >= 0) {
disable_dma(chip->dma1);
@@ -1377,7 +1384,7 @@ int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm)
strcpy(pcm->name, snd_opti93x_chip_id(codec));
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, codec->dma1 > 3 || codec->dma2 > 3 ? 128*1024 : 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, codec->dma1 > 3 || codec->dma2 > 3 ? 128*1024 : 64*1024);
codec->pcm = pcm;
if (rpcm)
@@ -1889,7 +1896,7 @@ static void snd_card_opti9xx_free(snd_card_t *card)
#endif /* __ISAPNP__ */
if (chip->res_mc_base) {
release_resource(chip->res_mc_base);
- kfree(chip->res_mc_base);
+ kfree_nocheck(chip->res_mc_base);
}
}
}
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c
index 0832385be895..61f4a0130161 100644
--- a/sound/isa/sb/emu8000.c
+++ b/sound/isa/sb/emu8000.c
@@ -21,6 +21,11 @@
*/
#define __NO_VERSION__
+#include <sound/driver.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <sound/core.h>
#include <sound/emu8000.h>
#include <sound/emu8000_reg.h>
#include <asm/io.h>
@@ -1058,15 +1063,15 @@ static int snd_emu8000_free(emu8000_t *hw)
{
if (hw->res_port1) {
release_resource(hw->res_port1);
- kfree(hw->res_port1);
+ kfree_nocheck(hw->res_port1);
}
if (hw->res_port2) {
release_resource(hw->res_port2);
- kfree(hw->res_port2);
+ kfree_nocheck(hw->res_port2);
}
if (hw->res_port3) {
release_resource(hw->res_port3);
- kfree(hw->res_port3);
+ kfree_nocheck(hw->res_port3);
}
snd_magic_kfree(hw);
return 0;
diff --git a/sound/isa/sb/emu8000_local.h b/sound/isa/sb/emu8000_local.h
index e53c1aa04683..12e64e371232 100644
--- a/sound/isa/sb/emu8000_local.h
+++ b/sound/isa/sb/emu8000_local.h
@@ -21,6 +21,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 <sound/core.h>
#include <sound/emu8000.h>
#include <sound/emu8000_reg.h>
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c
index d8bae77c2e24..bd9bace2c2b0 100644
--- a/sound/isa/sb/es968.c
+++ b/sound/isa/sb/es968.c
@@ -22,6 +22,12 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#define SNDRV_GET_ID
#include <sound/initval.h>
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index 40b5f2091fbe..b57b0bd7218d 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -22,6 +22,12 @@
#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/sb16_csp.h>
@@ -350,7 +356,7 @@ static void snd_sb16_free(snd_card_t *card)
return;
if (acard->fm_res) {
release_resource(acard->fm_res);
- kfree(acard->fm_res);
+ kfree_nocheck(acard->fm_res);
}
#ifdef __ISAPNP__
snd_sb16_deactivate(acard);
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index c773a368990b..9d6ed682d6cc 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -26,6 +26,7 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
@@ -41,14 +42,11 @@ MODULE_CLASSES("{sound}");
#ifdef SNDRV_LITTLE_ENDIAN
#define CSP_HDR_VALUE(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
-#define LE_SHORT(v) (v)
-#define LE_INT(v) (v)
#else
-#include <byteswap.h>
#define CSP_HDR_VALUE(a,b,c,d) ((d) | ((c)<<8) | ((b)<<16) | ((a)<<24))
-#define LE_SHORT(v) bswap_16(v)
-#define LE_INT(v) bswap_32(v)
#endif
+#define LE_SHORT(v) le16_to_cpu(v)
+#define LE_INT(v) le32_to_cpu(v)
#define RIFF_HEADER CSP_HDR_VALUE('R', 'I', 'F', 'F')
#define CSP__HEADER CSP_HDR_VALUE('C', 'S', 'P', ' ')
@@ -320,7 +318,7 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode
return -EFAULT;
if ((file_h.name != RIFF_HEADER) ||
(LE_INT(file_h.len) >= SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE - sizeof(file_h))) {
- snd_printd(__FUNCTION__ ": Invalid RIFF header\n");
+ snd_printd("%s: Invalid RIFF header\n", __FUNCTION__);
return -EINVAL;
}
data_ptr += sizeof(file_h);
@@ -329,7 +327,7 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode
if (copy_from_user(&item_type, data_ptr, sizeof(item_type)))
return -EFAULT;
if (item_type != CSP__HEADER) {
- snd_printd(__FUNCTION__ ": Invalid RIFF file type\n");
+ snd_printd("%s: Invalid RIFF file type\n", __FUNCTION__);
return -EINVAL;
}
data_ptr += sizeof (item_type);
@@ -384,7 +382,7 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode
return -EFAULT;
if (code_h.name != MAIN_HEADER) {
- snd_printd(__FUNCTION__ ": Missing 'main' microcode\n");
+ snd_printd("%s: Missing 'main' microcode\n", __FUNCTION__);
return -EINVAL;
}
data_ptr += sizeof(code_h);
@@ -428,7 +426,8 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode
default: /* other codecs are unsupported */
p->acc_format = p->acc_width = p->acc_rates = 0;
p->mode = 0;
- snd_printd(__FUNCTION__ ": Unsupported CSP codec type: 0x%04x\n",
+ snd_printd("%s: Unsupported CSP codec type: 0x%04x\n",
+ __FUNCTION__,
LE_SHORT(funcdesc_h.VOC_type));
return -EINVAL;
}
@@ -447,7 +446,7 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode
return 0;
}
}
- snd_printd(__FUNCTION__ ": Function #%d not found\n", info.func_req);
+ snd_printd("%s: Function #%d not found\n", __FUNCTION__, info.func_req);
return -EINVAL;
}
@@ -601,7 +600,7 @@ static int get_version(sb_t *chip)
static int snd_sb_csp_check_version(snd_sb_csp_t * p)
{
if (p->version < 0x10 || p->version > 0x1f) {
- snd_printd(__FUNCTION__ ": Invalid CSP version: 0x%x\n", p->version);
+ snd_printd("%s: Invalid CSP version: 0x%x\n", __FUNCTION__, p->version);
return 1;
}
return 0;
@@ -620,7 +619,7 @@ static int snd_sb_csp_load(snd_sb_csp_t * p, const unsigned char *buf, int size,
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(__FUNCTION__ ": Download command failed\n");
+ snd_printd("%s: Download command failed\n", __FUNCTION__);
goto __fail;
}
/* Send CSP low byte (size - 1) */
@@ -665,7 +664,7 @@ static int snd_sb_csp_load(snd_sb_csp_t * p, const unsigned char *buf, int size,
udelay (10);
}
if (status != 0x55) {
- snd_printd(__FUNCTION__ ": Microcode initialization failed\n");
+ snd_printd("%s: Microcode initialization failed\n", __FUNCTION__);
goto __fail;
}
} else {
@@ -780,19 +779,19 @@ static int snd_sb_csp_start(snd_sb_csp_t * p, int sample_width, int channels)
unsigned long flags;
if (!(p->running & (SNDRV_SB_CSP_ST_LOADED | SNDRV_SB_CSP_ST_AUTO))) {
- snd_printd(__FUNCTION__ ": Microcode not loaded\n");
+ snd_printd("%s: Microcode not loaded\n", __FUNCTION__);
return -ENXIO;
}
if (p->running & SNDRV_SB_CSP_ST_RUNNING) {
- snd_printd(__FUNCTION__ ": CSP already running\n");
+ snd_printd("%s: CSP already running\n", __FUNCTION__);
return -EBUSY;
}
if (!(sample_width & p->acc_width)) {
- snd_printd(__FUNCTION__ ": Unsupported PCM sample width\n");
+ snd_printd("%s: Unsupported PCM sample width\n", __FUNCTION__);
return -EINVAL;
}
if (!(channels & p->acc_channels)) {
- snd_printd(__FUNCTION__ ": Invalid number of channels\n");
+ snd_printd("%s: Invalid number of channels\n", __FUNCTION__);
return -EINVAL;
}
@@ -814,11 +813,11 @@ static int snd_sb_csp_start(snd_sb_csp_t * p, int sample_width, int channels)
s_type |= 0x22; /* 00dX 00dX (d = 1 if 8 bit samples) */
if (set_codec_parameter(p->chip, 0x81, s_type)) {
- snd_printd(__FUNCTION__ ": Set sample type command failed\n");
+ snd_printd("%s: Set sample type command failed\n", __FUNCTION__);
goto __fail;
}
if (set_codec_parameter(p->chip, 0x80, 0x00)) {
- snd_printd(__FUNCTION__ ": Codec start command failed\n");
+ snd_printd("%s: Codec start command failed\n", __FUNCTION__);
goto __fail;
}
p->run_width = sample_width;
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index a5ded25f5546..0d59af55cd1b 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -31,6 +31,7 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/sb16_csp.h>
@@ -269,7 +270,7 @@ static int snd_sb16_playback_prepare(snd_pcm_substream_t * substream)
snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_PLAYBACK);
size = chip->p_dma_size = snd_pcm_lib_buffer_bytes(substream);
dma = (chip->mode & SB_MODE_PLAYBACK_8) ? chip->dma8 : chip->dma16;
- snd_dma_program(dma, runtime->dma_area, size, DMA_MODE_WRITE | DMA_AUTOINIT);
+ snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT);
count = snd_pcm_lib_period_bytes(substream);
spin_lock_irqsave(&chip->reg_lock, flags);
@@ -336,7 +337,7 @@ static int snd_sb16_capture_prepare(snd_pcm_substream_t * substream)
snd_sb16_setup_rate(chip, runtime->rate, SNDRV_PCM_STREAM_CAPTURE);
size = chip->c_dma_size = snd_pcm_lib_buffer_bytes(substream);
dma = (chip->mode & SB_MODE_CAPTURE_8) ? chip->dma8 : chip->dma16;
- snd_dma_program(dma, runtime->dma_area, size, DMA_MODE_READ | DMA_AUTOINIT);
+ snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT);
count = snd_pcm_lib_period_bytes(substream);
spin_lock_irqsave(&chip->reg_lock, flags);
@@ -870,7 +871,7 @@ int snd_sb16dsp_pcm(sb_t * chip, int device, snd_pcm_t ** rpcm)
snd_ctl_add(card, snd_ctl_new1(&snd_sb16_dma_control, chip));
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 128*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 128*1024);
if (rpcm)
*rpcm = pcm;
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index ea79d0018e97..320b9fa59101 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -21,6 +21,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/opl3.h>
@@ -89,7 +90,7 @@ static void snd_sb8_free(snd_card_t *card)
return;
if (acard->fm_res) {
release_resource(acard->fm_res);
- kfree(acard->fm_res);
+ kfree_nocheck(acard->fm_res);
}
}
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index 816c86066611..9a283c63fb92 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -34,6 +34,7 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
@@ -147,7 +148,7 @@ static int snd_sb8_playback_prepare(snd_pcm_substream_t * 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_area, 1, DMA_MODE_WRITE);
+ snd_dma_program(chip->dma8, runtime->dma_addr, 1, DMA_MODE_WRITE);
/* force interrupt */
chip->mode = SB_MODE_HALT;
snd_sbdsp_command(chip, SB_DSP_OUTPUT);
@@ -174,7 +175,7 @@ static int snd_sb8_playback_prepare(snd_pcm_substream_t * substream)
snd_sbdsp_command(chip, count >> 8);
}
spin_unlock_irqrestore(&chip->reg_lock, flags);
- snd_dma_program(chip->dma8, runtime->dma_area,
+ snd_dma_program(chip->dma8, runtime->dma_addr,
size, DMA_MODE_WRITE | DMA_AUTOINIT);
return 0;
}
@@ -286,7 +287,7 @@ static int snd_sb8_capture_prepare(snd_pcm_substream_t * substream)
snd_sbdsp_command(chip, count >> 8);
}
spin_unlock_irqrestore(&chip->reg_lock, flags);
- snd_dma_program(chip->dma8, runtime->dma_area,
+ snd_dma_program(chip->dma8, runtime->dma_addr,
size, DMA_MODE_READ | DMA_AUTOINIT);
return 0;
}
@@ -533,7 +534,7 @@ int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** 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);
- snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 64*1024, GFP_KERNEL|GFP_DMA);
+ snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 64*1024);
if (rpcm)
*rpcm = pcm;
diff --git a/sound/isa/sb/sb8_midi.c b/sound/isa/sb/sb8_midi.c
index b6c7f75b4e8d..deb838686418 100644
--- a/sound/isa/sb/sb8_midi.c
+++ b/sound/isa/sb/sb8_midi.c
@@ -26,6 +26,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/io.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
index 1c5bad99f79f..22da20bf6f21 100644
--- a/sound/isa/sb/sb_common.c
+++ b/sound/isa/sb/sb_common.c
@@ -25,6 +25,7 @@
#include <asm/dma.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/initval.h>
@@ -51,7 +52,7 @@ int snd_sbdsp_command(sb_t *chip, unsigned char val)
outb(val, SBP(chip, COMMAND));
return 1;
}
- snd_printd(__FUNCTION__ " [0x%lx]: timeout (0x%x)\n", chip->port, val);
+ snd_printd("%s [0x%lx]: timeout (0x%x)\n", __FUNCTION__, chip->port, val);
return 0;
}
@@ -68,7 +69,7 @@ int snd_sbdsp_get_byte(sb_t *chip)
return val;
}
}
- snd_printd(__FUNCTION__ " [0x%lx]: timeout\n", chip->port);
+ snd_printd("%s [0x%lx]: timeout\n", __FUNCTION__, chip->port);
return -ENODEV;
}
@@ -87,7 +88,7 @@ int snd_sbdsp_reset(sb_t *chip)
else
break;
}
- snd_printdd(__FUNCTION__ " [0x%lx] failed...\n", chip->port);
+ snd_printdd("%s [0x%lx] failed...\n", __FUNCTION__, chip->port);
return -ENODEV;
}
@@ -176,11 +177,11 @@ static int snd_sbdsp_free(sb_t *chip)
{
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->res_alt_port) {
release_resource(chip->res_alt_port);
- kfree(chip->res_alt_port);
+ kfree_nocheck(chip->res_alt_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index efa1bafbc383..340e0d898c34 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -23,6 +23,7 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/control.h>
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c
index 853e46155921..09ddf37c48c2 100644
--- a/sound/isa/sgalaxy.c
+++ b/sound/isa/sgalaxy.c
@@ -24,6 +24,8 @@
#include <sound/driver.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/ad1848.h>
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index b3110549ea84..59164bf908f9 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -21,6 +21,12 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#ifndef LINUX_ISAPNP_H
+#include <linux/isapnp.h>
+#define isapnp_card pci_bus
+#define isapnp_dev pci_dev
+#endif
#include <sound/core.h>
#define SNDRV_GET_ID
#include <sound/initval.h>
@@ -47,10 +53,9 @@ static int snd_cs4232_mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 9,11,12,15 */
static long snd_ics2115_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int snd_ics2115_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,9,11,12,15 */
static long snd_fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
-static long snd_control_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
-static long snd_wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int snd_dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
static int snd_dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
+static int snd_use_cs4232_midi[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_SYNTAX(snd_index, "Index value for WaveFront soundcard.");
@@ -92,9 +97,9 @@ MODULE_PARM_SYNTAX(snd_ics2115_port, SNDRV_PORT12_DESC);
MODULE_PARM(snd_fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_fm_port, "FM port #.");
MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(snd_wss_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
-MODULE_PARM_DESC(snd_wss_port, "Windows Sound System port #.");
-MODULE_PARM_SYNTAX(snd_wss_port, SNDRV_PORT12_DESC);
+MODULE_PARM(snd_use_cs4232_midi, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(snd_use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");
+MODULE_PARM_SYNTAX(snd_use_cs4232_midi, SNDRV_ENABLED ",allows use of CS4323 MPU-401 interface");
static snd_card_t *snd_wavefront_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
@@ -130,10 +135,10 @@ snd_wavefront_isapnp (int dev, snd_wavefront_card_t *acard)
struct isapnp_card *card = snd_wavefront_isapnp_cards[dev];
struct isapnp_dev *pdev;
int tmp;
-
+
/* Check for each logical device. */
- /* "windows sound system" has id 0 */
+ /* CS4232 chip (aka "windows sound system") is logical device 0 */
acard->wss = isapnp_find_dev(card, id->devs[0].vendor, id->devs[0].function, NULL);
if (acard->wss->active) {
@@ -141,66 +146,67 @@ snd_wavefront_isapnp (int dev, snd_wavefront_card_t *acard)
return -EBUSY;
}
- /* control interface has id 1 */
-
- acard->ctrl = isapnp_find_dev(card, id->devs[1].vendor, id->devs[1].function, NULL);
- if (acard->ctrl->active) {
- acard->wss = acard->ctrl = NULL;
- return -EBUSY;
- }
-
- /* synth has id 3 */
+ /* there is a game port at logical device 1, but we ignore it completely */
- acard->synth = isapnp_find_dev(card, id->devs[3].vendor, id->devs[3].function, NULL);
- if (acard->synth->active) {
- acard->wss = acard->ctrl = acard->synth = NULL;
- return -EBUSY;
- }
+ /* the control interface is logical device 2, but we ignore it
+ completely. in fact, nobody even seems to know what it
+ does.
+ */
- /* Only configure the CS4232 MIDI interface is its been
- requested. It has id 2.
+ /* Only configure the CS4232 MIDI interface if its been
+ specifically requested. It is logical device 3.
*/
- if (snd_cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
+ if (snd_use_cs4232_midi[dev]) {
acard->mpu = isapnp_find_dev(card, id->devs[2].vendor, id->devs[2].function, NULL);
if (acard->mpu->active) {
- acard->wss = acard->ctrl = acard->synth = acard->mpu = NULL;
+ acard->wss = acard->synth = acard->mpu = NULL;
return -EBUSY;
}
}
+ /* The ICS2115 synth is logical device 4 */
+
+ acard->synth = isapnp_find_dev(card, id->devs[3].vendor, id->devs[3].function, NULL);
+ if (acard->synth->active) {
+ acard->wss = acard->synth = NULL;
+ return -EBUSY;
+ }
+
/* PCM/FM initialization */
pdev = acard->wss;
if ((tmp = pdev->prepare (pdev)) < 0) {
if (tmp == -EBUSY) {
- snd_printk ("ISA PnP configuration appears to have been "
- "done. Restart the isa-pnp module.\n");
+ snd_printk ("ISA PnP configuration appears to have "
+ "been done. Restart the isapnp module.\n");
return 0;
}
-
snd_printk ("isapnp WSS preparation failed\n");
return -EAGAIN;
}
+ /* An interesting note from the Tropez+ FAQ:
+
+ Q. [Ports] Why is the base address of the WSS I/O ports off by 4?
+
+ A. WSS I/O requires a block of 8 I/O addresses ("ports"). Of these, the first
+ 4 are used to identify and configure the board. With the advent of PnP,
+ these first 4 addresses have become obsolete, and software applications
+ only use the last 4 addresses to control the codec chip. Therefore, the
+ base address setting "skips past" the 4 unused addresses.
+
+ */
+
if (snd_cs4232_pcm_port[dev] != SNDRV_AUTO_PORT)
isapnp_resource_change(&pdev->resource[0], snd_cs4232_pcm_port[dev], 4);
if (snd_fm_port[dev] != SNDRV_AUTO_PORT)
isapnp_resource_change(&pdev->resource[1], snd_fm_port[dev], 4);
- if (snd_wss_port[dev] != SNDRV_AUTO_PORT)
- isapnp_resource_change(&pdev->resource[2], snd_wss_port[dev], 4);
-
- if (snd_ics2115_port[dev] != SNDRV_AUTO_PORT)
- isapnp_resource_change(&pdev->resource[3], snd_ics2115_port[dev], 8);
- if (snd_ics2115_irq[dev] != SNDRV_AUTO_IRQ)
- isapnp_resource_change(&pdev->irq_resource[3], snd_ics2115_irq[dev], 1);
-
if (snd_dma1[dev] != SNDRV_AUTO_DMA)
isapnp_resource_change(&pdev->dma_resource[0], snd_dma1[dev], 1);
if (snd_dma2[dev] != SNDRV_AUTO_DMA)
isapnp_resource_change(&pdev->dma_resource[1], snd_dma2[dev], 1);
-
if (snd_cs4232_pcm_irq[dev] != SNDRV_AUTO_IRQ)
isapnp_resource_change(&pdev->irq_resource[0], snd_cs4232_pcm_irq[dev], 1);
@@ -211,93 +217,51 @@ snd_wavefront_isapnp (int dev, snd_wavefront_card_t *acard)
snd_cs4232_pcm_port[dev] = pdev->resource[0].start;
snd_fm_port[dev] = pdev->resource[1].start;
- snd_wss_port[dev] = pdev->resource[2].start;
-
- snd_ics2115_port[dev] = pdev->resource[3].start;
- snd_ics2115_irq[dev] = pdev->irq_resource[3].start;
-
snd_dma1[dev] = pdev->dma_resource[0].start;
- snd_dma2[dev] = pdev->dma_resource[1].start == 4 ? -1 : pdev->dma_resource[1].start;
-
+ snd_dma2[dev] = pdev->dma_resource[1].start;
snd_cs4232_pcm_irq[dev] = pdev->irq_resource[0].start;
- snd_printk ("CS4232: port=0x%lx, fm port=0x%lx, wss port=0x%lx\n"
- "CS4232: dma1=%i, dma2=%i, irq=%i\n"
- "ICS2115: port=0x%lx, irq=%i\n",
- snd_cs4232_pcm_port[dev], snd_fm_port[dev], snd_wss_port[dev],
- snd_dma1[dev], snd_dma2[dev], snd_cs4232_pcm_irq[dev],
- snd_ics2115_port[dev],
- snd_ics2115_irq[dev]);
-
- /* CTRL initialization */
-
- if (snd_control_port[dev] != SNDRV_AUTO_PORT) {
-
- pdev = acard->ctrl;
+ /* Synth initialization */
- if (pdev->prepare(pdev)<0) {
- acard->wss->deactivate(acard->wss);
- snd_printk ("isapnp CTRL preparation failed\n");
- return -EAGAIN;
- }
-
- if (snd_control_port[dev] != SNDRV_AUTO_PORT)
- isapnp_resource_change(&pdev->resource[0], snd_control_port[dev], 8);
-
- if (pdev->activate(pdev)<0) {
- snd_printk("isapnp CTRL activation failed\n");
- acard->wss->deactivate(acard->wss);
- return -EBUSY;
+ pdev = acard->synth;
+
+ if ((tmp = pdev->prepare(pdev))<0) {
+ if (tmp == -EBUSY) {
+ snd_printk ("ISA PnP configuration appears to have "
+ "been done. Restart the isapnp module.\n");
}
-
- snd_control_port[dev] = pdev->resource[0].start;
- snd_printk ("isapnp CTRL: control port=0x%lx\n",
- snd_control_port[dev]);
+ acard->wss->deactivate(acard->wss);
+ snd_printk ("ICS2115 synth preparation failed\n");
+ return -EAGAIN;
}
-
- /* Synth initialization */
-
if (snd_ics2115_port[dev] != SNDRV_AUTO_PORT) {
-
- pdev = acard->synth;
-
- if (pdev->prepare(pdev)<0) {
- acard->wss->deactivate(acard->wss);
- if (acard->ctrl)
- acard->ctrl->deactivate(acard->ctrl);
- snd_printk ("ICS2115 synth preparation failed\n");
- return -EAGAIN;
- }
+ isapnp_resource_change(&pdev->resource[0], snd_ics2115_port[dev], 16);
+ }
- isapnp_resource_change(&pdev->resource[0], snd_ics2115_port[dev], 8);
- if (snd_ics2115_irq[dev] != SNDRV_AUTO_IRQ)
- isapnp_resource_change(&pdev->irq_resource[0], snd_ics2115_irq[dev], 1);
+ if (snd_ics2115_port[dev] != SNDRV_AUTO_IRQ) {
+ isapnp_resource_change(&pdev->irq_resource[0], snd_ics2115_irq[dev], 1);
+ }
- if (pdev->activate(pdev)<0) {
- snd_printk("synth configuration failed\n");
- acard->wss->deactivate(acard->wss);
- if (acard->ctrl)
- acard->ctrl->deactivate(acard->ctrl);
- return -EBUSY;
- }
-
- snd_ics2115_port[dev] = pdev->resource[0].start;
- snd_ics2115_irq[dev] = pdev->irq_resource[0].start;
+ if (pdev->activate(pdev)<0) {
+ snd_printk("isapnp activation for ICS2115 failed\n");
+ acard->wss->deactivate(acard->wss);
+ return -EBUSY;
}
+ snd_ics2115_port[dev] = pdev->resource[0].start;
+ snd_ics2115_irq[dev] = pdev->irq_resource[0].start;
+
/* CS4232 MPU initialization. Configure this only if
explicitly requested, since its physically inaccessible and
consumes another IRQ.
*/
- if (snd_cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
+ if (snd_use_cs4232_midi[dev]) {
pdev = acard->mpu;
if (pdev->prepare(pdev)<0) {
acard->wss->deactivate(acard->wss);
- if (acard->ctrl)
- acard->ctrl->deactivate(acard->ctrl);
if (acard->synth)
acard->synth->deactivate(acard->synth);
snd_printk ("CS4232 MPU preparation failed\n");
@@ -322,6 +286,15 @@ snd_wavefront_isapnp (int dev, snd_wavefront_card_t *acard)
snd_cs4232_mpu_irq[dev]);
}
+ snd_printdd ("CS4232: pcm port=0x%lx, fm port=0x%lx, dma1=%i, dma2=%i, irq=%i\nICS2115: port=0x%lx, irq=%i\n",
+ snd_cs4232_pcm_port[dev],
+ snd_fm_port[dev],
+ snd_dma1[dev],
+ snd_dma2[dev],
+ snd_cs4232_pcm_irq[dev],
+ snd_ics2115_port[dev],
+ snd_ics2115_irq[dev]);
+
return 0;
}
@@ -472,7 +445,7 @@ snd_wavefront_free(snd_card_t *card)
#endif
if (acard->wavefront.res_base != NULL) {
release_resource(acard->wavefront.res_base);
- kfree(acard->wavefront.res_base);
+ kfree_nocheck(acard->wavefront.res_base);
}
if (acard->wavefront.irq > 0)
free_irq(acard->wavefront.irq, (void *)acard);
@@ -529,8 +502,7 @@ snd_wavefront_probe (int dev)
#ifdef __ISAPNP__
if (snd_isapnp[dev] && snd_wavefront_isapnp (dev, acard) < 0) {
- if (snd_cs4232_pcm_port[dev] == SNDRV_AUTO_PORT ||
- snd_control_port[dev] == SNDRV_AUTO_PORT) {
+ if (snd_cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
snd_printk ("isapnp detection failed\n");
snd_card_free (card);
return -ENODEV;
@@ -542,7 +514,7 @@ snd_wavefront_probe (int dev)
if ((err = snd_cs4231_create (card,
snd_cs4232_pcm_port[dev],
- snd_control_port[dev],
+ -1,
snd_cs4232_pcm_irq[dev],
snd_dma1[dev],
snd_dma2[dev],
@@ -792,8 +764,9 @@ module_exit(alsa_card_wavefront_exit)
snd_cs4232_pcm_port,snd_cs4232_pcm_irq,
snd_cs4232_mpu_port,snd_cs4232_mpu_irq,
snd_ics2115_port,snd_ics2115_irq,
- snd_fm_port,snd_control_port,snd_wss_port,
- snd_dma1,snd_dma2 */
+ snd_fm_port,
+ snd_dma1,snd_dma2,
+ snd_use_cs4232_midi */
static int __init alsa_card_wavefront_setup(char *str)
{
@@ -812,10 +785,9 @@ static int __init alsa_card_wavefront_setup(char *str)
get_option(&str,(int *)&snd_ics2115_port[nr_dev]) == 2 &&
get_option(&str,&snd_ics2115_irq[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_fm_port[nr_dev]) == 2 &&
- get_option(&str,(int *)&snd_control_port[nr_dev]) == 2 &&
- get_option(&str,(int *)&snd_wss_port[nr_dev]) == 2 &&
get_option(&str,&snd_dma1[nr_dev]) == 2 &&
- get_option(&str,&snd_dma2[nr_dev]) == 2);
+ get_option(&str,&snd_dma2[nr_dev]) == 2 &&
+ get_option(&str,&snd_use_cs4232_midi[nr_dev]) == 2);
nr_dev++;
return 1;
}
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 849148f02d13..12e1cacb8225 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-1999 by Paul Barton-Davis <pbd@op.net>
+ * Copyright (c) 1998-2002 by Paul Davis <pbd@op.net>
*
* 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
@@ -20,13 +20,15 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/snd_wavefront.h>
#include <sound/yss225.h>
#include <sound/initval.h>
#if 0
-MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>");
+MODULE_AUTHOR("Paul Davis <pbd@op.net>");
MODULE_DESCRIPTION("ALSA driver for Turtle Beach Tropez+ YSS225 FX Processor");
MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
@@ -711,7 +713,7 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
/* wierd stuff, derived from port I/O tracing with dosemu */
-unsigned char page_zero[] = {
+static unsigned char page_zero[] __initdata = {
0x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
0x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,
0x00, 0x14, 0x02, 0x76, 0x00, 0x60, 0x00, 0x80, 0x02, 0x00, 0x00,
@@ -738,7 +740,7 @@ unsigned char page_zero[] = {
0x1d, 0x02, 0xdf
};
-unsigned char page_one[] = {
+static unsigned char page_one[] __initdata = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd8, 0x00, 0x00,
0x02, 0x20, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01,
@@ -765,7 +767,7 @@ unsigned char page_one[] = {
0x60, 0x00, 0x1b
};
-unsigned char page_two[] = {
+static unsigned char page_two[] __initdata = {
0xc4, 0x00, 0x44, 0x07, 0x44, 0x00, 0x40, 0x25, 0x01, 0x06, 0xc4,
0x07, 0x40, 0x25, 0x01, 0x00, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -780,7 +782,7 @@ unsigned char page_two[] = {
0x46, 0x05, 0x46, 0x07, 0x46, 0x07, 0x44
};
-unsigned char page_three[] = {
+static unsigned char page_three[] __initdata = {
0x07, 0x40, 0x00, 0x00, 0x00, 0x47, 0x00, 0x40, 0x00, 0x40, 0x06,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -795,7 +797,7 @@ unsigned char page_three[] = {
0x02, 0x00, 0x42, 0x00, 0xc0, 0x00, 0x40
};
-unsigned char page_four[] = {
+static unsigned char page_four[] __initdata = {
0x63, 0x03, 0x26, 0x02, 0x2c, 0x00, 0x24, 0x00, 0x2e, 0x02, 0x02,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -810,7 +812,7 @@ unsigned char page_four[] = {
0x02, 0x62, 0x02, 0x20, 0x01, 0x21, 0x01
};
-unsigned char page_six[] = {
+static unsigned char page_six[] __initdata = {
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e,
0x00, 0x00, 0x10, 0x00, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x00,
@@ -831,7 +833,7 @@ unsigned char page_six[] = {
0x80, 0x00, 0x7e, 0x80, 0x80
};
-unsigned char page_seven[] = {
+static unsigned char page_seven[] __initdata = {
0x0f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
0x08, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f,
@@ -858,7 +860,7 @@ unsigned char page_seven[] = {
0x00, 0x02, 0x00
};
-unsigned char page_zero_v2[] = {
+static unsigned char page_zero_v2[] __initdata = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -870,7 +872,7 @@ unsigned char page_zero_v2[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-unsigned char page_one_v2[] = {
+static unsigned char page_one_v2[] __initdata = {
0x01, 0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -882,21 +884,21 @@ unsigned char page_one_v2[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-unsigned char page_two_v2[] = {
+static unsigned char page_two_v2[] __initdata = {
0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
-unsigned char page_three_v2[] = {
+static unsigned char page_three_v2[] __initdata = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
-unsigned char page_four_v2[] = {
+static unsigned char page_four_v2[] __initdata = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -904,7 +906,7 @@ unsigned char page_four_v2[] = {
0x00, 0x00, 0x00, 0x00
};
-unsigned char page_seven_v2[] = {
+static unsigned char page_seven_v2[] __initdata = {
0x0f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -915,7 +917,8 @@ unsigned char page_seven_v2[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-unsigned char mod_v2[] = {
+
+static unsigned char mod_v2[] __initdata = {
0x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x02,
0x00, 0x01, 0x03, 0x02, 0x00, 0x01, 0x04, 0x02, 0x00, 0x01, 0x05,
0x02, 0x00, 0x01, 0x06, 0x02, 0x00, 0x01, 0x07, 0x02, 0x00, 0xb0,
@@ -945,7 +948,7 @@ unsigned char mod_v2[] = {
0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x05, 0x02, 0x01, 0x01,
0x06, 0x02, 0x01, 0x01, 0x07, 0x02, 0x01
};
-unsigned char coefficients[] = {
+static unsigned char coefficients[] __initdata = {
0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x03,
0x11, 0x00, 0x4d, 0x01, 0x32, 0x07, 0x46, 0x00, 0x00, 0x07, 0x49,
0x00, 0x00, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x01,
@@ -981,14 +984,14 @@ unsigned char coefficients[] = {
0x06, 0x6c, 0x4c, 0x6c, 0x06, 0x50, 0x52, 0xe2, 0x06, 0x42, 0x02,
0xba
};
-unsigned char coefficients2[] = {
+static unsigned char coefficients2[] __initdata = {
0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x45, 0x0f,
0xff, 0x07, 0x48, 0x0f, 0xff, 0x07, 0x7b, 0x04, 0xcc, 0x07, 0x7d,
0x04, 0xcc, 0x07, 0x7c, 0x00, 0x00, 0x07, 0x7e, 0x00, 0x00, 0x07,
0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00,
0x07, 0x4a, 0x00, 0x00, 0x07, 0x4c, 0x00, 0x00, 0x07, 0x4e, 0x00, 0x00
};
-unsigned char coefficients3[] = {
+static unsigned char coefficients3[] __initdata = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x51, 0x00,
0x51, 0x00, 0x7a, 0x00, 0x7a, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0xcc,
0x00, 0xcc, 0x00, 0xf5, 0x00, 0xf5, 0x01, 0x1e, 0x01, 0x1e, 0x01,
diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c
index eb555c3dda26..b54c7171c280 100644
--- a/sound/isa/wavefront/wavefront_midi.c
+++ b/sound/isa/wavefront/wavefront_midi.c
@@ -51,6 +51,8 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/snd_wavefront.h>
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index bc5b9b9f3d0a..b356878ebb87 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -25,6 +25,9 @@
#include <asm/io.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/time.h>
+#include <linux/wait.h>
#include <sound/core.h>
#include <sound/snd_wavefront.h>
#include <sound/initval.h>
@@ -905,7 +908,7 @@ wavefront_freemem (snd_wavefront_t *dev)
static int
wavefront_send_sample (snd_wavefront_t *dev,
wavefront_patch_info *header,
- UINT16 *dataptr,
+ u16 *dataptr,
int data_is_unsigned)
{
@@ -918,9 +921,9 @@ wavefront_send_sample (snd_wavefront_t *dev,
divided by 2.
*/
- UINT16 sample_short;
- UINT32 length;
- UINT16 *data_end = 0;
+ u16 sample_short;
+ u32 length;
+ u16 *data_end = 0;
unsigned int i;
const int max_blksize = 4096/2;
unsigned int written;
@@ -1070,13 +1073,13 @@ wavefront_send_sample (snd_wavefront_t *dev,
but the offset only uses 24 bits.
*/
- shptr = munge_int32 (*((UINT32 *) &header->hdr.s.sampleStartOffset),
+ shptr = munge_int32 (*((u32 *) &header->hdr.s.sampleStartOffset),
shptr, 4);
- shptr = munge_int32 (*((UINT32 *) &header->hdr.s.loopStartOffset),
+ shptr = munge_int32 (*((u32 *) &header->hdr.s.loopStartOffset),
shptr, 4);
- shptr = munge_int32 (*((UINT32 *) &header->hdr.s.loopEndOffset),
+ shptr = munge_int32 (*((u32 *) &header->hdr.s.loopEndOffset),
shptr, 4);
- shptr = munge_int32 (*((UINT32 *) &header->hdr.s.sampleEndOffset),
+ shptr = munge_int32 (*((u32 *) &header->hdr.s.sampleEndOffset),
shptr, 4);
/* This one is truly wierd. What kind of wierdo decided that in
@@ -1482,11 +1485,11 @@ WaveFront: hardware-dependent interface
***********************************************************************/
static void
-process_sample_hdr (UCHAR8 *buf)
+process_sample_hdr (u8 *buf)
{
wavefront_sample s;
- UCHAR8 *ptr;
+ u8 *ptr;
ptr = buf;
@@ -1497,11 +1500,11 @@ process_sample_hdr (UCHAR8 *buf)
something very similar in the reverse direction.
*/
- *((UINT32 *) &s.sampleStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
- *((UINT32 *) &s.loopStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
- *((UINT32 *) &s.loopEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
- *((UINT32 *) &s.sampleEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
- *((UINT32 *) &s.FrequencyBias) = demunge_int32 (ptr, 3); ptr += 3;
+ *((u32 *) &s.sampleStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
+ *((u32 *) &s.loopStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
+ *((u32 *) &s.loopEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
+ *((u32 *) &s.sampleEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
+ *((u32 *) &s.FrequencyBias) = demunge_int32 (ptr, 3); ptr += 3;
s.SampleResolution = *ptr & 0x3;
s.Loop = *ptr & 0x8;
@@ -1568,7 +1571,7 @@ wavefront_synth_control (snd_wavefront_card_t *acard,
return 0;
case WFC_UPLOAD_PATCH:
- munge_int32 (*((UINT32 *) wc->wbuf), patchnumbuf, 2);
+ munge_int32 (*((u32 *) wc->wbuf), patchnumbuf, 2);
memcpy (wc->wbuf, patchnumbuf, 2);
break;
@@ -1800,65 +1803,6 @@ wavefront_should_cause_interrupt (snd_wavefront_t *dev,
restore_flags (flags);
}
-int
-snd_wavefront_detect_irq (snd_wavefront_t *dev)
-
-{
- int i;
- int possible_irqs[] = { 5, 9, 12, 15, -1 };
-
- /* Note: according to the PnP dump, 7 and 11 are possible too, but the
- WaveFront SDK doesn't tell us how to set the card to use them.
- */
-
- snd_printk ("autodetecting WaveFront IRQ\n");
-
- for (i = 0; possible_irqs[i] > 0; i++) {
- if (snd_wavefront_check_irq (dev, possible_irqs[i]) == 0) {
- snd_printk ("autodetected IRQ %d\n",
- possible_irqs[i]);
- return possible_irqs[i];
- }
- }
-
- return -1;
-}
-
-int
-snd_wavefront_check_irq (snd_wavefront_t *dev, int irq)
-
-{
- int bits;
- unsigned long irq_mask;
- short reported_irq;
-
- bits = snd_wavefront_interrupt_bits (irq);
-
- irq_mask = probe_irq_on ();
-
- outb (0x0, dev->control_port);
- outb (0x80 | 0x40 | bits, dev->data_port);
- wavefront_should_cause_interrupt(dev, 0x80|0x40|0x10|0x1,
- dev->control_port,
- (reset_time*HZ)/100);
-
- reported_irq = probe_irq_off (irq_mask);
-
- if (reported_irq == 0) {
- snd_printk ("No unassigned interrupts detected "
- "after h/w reset\n");
- return -1;
- } else if (reported_irq < 0) {
- snd_printk ("Multiple unassigned interrupts detected "
- "after h/w reset\n");
- return -1;
- } else if (reported_irq != irq) {
- return -1;
- }
-
- return 0; /* OK */
-}
-
static int
wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
@@ -2306,8 +2250,6 @@ EXPORT_SYMBOL(snd_wavefront_synth_open);
EXPORT_SYMBOL(snd_wavefront_synth_release);
EXPORT_SYMBOL(snd_wavefront_internal_interrupt);
EXPORT_SYMBOL(snd_wavefront_interrupt_bits);
-EXPORT_SYMBOL(snd_wavefront_detect_irq);
-EXPORT_SYMBOL(snd_wavefront_check_irq);
EXPORT_SYMBOL(snd_wavefront_start);
EXPORT_SYMBOL(snd_wavefront_detect);
EXPORT_SYMBOL(snd_wavefront_cmd);
diff --git a/sound/last.c b/sound/last.c
index 495de7e01ae1..ec5416ab0ca8 100644
--- a/sound/last.c
+++ b/sound/last.c
@@ -23,8 +23,6 @@
#include <sound/driver.h>
#include <sound/core.h>
-#ifndef MODULE
-
static int __init alsa_sound_last_init(void)
{
int idx, ok = 0;
@@ -40,6 +38,4 @@ static int __init alsa_sound_last_init(void)
return 0;
}
-module_init(alsa_sound_last_init)
-
-#endif /* MODULE */
+__initcall(alsa_sound_last_init);
diff --git a/sound/pci/Config.in b/sound/pci/Config.in
index f7718dbfe4f6..4621e024f48c 100644
--- a/sound/pci/Config.in
+++ b/sound/pci/Config.in
@@ -1,7 +1,13 @@
# ALSA PCI drivers
+mainmenu_option next_comment
+comment 'PCI devices'
+
dep_tristate 'ALi PCI Audio M5451' CONFIG_SND_ALI5451 $CONFIG_SND
dep_tristate 'Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x' CONFIG_SND_CS46XX $CONFIG_SND
+if [ "$CONFIG_SND_CS46XX" != "n" ]; then
+ bool ' Cirrus Logic (Sound Fusion) MMAP support for OSS' CONFIG_SND_CS46XX_ACCEPT_VALID
+fi
dep_tristate 'EMU10K1 (SB Live!, E-mu APS)' CONFIG_SND_EMU10K1 $CONFIG_SND
dep_tristate 'Korg 1212 IO' CONFIG_SND_KORG1212 $CONFIG_SND
dep_tristate 'NeoMagic NM256AV/ZX' CONFIG_SND_NM256 $CONFIG_SND
@@ -22,3 +28,5 @@ dep_tristate 'Intel i810/i820/i830/i840/MX440 integrated audio' CONFIG_SND_INTEL
dep_tristate 'S3 SonicVibes' CONFIG_SND_SONICVIBES $CONFIG_SND
dep_tristate 'VIA 82C686A/B South Bridge' CONFIG_SND_VIA686 $CONFIG_SND
dep_tristate 'VIA 8233 South Bridge' CONFIG_SND_VIA8233 $CONFIG_SND
+
+endmenu
diff --git a/sound/pci/ac97/Makefile b/sound/pci/ac97/Makefile
index 6847742b18d0..313fd35a4009 100644
--- a/sound/pci/ac97/Makefile
+++ b/sound/pci/ac97/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_SND_FM801) += snd-ac97-codec.o
obj-$(CONFIG_SND_ICE1712) += snd-ac97-codec.o
obj-$(CONFIG_SND_INTEL8X0) += snd-ac97-codec.o
obj-$(CONFIG_SND_MAESTRO3) += snd-ac97-codec.o
-obj-$(CONFIG_SND_VIA686A) += snd-ac97-codec.o
+obj-$(CONFIG_SND_VIA686) += snd-ac97-codec.o
obj-$(CONFIG_SND_VIA8233) += snd-ac97-codec.o
obj-$(CONFIG_SND_ALI5451) += snd-ac97-codec.o
obj-$(CONFIG_SND_CS46XX) += snd-ac97-codec.o
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index e5fecef0da8c..b8a2bf11d1f3 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -25,6 +25,7 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
diff --git a/sound/pci/ac97/ak4531_codec.c b/sound/pci/ac97/ak4531_codec.c
index be13f11e0b17..fb3879095838 100644
--- a/sound/pci/ac97/ak4531_codec.c
+++ b/sound/pci/ac97/ak4531_codec.c
@@ -22,6 +22,7 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ak4531_codec.h>
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 3ed7eec8e8bb..200e61a9bcce 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -32,6 +32,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
@@ -1972,7 +1973,7 @@ static int snd_ali_free(ali_t * codec)
free_irq(codec->irq, (void *)codec);
if (codec->res_port) {
release_resource(codec->res_port);
- kfree(codec->res_port);
+ kfree_nocheck(codec->res_port);
}
#ifdef CONFIG_PM
if (codec->image)
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 832247a19fe8..87322007c8ed 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -47,6 +47,7 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/rawmidi.h>
@@ -602,7 +603,7 @@ static int __devinit snd_card_als4k_probe(struct pci_dev *pci,
sizeof( snd_card_als4000_t ) );
if (card == NULL) {
release_resource(res_gcr_port);
- kfree(res_gcr_port);
+ kfree_nocheck(res_gcr_port);
return -ENOMEM;
}
@@ -619,7 +620,7 @@ static int __devinit snd_card_als4k_probe(struct pci_dev *pci,
SB_HW_ALS4000,
&chip)) < 0) {
release_resource(res_gcr_port);
- kfree(res_gcr_port);
+ kfree_nocheck(res_gcr_port);
snd_card_free(card);
return err;
}
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 5700eac0fa3b..f60ca9a0e985 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -21,6 +21,7 @@
#include <asm/io.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -61,10 +62,10 @@ MODULE_PARM_DESC(snd_enable, "Enable C-Media PCI soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_mpu_port, "MPU-401 port.");
-MODULE_PARM_SYNTAX(snd_mpu_port, "allows:{{-1},{0x330},{0x320},{0x310},{0x300}},dialog:list");
+MODULE_PARM_SYNTAX(snd_mpu_port, SNDRV_ENABLED ",allows:{{-1},{0x330},{0x320},{0x310},{0x300}},dialog:list");
MODULE_PARM(snd_fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_fm_port, "FM port.");
-MODULE_PARM_SYNTAX(snd_fm_port, "allows:{{-1},{0x388},{0x3c8},{0x3e0},{0x3e8}},dialog:list");
+MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x3e0},{0x3e8}},dialog:list");
#ifndef PCI_DEVICE_ID_CMEDIA_CM8738
#define PCI_DEVICE_ID_CMEDIA_CM8738 0x0111
@@ -2448,7 +2449,7 @@ static int snd_cmipci_free(cmipci_t *cm)
}
if (cm->res_iobase) {
release_resource(cm->res_iobase);
- kfree(cm->res_iobase);
+ kfree_nocheck(cm->res_iobase);
}
snd_magic_kfree(cm);
return 0;
@@ -2678,7 +2679,7 @@ static int __devinit snd_cmipci_probe(struct pci_dev *pci,
cm->iobase,
cm->irq);
- snd_printd("%s is detected\n", card->longname);
+ //snd_printd("%s is detected\n", card->longname);
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ea0f6d50f549..5d0e5619e98f 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -1220,11 +1221,11 @@ static int snd_cs4281_free(cs4281_t *chip)
iounmap((void *) chip->ba1);
if (chip->ba0_res) {
release_resource(chip->ba0_res);
- kfree(chip->ba0_res);
+ kfree_nocheck(chip->ba0_res);
}
if (chip->ba1_res) {
release_resource(chip->ba1_res);
- kfree(chip->ba1_res);
+ kfree_nocheck(chip->ba1_res);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index 4698df13ca12..14d4981f9a2e 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -26,6 +26,7 @@
*/
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/cs46xx.h>
#define SNDRV_GET_ID
@@ -62,10 +63,10 @@ MODULE_PARM_DESC(snd_enable, "Enable CS46xx soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_external_amp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_external_amp, "Force to enable external amplifer.");
-MODULE_PARM_SYNTAX(snd_external_amp, SNDRV_BOOLEAN_FALSE_DESC);
+MODULE_PARM_SYNTAX(snd_external_amp, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
MODULE_PARM(snd_thinkpad, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_thinkpad, "Force to enable Thinkpad's CLKRUN control.");
-MODULE_PARM_SYNTAX(snd_thinkpad, SNDRV_BOOLEAN_FALSE_DESC);
+MODULE_PARM_SYNTAX(snd_thinkpad, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
static struct pci_device_id snd_cs46xx_ids[] __devinitdata = {
{ 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */
@@ -134,25 +135,25 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci,
static int snd_card_cs46xx_suspend(struct pci_dev *pci, u32 state)
{
cs46xx_t *chip = snd_magic_cast(cs46xx_t, pci_get_drvdata(pci), return -ENXIO);
- snd_cs46xx_suspend(chip, 0);
+ snd_cs46xx_suspend(chip);
return 0;
}
static int snd_card_cs46xx_resume(struct pci_dev *pci)
{
cs46xx_t *chip = snd_magic_cast(cs46xx_t, pci_get_drvdata(pci), return -ENXIO);
- snd_cs46xx_resume(chip, 0);
+ snd_cs46xx_resume(chip);
return 0;
}
#else
static void snd_card_cs46xx_suspend(struct pci_dev *pci)
{
cs46xx_t *chip = snd_magic_cast(cs46xx_t, pci_get_drvdata(pci), return);
- snd_cs46xx_suspend(chip, 0);
+ snd_cs46xx_suspend(chip);
}
static void snd_card_cs46xx_resume(struct pci_dev *pci)
{
cs46xx_t *chip = snd_magic_cast(cs46xx_t, pci_get_drvdata(pci), return);
- snd_cs46xx_resume(chip, 0);
+ snd_cs46xx_resume(chip);
}
#endif
#endif
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index b16b2e76ec15..083a2b7236be 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -36,6 +36,7 @@
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
@@ -48,7 +49,7 @@
*/
#if 0
-#define ACCEPT_VALID /* REQUIRED ONLY FOR OSS EMULATION */
+#define SND_CONFIG_CS46XX_ACCEPT_VALID /* REQUIRED ONLY FOR OSS EMULATION */
#endif
#define CS46XX_BA0_SIZE 0x1000
@@ -1048,7 +1049,7 @@ static void snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static snd_pcm_hardware_t snd_cs46xx_playback =
{
info: (SNDRV_PCM_INFO_MMAP |
-#ifdef ACCEPT_VALID
+#ifdef SND_CONFIG_CS46XX_ACCEPT_VALID
/* NOT TRUE!!! OSS REQUIRES IT */
SNDRV_PCM_INFO_MMAP_VALID |
#endif
@@ -1074,7 +1075,7 @@ static snd_pcm_hardware_t snd_cs46xx_playback =
static snd_pcm_hardware_t snd_cs46xx_capture =
{
info: (SNDRV_PCM_INFO_MMAP |
-#ifdef ACCEPT_VALID
+#ifdef SND_CONFIG_CS46XX_ACCEPT_VALID
/* NOT TRUE!!! OSS REQUIRES IT */
SNDRV_PCM_INFO_MMAP_VALID |
#endif
@@ -1652,7 +1653,7 @@ static int snd_cs46xx_free(cs46xx_t *chip)
iounmap((void *) region->remap_addr);
if (region->resource) {
release_resource(region->resource);
- kfree(region->resource);
+ kfree_nocheck(region->resource);
}
}
if (chip->irq >= 0)
@@ -2079,11 +2080,11 @@ static struct cs_card_type __initdata cards[] = {
* APM support
*/
#ifdef CONFIG_PM
-void snd_cs46xx_suspend(cs46xx_t *chip, int can_schedule)
+void snd_cs46xx_suspend(cs46xx_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
snd_pcm_suspend_all(chip->pcm);
@@ -2095,12 +2096,12 @@ void snd_cs46xx_suspend(cs46xx_t *chip, int can_schedule)
snd_power_unlock(card);
}
-void snd_cs46xx_resume(cs46xx_t *chip, int can_schedule)
+void snd_cs46xx_resume(cs46xx_t *chip)
{
snd_card_t *card = chip->card;
int amp_saved;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -2143,11 +2144,11 @@ static int snd_cs46xx_set_power_state(snd_card_t *card, unsigned int power_state
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- snd_cs46xx_resume(chip, 1);
+ snd_cs46xx_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- snd_cs46xx_suspend(chip, 1);
+ snd_cs46xx_suspend(chip);
break;
default:
return -EINVAL;
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 594cb19cf0d3..e7e501d6cd94 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -21,6 +21,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define SNDRV_GET_ID
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index e96d6e9cb972..427fa44ad9a7 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -24,7 +24,7 @@
/* voice status */
enum {
- V_OFF=0, V_RELEASED, V_PLAYING, V_END
+ V_FREE=0, V_OFF, V_RELEASED, V_PLAYING, V_END
};
/* Keeps track of what we are finding */
@@ -235,8 +235,9 @@ lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_onl
if (vp->ch < 0) {
if (active_only)
continue;
- }
- bp = best + V_OFF;
+ bp = best + V_FREE;
+ } else
+ bp = best + V_OFF;
}
else if (state == SNDRV_EMUX_ST_RELEASED ||
state == SNDRV_EMUX_ST_PENDING) {
@@ -255,7 +256,7 @@ lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_onl
continue;
/* check if sample is finished playing (non-looping only) */
- if (bp != best + V_OFF &&
+ if (bp != best + V_OFF && bp != best + V_FREE &&
(vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) {
val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch);
if (val >= vp->reg.loopstart)
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 34eb468e2b47..241361a94145 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -29,6 +29,8 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
@@ -503,7 +505,7 @@ static int snd_emu10k1_free(emu10k1_t *emu)
vfree(emu->page_addr_table);
if (emu->res_port) {
release_resource(emu->res_port);
- kfree(emu->res_port);
+ kfree_nocheck(emu->res_port);
}
if (emu->irq >= 0)
free_irq(emu->irq, (void *)emu);
diff --git a/sound/pci/emu10k1/emu10k1_synth_local.h b/sound/pci/emu10k1/emu10k1_synth_local.h
index 22f19320103d..96711ffa60d2 100644
--- a/sound/pci/emu10k1/emu10k1_synth_local.h
+++ b/sound/pci/emu10k1/emu10k1_synth_local.h
@@ -21,6 +21,7 @@
*/
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1_synth.h>
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 98630bdcecdf..96c3a83f80ce 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -28,6 +28,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/delay.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index 282d1a2bd66f..9ff70781f6e6 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -28,6 +28,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
index 497e0c82f657..70646f78c31f 100644
--- a/sound/pci/emu10k1/emumpu401.c
+++ b/sound/pci/emu10k1/emumpu401.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index 899d4a2afce0..44037bb6fd22 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -27,6 +27,8 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index ee6e9a821eaf..d128b339a208 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -27,6 +27,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index 1c2725b414e0..50dd7344af4f 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -27,6 +27,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
index 8f25c67ad1d2..a25808260d4a 100644
--- a/sound/pci/emu10k1/irq.c
+++ b/sound/pci/emu10k1/irq.c
@@ -27,6 +27,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index f1f402adae6c..b5d8834c9d93 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -23,6 +23,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index 1138978bdf15..0bf503dea178 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -27,6 +27,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index cad266f11ebc..9d6df8b552df 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -1411,8 +1412,8 @@ static int snd_es1371_joystick_addr_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
- if (uinfo->value.enumerated.item > 3)
- uinfo->value.enumerated.item = 3;
+ if (uinfo->value.enumerated.item >= 3)
+ uinfo->value.enumerated.item = 2;
sprintf(uinfo->value.enumerated.name, "port 0x%x", (uinfo->value.enumerated.item * 8) + 0x200);
return 0;
}
@@ -1524,7 +1525,7 @@ static int snd_ensoniq_free(ensoniq_t *ensoniq)
#endif
if (ensoniq->res_port) {
release_resource(ensoniq->res_port);
- kfree(ensoniq->res_port);
+ kfree_nocheck(ensoniq->res_port);
}
if (ensoniq->irq >= 0)
free_irq(ensoniq->irq, (void *)ensoniq);
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index f22e4a33addb..e8a254a62403 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -50,6 +50,7 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -1330,23 +1331,23 @@ static int snd_es1938_free(es1938_t *chip)
#endif
if (chip->res_io_port) {
release_resource(chip->res_io_port);
- kfree(chip->res_io_port);
+ kfree_nocheck(chip->res_io_port);
}
if (chip->res_sb_port) {
release_resource(chip->res_sb_port);
- kfree(chip->res_sb_port);
+ kfree_nocheck(chip->res_sb_port);
}
if (chip->res_vc_port) {
release_resource(chip->res_vc_port);
- kfree(chip->res_vc_port);
+ kfree_nocheck(chip->res_vc_port);
}
if (chip->res_mpu_port) {
release_resource(chip->res_mpu_port);
- kfree(chip->res_mpu_port);
+ kfree_nocheck(chip->res_mpu_port);
}
if (chip->res_game_port) {
release_resource(chip->res_game_port);
- kfree(chip->res_game_port);
+ kfree_nocheck(chip->res_game_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index d172e95eea44..aa0bdc589609 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -99,8 +99,8 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
-#include <linux/reboot.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/mpu401.h>
@@ -126,7 +126,6 @@ static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int snd_total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 };
-static int snd_midi_enable[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0 };
static int snd_pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 };
static int snd_pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
static int snd_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
@@ -143,9 +142,6 @@ MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_total_bufsize, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_total_bufsize, "Total buffer size in kB.");
MODULE_PARM_SYNTAX(snd_total_bufsize, SNDRV_ENABLED ",allows:{{1,4096}},skill:advanced");
-MODULE_PARM(snd_midi_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
-MODULE_PARM_DESC(snd_midi_enable, "Midi enabled for " CARD_NAME " soundcard.");
-MODULE_PARM_SYNTAX(snd_midi_enable, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
MODULE_PARM(snd_pcm_substreams_p, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_pcm_substreams_p, "PCM Playback substreams for " CARD_NAME " soundcard.");
MODULE_PARM_SYNTAX(snd_pcm_substreams_p, SNDRV_ENABLED ",allows:{{1,8}}");
@@ -543,8 +539,6 @@ struct snd_esschan {
struct snd_es1968 {
/* Module Config */
- int midi_enabled; /* bool */
-
int total_bufsize; /* in bytes */
int playback_streams, capture_streams;
@@ -735,12 +729,12 @@ static void apu_data_set(es1968_t *chip, u16 data)
static void __apu_set_register(es1968_t *chip, u16 channel, u8 reg, u16 data)
{
snd_assert(channel < NR_APUS, return);
- reg |= (channel << 4);
- apu_index_set(chip, reg);
- apu_data_set(chip, data);
#ifdef CONFIG_PM
chip->apu_map[channel][reg] = data;
#endif
+ reg |= (channel << 4);
+ apu_index_set(chip, reg);
+ apu_data_set(chip, data);
}
inline static void apu_set_register(es1968_t *chip, u16 channel, u8 reg, u16 data)
@@ -1034,14 +1028,16 @@ static void snd_es1968_pcm_stop(es1968_t *chip, esschan_t *es)
/* set the wavecache control reg */
static void snd_es1968_program_wavecache(es1968_t *chip, esschan_t *es,
- int channel, u32 addr)
+ int channel, u32 addr, int capture)
{
u32 tmpval = (addr - 0x10) & 0xFFF8;
- if (!(es->fmt & ESS_FMT_16BIT))
- tmpval |= 4; /* 8bit */
- if (es->fmt & ESS_FMT_STEREO)
- tmpval |= 2; /* stereo */
+ if (! capture) {
+ if (!(es->fmt & ESS_FMT_16BIT))
+ tmpval |= 4; /* 8bit */
+ if (es->fmt & ESS_FMT_STEREO)
+ tmpval |= 2; /* stereo */
+ }
/* set the wavecache control reg */
wave_set_register(chip, es->apu[channel] << 3, tmpval);
@@ -1070,7 +1066,7 @@ static void snd_es1968_playback_setup(es1968_t *chip, esschan_t *es,
for (channel = 0; channel <= high_apu; channel++) {
apu = es->apu[channel];
- snd_es1968_program_wavecache(chip, es, channel, es->memory->addr);
+ snd_es1968_program_wavecache(chip, es, channel, es->memory->addr, 0);
/* Offset to PCMBAR */
pa = es->memory->addr;
@@ -1217,7 +1213,7 @@ static void snd_es1968_capture_setup(es1968_t *chip, esschan_t *es,
}
/* set the wavecache control reg */
- snd_es1968_program_wavecache(chip, es, channel, pa);
+ snd_es1968_program_wavecache(chip, es, channel, pa, 1);
/* Offset to PCMBAR */
pa -= chip->dma_buf_addr;
@@ -1243,10 +1239,9 @@ static void snd_es1968_capture_setup(es1968_t *chip, esschan_t *es,
apu_set_register(chip, apu, 5, pa & 0xFFFF);
apu_set_register(chip, apu, 6, (pa + bsize) & 0xFFFF);
apu_set_register(chip, apu, 7, bsize);
-#if 1
+#if 0
if (es->fmt & ESS_FMT_STEREO) /* ??? really ??? */
- apu_set_register(chip, es->apu[channel], 7,
- bsize - 1);
+ apu_set_register(chip, apu, 7, bsize - 1);
#endif
/* clear effects/env.. */
@@ -1429,7 +1424,7 @@ static int calc_available_memory_size(es1968_t *chip)
}
up(&chip->memory_mutex);
if (max_size >= 128*1024)
- max_size = 128*1024 - 2;
+ max_size = 127*1024;
return max_size;
}
@@ -1512,7 +1507,7 @@ snd_es1968_init_dmabuf(es1968_t *chip)
esm_memory_t *chunk;
chip->dma_buf = snd_malloc_pci_pages_fallback(chip->pci, chip->total_bufsize,
&chip->dma_buf_addr, &chip->dma_buf_size);
- //snd_printd("es1968: allocated buffer size %ld\n", chip->dma_buf_size);
+ //snd_printd("es1968: allocated buffer size %ld at %p\n", chip->dma_buf_size, chip->dma_buf);
if (chip->dma_buf == NULL) {
snd_printk("es1968: can't allocate dma pages for size %d\n",
chip->total_bufsize);
@@ -1836,8 +1831,16 @@ static void __devinit es1968_measure_clock(es1968_t *chip)
snd_es1968_trigger_apu(chip, apu, 0x10); /* 16bit mono */
do_gettimeofday(&start_time);
spin_unlock_irqrestore(&chip->reg_lock, flags);
+#if 0
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ / 20); /* 50 msec */
+#else
+ /* FIXME:
+ * schedule() above may be too inaccurate and the pointer can
+ * overlap the boundary..
+ */
+ mdelay(50);
+#endif
spin_lock_irqsave(&chip->reg_lock, flags);
offset = __apu_get_register(chip, apu, 5);
do_gettimeofday(&stop_time);
@@ -1859,9 +1862,11 @@ static void __devinit es1968_measure_clock(es1968_t *chip)
} else {
offset *= 1000;
offset = (offset / t) * 1000 + ((offset % t) * 1000) / t;
- if (offset < 47500 || offset > 48500)
- chip->clock = (chip->clock * offset) / 48000;
- snd_printd("setting clock to %d\n", chip->clock);
+ if (offset < 47500 || offset > 48500) {
+ if (offset >= 40000 && offset <= 50000)
+ chip->clock = (chip->clock * offset) / 48000;
+ }
+ printk(KERN_INFO "es1968: clocking to %d\n", chip->clock);
}
snd_es1968_free_memory(chip, memory);
snd_es1968_free_apu_pair(chip, apu);
@@ -2323,12 +2328,7 @@ static void snd_es1968_chip_init(es1968_t *chip)
outb(0, iobase + ASSP_CONTROL_C); /* M: Disable ASSP, ASSP IRQ's and FM Port */
/* Enable IRQ's */
-
- if (chip->midi_enabled)
- w = ESM_HIRQ_DSIE | ESM_HIRQ_MPU401;
- else
- w = ESM_HIRQ_DSIE;
-
+ w = ESM_HIRQ_DSIE | ESM_HIRQ_MPU401;
outw(w, iobase + ESM_PORT_HOST_IRQ);
/*
@@ -2404,11 +2404,11 @@ static void snd_es1968_chip_init(es1968_t *chip)
/*
* PM support
*/
-static void es1968_suspend(es1968_t *chip, int can_schedule)
+static void es1968_suspend(es1968_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
@@ -2419,11 +2419,11 @@ static void es1968_suspend(es1968_t *chip, int can_schedule)
snd_power_unlock(card);
}
-static void es1968_resume(es1968_t *chip, int can_schedule)
+static void es1968_resume(es1968_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -2452,25 +2452,25 @@ static void es1968_resume(es1968_t *chip, int can_schedule)
static int snd_es1968_suspend(struct pci_dev *dev, u32 state)
{
es1968_t *chip = snd_magic_cast(es1968_t, pci_get_drvdata(dev), return -ENXIO);
- es1968_suspend(chip, 0);
+ es1968_suspend(chip);
return 0;
}
static int snd_es1968_resume(struct pci_dev *dev)
{
es1968_t *chip = snd_magic_cast(es1968_t, pci_get_drvdata(dev), return -ENXIO);
- es1968_resume(chip, 0);
+ es1968_resume(chip);
return 0;
}
#else
static void snd_es1968_suspend(struct pci_dev *dev)
{
es1968_t *chip = snd_magic_cast(es1968_t, pci_get_drvdata(dev), return);
- es1968_suspend(chip, 0);
+ es1968_suspend(chip);
}
static void snd_es1968_resume(struct pci_dev *dev)
{
es1968_t *chip = snd_magic_cast(es1968_t, pci_get_drvdata(dev), return);
- es1968_resume(chip, 0);
+ es1968_resume(chip);
}
#endif
@@ -2482,11 +2482,11 @@ static int snd_es1968_set_power_state(snd_card_t *card, unsigned int power_state
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- es1968_resume(chip, 1);
+ es1968_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- es1968_suspend(chip, 1);
+ es1968_suspend(chip);
break;
default:
return -EINVAL;
@@ -2503,7 +2503,7 @@ static int snd_es1968_free(es1968_t *chip)
chip->master_volume = NULL;
if (chip->res_io_port) {
release_resource(chip->res_io_port);
- kfree(chip->res_io_port);
+ kfree_nocheck(chip->res_io_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
@@ -2519,7 +2519,6 @@ static int snd_es1968_dev_free(snd_device_t *device)
static int __devinit snd_es1968_create(snd_card_t * card,
struct pci_dev *pci,
- int midi_enabled,
int total_bufsize,
int play_streams,
int capt_streams,
@@ -2559,7 +2558,6 @@ static int __devinit snd_es1968_create(snd_card_t * card,
chip->card = card;
chip->pci = pci;
chip->irq = -1;
- chip->midi_enabled = midi_enabled;
chip->total_bufsize = total_bufsize; /* in bytes */
chip->playback_streams = play_streams;
chip->capture_streams = capt_streams;
@@ -2608,31 +2606,6 @@ static int __devinit snd_es1968_create(snd_card_t * card,
return 0;
}
-/* *************
- * Midi Part *
- *************/
-static int __devinit
-snd_es1968_midi(es1968_t *chip, int device, snd_rawmidi_t ** rawmidi)
-{
- unsigned long mpu_port;
- int err;
- snd_rawmidi_t *rm;
-
- rm = NULL;
-
- mpu_port = chip->io_port + ESM_MPU401_PORT;
-
- err = snd_mpu401_uart_new(chip->card, device,
- MPU401_HW_MPU401,
- mpu_port, 1, chip->irq, 0, &rm);
- if (err < 0)
- return err;
-
- chip->rmidi = rm;
- if (rawmidi)
- *rawmidi = rm;
- return 0;
-}
/*
* joystick
@@ -2711,7 +2684,6 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
if (snd_total_bufsize[dev] > 4096)
snd_total_bufsize[dev] = 4096;
if ((err = snd_es1968_create(card, pci,
- snd_midi_enable[dev],
snd_total_bufsize[dev] * 1024, /* in bytes */
snd_pcm_substreams_p[dev],
snd_pcm_substreams_c[dev],
@@ -2745,11 +2717,10 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
return err;
}
- if (snd_midi_enable[dev]) {
- if ((err = snd_es1968_midi(chip, 0, NULL)) < 0) {
- snd_card_free(card);
- return err;
- }
+ if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
+ chip->io_port + ESM_MPU401_PORT, 1,
+ chip->irq, 0, &chip->rmidi)) < 0) {
+ printk(KERN_INFO "es1968: skipping MPU-401 MIDI support..\n");
}
/* card switches */
@@ -2762,7 +2733,8 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
}
chip->clock = snd_clock[dev];
- es1968_measure_clock(chip);
+ if (! chip->clock)
+ es1968_measure_clock(chip);
sprintf(card->longname, "%s at 0x%lx, irq %i",
card->shortname, chip->io_port, chip->irq);
@@ -2840,7 +2812,7 @@ module_exit(alsa_card_es1968_exit)
#ifndef MODULE
/* format is: snd-es1968=snd_enable,snd_index,snd_id,
- snd_total_bufsize,snd_midi_enable,
+ snd_total_bufsize,
snd_pcm_substreams_p,
snd_pcm_substreams_c,
snd_clock
@@ -2856,7 +2828,6 @@ static int __init alsa_card_es1968_setup(char *str)
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,&snd_total_bufsize[nr_dev]) == 2 &&
- get_option(&str,&snd_midi_enable[nr_dev]) == 2 &&
get_option(&str,&snd_pcm_substreams_p[nr_dev]) == 2 &&
get_option(&str,&snd_pcm_substreams_c[nr_dev]) == 2 &&
get_option(&str,&snd_clock[nr_dev]) == 2);
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 3b4418b91a86..469f537e9202 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -23,6 +23,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
@@ -878,7 +879,7 @@ static int snd_fm801_free(fm801_t *chip)
__end_hw:
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
diff --git a/sound/pci/ice1712.c b/sound/pci/ice1712.c
index 370e0db783d0..71cf7916ad0d 100644
--- a/sound/pci/ice1712.c
+++ b/sound/pci/ice1712.c
@@ -30,6 +30,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -62,6 +63,7 @@ MODULE_DEVICES("{{Hoontech SoundTrack DSP 24},"
"{TerraTec,EWX 24/96},"
"{TerraTec,EWS 88MT},"
"{TerraTec,EWS 88D},"
+ "{TerraTec,DMX 6Fire},"
"{ICEnsemble,Generic ICE1712},"
"{ICEnsemble,Generic Envy24}}");
@@ -81,7 +83,7 @@ MODULE_PARM_DESC(snd_enable, "Enable ICE1712 soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_omni, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_omni, "Enable Midiman M-Audio Delta Omni I/O support.");
-MODULE_PARM_SYNTAX(snd_omni, SNDRV_ENABLE_DESC);
+MODULE_PARM_SYNTAX(snd_omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
#ifndef PCI_VENDOR_ID_ICE
#define PCI_VENDOR_ID_ICE 0x1412
@@ -4048,8 +4050,8 @@ static int __init snd_ice1712_build_controls(ice1712_t *ice)
err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_6fire_led, ice));
if (err < 0)
return err;
- break;
#endif
+ break;
}
return 0;
@@ -4070,19 +4072,19 @@ static int snd_ice1712_free(ice1712_t *ice)
free_irq(ice->irq, (void *) ice);
if (ice->res_port) {
release_resource(ice->res_port);
- kfree(ice->res_port);
+ kfree_nocheck(ice->res_port);
}
if (ice->res_ddma_port) {
release_resource(ice->res_ddma_port);
- kfree(ice->res_ddma_port);
+ kfree_nocheck(ice->res_ddma_port);
}
if (ice->res_dmapath_port) {
release_resource(ice->res_dmapath_port);
- kfree(ice->res_dmapath_port);
+ kfree_nocheck(ice->res_dmapath_port);
}
if (ice->res_profi_port) {
release_resource(ice->res_profi_port);
- kfree(ice->res_profi_port);
+ kfree_nocheck(ice->res_profi_port);
}
snd_magic_kfree(ice);
return 0;
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 8433c2cf1503..a22598cfc345 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -30,6 +30,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
@@ -54,7 +55,7 @@ MODULE_DEVICES("{{Intel,82801AA},"
static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
-static int snd_ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
+static int snd_ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for Intel i8x0 soundcard.");
@@ -66,8 +67,8 @@ MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_enable, "Enable Intel i8x0 soundcard.");
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_ac97_clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
-MODULE_PARM_DESC(snd_ac97_clock, "AC'97 codec clock (default 48000Hz).");
-MODULE_PARM_SYNTAX(snd_ac97_clock, SNDRV_ENABLED ",default:48000");
+MODULE_PARM_DESC(snd_ac97_clock, "AC'97 codec clock (0 = auto-detect).");
+MODULE_PARM_SYNTAX(snd_ac97_clock, SNDRV_ENABLED ",default:0");
/*
* Direct registers
@@ -177,10 +178,10 @@ MODULE_PARM_SYNTAX(snd_ac97_clock, SNDRV_ENABLED ",default:48000");
typedef struct {
unsigned long reg_offset;
- unsigned int *bdbar; /* CPU address */
- dma_addr_t bdbar_addr; /* PCI bus address */
- snd_pcm_substream_t *substream;
- dma_addr_t physbuf;
+ u32 *bdbar; /* CPU address (32bit) */
+ unsigned int bdbar_addr; /* PCI bus address (32bit) */
+ snd_pcm_substream_t *substream;
+ unsigned int physbuf; /* physical address (32bit) */
unsigned int size;
unsigned int fragsize;
unsigned int fragsize1;
@@ -225,6 +226,7 @@ struct _snd_intel8x0 {
int multi4: 1,
multi6: 1;
+ int in_ac97_init: 1;
ac97_t *ac97;
ac97_t *ac97sec;
@@ -233,7 +235,7 @@ struct _snd_intel8x0 {
spinlock_t ac97_lock;
snd_info_entry_t *proc_entry;
- unsigned int *bdbars;
+ u32 *bdbars;
dma_addr_t bdbars_addr;
unsigned int reg_pi_sr;
@@ -298,8 +300,10 @@ static void snd_intel8x0_codec_write(ac97_t *ac97,
intel8x0_t *chip = snd_magic_cast(intel8x0_t, ac97->private_data, return);
spin_lock(&chip->ac97_lock);
- if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0)
- snd_printk("codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
+ if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) {
+ if (! chip->in_ac97_init)
+ snd_printk("codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
+ }
outw(val, chip->port + reg + ac97->num * 0x80);
spin_unlock(&chip->ac97_lock);
}
@@ -313,14 +317,16 @@ static unsigned short snd_intel8x0_codec_read(ac97_t *ac97,
spin_lock(&chip->ac97_lock);
if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) {
- snd_printk("codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
+ if (! chip->in_ac97_init)
+ snd_printk("codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
res = 0xffff;
} else {
res = inw(chip->port + reg + ac97->num * 0x80);
if ((tmp = inl(ICHREG(chip, GLOB_STA))) & ICH_RCS) {
/* reset RCS and preserve other R/WC bits */
outl(tmp & ~(ICH_SRI|ICH_PRI|ICH_GSCI), ICHREG(chip, GLOB_STA));
- snd_printk("codec_read %d: read timeout for register 0x%x\n", ac97->num, reg);
+ if (! chip->in_ac97_init)
+ snd_printk("codec_read %d: read timeout for register 0x%x\n", ac97->num, reg);
res = 0xffff;
}
}
@@ -363,7 +369,7 @@ static int snd_intel8x0_trigger(intel8x0_t *chip, ichdev_t *ichdev, int cmd)
static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev)
{
int idx;
- unsigned int *bdbar = ichdev->bdbar;
+ u32 *bdbar = ichdev->bdbar;
unsigned long port = chip->bmport + ichdev->reg_offset;
int shiftlen = (chip->device_type == DEVICE_SIS) ? 0 : 1;
@@ -741,7 +747,7 @@ static int __devinit snd_intel8x0_pcm(intel8x0_t *chip, int device, snd_pcm_t **
pcm->private_data = chip;
pcm->private_free = snd_intel8x0_pcm_free;
pcm->info_flags = 0;
- strcpy(pcm->name, "Intel ICH");
+ strcpy(pcm->name, chip->card->shortname);
chip->pcm = pcm;
snd_pcm_lib_preallocate_pci_pages_for_all(chip->pci, pcm, 64*1024, 128*1024);
@@ -881,7 +887,7 @@ static int __devinit snd_intel8x0_pcm_mic(intel8x0_t *chip, int device, snd_pcm_
pcm->private_data = chip;
pcm->private_free = snd_intel8x0_pcm_mic_free;
pcm->info_flags = 0;
- strcpy(pcm->name, "Intel ICH - MIC ADC");
+ sprintf(pcm->name, "%s - MIC ADC", chip->card->shortname);
chip->pcm_mic = pcm;
if (rpcm)
@@ -918,6 +924,7 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
ac97_t ac97;
int err;
+ chip->in_ac97_init = 1;
memset(&ac97, 0, sizeof(ac97));
ac97.write = snd_intel8x0_codec_write;
ac97.read = snd_intel8x0_codec_read;
@@ -946,6 +953,7 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
(chip->ac97sec && (chip->ac97sec->scaps & AC97_SCAP_CENTER_LFE_DAC)))
chip->multi6 = 1;
}
+ chip->in_ac97_init = 0;
return 0;
}
@@ -1056,14 +1064,14 @@ static int snd_intel8x0_free(intel8x0_t *chip)
synchronize_irq();
__hw_end:
if (chip->bdbars)
- snd_free_pci_pages(chip->pci, 3 * sizeof(unsigned int) * ICH_MAX_FRAGS * 2, chip->bdbars, chip->bdbars_addr);
+ snd_free_pci_pages(chip->pci, 3 * sizeof(u32) * ICH_MAX_FRAGS * 2, chip->bdbars, chip->bdbars_addr);
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->res_bmport) {
release_resource(chip->res_bmport);
- kfree(chip->res_bmport);
+ kfree_nocheck(chip->res_bmport);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
@@ -1075,11 +1083,11 @@ static int snd_intel8x0_free(intel8x0_t *chip)
/*
* power management
*/
-static void intel8x0_suspend(intel8x0_t *chip, int can_schedule)
+static void intel8x0_suspend(intel8x0_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
@@ -1091,11 +1099,11 @@ static void intel8x0_suspend(intel8x0_t *chip, int can_schedule)
snd_power_unlock(card);
}
-static void intel8x0_resume(intel8x0_t *chip, int can_schedule)
+static void intel8x0_resume(intel8x0_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -1113,25 +1121,25 @@ static void intel8x0_resume(intel8x0_t *chip, int can_schedule)
static int snd_intel8x0_suspend(struct pci_dev *dev, u32 state)
{
intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return -ENXIO);
- intel8x0_suspend(chip, 0);
+ intel8x0_suspend(chip);
return 0;
}
static int snd_intel8x0_resume(struct pci_dev *dev)
{
intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return -ENXIO);
- intel8x0_resume(chip, 0);
+ intel8x0_resume(chip);
return 0;
}
#else
static void snd_intel8x0_suspend(struct pci_dev *dev)
{
intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return);
- intel8x0_suspend(chip, 0);
+ intel8x0_suspend(chip);
}
static void snd_intel8x0_resume(struct pci_dev *dev)
{
intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return);
- intel8x0_resume(chip, 0);
+ intel8x0_resume(chip);
}
#endif
@@ -1143,11 +1151,11 @@ static int snd_intel8x0_set_power_state(snd_card_t *card, unsigned int power_sta
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- intel8x0_resume(chip, 1);
+ intel8x0_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- intel8x0_suspend(chip, 1);
+ intel8x0_suspend(chip);
break;
default:
return -EINVAL;
@@ -1187,8 +1195,13 @@ static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip)
outb(ICH_IOCE | ICH_STARTBM, port + ICH_REG_PI_CR); /* trigger */
do_gettimeofday(&start_time);
spin_unlock_irqrestore(&chip->reg_lock, flags);
+#if 0
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ / 20);
+#else
+ /* FIXME: schedule() can take too long time and overlap the boundary.. */
+ mdelay(50);
+#endif
spin_lock_irqsave(&chip->reg_lock, flags);
/* check the position */
pos = chip->playback.fragsize1;
@@ -1217,9 +1230,10 @@ static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip)
}
pos = (pos / 4) * 1000;
pos = (pos / t) * 1000 + ((pos % t) * 1000) / t;
- if (pos && (pos > 48500 || pos < 47500)) {
+ if ((pos > 40000 && pos < 47500) ||
+ (pos > 48500 && pos < 50000)) {
chip->ac97->clock = (chip->ac97->clock * 48000) / pos;
- snd_printd("setting clocking to %d\n", chip->ac97->clock);
+ printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97->clock);
}
}
@@ -1239,6 +1253,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
static snd_device_ops_t ops = {
dev_free: snd_intel8x0_dev_free,
};
+ char name[32];
*r_intel8x0 = NULL;
@@ -1255,18 +1270,20 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
chip->pci = pci;
chip->irq = -1;
chip->port = pci_resource_start(pci, 0);
- if ((chip->res_port = request_region(chip->port, 256, "Intel ICH - AC'97")) == NULL) {
+ sprintf(name, "%s - AC'97", card->shortname);
+ if ((chip->res_port = request_region(chip->port, 256, name)) == NULL) {
snd_intel8x0_free(chip);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", chip->port, chip->port + 256 - 1);
return -EBUSY;
}
+ sprintf(name, "%s - Controller", card->shortname);
chip->bmport = pci_resource_start(pci, 1);
- if ((chip->res_bmport = request_region(chip->bmport, 64, "Intel ICH - Controller")) == NULL) {
+ if ((chip->res_bmport = request_region(chip->bmport, 64, name)) == NULL) {
snd_intel8x0_free(chip);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", chip->bmport, chip->bmport + 64 - 1);
return -EBUSY;
}
- if (request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, "Intel ICH", (void *)chip)) {
+ if (request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) {
snd_intel8x0_free(chip);
snd_printk("unable to grab IRQ %d\n", pci->irq);
return -EBUSY;
@@ -1296,19 +1313,27 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
/* allocate buffer descriptor lists */
/* the start of each lists must be aligned to 8 bytes */
- chip->bdbars = (unsigned int *)snd_malloc_pci_pages(pci, 3 * sizeof(unsigned int) * ICH_MAX_FRAGS * 2, &chip->bdbars_addr);
+ chip->bdbars = (u32 *)snd_malloc_pci_pages(pci, 3 * sizeof(unsigned int) * ICH_MAX_FRAGS * 2, &chip->bdbars_addr);
if (chip->bdbars == NULL) {
snd_intel8x0_free(chip);
return -ENOMEM;
}
/* tables must be aligned to 8 bytes here, but the kernel pages
- are much bigger, so we don't care */
- chip->playback.bdbar = chip->bdbars;
- chip->playback.bdbar_addr = chip->bdbars_addr;
+ are much bigger, so we don't care (on i386) */
+#ifndef __i386__
+ /* .. not sure on other architectures, so we check now. */
+ if (chip->bdbars_addr & ~((dma_addr_t)0xffffffff | 0x07)) {
+ snd_printk("invalid i/o port address %lx\n", (unsigned long)chip->bdbars_addr);
+ snd_intel8x0_free(chip);
+ return -ENOMEM;
+ }
+#endif
+ chip->playback.bdbar = chip->bdbars; /* crop to 32bit */
+ chip->playback.bdbar_addr = (unsigned int)chip->bdbars_addr;
chip->capture.bdbar = chip->playback.bdbar + ICH_MAX_FRAGS * 2;
- chip->capture.bdbar_addr = chip->playback.bdbar_addr + sizeof(unsigned int) * ICH_MAX_FRAGS * 2;
+ chip->capture.bdbar_addr = chip->playback.bdbar_addr + sizeof(u32) * ICH_MAX_FRAGS * 2;
chip->capture_mic.bdbar = chip->capture.bdbar + ICH_MAX_FRAGS * 2;
- chip->capture_mic.bdbar_addr = chip->capture.bdbar_addr + sizeof(unsigned int) * ICH_MAX_FRAGS * 2;
+ chip->capture_mic.bdbar_addr = chip->capture.bdbar_addr + sizeof(u32) * ICH_MAX_FRAGS * 2;
if ((err = snd_intel8x0_chip_init(chip)) < 0) {
snd_intel8x0_free(chip);
@@ -1338,7 +1363,7 @@ static struct shortname_table {
{ PCI_DEVICE_ID_INTEL_440MX, "Intel 440MX" },
{ PCI_DEVICE_ID_INTEL_ICH3, "Intel ICH3" },
{ PCI_DEVICE_ID_SI_7012, "SiS SI7012" },
- { PCI_DEVICE_ID_NVIDIA_MCP_AUDIO, "NVidia NForce Audio" },
+ { PCI_DEVICE_ID_NVIDIA_MCP_AUDIO, "NVidia NForce" },
{ 0, 0 },
};
@@ -1362,6 +1387,15 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
if (card == NULL)
return -ENOMEM;
+ strcpy(card->driver, "ICH");
+ strcpy(card->shortname, "Intel ICH");
+ for (name = shortnames; name->id; name++) {
+ if (pci->device == name->id) {
+ strcpy(card->shortname, name->s);
+ break;
+ }
+ }
+
if ((err = snd_intel8x0_create(card, pci, id->driver_data, &chip)) < 0) {
snd_card_free(card);
return err;
@@ -1382,19 +1416,10 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
}
}
- strcpy(card->driver, "ICH");
- strcpy(card->shortname, "Intel ICH");
- for (name = shortnames; name->id; name++) {
- if (chip->pci->device == name->id) {
- strcpy(card->shortname, name->s);
- break;
- }
- }
-
sprintf(card->longname, "%s at 0x%lx, irq %i",
card->shortname, chip->port, chip->irq);
- if (chip->ac97->clock == 48000)
+ if (! snd_ac97_clock[dev])
intel8x0_measure_ac97_clock(chip);
if ((err = snd_card_register(card)) < 0) {
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index c06f2bc8f7e1..e7cdc347eed1 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -23,6 +23,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -165,9 +166,11 @@ typedef enum {
#define K1212_CHANNELS 16
#define K1212_FRAME_SIZE (sizeof(KorgAudioFrame))
+#define K1212_MAX_SAMPLES (kPlayBufferFrames*kNumBuffers)
+#define K1212_PERIODS (K1212_BUF_SIZE/K1212_BLOCK_SIZE)
+#define K1212_PERIOD_BYTES (K1212_BLOCK_SIZE)
#define K1212_BLOCK_SIZE (K1212_FRAME_SIZE*kPlayBufferFrames)
#define K1212_BUF_SIZE (K1212_BLOCK_SIZE*kNumBuffers)
-#define K1212_MAX_SAMPLES (kPlayBufferFrames*kNumBuffers)
#define k1212MinADCSens 0x7f
#define k1212MaxADCSens 0x00
@@ -273,7 +276,7 @@ typedef struct KorgSharedBuffer {
KorgAudioBuffer playDataBufs[kNumBuffers];
KorgAudioBuffer recordDataBufs[kNumBuffers];
#endif
- u16 volumeData[kAudioChannels];
+ short volumeData[kAudioChannels];
u32 cardCommand;
u16 routeData [kAudioChannels];
u32 AdatTimeCode; // ADAT timecode value
@@ -1060,7 +1063,7 @@ static void snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs)
switch (doorbellValue) {
case K1212_DB_DSPDownloadDone:
#ifdef DEBUG
- PRINTK("DEBUG: IRQ count - %ld, %x, [%s].\n", korg1212->irqcount, doorbellValue, stateName[korg1212->cardState]);
+ PRINTK("DEBUG: IRQ DNLD count - %ld, %x, [%s].\n", korg1212->irqcount, doorbellValue, stateName[korg1212->cardState]);
#endif
if (korg1212->cardState == K1212_STATE_DSP_IN_PROCESS) {
snd_korg1212_setCardState(korg1212, K1212_STATE_DSP_COMPLETE);
@@ -1073,7 +1076,7 @@ static void snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs)
// ------------------------------------------------------------------------
case K1212_ISRCODE_DMAERROR:
#ifdef DEBUG
- PRINTK("DEBUG: IRQ count - %ld, %x, [%s].\n", korg1212->irqcount, doorbellValue, stateName[korg1212->cardState]);
+ PRINTK("DEBUG: IRQ DMAE count - %ld, %x, [%s].\n", korg1212->irqcount, doorbellValue, stateName[korg1212->cardState]);
#endif
writel(0, &korg1212->sharedBufferPtr->cardCommand);
break;
@@ -1084,12 +1087,16 @@ static void snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs)
// ------------------------------------------------------------------------
case K1212_ISRCODE_CARDSTOPPED:
#ifdef DEBUG
- PRINTK("DEBUG: IRQ count - %ld, %x, [%s].\n", korg1212->irqcount, doorbellValue, stateName[korg1212->cardState]);
+ PRINTK("DEBUG: IRQ CSTP count - %ld, %x, [%s].\n", korg1212->irqcount, doorbellValue, stateName[korg1212->cardState]);
#endif
writel(0, &korg1212->sharedBufferPtr->cardCommand);
break;
default:
+#ifdef XDEBUG
+ PRINTK("DEBUG: IRQ DFLT count - %ld, %x, cpos=%d [%s].\n", korg1212->irqcount, doorbellValue,
+ korg1212->currentBuffer, stateName[korg1212->cardState]);
+#endif
if ((korg1212->cardState > K1212_STATE_SETUP) || korg1212->idleMonitorOn) {
korg1212->currentBuffer++;
@@ -1157,10 +1164,10 @@ static snd_pcm_hardware_t snd_korg1212_playback_info =
channels_min: K1212_CHANNELS,
channels_max: K1212_CHANNELS,
buffer_bytes_max: K1212_BUF_SIZE,
- period_bytes_min: K1212_BLOCK_SIZE,
- period_bytes_max: K1212_BLOCK_SIZE,
- periods_min: K1212_BUF_SIZE / K1212_BLOCK_SIZE,
- periods_max: K1212_BUF_SIZE / K1212_BLOCK_SIZE,
+ period_bytes_min: K1212_PERIOD_BYTES,
+ period_bytes_max: K1212_PERIOD_BYTES,
+ periods_min: K1212_PERIODS,
+ periods_max: K1212_PERIODS,
fifo_size: 0,
};
@@ -1177,10 +1184,10 @@ static snd_pcm_hardware_t snd_korg1212_capture_info =
channels_min: K1212_CHANNELS,
channels_max: K1212_CHANNELS,
buffer_bytes_max: K1212_BUF_SIZE,
- period_bytes_min: K1212_BLOCK_SIZE,
- period_bytes_max: K1212_BLOCK_SIZE,
- periods_min: K1212_BUF_SIZE / K1212_BLOCK_SIZE,
- periods_max: K1212_BUF_SIZE / K1212_BLOCK_SIZE,
+ period_bytes_min: K1212_PERIOD_BYTES,
+ period_bytes_max: K1212_PERIOD_BYTES,
+ periods_min: K1212_PERIODS,
+ periods_max: K1212_PERIODS,
fifo_size: 0,
};
@@ -1195,7 +1202,7 @@ static void snd_korg1212_free_pcm(snd_pcm_t *pcm)
korg1212->pcm16 = NULL;
}
-static unsigned int period_bytes[] = { K1212_BLOCK_SIZE };
+static unsigned int period_bytes[] = { K1212_PERIOD_BYTES };
#define PERIOD_BYTES sizeof(period_bytes) / sizeof(period_bytes[0])
@@ -1226,7 +1233,7 @@ static int snd_korg1212_playback_open(snd_pcm_substream_t *substream)
runtime->dma_bytes = K1212_BUF_SIZE;
korg1212->playback_substream = substream;
- korg1212->periodsize = K1212_BLOCK_SIZE;
+ korg1212->periodsize = K1212_PERIODS;
spin_unlock_irqrestore(&korg1212->lock, flags);
@@ -1256,7 +1263,7 @@ static int snd_korg1212_capture_open(snd_pcm_substream_t *substream)
runtime->dma_bytes = K1212_BUF_SIZE;
korg1212->capture_substream = substream;
- korg1212->periodsize = K1212_BLOCK_SIZE;
+ korg1212->periodsize = K1212_PERIODS;
spin_unlock_irqrestore(&korg1212->lock, flags);
@@ -1383,7 +1390,7 @@ static int snd_korg1212_prepare(snd_pcm_substream_t *substream)
snd_korg1212_SetupForPlay(korg1212);
- korg1212->currentBuffer = kNumBuffers;
+ korg1212->currentBuffer = -1;
spin_unlock_irqrestore(&korg1212->lock, flags);
return 0;
@@ -1395,7 +1402,7 @@ static int snd_korg1212_trigger(snd_pcm_substream_t *substream,
korg1212_t *korg1212 = _snd_pcm_substream_chip(substream);
#ifdef DEBUG
- PRINTK("DEBUG: snd_korg1212_trigger [%s]\n", stateName[korg1212->cardState]);
+ PRINTK("DEBUG: snd_korg1212_trigger [%s] cmd=%d\n", stateName[korg1212->cardState], cmd);
#endif
switch (cmd) {
@@ -1418,7 +1425,12 @@ static int snd_korg1212_trigger(snd_pcm_substream_t *substream,
static snd_pcm_uframes_t snd_korg1212_pointer(snd_pcm_substream_t *substream)
{
korg1212_t *korg1212 = _snd_pcm_substream_chip(substream);
- snd_pcm_uframes_t pos = korg1212->currentBuffer * kPlayBufferFrames;
+ snd_pcm_uframes_t pos;
+
+ if (korg1212->currentBuffer < 0)
+ return 0;
+
+ pos = korg1212->currentBuffer * kPlayBufferFrames;
#ifdef XDEBUG
PRINTK("DEBUG: snd_korg1212_pointer [%s] %ld\n", stateName[korg1212->cardState], pos);
@@ -1515,15 +1527,8 @@ static snd_pcm_ops_t snd_korg1212_capture_ops = {
static int snd_korg1212_control_phase_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
- static char * texts[] = { "Inverted", "Mute", "Not Inverted" };
-
- uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
- uinfo->count = kAudioChannels;
- 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]);
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = (kcontrol->private_value >= 8) ? 2 : 1;
return 0;
}
@@ -1531,12 +1536,14 @@ static int snd_korg1212_control_phase_get(snd_kcontrol_t *kcontrol, snd_ctl_elem
{
korg1212_t *korg1212 = _snd_kcontrol_chip(kcontrol);
unsigned long flags;
- int i;
+ int i = kcontrol->private_value;
spin_lock_irqsave(&korg1212->lock, flags);
- for (i=0; i<kAudioChannels; i++)
- u->value.enumerated.item[i] = korg1212->volumePhase[i] + 1;
+ u->value.integer.value[0] = korg1212->volumePhase[i];
+
+ if (i >= 8)
+ u->value.integer.value[1] = korg1212->volumePhase[i+1];
spin_unlock_irqrestore(&korg1212->lock, flags);
@@ -1552,13 +1559,30 @@ static int snd_korg1212_control_phase_put(snd_kcontrol_t *kcontrol, snd_ctl_elem
spin_lock_irqsave(&korg1212->lock, flags);
- for (i=0; i<kAudioChannels; i++)
- if (u->value.integer.value[i] != korg1212->volumePhase[i]) {
- korg1212->volumePhase[i] = u->value.enumerated.item[i] - 1;
- val = u->value.integer.value[i] * korg1212->volumePhase[i];
- korg1212->sharedBufferPtr->volumeData[i] = val;
- change = 1;
- }
+ i = kcontrol->private_value;
+
+ korg1212->volumePhase[i] = u->value.integer.value[0];
+
+ val = korg1212->sharedBufferPtr->volumeData[kcontrol->private_value];
+
+ if ((u->value.integer.value[0] > 0) != (val < 0)) {
+ val = abs(val) * (korg1212->volumePhase[i] > 0 ? -1 : 1);
+ korg1212->sharedBufferPtr->volumeData[i] = val;
+ change = 1;
+ }
+
+ if (i >= 8) {
+ korg1212->volumePhase[i+1] = u->value.integer.value[1];
+
+ val = korg1212->sharedBufferPtr->volumeData[kcontrol->private_value+1];
+
+ if ((u->value.integer.value[1] > 0) != (val < 0)) {
+ val = abs(val) * (korg1212->volumePhase[i+1] > 0 ? -1 : 1);
+ korg1212->sharedBufferPtr->volumeData[i+1] = val;
+ change = 1;
+ }
+ }
+
spin_unlock_irqrestore(&korg1212->lock, flags);
return change;
@@ -1567,7 +1591,7 @@ static int snd_korg1212_control_phase_put(snd_kcontrol_t *kcontrol, snd_ctl_elem
static int snd_korg1212_control_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
- uinfo->count = kAudioChannels;
+ uinfo->count = (kcontrol->private_value >= 8) ? 2 : 1;
uinfo->value.integer.min = k1212MinVolume;
uinfo->value.integer.max = k1212MaxVolume;
return 0;
@@ -1581,8 +1605,11 @@ static int snd_korg1212_control_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_ele
spin_lock_irqsave(&korg1212->lock, flags);
- for (i=0; i<kAudioChannels; i++)
- u->value.integer.value[i] = korg1212->sharedBufferPtr->volumeData[i] & 0x7fff;
+ i = kcontrol->private_value;
+ u->value.integer.value[0] = abs(korg1212->sharedBufferPtr->volumeData[i]);
+
+ if (i >= 8)
+ u->value.integer.value[1] = abs(korg1212->sharedBufferPtr->volumeData[i+1]);
spin_unlock_irqrestore(&korg1212->lock, flags);
@@ -1599,12 +1626,24 @@ static int snd_korg1212_control_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_ele
spin_lock_irqsave(&korg1212->lock, flags);
- for (i=0; i<kAudioChannels; i++)
- if (u->value.integer.value[i] != (korg1212->sharedBufferPtr->volumeData[i] & 0x7fff)) {
- val = u->value.integer.value[i] * korg1212->volumePhase[i];
- korg1212->sharedBufferPtr->volumeData[i] = val;
- change = 1;
- }
+ i = kcontrol->private_value;
+
+ if (u->value.integer.value[0] != abs(korg1212->sharedBufferPtr->volumeData[i])) {
+ val = korg1212->volumePhase[i] > 0 ? -1 : 1;
+ val *= u->value.integer.value[0];
+ korg1212->sharedBufferPtr->volumeData[i] = val;
+ change = 1;
+ }
+
+ if (i >= 8) {
+ if (u->value.integer.value[1] != abs(korg1212->sharedBufferPtr->volumeData[i+1])) {
+ val = korg1212->volumePhase[i+1] > 0 ? -1 : 1;
+ val *= u->value.integer.value[1];
+ korg1212->sharedBufferPtr->volumeData[i+1] = val;
+ change = 1;
+ }
+ }
+
spin_unlock_irqrestore(&korg1212->lock, flags);
return change;
@@ -1613,7 +1652,7 @@ static int snd_korg1212_control_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_ele
static int snd_korg1212_control_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
- uinfo->count = kAudioChannels;
+ uinfo->count = (kcontrol->private_value >= 8) ? 2 : 1;
uinfo->value.enumerated.items = kAudioChannels;
if (uinfo->value.enumerated.item > kAudioChannels-1) {
uinfo->value.enumerated.item = kAudioChannels-1;
@@ -1630,8 +1669,11 @@ static int snd_korg1212_control_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem
spin_lock_irqsave(&korg1212->lock, flags);
- for (i=0; i<kAudioChannels; i++)
- u->value.enumerated.item[i] = korg1212->sharedBufferPtr->routeData[i];
+ i = kcontrol->private_value;
+ u->value.enumerated.item[0] = korg1212->sharedBufferPtr->routeData[i];
+
+ if (i >= 8)
+ u->value.enumerated.item[1] = korg1212->sharedBufferPtr->routeData[i+1];
spin_unlock_irqrestore(&korg1212->lock, flags);
@@ -1642,16 +1684,24 @@ static int snd_korg1212_control_route_put(snd_kcontrol_t *kcontrol, snd_ctl_elem
{
korg1212_t *korg1212 = _snd_kcontrol_chip(kcontrol);
unsigned long flags;
- int change = 0;
- int i;
+ int change = 0, i;
spin_lock_irqsave(&korg1212->lock, flags);
- for (i=0; i<kAudioChannels; i++)
- if (u->value.enumerated.item[i] != korg1212->sharedBufferPtr->volumeData[i]) {
- korg1212->sharedBufferPtr->routeData[i] = u->value.enumerated.item[i];
- change = 1;
- }
+ i = kcontrol->private_value;
+
+ if (u->value.enumerated.item[0] != korg1212->sharedBufferPtr->volumeData[i]) {
+ korg1212->sharedBufferPtr->routeData[i] = u->value.enumerated.item[0];
+ change = 1;
+ }
+
+ if (i >= 8) {
+ if (u->value.enumerated.item[1] != korg1212->sharedBufferPtr->volumeData[i+1]) {
+ korg1212->sharedBufferPtr->routeData[i+1] = u->value.enumerated.item[1];
+ change = 1;
+ }
+ }
+
spin_unlock_irqrestore(&korg1212->lock, flags);
return change;
@@ -1661,8 +1711,8 @@ static int snd_korg1212_control_analog_info(snd_kcontrol_t *kcontrol, snd_ctl_el
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
- uinfo->value.integer.min = k1212MinADCSens;
- uinfo->value.integer.max = k1212MaxADCSens;
+ uinfo->value.integer.min = k1212MaxADCSens;
+ uinfo->value.integer.max = k1212MinADCSens;
return 0;
}
@@ -1746,8 +1796,41 @@ static int snd_korg1212_control_sync_put(snd_kcontrol_t * kcontrol, snd_ctl_elem
return change;
}
+#define MON_MIXER(ord,c_name) \
+ { \
+ access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \
+ iface: SNDRV_CTL_ELEM_IFACE_MIXER, \
+ name: c_name " Monitor Volume", \
+ info: snd_korg1212_control_volume_info, \
+ get: snd_korg1212_control_volume_get, \
+ put: snd_korg1212_control_volume_put, \
+ private_value: ord, \
+ }, \
+ { \
+ access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \
+ iface: SNDRV_CTL_ELEM_IFACE_MIXER, \
+ name: c_name " Monitor Route", \
+ info: snd_korg1212_control_route_info, \
+ get: snd_korg1212_control_route_get, \
+ put: snd_korg1212_control_route_put, \
+ private_value: ord, \
+ }, \
+ { \
+ access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \
+ iface: SNDRV_CTL_ELEM_IFACE_PCM, \
+ name: c_name " Monitor Phase Invert", \
+ info: snd_korg1212_control_phase_info, \
+ get: snd_korg1212_control_phase_get, \
+ put: snd_korg1212_control_phase_put, \
+ private_value: ord, \
+ }
+
static snd_kcontrol_new_t snd_korg1212_controls[] = {
- {
+ MON_MIXER(8, "Analog"),
+ MON_MIXER(10, "SPDIF"),
+ MON_MIXER(0, "ADAT-1"), MON_MIXER(1, "ADAT-2"), MON_MIXER(2, "ADAT-3"), MON_MIXER(3, "ADAT-4"),
+ MON_MIXER(4, "ADAT-5"), MON_MIXER(5, "ADAT-6"), MON_MIXER(6, "ADAT-7"), MON_MIXER(7, "ADAT-8"),
+ {
access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE,
iface: SNDRV_CTL_ELEM_IFACE_PCM,
name: "Sync Source",
@@ -1758,31 +1841,7 @@ static snd_kcontrol_new_t snd_korg1212_controls[] = {
{
access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE,
iface: SNDRV_CTL_ELEM_IFACE_MIXER,
- name: "Monitor Volume",
- info: snd_korg1212_control_volume_info,
- get: snd_korg1212_control_volume_get,
- put: snd_korg1212_control_volume_put,
- },
- {
- access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE,
- iface: SNDRV_CTL_ELEM_IFACE_PCM,
- name: "Monitor Phase",
- info: snd_korg1212_control_phase_info,
- get: snd_korg1212_control_phase_get,
- put: snd_korg1212_control_phase_put,
- },
- {
- access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE,
- iface: SNDRV_CTL_ELEM_IFACE_MIXER,
- name: "Monitor Route",
- info: snd_korg1212_control_route_info,
- get: snd_korg1212_control_route_get,
- put: snd_korg1212_control_route_put,
- },
- {
- access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE,
- iface: SNDRV_CTL_ELEM_IFACE_MIXER,
- name: "ADC Sensibility",
+ name: "ADC Attenuation",
info: snd_korg1212_control_analog_info,
get: snd_korg1212_control_analog_get,
put: snd_korg1212_control_analog_put,
@@ -1867,7 +1926,7 @@ static int __init snd_korg1212_create(korg1212_t *korg1212)
korg1212->rightADCInSens = k1212MaxADCSens;
for (i=0; i<kAudioChannels; i++)
- korg1212->volumePhase[i] = 1;
+ korg1212->volumePhase[i] = 0;
if ((err = pci_enable_device(pci)) < 0)
return err;
@@ -2117,17 +2176,17 @@ snd_korg1212_free(void *private_data)
}
if (korg1212->res_iomem != NULL) {
release_resource(korg1212->res_iomem);
- kfree(korg1212->res_iomem);
+ kfree_nocheck(korg1212->res_iomem);
korg1212->res_iomem = NULL;
}
if (korg1212->res_ioport != NULL) {
release_resource(korg1212->res_ioport);
- kfree(korg1212->res_ioport);
+ kfree_nocheck(korg1212->res_ioport);
korg1212->res_ioport = NULL;
}
if (korg1212->res_iomem2 != NULL) {
release_resource(korg1212->res_iomem2);
- kfree(korg1212->res_iomem2);
+ kfree_nocheck(korg1212->res_iomem2);
korg1212->res_iomem2 = NULL;
}
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 03cd684c0b3a..c4174290171e 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -35,8 +35,9 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
-#include <linux/reboot.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -2306,7 +2307,7 @@ static int snd_m3_free(m3_t *chip)
if (chip->iobase_res) {
release_resource(chip->iobase_res);
- kfree(chip->iobase_res);
+ kfree_nocheck(chip->iobase_res);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
@@ -2321,12 +2322,12 @@ static int snd_m3_free(m3_t *chip)
*/
#ifdef CONFIG_PM
-static void m3_suspend(m3_t *chip, int can_schedule)
+static void m3_suspend(m3_t *chip)
{
snd_card_t *card = chip->card;
int i, index;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
@@ -2353,12 +2354,12 @@ static void m3_suspend(m3_t *chip, int can_schedule)
snd_power_unlock(card);
}
-static void m3_resume(m3_t *chip, int can_schedule)
+static void m3_resume(m3_t *chip)
{
snd_card_t *card = chip->card;
int i, index;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -2399,25 +2400,25 @@ static void m3_resume(m3_t *chip, int can_schedule)
static int snd_m3_suspend(struct pci_dev *pci, u32 state)
{
m3_t *chip = snd_magic_cast(m3_t, pci_get_drvdata(pci), return -ENXIO);
- m3_suspend(chip, 0);
+ m3_suspend(chip);
return 0;
}
static int snd_m3_resume(struct pci_dev *pci)
{
m3_t *chip = snd_magic_cast(m3_t, pci_get_drvdata(pci), return -ENXIO);
- m3_resume(chip, 0);
+ m3_resume(chip);
return 0;
}
#else
static void snd_m3_suspend(struct pci_dev *pci)
{
m3_t *chip = snd_magic_cast(m3_t, pci_get_drvdata(pci), return);
- m3_suspend(chip, 0);
+ m3_suspend(chip);
}
static void snd_m3_resume(struct pci_dev *pci)
{
m3_t *chip = snd_magic_cast(m3_t, pci_get_drvdata(pci), return);
- m3_resume(chip, 0);
+ m3_resume(chip);
}
#endif
@@ -2429,11 +2430,11 @@ static int snd_m3_set_power_state(snd_card_t *card, unsigned int power_state)
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- m3_resume(chip, 1);
+ m3_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- m3_suspend(chip, 1);
+ m3_suspend(chip);
break;
default:
return -EINVAL;
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index fd7b4b2e6c30..7deb6598c096 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -29,6 +29,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -1256,11 +1257,11 @@ snd_nm256_peek_for_sig(nm256_t *chip)
* APM event handler, so the card is properly reinitialized after a power
* event.
*/
-static void nm256_suspend(nm256_t *chip, int can_schedule)
+static void nm256_suspend(nm256_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
@@ -1271,11 +1272,11 @@ static void nm256_suspend(nm256_t *chip, int can_schedule)
snd_power_unlock(card);
}
-static void nm256_resume(nm256_t *chip, int can_schedule)
+static void nm256_resume(nm256_t *chip)
{
snd_card_t *card = chip->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -1295,25 +1296,25 @@ static void nm256_resume(nm256_t *chip, int can_schedule)
static int snd_nm256_suspend(struct pci_dev *dev, u32 state)
{
nm256_t *chip = snd_magic_cast(nm256_t, pci_get_drvdata(dev), return -ENXIO);
- nm256_suspend(chip, 0);
+ nm256_suspend(chip);
return 0;
}
static int snd_nm256_resume(struct pci_dev *dev)
{
nm256_t *chip = snd_magic_cast(nm256_t, pci_get_drvdata(dev), return -ENXIO);
- nm256_resume(chip, 0);
+ nm256_resume(chip);
return 0;
}
#else
static void snd_nm256_suspend(struct pci_dev *dev)
{
nm256_t *chip = snd_magic_cast(nm256_t, pci_get_drvdata(dev), return);
- nm256_suspend(chip, 0);
+ nm256_suspend(chip);
}
static void snd_nm256_resume(struct pci_dev *dev)
{
nm256_t *chip = snd_magic_cast(nm256_t, pci_get_drvdata(dev), return);
- nm256_resume(chip, 0);
+ nm256_resume(chip);
}
#endif
@@ -1325,11 +1326,11 @@ static int snd_nm256_set_power_state(snd_card_t *card, unsigned int power_state)
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- nm256_resume(chip, 1);
+ nm256_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- nm256_suspend(chip, 1);
+ nm256_suspend(chip);
break;
default:
return -EINVAL;
@@ -1354,11 +1355,11 @@ static int snd_nm256_free(nm256_t *chip)
iounmap((void *) chip->buffer);
if (chip->res_cport) {
release_resource(chip->res_cport);
- kfree(chip->res_cport);
+ kfree_nocheck(chip->res_cport);
}
if (chip->res_buffer) {
release_resource(chip->res_buffer);
- kfree(chip->res_buffer);
+ kfree_nocheck(chip->res_buffer);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void*)chip);
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index cfb10c4afb2f..31446b1b52a1 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -27,6 +27,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -835,8 +836,8 @@ snd_rme96_setinputtype(rme96_t *rme96,
RME96_WCR_INP_1;
break;
case RME96_INPUT_XLR:
- if (rme96->pci->device != PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST ||
- rme96->pci->device != PCI_DEVICE_ID_DIGI96_8_PRO ||
+ if ((rme96->pci->device != PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST &&
+ rme96->pci->device != PCI_DEVICE_ID_DIGI96_8_PRO) ||
(rme96->pci->device == PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST &&
rme96->rev > 4))
{
@@ -1561,7 +1562,7 @@ snd_rme96_free(void *private_data)
}
if (rme96->res_port != NULL) {
release_resource(rme96->res_port);
- kfree(rme96->res_port);
+ kfree_nocheck(rme96->res_port);
rme96->res_port = NULL;
}
}
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 8c1424577b16..9d8d1ab49fff 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -24,6 +24,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -49,7 +50,7 @@ MODULE_PARM_DESC(snd_enable, "Enable/disable specific RME96{52,36} soundcards.")
MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
MODULE_PARM(snd_precise_ptr, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_precise_ptr, "Enable precise pointer (doesn't work reliably).");
-MODULE_PARM_SYNTAX(snd_precise_ptr, SNDRV_BOOLEAN_FALSE_DESC);
+MODULE_PARM_SYNTAX(snd_precise_ptr, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
MODULE_AUTHOR("Paul Davis <pbd@op.net>, Winfried Ritsch");
MODULE_DESCRIPTION("RME Digi9652/Digi9636");
MODULE_LICENSE("GPL");
@@ -1849,7 +1850,7 @@ static int snd_rme9652_free(rme9652_t *rme9652)
iounmap((void *) rme9652->iobase);
if (rme9652->res_port) {
release_resource(rme9652->res_port);
- kfree(rme9652->res_port);
+ kfree_nocheck(rme9652->res_port);
}
if (rme9652->irq >= 0)
free_irq(rme9652->irq, (void *)rme9652);
@@ -1911,8 +1912,13 @@ static int __init snd_rme9652_initialize_memory(rme9652_t *rme9652)
rme9652_write(rme9652, RME9652_rec_buffer, cb_bus);
rme9652_write(rme9652, RME9652_play_buffer, pb_bus);
+#if 0 // not all architectures have this macro
rme9652->capture_buffer = bus_to_virt(cb_bus);
rme9652->playback_buffer = bus_to_virt(pb_bus);
+#else
+ rme9652->capture_buffer += cb_bus - cb_addr;
+ rme9652->playback_buffer += pb_bus - pb_addr;
+#endif
return 0;
}
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 3caed229b038..a3316e7caa95 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -26,6 +26,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
@@ -1214,27 +1215,27 @@ static int snd_sonicvibes_free(sonicvibes_t *sonic)
pci_write_config_dword(sonic->pci, 0x48, sonic->dmac_port);
if (sonic->res_sb_port) {
release_resource(sonic->res_sb_port);
- kfree(sonic->res_sb_port);
+ kfree_nocheck(sonic->res_sb_port);
}
if (sonic->res_enh_port) {
release_resource(sonic->res_enh_port);
- kfree(sonic->res_enh_port);
+ kfree_nocheck(sonic->res_enh_port);
}
if (sonic->res_synth_port) {
release_resource(sonic->res_synth_port);
- kfree(sonic->res_synth_port);
+ kfree_nocheck(sonic->res_synth_port);
}
if (sonic->res_midi_port) {
release_resource(sonic->res_midi_port);
- kfree(sonic->res_midi_port);
+ kfree_nocheck(sonic->res_midi_port);
}
if (sonic->res_dmaa) {
release_resource(sonic->res_dmaa);
- kfree(sonic->res_dmaa);
+ kfree_nocheck(sonic->res_dmaa);
}
if (sonic->res_dmac) {
release_resource(sonic->res_dmac);
- kfree(sonic->res_dmac);
+ kfree_nocheck(sonic->res_dmac);
}
if (sonic->irq >= 0)
free_irq(sonic->irq, (void *)sonic);
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index 6ffd36f6d63f..a352379b201a 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -23,6 +23,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/trident.h>
#define SNDRV_GET_ID
@@ -182,25 +183,25 @@ static void __devexit snd_trident_remove(struct pci_dev *pci)
static int snd_card_trident_suspend(struct pci_dev *pci, u32 state)
{
trident_t *chip = snd_magic_cast(trident_t, pci_get_drvdata(pci), return -ENXIO);
- snd_trident_suspend(chip, 0);
+ snd_trident_suspend(chip);
return 0;
}
static int snd_card_trident_resume(struct pci_dev *pci)
{
trident_t *chip = snd_magic_cast(trident_t, pci_get_drvdata(pci), return -ENXIO);
- snd_trident_resume(chip, 0);
+ snd_trident_resume(chip);
return 0;
}
#else
static void snd_card_trident_suspend(struct pci_dev *pci)
{
trident_t *chip = snd_magic_cast(trident_t, pci_get_drvdata(pci), return);
- snd_trident_suspend(chip, 0);
+ snd_trident_suspend(chip);
}
static void snd_card_trident_resume(struct pci_dev *pci)
{
trident_t *chip = snd_magic_cast(trident_t, pci_get_drvdata(pci), return);
- snd_trident_resume(chip, 0);
+ snd_trident_resume(chip);
}
#endif
#endif
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index f7f89b47b690..afeeeb1f1526 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -30,6 +30,8 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -3336,7 +3338,7 @@ int snd_trident_free(trident_t *trident)
free_irq(trident->irq, (void *)trident);
if (trident->res_port) {
release_resource(trident->res_port);
- kfree(trident->res_port);
+ kfree_nocheck(trident->res_port);
}
snd_magic_kfree(trident);
return 0;
@@ -3556,11 +3558,11 @@ void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigne
#ifdef CONFIG_PM
-void snd_trident_suspend(trident_t *trident, int can_schedule)
+void snd_trident_suspend(trident_t *trident)
{
snd_card_t *card = trident->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
snd_pcm_suspend_all(trident->pcm);
@@ -3580,11 +3582,11 @@ void snd_trident_suspend(trident_t *trident, int can_schedule)
snd_power_unlock(card);
}
-void snd_trident_resume(trident_t *trident, int can_schedule)
+void snd_trident_resume(trident_t *trident)
{
snd_card_t *card = trident->card;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
switch (trident->device) {
@@ -3607,11 +3609,11 @@ static int snd_trident_set_power_state(snd_card_t *card, unsigned int power_stat
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- snd_trident_resume(chip, 1);
+ snd_trident_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- snd_trident_suspend(chip, 1);
+ snd_trident_suspend(chip);
break;
default:
return -EINVAL;
diff --git a/sound/pci/trident/trident_memory.c b/sound/pci/trident/trident_memory.c
index c2b8404d8829..8aeea0afa788 100644
--- a/sound/pci/trident/trident_memory.c
+++ b/sound/pci/trident/trident_memory.c
@@ -26,6 +26,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/io.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/trident.h>
@@ -64,6 +65,7 @@
#define get_aligned_page(offset) ((offset) >> 13)
#define aligned_page_offset(page) ((page) << 13)
#define page_to_ptr(trident,page) __tlb_to_ptr(trident, (page) << 1)
+#define page_to_addr(trident,page) __tlb_to_addr(trident, (page) << 1)
/* fill TLB entries -- we need to fill two entries */
static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr, dma_addr_t addr)
diff --git a/sound/pci/trident/trident_synth.c b/sound/pci/trident/trident_synth.c
index a9e5a64e366f..4c3d3539743b 100644
--- a/sound/pci/trident/trident_synth.c
+++ b/sound/pci/trident/trident_synth.c
@@ -22,6 +22,7 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/trident.h>
#include <sound/seq_device.h>
diff --git a/sound/pci/via686.c b/sound/pci/via686.c
index 9b4e50e3292c..9378a6adf003 100644
--- a/sound/pci/via686.c
+++ b/sound/pci/via686.c
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
@@ -44,7 +45,6 @@ static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static long snd_mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
-static int snd_joystick[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
static int snd_ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
@@ -62,9 +62,6 @@ MODULE_PARM_SYNTAX(snd_mpu_port, SNDRV_PORT_DESC);
MODULE_PARM(snd_ac97_clock, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_ac97_clock, "AC'97 codec clock (default 48000Hz).");
MODULE_PARM_SYNTAX(snd_ac97_clock, SNDRV_ENABLED ",default:48000");
-MODULE_PARM(snd_joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
-MODULE_PARM_DESC(snd_joystick, "Joystick support.");
-MODULE_PARM_SYNTAX(snd_joystick, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
/*
* Direct registers
@@ -823,6 +820,53 @@ static int __devinit snd_via686a_mixer(via686a_t *chip)
}
/*
+ * joystick
+ */
+
+static int snd_via686a_joystick_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int snd_via686a_joystick_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ via686a_t *chip = snd_kcontrol_chip(kcontrol);
+ u16 val;
+
+ pci_read_config_word(chip->pci, 0x42, &val);
+ ucontrol->value.integer.value[0] = (val & 0x08) ? 1 : 0;
+ return 0;
+}
+
+static int snd_via686a_joystick_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ via686a_t *chip = snd_kcontrol_chip(kcontrol);
+ u16 val, oval;
+
+ pci_read_config_word(chip->pci, 0x42, &oval);
+ val = oval & ~0x08;
+ if (ucontrol->value.integer.value[0])
+ val |= 0x08;
+ if (val != oval) {
+ pci_write_config_word(chip->pci, 0x42, val);
+ return 1;
+ }
+ return 0;
+}
+
+static snd_kcontrol_new_t snd_via686a_joystick_control __devinitdata = {
+ name: "Joystick",
+ iface: SNDRV_CTL_ELEM_IFACE_CARD,
+ info: snd_via686a_joystick_info,
+ get: snd_via686a_joystick_get,
+ put: snd_via686a_joystick_put,
+};
+
+/*
*
*/
@@ -947,7 +991,7 @@ static int snd_via686a_free(via686a_t *chip)
snd_free_pci_pages(chip->pci, 3 * sizeof(unsigned int) * VIA_MAX_FRAGS * 2, chip->tables, chip->tables_addr);
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
@@ -1094,8 +1138,9 @@ static int __devinit snd_via686a_probe(struct pci_dev *pci,
#endif
legacy |= 0x40; /* disable MIDI */
+ legacy &= ~0x08; /* disable joystick */
if (chip->revision >= 0x20) {
- if (snd_joystick[dev] > 0 || check_region(pci_resource_start(pci, 2), 4)) {
+ if (check_region(pci_resource_start(pci, 2), 4)) {
rev_h = 0;
legacy &= ~0x80; /* disable PCI I/O 2 */
} else {
@@ -1105,9 +1150,6 @@ static int __devinit snd_via686a_probe(struct pci_dev *pci,
}
pci_write_config_byte(pci, 0x42, legacy);
pci_write_config_byte(pci, 0x43, legacy_cfg);
- if (snd_joystick[dev] > 0) {
- legacy |= 8;
- }
if (rev_h && snd_mpu_port[dev] >= 0x200) { /* force MIDI */
legacy |= 0x02; /* enable MPU */
pci_write_config_dword(pci, 0x18, (snd_mpu_port[dev] & 0xfffc) | 0x01);
@@ -1156,6 +1198,13 @@ static int __devinit snd_via686a_probe(struct pci_dev *pci,
;
}
+ /* card switches */
+ err = snd_ctl_add(card, snd_ctl_new1(&snd_via686a_joystick_control, chip));
+ if (err < 0) {
+ snd_card_free(card);
+ return err;
+ }
+
strcpy(card->driver, "VIA686A");
strcpy(card->shortname, "VIA 82C686A/B");
@@ -1208,7 +1257,7 @@ module_exit(alsa_card_via686a_exit)
#ifndef MODULE
/* format is: snd-via686a=snd_enable,snd_index,snd_id,
- snd_mpu_port,snd_joystick,snd_ac97_clock */
+ snd_mpu_port,snd_ac97_clock */
static int __init alsa_card_via686a_setup(char *str)
{
@@ -1220,7 +1269,6 @@ static int __init alsa_card_via686a_setup(char *str)
get_option(&str,&snd_index[nr_dev]) == 2 &&
get_id(&str,&snd_id[nr_dev]) == 2 &&
get_option(&str,(int *)&snd_mpu_port[nr_dev]) == 2 &&
- get_option(&str,&snd_joystick[nr_dev]) == 2 &&
get_option(&str,&snd_ac97_clock[nr_dev]) == 2);
nr_dev++;
return 1;
diff --git a/sound/pci/via8233.c b/sound/pci/via8233.c
index ecfbe55d83b1..7ee583aa0b85 100644
--- a/sound/pci/via8233.c
+++ b/sound/pci/via8233.c
@@ -25,6 +25,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
@@ -713,7 +714,7 @@ static int snd_via8233_free(via8233_t *chip)
chip->tables_addr);
if (chip->res_port) {
release_resource(chip->res_port);
- kfree(chip->res_port);
+ kfree_nocheck(chip->res_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 391fa6320ad0..66c2059f9da3 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -20,8 +20,8 @@
*/
#include <sound/driver.h>
-#include <linux/reboot.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/ymfpci.h>
#include <sound/mpu401.h>
@@ -47,7 +47,6 @@ static char *snd_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static long snd_fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
static long snd_mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
-static long snd_joystick_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1 };
MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(snd_index, "Index value for the Yamaha DS-XG PCI soundcard.");
@@ -64,9 +63,6 @@ MODULE_PARM_SYNTAX(snd_mpu_port, SNDRV_ENABLED);
MODULE_PARM(snd_fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(snd_fm_port, "FM OPL-3 Port.");
MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_ENABLED);
-MODULE_PARM(snd_joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
-MODULE_PARM_DESC(snd_joystick_port, "Joystick Port.");
-MODULE_PARM_SYNTAX(snd_joystick_port, SNDRV_ENABLED);
static struct pci_device_id snd_ymfpci_ids[] __devinitdata = {
{ 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */
@@ -133,15 +129,6 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
pci_write_config_word(pci, PCIR_DSXG_MPU401BASE, snd_mpu_port[dev]);
snd_printd("MPU401 supported on 0x%lx\n", snd_mpu_port[dev]);
}
- if (snd_joystick_port[dev] < 0)
- snd_joystick_port[dev] = pci_resource_start(pci, 2);
- else if (check_region(snd_joystick_port[dev], 4))
- snd_joystick_port[dev] = -1;
- if (snd_joystick_port[dev] >= 0) {
- snd_printd("joystick supported on 0x%lx\n", snd_joystick_port[dev]);
- legacy_ctrl |= 4;
- pci_write_config_word(pci, PCIR_DSXG_JOYBASE, snd_joystick_port[dev]);
- }
} else {
switch (snd_fm_port[dev]) {
case 0x388: legacy_ctrl2 |= 0; break;
@@ -170,29 +157,15 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
legacy_ctrl2 &= ~(3 << 4);
snd_mpu_port[dev] = -1;
}
- switch (snd_joystick_port[dev]) {
- case 0x201: legacy_ctrl2 |= 0 << 6; break;
- case 0x202: legacy_ctrl2 |= 1 << 6; break;
- case 0x204: legacy_ctrl2 |= 2 << 6; break;
- case 0x205: legacy_ctrl2 |= 3 << 6; break;
- default: snd_joystick_port[dev] = -1; break;
- }
- if (snd_joystick_port[dev] > 0 && check_region(snd_joystick_port[dev], 2) == 0) {
- legacy_ctrl |= 4;
- snd_printd("joystick supported on 0x%lx\n", snd_joystick_port[dev]);
- } else {
- legacy_ctrl2 &= ~(3 << 6);
- snd_joystick_port[dev] = -1;
- }
}
if (snd_mpu_port[dev] > 0) {
legacy_ctrl |= 0x10; /* MPU401 irq enable */
legacy_ctrl2 |= 1 << 15; /* IMOD */
}
pci_read_config_word(pci, PCIR_DSXG_LEGACY, &old_legacy_ctrl);
- snd_printdd("legacy_ctrl = 0x%x\n", legacy_ctrl);
+ //snd_printdd("legacy_ctrl = 0x%x\n", legacy_ctrl);
pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl);
- snd_printdd("legacy_ctrl2 = 0x%x\n", legacy_ctrl2);
+ //snd_printdd("legacy_ctrl2 = 0x%x\n", legacy_ctrl2);
pci_write_config_word(pci, PCIR_DSXG_ELEGACY, legacy_ctrl2);
if ((err = snd_ymfpci_create(card, pci,
old_legacy_ctrl,
@@ -224,8 +197,10 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_YMFPCI,
snd_mpu_port[dev], 0,
pci->irq, 0, &chip->rawmidi)) < 0) {
- snd_card_free(card);
- return err;
+ printk(KERN_INFO "ymfpci: cannot initialize MPU401 at 0x%lx, skipping...\n", snd_mpu_port[dev]);
+ } else {
+ legacy_ctrl &= ~0x10; /* disable MPU401 irq */
+ pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl);
}
}
if (snd_fm_port[dev] > 0) {
@@ -233,13 +208,15 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
snd_fm_port[dev],
snd_fm_port[dev] + 2,
OPL3_HW_OPL3, 0, &opl3)) < 0) {
+ printk(KERN_INFO "ymfpci: cannot initialize FM OPL3 at 0x%lx, skipping...\n", snd_fm_port[dev]);
+ } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
snd_card_free(card);
+ snd_printk("cannot create opl3 hwdep\n");
return err;
}
- if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
- snd_card_free(card);
- return err;
- }
+ }
+ if ((err = snd_ymfpci_joystick(chip)) < 0) {
+ printk(KERN_INFO "ymfpci: cannot initialize joystick, skipping...\n");
}
strcpy(card->driver, str);
sprintf(card->shortname, "Yamaha DS-XG PCI (%s)", str);
@@ -262,25 +239,25 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
static int snd_card_ymfpci_suspend(struct pci_dev *pci, u32 state)
{
ymfpci_t *chip = snd_magic_cast(ymfpci_t, pci_get_drvdata(pci), return -ENXIO);
- snd_ymfpci_suspend(chip, 0);
+ snd_ymfpci_suspend(chip);
return 0;
}
static int snd_card_ymfpci_resume(struct pci_dev *pci)
{
ymfpci_t *chip = snd_magic_cast(ymfpci_t, pci_get_drvdata(pci), return -ENXIO);
- snd_ymfpci_resume(chip, 0);
+ snd_ymfpci_resume(chip);
return 0;
}
#else
static void snd_card_ymfpci_suspend(struct pci_dev *pci)
{
ymfpci_t *chip = snd_magic_cast(ymfpci_t, pci_get_drvdata(pci), return);
- snd_ymfpci_suspend(chip, 0);
+ snd_ymfpci_suspend(chip);
}
static void snd_card_ymfpci_resume(struct pci_dev *pci)
{
ymfpci_t *chip = snd_magic_cast(ymfpci_t, pci_get_drvdata(pci), return);
- snd_ymfpci_resume(chip, 0);
+ snd_ymfpci_resume(chip);
}
#endif
#endif
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 7b2c5dd15db3..4c6dd27f3306 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -29,6 +29,7 @@
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
@@ -1508,6 +1509,124 @@ int __devinit snd_ymfpci_mixer(ymfpci_t *chip)
return 0;
}
+
+/*
+ * joystick support
+ */
+
+static int ymfpci_joystick_ports[4] = {
+ 0x201, 0x202, 0x204, 0x205
+};
+
+static void setup_joystick_base(ymfpci_t *chip)
+{
+ if (chip->pci->device >= 0x0010) /* YMF 744/754 */
+ pci_write_config_word(chip->pci, PCIR_DSXG_JOYBASE,
+ ymfpci_joystick_ports[chip->joystick_port]);
+ else {
+ u16 legacy_ctrl2;
+ pci_read_config_word(chip->pci, PCIR_DSXG_ELEGACY, &legacy_ctrl2);
+ legacy_ctrl2 &= ~(3 << 6);
+ legacy_ctrl2 |= chip->joystick_port << 6;
+ pci_write_config_word(chip->pci, PCIR_DSXG_ELEGACY, legacy_ctrl2);
+ }
+}
+
+static int snd_ymfpci_joystick_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int snd_ymfpci_joystick_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
+ u16 val;
+
+ pci_read_config_word(chip->pci, PCIR_DSXG_LEGACY, &val);
+ ucontrol->value.integer.value[0] = (val & 0x04) ? 1 : 0;
+ return 0;
+}
+
+static int snd_ymfpci_joystick_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
+ u16 val, oval;
+
+ pci_read_config_word(chip->pci, PCIR_DSXG_LEGACY, &oval);
+ val = oval & ~0x04;
+ if (ucontrol->value.integer.value[0])
+ val |= 0x04;
+ if (val != oval) {
+ setup_joystick_base(chip);
+ pci_write_config_word(chip->pci, PCIR_DSXG_LEGACY, val);
+ return 1;
+ }
+ return 0;
+}
+
+static int snd_ymfpci_joystick_addr_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+ uinfo->count = 1;
+ uinfo->value.enumerated.items = 4;
+ if (uinfo->value.enumerated.item >= 4)
+ uinfo->value.enumerated.item = 3;
+ sprintf(uinfo->value.enumerated.name, "port 0x%x", ymfpci_joystick_ports[uinfo->value.enumerated.item]);
+ return 0;
+}
+
+static int snd_ymfpci_joystick_addr_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
+ ucontrol->value.integer.value[0] = chip->joystick_port;
+ return 0;
+}
+
+static int snd_ymfpci_joystick_addr_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ymfpci_t *chip = snd_kcontrol_chip(kcontrol);
+ if (ucontrol->value.integer.value[0] != chip->joystick_port) {
+ snd_assert(ucontrol->value.integer.value[0] >= 0 && ucontrol->value.integer.value[0] < 4, return -EINVAL);
+ chip->joystick_port = ucontrol->value.integer.value[0];
+ setup_joystick_base(chip);
+ return 1;
+ }
+ return 0;
+}
+
+static snd_kcontrol_new_t snd_ymfpci_control_joystick __devinitdata = {
+ name: "Joystick",
+ iface: SNDRV_CTL_ELEM_IFACE_CARD,
+ info: snd_ymfpci_joystick_info,
+ get: snd_ymfpci_joystick_get,
+ put: snd_ymfpci_joystick_put,
+};
+
+static snd_kcontrol_new_t snd_ymfpci_control_joystick_addr __devinitdata = {
+ name: "Joystick Address",
+ iface: SNDRV_CTL_ELEM_IFACE_CARD,
+ info: snd_ymfpci_joystick_addr_info,
+ get: snd_ymfpci_joystick_addr_get,
+ put: snd_ymfpci_joystick_addr_put,
+};
+
+int __devinit snd_ymfpci_joystick(ymfpci_t *chip)
+{
+ int err;
+
+ chip->joystick_port = 0; /* default */
+ if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_control_joystick, chip))) < 0)
+ return err;
+ if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_control_joystick_addr, chip))) < 0)
+ return err;
+ return 0;
+}
+
+
/*
* proc interface
*/
@@ -1765,7 +1884,7 @@ static int snd_ymfpci_free(ymfpci_t *chip)
free_irq(chip->irq, (void *)chip);
if (chip->res_reg_area) {
release_resource(chip->res_reg_area);
- kfree(chip->res_reg_area);
+ kfree_nocheck(chip->res_reg_area);
}
pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);
@@ -1809,12 +1928,12 @@ static int saved_regs_index[] = {
};
#define YDSXGR_NUM_SAVED_REGS (sizeof(saved_regs_index)/sizeof(saved_regs_index[0]))
-void snd_ymfpci_suspend(ymfpci_t *chip, int can_schedule)
+void snd_ymfpci_suspend(ymfpci_t *chip)
{
snd_card_t *card = chip->card;
int i;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
snd_pcm_suspend_all(chip->pcm);
@@ -1831,12 +1950,12 @@ void snd_ymfpci_suspend(ymfpci_t *chip, int can_schedule)
snd_power_unlock(card);
}
-void snd_ymfpci_resume(ymfpci_t *chip, int can_schedule)
+void snd_ymfpci_resume(ymfpci_t *chip)
{
snd_card_t *card = chip->card;
int i;
- snd_power_lock(card, can_schedule);
+ snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -1873,11 +1992,11 @@ static int snd_ymfpci_set_power_state(snd_card_t *card, unsigned int power_state
case SNDRV_CTL_POWER_D0:
case SNDRV_CTL_POWER_D1:
case SNDRV_CTL_POWER_D2:
- snd_ymfpci_resume(chip, 1);
+ snd_ymfpci_resume(chip);
break;
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
- snd_ymfpci_suspend(chip, 1);
+ snd_ymfpci_suspend(chip);
break;
default:
return -EINVAL;
diff --git a/sound/ppc/Config.in b/sound/ppc/Config.in
index e90ff1c4dc3e..0a9cb4ed8ad9 100644
--- a/sound/ppc/Config.in
+++ b/sound/ppc/Config.in
@@ -1,3 +1,8 @@
# ALSA PowerMac drivers
+mainmenu_option next_comment
+comment 'ALSA PowerMac devices'
+
dep_tristate 'PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)' CONFIG_SND_POWERMAC $CONFIG_SND
+
+endmenu
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c
index 61ef39258717..b2a0389d62b8 100644
--- a/sound/ppc/awacs.c
+++ b/sound/ppc/awacs.c
@@ -357,9 +357,11 @@ snd_pmac_awacs_init(pmac_t *chip)
snd_pmac_awacs_write_reg(chip, 7, 0);
}
+#ifdef CONFIG_PMAC_PBOOK
/* Recalibrate chip */
if (chip->model == PMAC_SCREAMER)
screamer_recalibrate(chip);
+#endif
if (chip->model <= PMAC_SCREAMER && chip->revision == 0) {
chip->revision =
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index c4a7a4a1f4a6..36ca68f07ff4 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -24,6 +24,7 @@
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/init.h>
+#include <linux/delay.h>
#include <sound/core.h>
#include "pmac.h"
#include <sound/pcm_params.h>
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 541b09e73368..68b9283d9387 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -22,6 +22,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/delay.h>
#include <sound/core.h>
#include "pmac.h"
diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c
index ba69e8fa15e8..0189dafe6ac2 100644
--- a/sound/synth/emux/emux.c
+++ b/sound/synth/emux/emux.c
@@ -18,6 +18,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 <sound/core.h>
#include <sound/emux_synth.h>
#include <linux/init.h>
#include "emux_voice.h"
diff --git a/sound/synth/emux/emux_effect.c b/sound/synth/emux/emux_effect.c
index 769d2dd02479..deceab647a08 100644
--- a/sound/synth/emux/emux_effect.c
+++ b/sound/synth/emux/emux_effect.c
@@ -24,6 +24,7 @@
#define __NO_VERSION__
#include "emux_voice.h"
+#include <linux/slab.h>
#ifdef SNDRV_EMUX_USE_RAW_EFFECT
/*
diff --git a/sound/synth/emux/emux_proc.c b/sound/synth/emux/emux_proc.c
index 5578a53cfe4e..7b8576d36a4b 100644
--- a/sound/synth/emux/emux_proc.c
+++ b/sound/synth/emux/emux_proc.c
@@ -19,6 +19,11 @@
*/
#define __NO_VERSION__
+#include <sound/driver.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <sound/core.h>
#include <sound/emux_synth.h>
#include <sound/info.h>
#include "emux_voice.h"
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index 3ba03d03ac9f..df2b772f0c6e 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -21,6 +21,7 @@
#define __NO_VERSION__
#include "emux_voice.h"
+#include <linux/slab.h>
/* Prototypes for static functions */
diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c
index cf2f34ac3e18..7c4a972e5b74 100644
--- a/sound/synth/emux/emux_synth.c
+++ b/sound/synth/emux/emux_synth.c
@@ -540,11 +540,13 @@ update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update)
}
+#if 0 // not used
/* table for volume target calculation */
static unsigned short voltarget[16] = {
0xEAC0, 0xE0C8, 0xD740, 0xCE20, 0xC560, 0xBD08, 0xB500, 0xAD58,
0xA5F8, 0x9EF0, 0x9830, 0x91C0, 0x8B90, 0x85A8, 0x8000, 0x7A90
};
+#endif
#define LO_BYTE(v) ((v) & 0xff)
#define HI_BYTE(v) (((v) >> 8) & 0xff)
diff --git a/sound/synth/emux/emux_voice.h b/sound/synth/emux/emux_voice.h
index cf81f6dbfcaa..5876a834d0a7 100644
--- a/sound/synth/emux/emux_voice.h
+++ b/sound/synth/emux/emux_voice.h
@@ -22,6 +22,10 @@
* 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 <sound/core.h>
#include <sound/emux_synth.h>
/* Prototypes for emux_seq.c */
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 896b756348f6..1018b033a602 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -28,6 +28,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/uaccess.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/soundfont.h>
diff --git a/sound/synth/util_mem.c b/sound/synth/util_mem.c
index 39cb093ad1d4..00679af00a90 100644
--- a/sound/synth/util_mem.c
+++ b/sound/synth/util_mem.c
@@ -20,6 +20,7 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/util_mem.h>