#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
#else
#error "Unsupported endian..."
#endif
-#endif
+
+#endif /* __KERNEL **/
+
+#endif /* LINUX */
+
#ifndef __KERNEL__
#include <sys/time.h>
#include <sys/types.h>
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
};
#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)
{
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
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);
#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);
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 */
* 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"
* 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"
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) */
/* 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);
*/
#include "driver.h"
+#include <linux/time.h>
#include "core.h"
#include "hwdep.h"
#include "timer.h"
#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,
*
*/
+#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,
* 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;
/* 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 */
/* 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)"
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
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;
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;
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;
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
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 {
} 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
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'.
*/
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;
struct resource *res_reg_area;
unsigned short old_legacy_ctrl;
+ unsigned int joystick_port;
void *work_ptr;
dma_addr_t work_ptr_addr;
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 */
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
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
fi
-if [ "$CONFIG_SND" != "n" -a "$CONFIG_ISA" == "y" ]; then
+if [ "$CONFIG_SND" != "n" -a "$CONFIG_ISA" = "y" ]; then
source sound/isa/Config.in
fi
-if [ "$CONFIG_SND" != "n" -a "$CONFIG_PCI" == "y" ]; then
+if [ "$CONFIG_SND" != "n" -a "$CONFIG_PCI" = "y" ]; then
source sound/pci/Config.in
fi
-if [ "$CONFIG_SND" != "n" -a "$CONFIG_PPC" == "y" ]; then
+if [ "$CONFIG_SND" != "n" -a "$CONFIG_PPC" = "y" ]; then
source sound/ppc/Config.in
fi
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 \
# 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
#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>
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;
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);
#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,
*/
#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>
#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>
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);
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
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
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
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;
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)"
#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>
#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>
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 */
#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;
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 */
*/
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;
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);
#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>
#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);
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;
}
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;
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
#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)
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
#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>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include "pcm_plugin.h"
#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>
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);
}
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 */
#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"
#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
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;
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;
#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"
};
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;
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;
#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>
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)
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;
}
#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>
#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.");
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);
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
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
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,
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;
}
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
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
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#define bswap_16 swab16
#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>
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);
{
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);
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:
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
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:
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
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:
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
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:
goto _end;
}
spin_unlock_irq(&runtime->lock);
- snd_power_wait(card, 1);
+ snd_power_wait(card);
spin_lock_irq(&runtime->lock);
}
/* Fall through */
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;
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;
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/timer.h>
#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>
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/timer.h>
#include <sound/info.h>
#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>
#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>
#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>
#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>
#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>
#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>
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;
goto __skip;
}
- direct = snd_seq_ev_is_direct(event);
-
/* expand the quoted event */
if (event->type == SNDRV_SEQ_EVENT_KERNEL_QUOTE) {
quoted = 1;
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);
#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");
#define __NO_VERSION__
#include <sound/driver.h>
#include <sound/core.h>
+#include <linux/slab.h>
#include "seq_fifo.h"
#include "seq_lock.h"
#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>
#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;
#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>
#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>
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 */
#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>
*/
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/seq_kernel.h>
#include <sound/seq_midi_event.h>
#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"
#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"
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include "seq_memory.h"
#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"
#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>
#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>
}
#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();
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);
#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>
#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>
# 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
#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>
#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
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/mpu401.h>
free_irq(mpu->irq, (void *) mpu);
if (mpu->res) {
release_resource(mpu->res);
- kfree(mpu->res);
+ kfree_nocheck(mpu->res);
}
snd_magic_kfree(mpu);
}
#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>
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
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);
#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");
{
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;
#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);
#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
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;
#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>
*/
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/i2c.h>
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/tea6330t.h>
# 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
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
+ 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
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
#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>
#include <asm/dma.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ad1816a.h>
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);
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);
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;
}
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;
}
{
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);
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)
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",
*/
#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
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/delay.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ad1848.h>
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);
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);
{
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);
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)
#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>
#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>
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/ad1848.h>
#include <sound/sb.h>
#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>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/cs4231.h>
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));
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);
{
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);
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)
#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>
#endif
if (acard->res_sb_port) {
release_resource(acard->res_sb_port);
- kfree(acard->res_sb_port);
+ kfree_nocheck(acard->res_sb_port);
}
}
}
#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>
#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>
#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>
#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>
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));
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));
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);
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;
}
#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>
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
#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
(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;
}
(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;
}
(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;
}
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);
}
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",
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/dma.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/gus.h>
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)
{
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
}
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);
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;
}
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#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>
__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);
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
#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>
#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>
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;
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;
}
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;
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) {
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include "gus_tables.h"
#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>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/gus.h>
#define __GUS_TABLES_ALLOC__
#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
#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>
#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>
#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>
#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)
#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>
/* 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;
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;
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;
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;
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;
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>
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);
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);
{
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);
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)
#endif /* __ISAPNP__ */
if (chip->res_mc_base) {
release_resource(chip->res_mc_base);
- kfree(chip->res_mc_base);
+ kfree_nocheck(chip->res_mc_base);
}
}
}
*/
#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>
{
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;
* 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>
#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>
#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>
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);
#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>
#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', ' ')
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);
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);
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);
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;
}
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;
}
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;
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) */
udelay (10);
}
if (status != 0x55) {
- snd_printd(__FUNCTION__ ": Microcode initialization failed\n");
+ snd_printd("%s: Microcode initialization failed\n", __FUNCTION__);
goto __fail;
}
} else {
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;
}
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;
#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>
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);
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);
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;
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/opl3.h>
return;
if (acard->fm_res) {
release_resource(acard->fm_res);
- kfree(acard->fm_res);
+ kfree_nocheck(acard->fm_res);
}
}
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
/* 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);
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;
}
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;
}
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;
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/io.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/sb.h>
#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>
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;
}
return val;
}
}
- snd_printd(__FUNCTION__ " [0x%lx]: timeout\n", chip->port);
+ snd_printd("%s [0x%lx]: timeout\n", __FUNCTION__, chip->port);
return -ENODEV;
}
else
break;
}
- snd_printdd(__FUNCTION__ " [0x%lx] failed...\n", chip->port);
+ snd_printdd("%s [0x%lx] failed...\n", __FUNCTION__, chip->port);
return -ENODEV;
}
{
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);
#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>
#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>
#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>
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.");
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;
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) {
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);
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");
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;
}
#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);
#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;
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],
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)
{
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;
}
/*
- * 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
#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}");
/* 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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
#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 <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>
static int
wavefront_send_sample (snd_wavefront_t *dev,
wavefront_patch_info *header,
- UINT16 *dataptr,
+ u16 *dataptr,
int data_is_unsigned)
{
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;
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
***********************************************************************/
static void
-process_sample_hdr (UCHAR8 *buf)
+process_sample_hdr (u8 *buf)
{
wavefront_sample s;
- UCHAR8 *ptr;
+ u8 *ptr;
ptr = 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;
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;
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)
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);
#include <sound/driver.h>
#include <sound/core.h>
-#ifndef MODULE
-
static int __init alsa_sound_last_init(void)
{
int idx, ok = 0;
return 0;
}
-module_init(alsa_sound_last_init)
-
-#endif /* MODULE */
+__initcall(alsa_sound_last_init);
# 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
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
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
#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>
#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>
#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>
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)
#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>
sizeof( snd_card_als4000_t ) );
if (card == NULL) {
release_resource(res_gcr_port);
- kfree(res_gcr_port);
+ kfree_nocheck(res_gcr_port);
return -ENOMEM;
}
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;
}
#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>
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
}
if (cm->res_iobase) {
release_resource(cm->res_iobase);
- kfree(cm->res_iobase);
+ kfree_nocheck(cm->res_iobase);
}
snd_magic_kfree(cm);
return 0;
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);
#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>
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);
*/
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/cs46xx.h>
#define SNDRV_GET_ID
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 */
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
#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>
*/
#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
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
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
iounmap((void *) region->remap_addr);
if (region->resource) {
release_resource(region->resource);
- kfree(region->resource);
+ kfree_nocheck(region->resource);
}
}
if (chip->irq >= 0)
* 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);
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;
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;
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define SNDRV_GET_ID
/* 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 */
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) {
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)
#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>
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);
*/
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1_synth.h>
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/delay.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#define __NO_VERSION__
#include <sound/driver.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
#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>
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;
}
#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);
#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>
#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);
#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>
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};
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}}");
struct snd_es1968 {
/* Module Config */
- int midi_enabled; /* bool */
-
int total_bufsize; /* in bytes */
int playback_streams, capture_streams;
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)
/* 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);
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;
}
/* 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;
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.. */
}
up(&chip->memory_mutex);
if (max_size >= 128*1024)
- max_size = 128*1024 - 2;
+ max_size = 127*1024;
return max_size;
}
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);
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);
} 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);
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);
/*
/*
* 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;
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;
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
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;
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);
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,
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;
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
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],
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 */
}
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);
#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
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);
#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>
__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);
#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>
"{TerraTec,EWX 24/96},"
"{TerraTec,EWS 88MT},"
"{TerraTec,EWS 88D},"
+ "{TerraTec,DMX 6Fire},"
"{ICEnsemble,Generic ICE1712},"
"{ICEnsemble,Generic Envy24}}");
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
err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_6fire_led, ice));
if (err < 0)
return err;
- break;
#endif
+ break;
}
return 0;
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;
#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>
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.");
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
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;
int multi4: 1,
multi6: 1;
+ int in_ac97_init: 1;
ac97_t *ac97;
ac97_t *ac97sec;
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;
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);
}
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;
}
}
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;
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);
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)
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;
(chip->ac97sec && (chip->ac97sec->scaps & AC97_SCAP_CENTER_LFE_DAC)))
chip->multi6 = 1;
}
+ chip->in_ac97_init = 0;
return 0;
}
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);
/*
* 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;
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;
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
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;
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;
}
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);
}
}
static snd_device_ops_t ops = {
dev_free: snd_intel8x0_dev_free,
};
+ char name[32];
*r_intel8x0 = NULL;
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;
/* 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);
{ 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 },
};
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;
}
}
- 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) {
#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>
#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
KorgAudioBuffer playDataBufs[kNumBuffers];
KorgAudioBuffer recordDataBufs[kNumBuffers];
#endif
- u16 volumeData[kAudioChannels];
+ short volumeData[kAudioChannels];
u32 cardCommand;
u16 routeData [kAudioChannels];
u32 AdatTimeCode; // ADAT timecode value
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);
// ------------------------------------------------------------------------
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;
// ------------------------------------------------------------------------
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++;
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,
};
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,
};
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])
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);
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);
snd_korg1212_SetupForPlay(korg1212);
- korg1212->currentBuffer = kNumBuffers;
+ korg1212->currentBuffer = -1;
spin_unlock_irqrestore(&korg1212->lock, flags);
return 0;
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) {
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);
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;
}
{
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);
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;
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;
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);
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;
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;
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);
{
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;
{
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;
}
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",
{
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,
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;
}
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;
}
#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>
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);
*/
#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;
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;
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
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;
#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>
* 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;
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;
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
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;
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);
#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>
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))
{
}
if (rme96->res_port != NULL) {
release_resource(rme96->res_port);
- kfree(rme96->res_port);
+ kfree_nocheck(rme96->res_port);
rme96->res_port = NULL;
}
}
#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>
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");
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);
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;
}
#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>
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);
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/trident.h>
#define SNDRV_GET_ID
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
#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>
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;
#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);
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) {
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;
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/io.h>
+#include <linux/time.h>
#include <sound/core.h>
#include <sound/trident.h>
#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)
#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>
#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>
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");
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
}
/*
+ * 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,
+};
+
+/*
*
*/
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);
#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 {
}
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);
;
}
+ /* 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");
#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)
{
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;
#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>
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);
*/
#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>
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.");
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 */
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;
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,
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) {
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);
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
#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>
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
*/
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);
};
#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);
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;
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;
# 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
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 =
#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>
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/delay.h>
#include <sound/core.h>
#include "pmac.h"
* 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"
#define __NO_VERSION__
#include "emux_voice.h"
+#include <linux/slab.h>
#ifdef SNDRV_EMUX_USE_RAW_EFFECT
/*
*/
#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"
#define __NO_VERSION__
#include "emux_voice.h"
+#include <linux/slab.h>
/* Prototypes for static functions */
}
+#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)
* 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 */
#define __NO_VERSION__
#include <sound/driver.h>
#include <asm/uaccess.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/soundfont.h>
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/slab.h>
#include <sound/core.h>
#include <sound/util_mem.h>