Commit b8877144 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-sound.bkbits.net/linux-sound

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 975d6b21 8d6ff919
...@@ -129,7 +129,7 @@ enum { ...@@ -129,7 +129,7 @@ enum {
* * * *
*****************************************************************************/ *****************************************************************************/
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2) #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3)
typedef unsigned long sndrv_pcm_uframes_t; typedef unsigned long sndrv_pcm_uframes_t;
typedef long sndrv_pcm_sframes_t; typedef long sndrv_pcm_sframes_t;
...@@ -423,6 +423,7 @@ enum { ...@@ -423,6 +423,7 @@ enum {
SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct sndrv_pcm_sw_params), SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct sndrv_pcm_sw_params),
SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status), SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status),
SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t), SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t),
SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22),
SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info), SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info),
SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40), SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40),
SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41), SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41),
......
...@@ -225,7 +225,6 @@ int snd_minor_info_oss_init(void); ...@@ -225,7 +225,6 @@ int snd_minor_info_oss_init(void);
int snd_minor_info_oss_done(void); int snd_minor_info_oss_done(void);
int snd_oss_init_module(void); int snd_oss_init_module(void);
void snd_oss_cleanup_module(void);
#endif #endif
......
...@@ -164,7 +164,7 @@ static inline int snd_info_card_unregister(snd_card_t * card) { return 0; } ...@@ -164,7 +164,7 @@ static inline int snd_info_card_unregister(snd_card_t * card) { return 0; }
static inline int snd_info_register(snd_info_entry_t * entry) { return 0; } static inline int snd_info_register(snd_info_entry_t * entry) { return 0; }
static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; } static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; }
static inline struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) { return 0; } static inline struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) { return NULL; }
static inline void snd_remove_proc_entry(struct proc_dir_entry *parent, static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de) { ; } struct proc_dir_entry *de) { ; }
...@@ -174,7 +174,7 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent, ...@@ -174,7 +174,7 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
* OSS info part * OSS info part
*/ */
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
#define SNDRV_OSS_INFO_DEV_AUDIO 0 #define SNDRV_OSS_INFO_DEV_AUDIO 0
#define SNDRV_OSS_INFO_DEV_SYNTH 1 #define SNDRV_OSS_INFO_DEV_SYNTH 1
...@@ -187,6 +187,6 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent, ...@@ -187,6 +187,6 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
extern int snd_oss_info_register(int dev, int num, char *string); extern int snd_oss_info_register(int dev, int num, char *string);
#define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL) #define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL)
#endif /* CONFIG_SND_OSSEMUL */ #endif /* CONFIG_SND_OSSEMUL && CONFIG_PROC_FS */
#endif /* __SOUND_INFO_H */ #endif /* __SOUND_INFO_H */
/* include/version.h. Generated automatically by configure. */ /* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc3" #define CONFIG_SND_VERSION "0.9.0rc3"
#define CONFIG_SND_DATE " (Fri Oct 04 13:09:13 2002 UTC)" #define CONFIG_SND_DATE " (Mon Oct 14 16:41:26 2002 UTC)"
...@@ -426,52 +426,59 @@ static int snd_ctl_elem_info(snd_ctl_file_t *ctl, snd_ctl_elem_info_t *_info) ...@@ -426,52 +426,59 @@ static int snd_ctl_elem_info(snd_ctl_file_t *ctl, snd_ctl_elem_info_t *_info)
static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *_control) static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *_control)
{ {
snd_ctl_elem_value_t control; snd_ctl_elem_value_t *control;
snd_kcontrol_t *kctl; snd_kcontrol_t *kctl;
int result, indirect; int result, indirect;
if (copy_from_user(&control, _control, sizeof(control))) control = kmalloc(sizeof(*control), GFP_KERNEL);
if (control == NULL)
return -ENOMEM;
if (copy_from_user(control, _control, sizeof(*control)))
return -EFAULT; return -EFAULT;
read_lock(&card->control_rwlock); read_lock(&card->control_rwlock);
kctl = snd_ctl_find_id(card, &control.id); kctl = snd_ctl_find_id(card, &control->id);
if (kctl == NULL) { if (kctl == NULL) {
result = -ENOENT; result = -ENOENT;
} else { } else {
indirect = kctl->access & SNDRV_CTL_ELEM_ACCESS_INDIRECT ? 1 : 0; indirect = kctl->access & SNDRV_CTL_ELEM_ACCESS_INDIRECT ? 1 : 0;
if (control.indirect != indirect) { if (control->indirect != indirect) {
result = -EACCES; result = -EACCES;
} else { } else {
if ((kctl->access & SNDRV_CTL_ELEM_ACCESS_READ) && kctl->get != NULL) { if ((kctl->access & SNDRV_CTL_ELEM_ACCESS_READ) && kctl->get != NULL) {
result = kctl->get(kctl, &control); result = kctl->get(kctl, control);
if (result >= 0) if (result >= 0)
control.id = kctl->id; control->id = kctl->id;
} else } else
result = -EPERM; result = -EPERM;
} }
} }
read_unlock(&card->control_rwlock); read_unlock(&card->control_rwlock);
if (result >= 0) if (result >= 0)
if (copy_to_user(_control, &control, sizeof(control))) if (copy_to_user(_control, control, sizeof(*control)))
return -EFAULT; return -EFAULT;
kfree(control);
return result; return result;
} }
static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_control) static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_control)
{ {
snd_card_t *card = file->card; snd_card_t *card = file->card;
snd_ctl_elem_value_t control; snd_ctl_elem_value_t *control;
snd_kcontrol_t *kctl; snd_kcontrol_t *kctl;
int result, indirect; int result, indirect;
if (copy_from_user(&control, _control, sizeof(control))) control = kmalloc(sizeof(*control), GFP_KERNEL);
if (control == NULL)
return -ENOMEM;
if (copy_from_user(control, _control, sizeof(*control)))
return -EFAULT; return -EFAULT;
read_lock(&card->control_rwlock); read_lock(&card->control_rwlock);
kctl = snd_ctl_find_id(card, &control.id); kctl = snd_ctl_find_id(card, &control->id);
if (kctl == NULL) { if (kctl == NULL) {
result = -ENOENT; result = -ENOENT;
} else { } else {
indirect = kctl->access & SNDRV_CTL_ELEM_ACCESS_INDIRECT ? 1 : 0; indirect = kctl->access & SNDRV_CTL_ELEM_ACCESS_INDIRECT ? 1 : 0;
if (control.indirect != indirect) { if (control->indirect != indirect) {
result = -EACCES; result = -EACCES;
} else { } else {
read_lock(&card->control_owner_lock); read_lock(&card->control_owner_lock);
...@@ -480,9 +487,9 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr ...@@ -480,9 +487,9 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr
(kctl->owner != NULL && kctl->owner != file)) { (kctl->owner != NULL && kctl->owner != file)) {
result = -EPERM; result = -EPERM;
} else { } else {
result = kctl->put(kctl, &control); result = kctl->put(kctl, control);
if (result >= 0) if (result >= 0)
control.id = kctl->id; control->id = kctl->id;
} }
read_unlock(&card->control_owner_lock); read_unlock(&card->control_owner_lock);
if (result > 0) { if (result > 0) {
...@@ -496,8 +503,9 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr ...@@ -496,8 +503,9 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr
read_unlock(&card->control_rwlock); read_unlock(&card->control_rwlock);
__unlocked: __unlocked:
if (result >= 0) if (result >= 0)
if (copy_to_user(_control, &control, sizeof(control))) if (copy_to_user(_control, control, sizeof(*control)))
return -EFAULT; return -EFAULT;
kfree(control);
return result; return result;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <sound/version.h> #include <sound/version.h>
#include <linux/utsname.h> #include <linux/utsname.h>
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
/* /*
* OSS compatible part * OSS compatible part
......
...@@ -216,7 +216,7 @@ static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buff ...@@ -216,7 +216,7 @@ static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
snd_iprintf(buffer, "--- no soundcards ---\n"); snd_iprintf(buffer, "--- no soundcards ---\n");
} }
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
void snd_card_info_read_oss(snd_info_buffer_t * buffer) void snd_card_info_read_oss(snd_info_buffer_t * buffer)
{ {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/slab.h>
#include <linux/init.h> #include <linux/init.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/control.h> #include <sound/control.h>
...@@ -264,46 +265,56 @@ static int get_ctl_type(struct file *file, snd_ctl_elem_id_t *id) ...@@ -264,46 +265,56 @@ static int get_ctl_type(struct file *file, snd_ctl_elem_id_t *id)
static int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl) static int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl)
{ {
// too big? struct sndrv_ctl_elem_value *data;
struct sndrv_ctl_elem_value data; struct sndrv_ctl_elem_value32 *data32;
struct sndrv_ctl_elem_value32 data32;
int err, i; int err, i;
int type; int type;
mm_segment_t oldseg; mm_segment_t oldseg;
/* FIXME: check the sane ioctl.. */ /* FIXME: check the sane ioctl.. */
if (copy_from_user(&data32, (void*)arg, sizeof(data32))) data = kmalloc(sizeof(*data), GFP_KERNEL);
return -EFAULT; data32 = kmalloc(sizeof(*data32), GFP_KERNEL);
memset(&data, 0, sizeof(data)); if (data == NULL || data32 == NULL) {
data.id = data32.id; err = -ENOMEM;
data.indirect = data32.indirect; goto __end;
if (data.indirect) /* FIXME: this is not correct for long arrays */ }
data.value.integer.value_ptr = (void*)TO_PTR(data32.value.integer.value_ptr);
type = get_ctl_type(file, &data.id); if (copy_from_user(data32, (void*)arg, sizeof(*data32))) {
if (type < 0) err = -EFAULT;
return type; goto __end;
if (! data.indirect) { }
memset(data, 0, sizeof(*data));
data->id = data32->id;
data->indirect = data32->indirect;
if (data->indirect) /* FIXME: this is not correct for long arrays */
data->value.integer.value_ptr = (void*)TO_PTR(data32->value.integer.value_ptr);
type = get_ctl_type(file, &data->id);
if (type < 0) {
err = type;
goto __end;
}
if (! data->indirect) {
switch (type) { switch (type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN: case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
case SNDRV_CTL_ELEM_TYPE_INTEGER: case SNDRV_CTL_ELEM_TYPE_INTEGER:
for (i = 0; i < 128; i++) for (i = 0; i < 128; i++)
data.value.integer.value[i] = data32.value.integer.value[i]; data->value.integer.value[i] = data32->value.integer.value[i];
break; break;
case SNDRV_CTL_ELEM_TYPE_INTEGER64: case SNDRV_CTL_ELEM_TYPE_INTEGER64:
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
data.value.integer64.value[i] = data32.value.integer64.value[i]; data->value.integer64.value[i] = data32->value.integer64.value[i];
break; break;
case SNDRV_CTL_ELEM_TYPE_ENUMERATED: case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
for (i = 0; i < 128; i++) for (i = 0; i < 128; i++)
data.value.enumerated.item[i] = data32.value.enumerated.item[i]; data->value.enumerated.item[i] = data32->value.enumerated.item[i];
break; break;
case SNDRV_CTL_ELEM_TYPE_BYTES: case SNDRV_CTL_ELEM_TYPE_BYTES:
memcpy(data.value.bytes.data, data32.value.bytes.data, memcpy(data->value.bytes.data, data32->value.bytes.data,
sizeof(data.value.bytes.data)); sizeof(data->value.bytes.data));
break; break;
case SNDRV_CTL_ELEM_TYPE_IEC958: case SNDRV_CTL_ELEM_TYPE_IEC958:
data.value.iec958 = data32.value.iec958; data->value.iec958 = data32->value.iec958;
break; break;
default: default:
printk("unknown type %d\n", type); printk("unknown type %d\n", type);
...@@ -313,40 +324,46 @@ static int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsign ...@@ -313,40 +324,46 @@ static int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsign
oldseg = get_fs(); oldseg = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)&data); err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)data);
set_fs(oldseg); set_fs(oldseg);
if (err < 0) if (err < 0)
return err; goto __end;
/* restore info to 32bit */ /* restore info to 32bit */
if (! data.indirect) { if (! data->indirect) {
switch (type) { switch (type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN: case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
case SNDRV_CTL_ELEM_TYPE_INTEGER: case SNDRV_CTL_ELEM_TYPE_INTEGER:
for (i = 0; i < 128; i++) for (i = 0; i < 128; i++)
data32.value.integer.value[i] = data.value.integer.value[i]; data32->value.integer.value[i] = data->value.integer.value[i];
break; break;
case SNDRV_CTL_ELEM_TYPE_INTEGER64: case SNDRV_CTL_ELEM_TYPE_INTEGER64:
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
data32.value.integer64.value[i] = data.value.integer64.value[i]; data32->value.integer64.value[i] = data->value.integer64.value[i];
break; break;
case SNDRV_CTL_ELEM_TYPE_ENUMERATED: case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
for (i = 0; i < 128; i++) for (i = 0; i < 128; i++)
data32.value.enumerated.item[i] = data.value.enumerated.item[i]; data32->value.enumerated.item[i] = data->value.enumerated.item[i];
break; break;
case SNDRV_CTL_ELEM_TYPE_BYTES: case SNDRV_CTL_ELEM_TYPE_BYTES:
memcpy(data32.value.bytes.data, data.value.bytes.data, memcpy(data32->value.bytes.data, data->value.bytes.data,
sizeof(data.value.bytes.data)); sizeof(data->value.bytes.data));
break; break;
case SNDRV_CTL_ELEM_TYPE_IEC958: case SNDRV_CTL_ELEM_TYPE_IEC958:
data32.value.iec958 = data.value.iec958; data32->value.iec958 = data->value.iec958;
break; break;
default: default:
break; break;
} }
} }
if (copy_to_user((void*)arg, &data32, sizeof(data32))) err = 0;
return -EFAULT; if (copy_to_user((void*)arg, data32, sizeof(*data32)))
return 0; err = -EFAULT;
__end:
if (data32)
kfree(data32);
if (data)
kfree(data);
return err;
} }
DEFINE_ALSA_IOCTL_ENTRY(ctl_elem_read, ctl_elem_value, SNDRV_CTL_IOCTL_ELEM_READ); DEFINE_ALSA_IOCTL_ENTRY(ctl_elem_read, ctl_elem_value, SNDRV_CTL_IOCTL_ELEM_READ);
......
...@@ -79,6 +79,44 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long ...@@ -79,6 +79,44 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long
return 0;\ return 0;\
} }
#define DEFINE_ALSA_IOCTL_BIG(type) \
static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl)\
{\
struct sndrv_##type##32 *data32;\
struct sndrv_##type *data;\
mm_segment_t oldseg;\
int err;\
data32 = kmalloc(sizeof(*data32), GFP_KERNEL); \
data = kmalloc(sizeof(*data), GFP_KERNEL); \
if (data32 == NULL || data == NULL) { \
err = -ENOMEM; \
goto __end; \
}\
if (copy_from_user(data32, (void*)arg, sizeof(*data32))) { \
err = -EFAULT; \
goto __end; \
}\
memset(data, 0, sizeof(*data));\
convert_from_32(type, data, data32);\
oldseg = get_fs();\
set_fs(KERNEL_DS);\
err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)data);\
if (err < 0) \
goto __end;\
err = 0;\
if (native_ctl & (_IOC_READ << _IOC_DIRSHIFT)) {\
convert_to_32(type, data32, data);\
if (copy_to_user((void*)arg, data32, sizeof(*data32)))\
err = -EFAULT;\
}\
__end:\
if (data)\
kfree(data);\
if (data32)\
kfree(data32);\
return err;\
}
#define DEFINE_ALSA_IOCTL_ENTRY(name,type,native_ctl) \ #define DEFINE_ALSA_IOCTL_ENTRY(name,type,native_ctl) \
static int snd_ioctl32_##name(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file) {\ static int snd_ioctl32_##name(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file) {\
return _snd_ioctl32_##type(fd, cmd, arg, file, native_ctl);\ return _snd_ioctl32_##type(fd, cmd, arg, file, native_ctl);\
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/slab.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include "ioctl32.h" #include "ioctl32.h"
...@@ -172,7 +173,7 @@ struct sndrv_pcm_status32 { ...@@ -172,7 +173,7 @@ struct sndrv_pcm_status32 {
DEFINE_ALSA_IOCTL(pcm_uframes_str); DEFINE_ALSA_IOCTL(pcm_uframes_str);
DEFINE_ALSA_IOCTL(pcm_sframes_str); DEFINE_ALSA_IOCTL(pcm_sframes_str);
DEFINE_ALSA_IOCTL(pcm_hw_params); DEFINE_ALSA_IOCTL_BIG(pcm_hw_params);
DEFINE_ALSA_IOCTL(pcm_sw_params); DEFINE_ALSA_IOCTL(pcm_sw_params);
DEFINE_ALSA_IOCTL(pcm_channel_info); DEFINE_ALSA_IOCTL(pcm_channel_info);
DEFINE_ALSA_IOCTL(pcm_status); DEFINE_ALSA_IOCTL(pcm_status);
...@@ -230,7 +231,7 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a ...@@ -230,7 +231,7 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a
snd_pcm_file_t *pcm_file; snd_pcm_file_t *pcm_file;
snd_pcm_substream_t *substream; snd_pcm_substream_t *substream;
struct sndrv_xfern32 data32, *srcptr = (struct sndrv_xfern32*)arg; struct sndrv_xfern32 data32, *srcptr = (struct sndrv_xfern32*)arg;
void *bufs[128]; void **bufs = NULL;
int err = 0, ch, i; int err = 0, ch, i;
u32 *bufptr; u32 *bufptr;
mm_segment_t oldseg; mm_segment_t oldseg;
...@@ -260,6 +261,9 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a ...@@ -260,6 +261,9 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a
return -EFAULT; return -EFAULT;
__get_user(data32.bufs, &srcptr->bufs); __get_user(data32.bufs, &srcptr->bufs);
bufptr = (u32*)TO_PTR(data32.bufs); bufptr = (u32*)TO_PTR(data32.bufs);
bufs = kmalloc(sizeof(void *) * 128, GFP_KERNEL);
if (bufs == NULL)
return -ENOMEM;
for (i = 0; i < ch; i++) { for (i = 0; i < ch; i++) {
u32 ptr; u32 ptr;
if (get_user(ptr, bufptr)) if (get_user(ptr, bufptr))
...@@ -278,10 +282,11 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a ...@@ -278,10 +282,11 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a
break; break;
} }
set_fs(oldseg); set_fs(oldseg);
if (err < 0) if (err >= 0) {
return err; if (put_user(err, &srcptr->result))
if (put_user(err, &srcptr->result)) err = -EFAULT;
return -EFAULT; }
kfree(bufs);
return 0; return 0;
} }
...@@ -343,24 +348,38 @@ static void snd_pcm_hw_convert_to_old_params(struct sndrv_pcm_hw_params_old32 *o ...@@ -343,24 +348,38 @@ static void snd_pcm_hw_convert_to_old_params(struct sndrv_pcm_hw_params_old32 *o
static int _snd_ioctl32_pcm_hw_params_old(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl) static int _snd_ioctl32_pcm_hw_params_old(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl)
{ {
struct sndrv_pcm_hw_params_old32 data32; struct sndrv_pcm_hw_params_old32 *data32;
struct sndrv_pcm_hw_params data; struct sndrv_pcm_hw_params *data;
mm_segment_t oldseg; mm_segment_t oldseg;
int err; int err;
if (copy_from_user(&data32, (void*)arg, sizeof(data32))) data32 = snd_kcalloc(sizeof(*data32), GFP_KERNEL);
return -EFAULT; data = snd_kcalloc(sizeof(*data), GFP_KERNEL);
snd_pcm_hw_convert_from_old_params(&data, &data32); if (data32 == NULL || data == NULL) {
err = -ENOMEM;
goto __end;
}
if (copy_from_user(data32, (void*)arg, sizeof(*data32))) {
err = -EFAULT;
goto __end;
}
snd_pcm_hw_convert_from_old_params(data, data32);
oldseg = get_fs(); oldseg = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)&data); err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)data);
set_fs(oldseg); set_fs(oldseg);
if (err < 0) if (err < 0)
return err; goto __end;
snd_pcm_hw_convert_to_old_params(&data32, &data); snd_pcm_hw_convert_to_old_params(data32, data);
if (copy_to_user((void*)arg, &data32, sizeof(data32))) err = 0;
return -EFAULT; if (copy_to_user((void*)arg, data32, sizeof(*data32)))
return 0; err = -EFAULT;
__end:
if (data)
kfree(data);
if (data32)
kfree(data32);
return err;
} }
......
...@@ -499,10 +499,10 @@ char *snd_kmalloc_strdup(const char *string, int flags) ...@@ -499,10 +499,10 @@ char *snd_kmalloc_strdup(const char *string, int flags)
int copy_to_user_fromio(void *dst, unsigned long src, size_t count) int copy_to_user_fromio(void *dst, unsigned long src, size_t count)
{ {
#if defined(__i386_) || defined(CONFIG_SPARC32) #if defined(__i386__) || defined(CONFIG_SPARC32)
return copy_to_user(dst, (const void*)src, count) ? -EFAULT : 0; return copy_to_user(dst, (const void*)src, count) ? -EFAULT : 0;
#else #else
char buf[1024]; char buf[256];
while (count) { while (count) {
size_t c = count; size_t c = count;
if (c > sizeof(buf)) if (c > sizeof(buf))
...@@ -520,10 +520,10 @@ int copy_to_user_fromio(void *dst, unsigned long src, size_t count) ...@@ -520,10 +520,10 @@ 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) int copy_from_user_toio(unsigned long dst, const void *src, size_t count)
{ {
#if defined(__i386_) || defined(CONFIG_SPARC32) #if defined(__i386__) || defined(CONFIG_SPARC32)
return copy_from_user((void*)dst, src, count) ? -EFAULT : 0; return copy_from_user((void*)dst, src, count) ? -EFAULT : 0;
#else #else
char buf[1024]; char buf[256];
while (count) { while (count) {
size_t c = count; size_t c = count;
if (c > sizeof(buf)) if (c > sizeof(buf))
......
This diff is collapsed.
...@@ -2123,9 +2123,11 @@ static int snd_pcm_oss_register_minor(unsigned short native_minor, ...@@ -2123,9 +2123,11 @@ static int snd_pcm_oss_register_minor(unsigned short native_minor,
pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count && pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count &&
!(pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX)); !(pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX));
sprintf(name, "%s%s", pcm->name, duplex ? " (DUPLEX)" : ""); sprintf(name, "%s%s", pcm->name, duplex ? " (DUPLEX)" : "");
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
snd_oss_info_register(SNDRV_OSS_INFO_DEV_AUDIO, snd_oss_info_register(SNDRV_OSS_INFO_DEV_AUDIO,
pcm->card->number, pcm->card->number,
name); name);
#endif
pcm->oss.reg++; pcm->oss.reg++;
} }
if (snd_adsp_map[pcm->card->number] == pcm->device) { if (snd_adsp_map[pcm->card->number] == pcm->device) {
...@@ -2146,7 +2148,9 @@ static int snd_pcm_oss_unregister_minor(unsigned short native_minor, ...@@ -2146,7 +2148,9 @@ static int snd_pcm_oss_unregister_minor(unsigned short native_minor,
if (snd_dsp_map[pcm->card->number] == pcm->device) { if (snd_dsp_map[pcm->card->number] == pcm->device) {
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM, snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
pcm->card, 0); pcm->card, 0);
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_AUDIO, pcm->card->number); snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_AUDIO, pcm->card->number);
#endif
} }
if (snd_adsp_map[pcm->card->number] == pcm->device) if (snd_adsp_map[pcm->card->number] == pcm->device)
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM, snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
......
...@@ -1473,7 +1473,7 @@ static int boundary_nearer(int min, int mindir, ...@@ -1473,7 +1473,7 @@ static int boundary_nearer(int min, int mindir,
int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
snd_pcm_hw_param_t var, unsigned int best, int *dir) snd_pcm_hw_param_t var, unsigned int best, int *dir)
{ {
snd_pcm_hw_params_t save; snd_pcm_hw_params_t *save = NULL;
int v; int v;
unsigned int saved_min; unsigned int saved_min;
int last = 0; int last = 0;
...@@ -1493,30 +1493,42 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ...@@ -1493,30 +1493,42 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
maxdir = 1; maxdir = 1;
max--; max--;
} }
save = *params; save = kmalloc(sizeof(*save), GFP_KERNEL);
if (save == NULL)
return -ENOMEM;
*save = *params;
saved_min = min; saved_min = min;
min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir); min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir);
if (min >= 0) { if (min >= 0) {
snd_pcm_hw_params_t params1; snd_pcm_hw_params_t *params1;
if (max < 0) if (max < 0)
goto _end; goto _end;
if ((unsigned int)min == saved_min && mindir == valdir) if ((unsigned int)min == saved_min && mindir == valdir)
goto _end; goto _end;
params1 = save; params1 = kmalloc(sizeof(*params1), GFP_KERNEL);
max = snd_pcm_hw_param_max(pcm, &params1, var, max, &maxdir); if (params1 == NULL) {
if (max < 0) kfree(save);
return -ENOMEM;
}
*params1 = *save;
max = snd_pcm_hw_param_max(pcm, params1, var, max, &maxdir);
if (max < 0) {
kfree(params1);
goto _end; goto _end;
}
if (boundary_nearer(max, maxdir, best, valdir, min, mindir)) { if (boundary_nearer(max, maxdir, best, valdir, min, mindir)) {
*params = params1; *params = *params1;
last = 1; last = 1;
} }
kfree(params1);
} else { } else {
*params = save; *params = *save;
max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir); max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir);
assert(max >= 0); assert(max >= 0);
last = 1; last = 1;
} }
_end: _end:
kfree(save);
if (last) if (last)
v = snd_pcm_hw_param_last(pcm, params, var, dir); v = snd_pcm_hw_param_last(pcm, params, var, dir);
else else
...@@ -1842,16 +1854,11 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, ...@@ -1842,16 +1854,11 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
if (runtime->sleep_min == 0 && runtime->status->state == SNDRV_PCM_STATE_RUNNING) if (runtime->sleep_min == 0 && runtime->status->state == SNDRV_PCM_STATE_RUNNING)
snd_pcm_update_hw_ptr(substream); snd_pcm_update_hw_ptr(substream);
avail = snd_pcm_playback_avail(runtime); avail = snd_pcm_playback_avail(runtime);
if (runtime->status->state == SNDRV_PCM_STATE_PAUSED || if (((avail < runtime->control->avail_min && size > avail) ||
runtime->status->state == SNDRV_PCM_STATE_PREPARED) { (size >= runtime->xfer_align && avail < runtime->xfer_align))) {
if (avail < runtime->xfer_align) {
err = -EPIPE;
goto _end_unlock;
}
} else if (((avail < runtime->control->avail_min && size > avail) ||
(size >= runtime->xfer_align && avail < runtime->xfer_align))) {
wait_queue_t wait; wait_queue_t wait;
enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state; enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state;
if (nonblock) { if (nonblock) {
err = -EAGAIN; err = -EAGAIN;
goto _end_unlock; goto _end_unlock;
...@@ -1868,8 +1875,11 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, ...@@ -1868,8 +1875,11 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
spin_unlock_irq(&runtime->lock); spin_unlock_irq(&runtime->lock);
if (schedule_timeout(10 * HZ) == 0) { if (schedule_timeout(10 * HZ) == 0) {
spin_lock_irq(&runtime->lock); spin_lock_irq(&runtime->lock);
state = runtime->status->state == SNDRV_PCM_STATE_SUSPENDED ? SUSPENDED : EXPIRED; if (runtime->status->state != SNDRV_PCM_STATE_PREPARED &&
break; runtime->status->state != SNDRV_PCM_STATE_PAUSED) {
state = runtime->status->state == SNDRV_PCM_STATE_SUSPENDED ? SUSPENDED : EXPIRED;
break;
}
} }
spin_lock_irq(&runtime->lock); spin_lock_irq(&runtime->lock);
switch (runtime->status->state) { switch (runtime->status->state) {
...@@ -1916,10 +1926,6 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, ...@@ -1916,10 +1926,6 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
cont = runtime->buffer_size - runtime->control->appl_ptr % runtime->buffer_size; cont = runtime->buffer_size - runtime->control->appl_ptr % runtime->buffer_size;
if (frames > cont) if (frames > cont)
frames = cont; frames = cont;
if (frames == 0 && runtime->status->state == SNDRV_PCM_STATE_PAUSED) {
err = -EPIPE;
goto _end_unlock;
}
snd_assert(frames != 0, snd_assert(frames != 0,
spin_unlock_irq(&runtime->lock); spin_unlock_irq(&runtime->lock);
return -EINVAL); return -EINVAL);
...@@ -2135,21 +2141,16 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void ...@@ -2135,21 +2141,16 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void
if (runtime->sleep_min == 0 && runtime->status->state == SNDRV_PCM_STATE_RUNNING) if (runtime->sleep_min == 0 && runtime->status->state == SNDRV_PCM_STATE_RUNNING)
snd_pcm_update_hw_ptr(substream); snd_pcm_update_hw_ptr(substream);
avail = snd_pcm_capture_avail(runtime); avail = snd_pcm_capture_avail(runtime);
if (runtime->status->state == SNDRV_PCM_STATE_PAUSED) { if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
if (avail < runtime->xfer_align) { if (avail < runtime->xfer_align) {
err = -EPIPE; err = -EPIPE;
goto _end_unlock; goto _end_unlock;
} }
} else if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
if (avail < runtime->xfer_align) {
runtime->status->state = SNDRV_PCM_STATE_SETUP;
err = -EPIPE;
goto _end_unlock;
}
} else if ((avail < runtime->control->avail_min && size > avail) || } else if ((avail < runtime->control->avail_min && size > avail) ||
(size >= runtime->xfer_align && avail < runtime->xfer_align)) { (size >= runtime->xfer_align && avail < runtime->xfer_align)) {
wait_queue_t wait; wait_queue_t wait;
enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state; enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state;
if (nonblock) { if (nonblock) {
err = -EAGAIN; err = -EAGAIN;
goto _end_unlock; goto _end_unlock;
...@@ -2166,8 +2167,11 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void ...@@ -2166,8 +2167,11 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void
spin_unlock_irq(&runtime->lock); spin_unlock_irq(&runtime->lock);
if (schedule_timeout(10 * HZ) == 0) { if (schedule_timeout(10 * HZ) == 0) {
spin_lock_irq(&runtime->lock); spin_lock_irq(&runtime->lock);
state = runtime->status->state == SNDRV_PCM_STATE_SUSPENDED ? SUSPENDED : EXPIRED; if (runtime->status->state != SNDRV_PCM_STATE_PREPARED &&
break; runtime->status->state != SNDRV_PCM_STATE_PAUSED) {
state = runtime->status->state == SNDRV_PCM_STATE_SUSPENDED ? SUSPENDED : EXPIRED;
break;
}
} }
spin_lock_irq(&runtime->lock); spin_lock_irq(&runtime->lock);
switch (runtime->status->state) { switch (runtime->status->state) {
......
This diff is collapsed.
...@@ -1425,7 +1425,9 @@ static int snd_rawmidi_dev_register(snd_device_t *device) ...@@ -1425,7 +1425,9 @@ static int snd_rawmidi_dev_register(snd_device_t *device)
snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 0); snd_printk(KERN_ERR "unable to register OSS rawmidi device %i:%i\n", rmidi->card->number, 0);
} else { } else {
rmidi->ossreg++; rmidi->ossreg++;
#ifdef SNDRV_OSS_INFO_DEV_MIDI
snd_oss_info_register(SNDRV_OSS_INFO_DEV_MIDI, rmidi->card->number, rmidi->name); snd_oss_info_register(SNDRV_OSS_INFO_DEV_MIDI, rmidi->card->number, rmidi->name);
#endif
} }
} }
if (rmidi->device == snd_amidi_map[rmidi->card->number]) { if (rmidi->device == snd_amidi_map[rmidi->card->number]) {
...@@ -1436,7 +1438,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device) ...@@ -1436,7 +1438,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device)
rmidi->ossreg++; rmidi->ossreg++;
} }
} }
#endif #endif /* CONFIG_SND_OSSEMUL */
up(&register_mutex); up(&register_mutex);
sprintf(name, "midi%d", rmidi->device); sprintf(name, "midi%d", rmidi->device);
entry = snd_info_create_card_entry(rmidi->card, name, rmidi->card->proc_root); entry = snd_info_create_card_entry(rmidi->card, name, rmidi->card->proc_root);
...@@ -1484,13 +1486,15 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device) ...@@ -1484,13 +1486,15 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device)
if (rmidi->ossreg) { if (rmidi->ossreg) {
if (rmidi->device == snd_midi_map[rmidi->card->number]) { if (rmidi->device == snd_midi_map[rmidi->card->number]) {
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 0); snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 0);
#ifdef SNDRV_OSS_INFO_DEV_MIDI
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_MIDI, rmidi->card->number); snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_MIDI, rmidi->card->number);
#endif
} }
if (rmidi->device == snd_amidi_map[rmidi->card->number]) if (rmidi->device == snd_amidi_map[rmidi->card->number])
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 1); snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 1);
rmidi->ossreg = 0; rmidi->ossreg = 0;
} }
#endif #endif /* CONFIG_SND_OSSEMUL */
if (rmidi->ops && rmidi->ops->dev_unregister) if (rmidi->ops && rmidi->ops->dev_unregister)
rmidi->ops->dev_unregister(rmidi); rmidi->ops->dev_unregister(rmidi);
snd_unregister_device(SNDRV_DEVICE_TYPE_RAWMIDI, rmidi->card, rmidi->device); snd_unregister_device(SNDRV_DEVICE_TYPE_RAWMIDI, rmidi->card, rmidi->device);
......
...@@ -159,9 +159,10 @@ snd_seq_oss_readq_pick(seq_oss_readq_t *q, int blocking, unsigned long *rflags) ...@@ -159,9 +159,10 @@ snd_seq_oss_readq_pick(seq_oss_readq_t *q, int blocking, unsigned long *rflags)
spin_lock_irqsave(&q->lock, *rflags); spin_lock_irqsave(&q->lock, *rflags);
if (q->qlen == 0) { if (q->qlen == 0) {
if (blocking) { if (blocking) {
snd_seq_sleep_timeout_in_lock(&q->midi_sleep, spin_unlock(&q->lock);
&q->lock, interruptible_sleep_on_timeout(&q->midi_sleep,
q->pre_event_timeout); q->pre_event_timeout);
spin_lock(&q->lock);
} }
if (q->qlen == 0) { if (q->qlen == 0) {
spin_unlock_irqrestore(&q->lock, *rflags); spin_unlock_irqrestore(&q->lock, *rflags);
......
...@@ -146,8 +146,10 @@ snd_seq_oss_synth_register(snd_seq_device_t *dev) ...@@ -146,8 +146,10 @@ snd_seq_oss_synth_register(snd_seq_device_t *dev)
debug_printk(("synth %s registered %d\n", rec->name, i)); debug_printk(("synth %s registered %d\n", rec->name, i));
spin_unlock_irqrestore(&register_lock, flags); spin_unlock_irqrestore(&register_lock, flags);
dev->driver_data = rec; dev->driver_data = rec;
#ifdef SNDRV_OSS_INFO_DEV_SYNTH
if (i < SNDRV_CARDS) if (i < SNDRV_CARDS)
snd_oss_info_register(SNDRV_OSS_INFO_DEV_SYNTH, i, rec->name); snd_oss_info_register(SNDRV_OSS_INFO_DEV_SYNTH, i, rec->name);
#endif
return 0; return 0;
} }
...@@ -178,8 +180,10 @@ snd_seq_oss_synth_unregister(snd_seq_device_t *dev) ...@@ -178,8 +180,10 @@ snd_seq_oss_synth_unregister(snd_seq_device_t *dev)
max_synth_devs = index + 1; max_synth_devs = index + 1;
} }
spin_unlock_irqrestore(&register_lock, flags); spin_unlock_irqrestore(&register_lock, flags);
#ifdef SNDRV_OSS_INFO_DEV_SYNTH
if (rec->seq_device < SNDRV_CARDS) if (rec->seq_device < SNDRV_CARDS)
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_SYNTH, rec->seq_device); snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_SYNTH, rec->seq_device);
#endif
snd_use_lock_sync(&rec->use_lock); snd_use_lock_sync(&rec->use_lock);
kfree(rec); kfree(rec);
......
...@@ -122,7 +122,9 @@ snd_seq_oss_writeq_sync(seq_oss_writeq_t *q) ...@@ -122,7 +122,9 @@ snd_seq_oss_writeq_sync(seq_oss_writeq_t *q)
} }
/* wait for echo event */ /* wait for echo event */
snd_seq_sleep_timeout_in_lock(&q->sync_sleep, &q->sync_lock, HZ); spin_unlock(&q->sync_lock);
interruptible_sleep_on_timeout(&q->sync_sleep, HZ);
spin_lock(&q->sync_lock);
if (signal_pending(current)) { if (signal_pending(current)) {
/* interrupted - return 0 to finish sync */ /* interrupted - return 0 to finish sync */
q->sync_event_put = 0; q->sync_event_put = 0;
......
...@@ -135,7 +135,7 @@ EXPORT_SYMBOL(snd_seq_event_port_attach); ...@@ -135,7 +135,7 @@ EXPORT_SYMBOL(snd_seq_event_port_attach);
EXPORT_SYMBOL(snd_seq_event_port_detach); EXPORT_SYMBOL(snd_seq_event_port_detach);
/* seq_lock.c */ /* seq_lock.c */
#if defined(__SMP__) || defined(CONFIG_SND_DEBUG) #if defined(__SMP__) || defined(CONFIG_SND_DEBUG)
EXPORT_SYMBOL(snd_seq_sleep_in_lock); /*EXPORT_SYMBOL(snd_seq_sleep_in_lock);*/
EXPORT_SYMBOL(snd_seq_sleep_timeout_in_lock); /*EXPORT_SYMBOL(snd_seq_sleep_timeout_in_lock);*/
EXPORT_SYMBOL(snd_use_lock_sync_helper); EXPORT_SYMBOL(snd_use_lock_sync_helper);
#endif #endif
...@@ -152,9 +152,11 @@ client_t *snd_seq_client_use_ptr(int clientid) ...@@ -152,9 +152,11 @@ client_t *snd_seq_client_use_ptr(int clientid)
} }
} else if (clientid >= 64 && clientid < 128) { } else if (clientid >= 64 && clientid < 128) {
int card = (clientid - 64) / 8; int card = (clientid - 64) / 8;
if (card < snd_ecards_limit && ! card_requested[card]) { if (card < snd_ecards_limit) {
card_requested[card] = 1; if (! card_requested[card]) {
snd_request_card(card); card_requested[card] = 1;
snd_request_card(card);
}
snd_seq_device_load_drivers(); snd_seq_device_load_drivers();
} }
} }
......
...@@ -182,7 +182,9 @@ int snd_seq_fifo_cell_out(fifo_t *f, snd_seq_event_cell_t **cellp, int nonblock) ...@@ -182,7 +182,9 @@ int snd_seq_fifo_cell_out(fifo_t *f, snd_seq_event_cell_t **cellp, int nonblock)
spin_unlock_irqrestore(&f->lock, flags); spin_unlock_irqrestore(&f->lock, flags);
return -EAGAIN; return -EAGAIN;
} }
snd_seq_sleep_in_lock(&f->input_sleep, &f->lock); spin_unlock(&f->lock);
interruptible_sleep_on(&f->input_sleep);
spin_lock(&f->lock);
if (signal_pending(current)) { if (signal_pending(current)) {
spin_unlock_irqrestore(&f->lock, flags); spin_unlock_irqrestore(&f->lock, flags);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#if defined(__SMP__) || defined(CONFIG_SND_DEBUG) #if defined(__SMP__) || defined(CONFIG_SND_DEBUG)
#if 0 /* NOT USED */
/* (interruptible) sleep_on during the specified spinlock */ /* (interruptible) sleep_on during the specified spinlock */
void snd_seq_sleep_in_lock(wait_queue_head_t *p, spinlock_t *lock) void snd_seq_sleep_in_lock(wait_queue_head_t *p, spinlock_t *lock)
{ {
...@@ -60,6 +61,7 @@ long snd_seq_sleep_timeout_in_lock(wait_queue_head_t *p, spinlock_t *lock, long ...@@ -60,6 +61,7 @@ long snd_seq_sleep_timeout_in_lock(wait_queue_head_t *p, spinlock_t *lock, long
return timeout; return timeout;
} }
#endif /* NOT USED */
/* wait until all locks are released */ /* wait until all locks are released */
void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line) void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line)
......
...@@ -20,12 +20,6 @@ typedef atomic_t snd_use_lock_t; ...@@ -20,12 +20,6 @@ typedef atomic_t snd_use_lock_t;
void snd_use_lock_sync_helper(snd_use_lock_t *lock, const char *file, int line); void snd_use_lock_sync_helper(snd_use_lock_t *lock, const char *file, int line);
#define snd_use_lock_sync(lockp) snd_use_lock_sync_helper(lockp, __BASE_FILE__, __LINE__) #define snd_use_lock_sync(lockp) snd_use_lock_sync_helper(lockp, __BASE_FILE__, __LINE__)
/* (interruptible) sleep_on during the specified spinlock */
void snd_seq_sleep_in_lock(wait_queue_head_t *p, spinlock_t *lock);
/* (interruptible) sleep_on with timeout during the specified spinlock */
long snd_seq_sleep_timeout_in_lock(wait_queue_head_t *p, spinlock_t *lock, long timeout);
#else /* SMP || CONFIG_SND_DEBUG */ #else /* SMP || CONFIG_SND_DEBUG */
typedef spinlock_t snd_use_lock_t; /* dummy */ typedef spinlock_t snd_use_lock_t; /* dummy */
...@@ -34,9 +28,6 @@ typedef spinlock_t snd_use_lock_t; /* dummy */ ...@@ -34,9 +28,6 @@ typedef spinlock_t snd_use_lock_t; /* dummy */
#define snd_use_lock_free(lockp) /**/ #define snd_use_lock_free(lockp) /**/
#define snd_use_lock_sync(lockp) /**/ #define snd_use_lock_sync(lockp) /**/
#define snd_seq_sleep_in_lock(p,lock) interruptible_sleep_on(p)
#define snd_seq_sleep_timeout_in_lock(p,lock,timeout) interruptible_sleep_on_timeout(p,timeout)
#endif /* SMP || CONFIG_SND_DEBUG */ #endif /* SMP || CONFIG_SND_DEBUG */
#endif /* __SND_SEQ_LOCK_H */ #endif /* __SND_SEQ_LOCK_H */
...@@ -233,17 +233,21 @@ int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock, ...@@ -233,17 +233,21 @@ int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock,
goto __error; goto __error;
} }
while (pool->free == NULL && ! nonblock && ! pool->closing) { while (pool->free == NULL && ! nonblock && ! pool->closing) {
spin_unlock(&pool->lock);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
/* change semaphore to allow other clients /* change semaphore to allow other clients
to access device file */ to access device file */
if (file) if (file)
up(&semaphore_of(file)); up(&semaphore_of(file));
#endif
snd_seq_sleep_in_lock(&pool->output_sleep, &pool->lock); interruptible_sleep_on(&pool->output_sleep);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
/* restore semaphore again */ /* restore semaphore again */
if (file) if (file)
down(&semaphore_of(file)); down(&semaphore_of(file));
#endif
spin_lock(&pool->lock);
/* interrupted? */ /* interrupted? */
if (signal_pending(current)) { if (signal_pending(current)) {
err = -ERESTARTSYS; err = -ERESTARTSYS;
......
...@@ -318,9 +318,6 @@ static int __init alsa_sound_init(void) ...@@ -318,9 +318,6 @@ static int __init alsa_sound_init(void)
#endif #endif
if (register_chrdev(snd_major, "alsa", &snd_fops)) { if (register_chrdev(snd_major, "alsa", &snd_fops)) {
snd_printk(KERN_ERR "unable to register native major device number %d\n", snd_major); snd_printk(KERN_ERR "unable to register native major device number %d\n", snd_major);
#ifdef CONFIG_SND_OSSEMUL
snd_oss_cleanup_module();
#endif
return -EIO; return -EIO;
} }
#ifdef CONFIG_SND_DEBUG_MEMORY #ifdef CONFIG_SND_DEBUG_MEMORY
...@@ -329,9 +326,6 @@ static int __init alsa_sound_init(void) ...@@ -329,9 +326,6 @@ static int __init alsa_sound_init(void)
if (snd_info_init() < 0) { if (snd_info_init() < 0) {
#ifdef CONFIG_SND_DEBUG_MEMORY #ifdef CONFIG_SND_DEBUG_MEMORY
snd_memory_done(); snd_memory_done();
#endif
#ifdef CONFIG_SND_OSSEMUL
snd_oss_cleanup_module();
#endif #endif
return -ENOMEM; return -ENOMEM;
} }
...@@ -369,7 +363,6 @@ static void __exit alsa_sound_exit(void) ...@@ -369,7 +363,6 @@ static void __exit alsa_sound_exit(void)
#ifdef CONFIG_SND_OSSEMUL #ifdef CONFIG_SND_OSSEMUL
snd_info_minor_unregister(); snd_info_minor_unregister();
snd_oss_cleanup_module();
#endif #endif
snd_info_done(); snd_info_done();
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)
...@@ -455,6 +448,7 @@ EXPORT_SYMBOL(snd_dma_disable); ...@@ -455,6 +448,7 @@ EXPORT_SYMBOL(snd_dma_disable);
EXPORT_SYMBOL(snd_dma_residue); EXPORT_SYMBOL(snd_dma_residue);
#endif #endif
/* info.c */ /* info.c */
#ifdef CONFIG_PROC_FS
EXPORT_SYMBOL(snd_seq_root); EXPORT_SYMBOL(snd_seq_root);
EXPORT_SYMBOL(snd_create_proc_entry); EXPORT_SYMBOL(snd_create_proc_entry);
EXPORT_SYMBOL(snd_remove_proc_entry); EXPORT_SYMBOL(snd_remove_proc_entry);
...@@ -468,8 +462,9 @@ EXPORT_SYMBOL(snd_info_create_device); ...@@ -468,8 +462,9 @@ EXPORT_SYMBOL(snd_info_create_device);
EXPORT_SYMBOL(snd_info_free_device); EXPORT_SYMBOL(snd_info_free_device);
EXPORT_SYMBOL(snd_info_register); EXPORT_SYMBOL(snd_info_register);
EXPORT_SYMBOL(snd_info_unregister); EXPORT_SYMBOL(snd_info_unregister);
#endif
/* info_oss.c */ /* info_oss.c */
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
EXPORT_SYMBOL(snd_oss_info_register); EXPORT_SYMBOL(snd_oss_info_register);
#endif #endif
/* control.c */ /* control.c */
......
...@@ -183,6 +183,8 @@ int snd_unregister_oss_device(int type, snd_card_t * card, int dev) ...@@ -183,6 +183,8 @@ int snd_unregister_oss_device(int type, snd_card_t * card, int dev)
* INFO PART * INFO PART
*/ */
#ifdef CONFIG_PROC_FS
static snd_info_entry_t *snd_minor_info_oss_entry = NULL; static snd_info_entry_t *snd_minor_info_oss_entry = NULL;
static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer)
...@@ -207,8 +209,11 @@ static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t * ...@@ -207,8 +209,11 @@ static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t *
up(&sound_oss_mutex); up(&sound_oss_mutex);
} }
#endif /* CONFIG_PROC_FS */
int __init snd_minor_info_oss_init(void) int __init snd_minor_info_oss_init(void)
{ {
#ifdef CONFIG_PROC_FS
snd_info_entry_t *entry; snd_info_entry_t *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root); entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root);
...@@ -222,13 +227,16 @@ int __init snd_minor_info_oss_init(void) ...@@ -222,13 +227,16 @@ int __init snd_minor_info_oss_init(void)
} }
} }
snd_minor_info_oss_entry = entry; snd_minor_info_oss_entry = entry;
#endif
return 0; return 0;
} }
int __exit snd_minor_info_oss_done(void) int __exit snd_minor_info_oss_done(void)
{ {
#ifdef CONFIG_PROC_FS
if (snd_minor_info_oss_entry) if (snd_minor_info_oss_entry)
snd_info_unregister(snd_minor_info_oss_entry); snd_info_unregister(snd_minor_info_oss_entry);
#endif
return 0; return 0;
} }
...@@ -241,8 +249,4 @@ int __init snd_oss_init_module(void) ...@@ -241,8 +249,4 @@ int __init snd_oss_init_module(void)
return 0; return 0;
} }
void snd_oss_cleanup_module(void)
{
}
#endif /* CONFIG_SND_OSSEMUL */ #endif /* CONFIG_SND_OSSEMUL */
...@@ -1356,7 +1356,7 @@ static int __init alsa_timer_init(void) ...@@ -1356,7 +1356,7 @@ static int __init alsa_timer_init(void)
int err; int err;
snd_info_entry_t *entry; snd_info_entry_t *entry;
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_TIMERS
snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1, "system timer"); snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1, "system timer");
#endif #endif
if ((entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL)) != NULL) { if ((entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL)) != NULL) {
...@@ -1391,7 +1391,7 @@ static void __exit alsa_timer_exit(void) ...@@ -1391,7 +1391,7 @@ static void __exit alsa_timer_exit(void)
snd_info_unregister(snd_timer_proc_entry); snd_info_unregister(snd_timer_proc_entry);
snd_timer_proc_entry = NULL; snd_timer_proc_entry = NULL;
} }
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_TIMERS
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1); snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1);
#endif #endif
} }
......
...@@ -1311,12 +1311,12 @@ static int __init snd_es18xx_initialize(es18xx_t *chip) ...@@ -1311,12 +1311,12 @@ static int __init snd_es18xx_initialize(es18xx_t *chip)
if (chip->caps & ES18XX_CONTROL) { if (chip->caps & ES18XX_CONTROL) {
/* Hardware volume IRQ */ /* Hardware volume IRQ */
snd_es18xx_config_write(chip, 0x27, chip->irq); snd_es18xx_config_write(chip, 0x27, chip->irq);
if (chip->fm_port > SNDRV_AUTO_PORT) { if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) {
/* FM I/O */ /* FM I/O */
snd_es18xx_config_write(chip, 0x62, chip->fm_port >> 8); snd_es18xx_config_write(chip, 0x62, chip->fm_port >> 8);
snd_es18xx_config_write(chip, 0x63, chip->fm_port & 0xff); snd_es18xx_config_write(chip, 0x63, chip->fm_port & 0xff);
} }
if (chip->mpu_port > SNDRV_AUTO_PORT) { if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
/* MPU-401 I/O */ /* MPU-401 I/O */
snd_es18xx_config_write(chip, 0x64, chip->mpu_port >> 8); snd_es18xx_config_write(chip, 0x64, chip->mpu_port >> 8);
snd_es18xx_config_write(chip, 0x65, chip->mpu_port & 0xff); snd_es18xx_config_write(chip, 0x65, chip->mpu_port & 0xff);
...@@ -1404,7 +1404,7 @@ static int __init snd_es18xx_initialize(es18xx_t *chip) ...@@ -1404,7 +1404,7 @@ static int __init snd_es18xx_initialize(es18xx_t *chip)
snd_es18xx_mixer_write(chip, 0x7A, 0x68); snd_es18xx_mixer_write(chip, 0x7A, 0x68);
/* Enable and set hardware volume interrupt */ /* Enable and set hardware volume interrupt */
snd_es18xx_mixer_write(chip, 0x64, 0x06); snd_es18xx_mixer_write(chip, 0x64, 0x06);
if (chip->mpu_port > SNDRV_AUTO_PORT) { if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
/* MPU401 share irq with audio /* MPU401 share irq with audio
Joystick enabled Joystick enabled
FM enabled */ FM enabled */
...@@ -2040,7 +2040,7 @@ static int __init snd_audiodrive_isapnp(int dev, struct snd_audiodrive *acard) ...@@ -2040,7 +2040,7 @@ static int __init snd_audiodrive_isapnp(int dev, struct snd_audiodrive *acard)
/* skip csn and logdev initialization - already done in isapnp_configure */ /* skip csn and logdev initialization - already done in isapnp_configure */
isapnp_cfg_begin(pdev->bus->number, pdev->devfn); isapnp_cfg_begin(pdev->bus->number, pdev->devfn);
isapnp_write_byte(0x27, pdev->irq_resource[0].start); /* Hardware Volume IRQ Number */ isapnp_write_byte(0x27, pdev->irq_resource[0].start); /* Hardware Volume IRQ Number */
if (snd_mpu_port[dev] > SNDRV_AUTO_PORT) if (snd_mpu_port[dev] != SNDRV_AUTO_PORT)
isapnp_write_byte(0x28, pdev->irq); /* MPU-401 IRQ Number */ isapnp_write_byte(0x28, pdev->irq); /* MPU-401 IRQ Number */
isapnp_write_byte(0x72, pdev->irq_resource[0].start); /* second IRQ */ isapnp_write_byte(0x72, pdev->irq_resource[0].start); /* second IRQ */
isapnp_cfg_end(); isapnp_cfg_end();
...@@ -2147,16 +2147,18 @@ static int __init snd_audiodrive_probe(int dev) ...@@ -2147,16 +2147,18 @@ static int __init snd_audiodrive_probe(int dev)
return err; return err;
} }
if (snd_opl3_create(card, chip->fm_port, chip->fm_port + 2, OPL3_HW_OPL3, 0, &opl3) < 0) { if (snd_fm_port[dev] > 0 && snd_fm_port[dev] != SNDRV_AUTO_PORT) {
printk(KERN_ERR PFX "opl3 not detected at 0x%lx\n", chip->port); if (snd_opl3_create(card, chip->fm_port, chip->fm_port + 2, OPL3_HW_OPL3, 0, &opl3) < 0) {
} else { printk(KERN_ERR PFX "opl3 not detected at 0x%lx\n", chip->fm_port);
if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { } else {
snd_card_free(card); if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
return err; snd_card_free(card);
return err;
}
} }
} }
if (snd_mpu_port[dev] != SNDRV_AUTO_PORT) { if (snd_mpu_port[dev] > 0 && snd_mpu_port[dev] != SNDRV_AUTO_PORT) {
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES18XX, if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES18XX,
chip->mpu_port, 0, chip->mpu_port, 0,
irq, 0, irq, 0,
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <asm/io.h> #include <asm/io.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/isapnp.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/slab.h> #include <linux/slab.h>
#ifndef LINUX_ISAPNP_H #ifndef LINUX_ISAPNP_H
......
...@@ -1138,11 +1138,13 @@ snd_emu8000_new(snd_card_t *card, int index, long port, int seq_ports, snd_seq_d ...@@ -1138,11 +1138,13 @@ snd_emu8000_new(snd_card_t *card, int index, long port, int seq_ports, snd_seq_d
snd_emu8000_free(hw); snd_emu8000_free(hw);
return err; return err;
} }
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
if (snd_seq_device_new(card, index, SNDRV_SEQ_DEV_ID_EMU8000, if (snd_seq_device_new(card, index, SNDRV_SEQ_DEV_ID_EMU8000,
sizeof(emu8000_t*), &awe) >= 0) { sizeof(emu8000_t*), &awe) >= 0) {
strcpy(awe->name, "EMU-8000"); strcpy(awe->name, "EMU-8000");
*(emu8000_t**)SNDRV_SEQ_DEVICE_ARGPTR(awe) = hw; *(emu8000_t**)SNDRV_SEQ_DEVICE_ARGPTR(awe) = hw;
} }
#endif
if (awe_ret) if (awe_ret)
*awe_ret = awe; *awe_ret = awe;
......
...@@ -114,7 +114,7 @@ MODULE_PARM_DESC(osrun_time, "how many seconds to wait for the ICS2115 OS"); ...@@ -114,7 +114,7 @@ MODULE_PARM_DESC(osrun_time, "how many seconds to wait for the ICS2115 OS");
#ifdef WF_DEBUG #ifdef WF_DEBUG
#ifdef NEW_MACRO_VARARGS #if defined(NEW_MACRO_VARARGS) || __GNUC__ >= 3
#define DPRINT(cond, ...) \ #define DPRINT(cond, ...) \
if ((dev->debug & (cond)) == (cond)) { \ if ((dev->debug & (cond)) == (cond)) { \
snd_printk (__VA_ARGS__); \ snd_printk (__VA_ARGS__); \
......
...@@ -77,7 +77,7 @@ CONFIG_SND_ICE1712 ...@@ -77,7 +77,7 @@ CONFIG_SND_ICE1712
CONFIG_SND_INTEL8X0 CONFIG_SND_INTEL8X0
Say 'Y' or 'M' to include support for Intel8x0 based soundcards, Say 'Y' or 'M' to include support for Intel8x0 based soundcards,
SiS 7012, AMD768/8111 and NVidia NForce chips. SiS 7012, AMD768/8111, NVidia NForce and ALi 5455 chips.
CONFIG_SND_SONICVIBES CONFIG_SND_SONICVIBES
Say 'Y' or 'M' to include support for S3 SonicVibes based soundcards. Say 'Y' or 'M' to include support for S3 SonicVibes based soundcards.
......
...@@ -4,9 +4,9 @@ mainmenu_option next_comment ...@@ -4,9 +4,9 @@ mainmenu_option next_comment
comment 'PCI devices' comment 'PCI devices'
dep_tristate 'ALi PCI Audio M5451' CONFIG_SND_ALI5451 $CONFIG_SND 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 dep_tristate 'Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x' CONFIG_SND_CS46XX $CONFIG_SND $CONFIG_SOUND_GAMEPORT
dep_mbool ' Cirrus Logic (Sound Fusion) New DSP support (EXPERIMENTAL)' CONFIG_SND_CS46XX_NEW_DSP $CONFIG_SND_CS46XX $CONFIG_EXPERIMENTAL dep_mbool ' Cirrus Logic (Sound Fusion) New DSP support (EXPERIMENTAL)' CONFIG_SND_CS46XX_NEW_DSP $CONFIG_SND_CS46XX $CONFIG_EXPERIMENTAL
dep_tristate 'Cirrus Logic (Sound Fusion) CS4281' CONFIG_SND_CS4281 $CONFIG_SND dep_tristate 'Cirrus Logic (Sound Fusion) CS4281' CONFIG_SND_CS4281 $CONFIG_SND $CONFIG_SOUND_GAMEPORT
dep_tristate 'EMU10K1 (SB Live! & Audigy, E-mu APS)' CONFIG_SND_EMU10K1 $CONFIG_SND dep_tristate 'EMU10K1 (SB Live! & Audigy, E-mu APS)' CONFIG_SND_EMU10K1 $CONFIG_SND
dep_tristate 'Korg 1212 IO' CONFIG_SND_KORG1212 $CONFIG_SND dep_tristate 'Korg 1212 IO' CONFIG_SND_KORG1212 $CONFIG_SND
dep_tristate 'NeoMagic NM256AV/ZX' CONFIG_SND_NM256 $CONFIG_SND dep_tristate 'NeoMagic NM256AV/ZX' CONFIG_SND_NM256 $CONFIG_SND
...@@ -14,30 +14,19 @@ dep_tristate 'RME Digi32, 32/8, 32 PRO' CONFIG_SND_RME32 $CONFIG_SND ...@@ -14,30 +14,19 @@ dep_tristate 'RME Digi32, 32/8, 32 PRO' CONFIG_SND_RME32 $CONFIG_SND
dep_tristate 'RME Digi96, 96/8, 96/8 PRO' CONFIG_SND_RME96 $CONFIG_SND dep_tristate 'RME Digi96, 96/8, 96/8 PRO' CONFIG_SND_RME96 $CONFIG_SND
dep_tristate 'RME Digi9652 (Hammerfall)' CONFIG_SND_RME9652 $CONFIG_SND dep_tristate 'RME Digi9652 (Hammerfall)' CONFIG_SND_RME9652 $CONFIG_SND
dep_tristate 'RME Hammerfall DSP Audio' CONFIG_SND_HDSP $CONFIG_SND dep_tristate 'RME Hammerfall DSP Audio' CONFIG_SND_HDSP $CONFIG_SND
dep_tristate 'Trident 4D-Wave DX/NX; SiS 7018' CONFIG_SND_TRIDENT $CONFIG_SND dep_tristate 'Trident 4D-Wave DX/NX; SiS 7018' CONFIG_SND_TRIDENT $CONFIG_SND $CONFIG_SOUND_GAMEPORT
dep_tristate 'Yamaha YMF724/740/744/754' CONFIG_SND_YMFPCI $CONFIG_SND dep_tristate 'Yamaha YMF724/740/744/754' CONFIG_SND_YMFPCI $CONFIG_SND
dep_tristate 'Avance Logic ALS4000' CONFIG_SND_ALS4000 $CONFIG_SND dep_tristate 'Avance Logic ALS4000' CONFIG_SND_ALS4000 $CONFIG_SND
dep_tristate 'C-Media 8738, 8338' CONFIG_SND_CMIPCI $CONFIG_SND dep_tristate 'C-Media 8738, 8338' CONFIG_SND_CMIPCI $CONFIG_SND
dep_tristate '(Creative) Ensoniq AudioPCI 1370' CONFIG_SND_ENS1370 $CONFIG_SND dep_tristate '(Creative) Ensoniq AudioPCI 1370' CONFIG_SND_ENS1370 $CONFIG_SND
dep_tristate '(Creative) Ensoniq AudioPCI 1371/1373' CONFIG_SND_ENS1371 $CONFIG_SND dep_tristate '(Creative) Ensoniq AudioPCI 1371/1373' CONFIG_SND_ENS1371 $CONFIG_SND
dep_tristate 'ESS ES1938/1946 (Solo-1)' CONFIG_SND_ES1938 $CONFIG_SND dep_tristate 'ESS ES1938/1946 (Solo-1)' CONFIG_SND_ES1938 $CONFIG_SND $CONFIG_SOUND_GAMEPORT
dep_tristate 'ESS ES1968/1978 (Maestro-1/2/2E)' CONFIG_SND_ES1968 $CONFIG_SND dep_tristate 'ESS ES1968/1978 (Maestro-1/2/2E)' CONFIG_SND_ES1968 $CONFIG_SND
dep_tristate 'ESS Allegro/Maestro3' CONFIG_SND_MAESTRO3 $CONFIG_SND dep_tristate 'ESS Allegro/Maestro3' CONFIG_SND_MAESTRO3 $CONFIG_SND
dep_tristate 'ForteMedia FM801' CONFIG_SND_FM801 $CONFIG_SND dep_tristate 'ForteMedia FM801' CONFIG_SND_FM801 $CONFIG_SND
dep_tristate 'ICEnsemble ICE1712 (Envy24)' CONFIG_SND_ICE1712 $CONFIG_SND dep_tristate 'ICEnsemble ICE1712 (Envy24)' CONFIG_SND_ICE1712 $CONFIG_SND
dep_tristate 'Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio; AMD768/8111' CONFIG_SND_INTEL8X0 $CONFIG_SND dep_tristate 'Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio; AMD768/8111' CONFIG_SND_INTEL8X0 $CONFIG_SND
dep_tristate 'S3 SonicVibes' CONFIG_SND_SONICVIBES $CONFIG_SND dep_tristate 'S3 SonicVibes' CONFIG_SND_SONICVIBES $CONFIG_SND $CONFIG_SOUND_GAMEPORT
dep_tristate 'VIA 82C686A/B, 8233 South Bridge' CONFIG_SND_VIA82XX $CONFIG_SND dep_tristate 'VIA 82C686A/B, 8233 South Bridge' CONFIG_SND_VIA82XX $CONFIG_SND
# define gameport if necessary
if [ "$CONFIG_INPUT_GAMEPORT" != "n" ]; then
if [ "$CONFIG_SND_CS4281" = "y" \
-o "$CONFIG_SND_ES1938" = "y" \
-o "$CONFIG_SND_CS46XX" = "y" \
-o "$CONFIG_SND_SONICVIBES" = "y" \
-o "$CONFIG_SND_TRIDENT" = "y" ]; then
define_tristate CONFIG_INPUT_GAMEPORT y
fi
fi
endmenu endmenu
...@@ -862,6 +862,7 @@ static void snd_emu10k1_tram_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) ...@@ -862,6 +862,7 @@ static void snd_emu10k1_tram_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
{ {
int tram; int tram;
memset(icode->tram_valid, 0, sizeof(icode->tram_valid));
for (tram = 0; tram < 0xa0; tram++) { for (tram = 0; tram < 0xa0; tram++) {
set_bit(tram, icode->tram_valid); set_bit(tram, icode->tram_valid);
icode->tram_data_map[tram] = snd_emu10k1_ptr_read(emu, TANKMEMDATAREGBASE + tram, 0); icode->tram_data_map[tram] = snd_emu10k1_ptr_read(emu, TANKMEMDATAREGBASE + tram, 0);
...@@ -885,6 +886,7 @@ static void snd_emu10k1_code_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) ...@@ -885,6 +886,7 @@ static void snd_emu10k1_code_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
{ {
u32 pc; u32 pc;
memset(icode->code_valid, 0, sizeof(icode->code_valid));
for (pc = 0; pc < 512; pc++) { for (pc = 0; pc < 512; pc++) {
set_bit(pc, icode->code_valid); set_bit(pc, icode->code_valid);
icode->code[pc][0] = snd_emu10k1_efx_read(emu, pc * 2); icode->code[pc][0] = snd_emu10k1_efx_read(emu, pc * 2);
...@@ -1031,7 +1033,7 @@ static void snd_emu10k1_del_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icod ...@@ -1031,7 +1033,7 @@ static void snd_emu10k1_del_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icod
} }
} }
static void snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) static int snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
{ {
int i = 0, j; int i = 0, j;
unsigned int total = 0; unsigned int total = 0;
...@@ -1044,7 +1046,7 @@ static void snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *ico ...@@ -1044,7 +1046,7 @@ static void snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *ico
list_for_each(list, &emu->fx8010.gpr_ctl) { list_for_each(list, &emu->fx8010.gpr_ctl) {
ctl = emu10k1_gpr_ctl(list); ctl = emu10k1_gpr_ctl(list);
total++; total++;
if (i < icode->gpr_list_control_count) { if (_gctl && i < icode->gpr_list_control_count) {
memset(&gctl, 0, sizeof(gctl)); memset(&gctl, 0, sizeof(gctl));
id = &ctl->kcontrol->id; id = &ctl->kcontrol->id;
gctl.id.iface = id->iface; gctl.id.iface = id->iface;
...@@ -1061,13 +1063,14 @@ static void snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *ico ...@@ -1061,13 +1063,14 @@ static void snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *ico
gctl.min = ctl->min; gctl.min = ctl->min;
gctl.max = ctl->max; gctl.max = ctl->max;
gctl.translation = ctl->translation; gctl.translation = ctl->translation;
snd_runtime_check(copy_to_user(_gctl, &gctl, sizeof(gctl)) == 0, goto __next); if (copy_to_user(_gctl, &gctl, sizeof(gctl)))
return -EFAULT;
_gctl++;
i++;
} }
__next:
_gctl++;
i++;
} }
icode->gpr_list_control_total = total; icode->gpr_list_control_total = total;
return 0;
} }
static int snd_emu10k1_icode_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) static int snd_emu10k1_icode_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
...@@ -1103,6 +1106,8 @@ static int snd_emu10k1_icode_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) ...@@ -1103,6 +1106,8 @@ static int snd_emu10k1_icode_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
static int snd_emu10k1_icode_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) static int snd_emu10k1_icode_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
{ {
int err;
down(&emu->fx8010.lock); down(&emu->fx8010.lock);
strncpy(icode->name, emu->fx8010.name, sizeof(icode->name)-1); strncpy(icode->name, emu->fx8010.name, sizeof(icode->name)-1);
emu->fx8010.name[sizeof(emu->fx8010.name)-1] = '\0'; emu->fx8010.name[sizeof(emu->fx8010.name)-1] = '\0';
...@@ -1110,9 +1115,9 @@ static int snd_emu10k1_icode_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) ...@@ -1110,9 +1115,9 @@ static int snd_emu10k1_icode_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
snd_emu10k1_gpr_peek(emu, icode); snd_emu10k1_gpr_peek(emu, icode);
snd_emu10k1_tram_peek(emu, icode); snd_emu10k1_tram_peek(emu, icode);
snd_emu10k1_code_peek(emu, icode); snd_emu10k1_code_peek(emu, icode);
snd_emu10k1_list_controls(emu, icode); err = snd_emu10k1_list_controls(emu, icode);
up(&emu->fx8010.lock); up(&emu->fx8010.lock);
return 0; return err;
} }
static int snd_emu10k1_ipcm_poke(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm) static int snd_emu10k1_ipcm_poke(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm)
...@@ -2171,9 +2176,13 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne ...@@ -2171,9 +2176,13 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
kfree(icode); kfree(icode);
return res; return res;
case SNDRV_EMU10K1_IOCTL_CODE_PEEK: case SNDRV_EMU10K1_IOCTL_CODE_PEEK:
icode = (emu10k1_fx8010_code_t *)snd_kcalloc(sizeof(*icode), GFP_KERNEL); icode = (emu10k1_fx8010_code_t *)kmalloc(sizeof(*icode), GFP_KERNEL);
if (icode == NULL) if (icode == NULL)
return -ENOMEM; return -ENOMEM;
if (copy_from_user(icode, (void *)arg, sizeof(*icode))) {
kfree(icode);
return -EFAULT;
}
res = snd_emu10k1_icode_peek(emu, icode); res = snd_emu10k1_icode_peek(emu, icode);
if (res == 0 && copy_to_user((void *)arg, icode, sizeof(*icode))) { if (res == 0 && copy_to_user((void *)arg, icode, sizeof(*icode))) {
kfree(icode); kfree(icode);
......
...@@ -30,8 +30,11 @@ ...@@ -30,8 +30,11 @@
#include <sound/control.h> #include <sound/control.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/rawmidi.h> #include <sound/rawmidi.h>
#ifdef CHIP1371
#include <sound/ac97_codec.h> #include <sound/ac97_codec.h>
#else
#include <sound/ak4531_codec.h> #include <sound/ak4531_codec.h>
#endif
#define SNDRV_GET_ID #define SNDRV_GET_ID
#include <sound/initval.h> #include <sound/initval.h>
...@@ -352,13 +355,16 @@ struct _snd_ensoniq { ...@@ -352,13 +355,16 @@ struct _snd_ensoniq {
unsigned int rev; /* chip revision */ unsigned int rev; /* chip revision */
union { union {
#ifdef CHIP1371
struct { struct {
ac97_t *ac97; ac97_t *ac97;
} es1371; } es1371;
#else
struct { struct {
int pclkdiv_lock; int pclkdiv_lock;
ak4531_t *ak4531; ak4531_t *ak4531;
} es1370; } es1370;
#endif
} u; } u;
struct pci_dev *pci; struct pci_dev *pci;
......
...@@ -1538,6 +1538,7 @@ YMFPCI_DOUBLE("ADC Playback Volume", 0, YDSXGR_PRIADCOUTVOL), ...@@ -1538,6 +1538,7 @@ YMFPCI_DOUBLE("ADC Playback Volume", 0, YDSXGR_PRIADCOUTVOL),
YMFPCI_DOUBLE("ADC Capture Volume", 0, YDSXGR_PRIADCLOOPVOL), YMFPCI_DOUBLE("ADC Capture Volume", 0, YDSXGR_PRIADCLOOPVOL),
YMFPCI_DOUBLE("ADC Playback Volume", 1, YDSXGR_SECADCOUTVOL), YMFPCI_DOUBLE("ADC Playback Volume", 1, YDSXGR_SECADCOUTVOL),
YMFPCI_DOUBLE("ADC Capture Volume", 1, YDSXGR_SECADCLOOPVOL), YMFPCI_DOUBLE("ADC Capture Volume", 1, YDSXGR_SECADCLOOPVOL),
YMFPCI_DOUBLE("FM Legacy Volume", 0, YDSXGR_LEGACYOUTVOL),
YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ", PLAYBACK,VOLUME), 0, YDSXGR_ZVOUTVOL), YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ", PLAYBACK,VOLUME), 0, YDSXGR_ZVOUTVOL),
YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("", CAPTURE,VOLUME), 0, YDSXGR_ZVLOOPVOL), YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("", CAPTURE,VOLUME), 0, YDSXGR_ZVLOOPVOL),
YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ",PLAYBACK,VOLUME), 1, YDSXGR_SPDIFOUTVOL), YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ",PLAYBACK,VOLUME), 1, YDSXGR_SPDIFOUTVOL),
...@@ -2022,6 +2023,7 @@ static int __devinit snd_ymfpci_memalloc(ymfpci_t *chip) ...@@ -2022,6 +2023,7 @@ static int __devinit snd_ymfpci_memalloc(ymfpci_t *chip)
snd_ymfpci_writel(chip, YDSXGR_NATIVEADCINVOL, 0x3fff3fff); snd_ymfpci_writel(chip, YDSXGR_NATIVEADCINVOL, 0x3fff3fff);
snd_ymfpci_writel(chip, YDSXGR_NATIVEDACINVOL, 0x3fff3fff); snd_ymfpci_writel(chip, YDSXGR_NATIVEDACINVOL, 0x3fff3fff);
snd_ymfpci_writel(chip, YDSXGR_PRIADCLOOPVOL, 0x3fff3fff); snd_ymfpci_writel(chip, YDSXGR_PRIADCLOOPVOL, 0x3fff3fff);
snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0x3fff3fff);
return 0; return 0;
} }
...@@ -2036,6 +2038,7 @@ static int snd_ymfpci_free(ymfpci_t *chip) ...@@ -2036,6 +2038,7 @@ static int snd_ymfpci_free(ymfpci_t *chip)
if (chip->res_reg_area) { /* don't touch busy hardware */ if (chip->res_reg_area) { /* don't touch busy hardware */
snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0);
snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0);
snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0);
snd_ymfpci_writel(chip, YDSXGR_STATUS, ~0); snd_ymfpci_writel(chip, YDSXGR_STATUS, ~0);
snd_ymfpci_disable_dsp(chip); snd_ymfpci_disable_dsp(chip);
snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, 0); snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, 0);
...@@ -2100,6 +2103,7 @@ static int saved_regs_index[] = { ...@@ -2100,6 +2103,7 @@ static int saved_regs_index[] = {
YDSXGR_SPDIFLOOPVOL, YDSXGR_SPDIFLOOPVOL,
YDSXGR_SPDIFOUTVOL, YDSXGR_SPDIFOUTVOL,
YDSXGR_ZVOUTVOL, YDSXGR_ZVOUTVOL,
YDSXGR_LEGACYOUTVOL,
/* address bases */ /* address bases */
YDSXGR_PLAYCTRLBASE, YDSXGR_PLAYCTRLBASE,
YDSXGR_RECCTRLBASE, YDSXGR_RECCTRLBASE,
...@@ -2112,7 +2116,7 @@ static int saved_regs_index[] = { ...@@ -2112,7 +2116,7 @@ static int saved_regs_index[] = {
YDSXGR_ADCFORMAT, YDSXGR_ADCFORMAT,
YDSXGR_ADCSLOTSR, YDSXGR_ADCSLOTSR,
}; };
#define YDSXGR_NUM_SAVED_REGS (sizeof(saved_regs_index)/sizeof(saved_regs_index[0])) #define YDSXGR_NUM_SAVED_REGS ARRAY_SIZE(saved_regs_index)
void snd_ymfpci_suspend(ymfpci_t *chip) void snd_ymfpci_suspend(ymfpci_t *chip)
{ {
......
...@@ -957,6 +957,19 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) ...@@ -957,6 +957,19 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
if (subs->interface >= 0 && subs->interface != fmt->iface) { if (subs->interface >= 0 && subs->interface != fmt->iface) {
usb_set_interface(subs->dev, subs->interface, 0); usb_set_interface(subs->dev, subs->interface, 0);
subs->interface = -1; subs->interface = -1;
subs->format = 0;
}
/* set interface */
if (subs->interface != fmt->iface || subs->format != fmt->altset_idx) {
if (usb_set_interface(dev, fmt->iface, fmt->altset_idx) < 0) {
snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed\n",
dev->devnum, fmt->iface, fmt->altsetting);
return -EIO;
}
snd_printdd(KERN_INFO "setting usb interface %d:%d\n", fmt->iface, fmt->altset_idx);
subs->interface = fmt->iface;
subs->format = fmt->altset_idx;
} }
/* create a data pipe */ /* create a data pipe */
...@@ -965,7 +978,6 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) ...@@ -965,7 +978,6 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
subs->datapipe = usb_sndisocpipe(dev, ep); subs->datapipe = usb_sndisocpipe(dev, ep);
else else
subs->datapipe = usb_rcvisocpipe(dev, ep); subs->datapipe = usb_rcvisocpipe(dev, ep);
subs->format = fmt->altset_idx;
subs->syncpipe = subs->syncinterval = 0; subs->syncpipe = subs->syncinterval = 0;
subs->maxpacksize = alts->endpoint[0].wMaxPacketSize; subs->maxpacksize = alts->endpoint[0].wMaxPacketSize;
subs->maxframesize = bytes_to_frames(runtime, subs->maxpacksize); subs->maxframesize = bytes_to_frames(runtime, subs->maxpacksize);
...@@ -998,15 +1010,6 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) ...@@ -998,15 +1010,6 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
subs->syncinterval = alts->endpoint[1].bRefresh; subs->syncinterval = alts->endpoint[1].bRefresh;
} }
/* set interface */
if (usb_set_interface(dev, fmt->iface, fmt->altset_idx) < 0) {
snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed\n",
dev->devnum, fmt->iface, fmt->altsetting);
return -EIO;
}
snd_printdd(KERN_INFO "setting usb interface %d:%d\n", fmt->iface, fmt->altset_idx);
subs->interface = fmt->iface;
ep = alts->endpoint[0].bEndpointAddress; ep = alts->endpoint[0].bEndpointAddress;
/* if endpoint has pitch control, enable it */ /* if endpoint has pitch control, enable it */
if (fmt->attributes & EP_CS_ATTR_PITCH_CONTROL) { if (fmt->attributes & EP_CS_ATTR_PITCH_CONTROL) {
...@@ -1171,6 +1174,7 @@ static int snd_usb_pcm_open(snd_pcm_substream_t *substream, int direction, ...@@ -1171,6 +1174,7 @@ static int snd_usb_pcm_open(snd_pcm_substream_t *substream, int direction,
snd_usb_substream_t *subs = &as->substream[direction]; snd_usb_substream_t *subs = &as->substream[direction];
subs->interface = -1; subs->interface = -1;
subs->format = 0;
runtime->hw = *hw; runtime->hw = *hw;
runtime->private_data = subs; runtime->private_data = subs;
subs->pcm_substream = substream; subs->pcm_substream = substream;
...@@ -1601,6 +1605,10 @@ static int parse_audio_format_type(struct usb_device *dev, int iface_no, int alt ...@@ -1601,6 +1605,10 @@ static int parse_audio_format_type(struct usb_device *dev, int iface_no, int alt
/* FIXME: correct endianess and sign? */ /* FIXME: correct endianess and sign? */
pcm_format = -1; pcm_format = -1;
switch (format) { switch (format) {
case 0: /* some devices don't define this correctly... */
snd_printd(KERN_INFO "%d:%u:%d : format type 0 is detected, processed as PCM\n",
dev->devnum, iface_no, altno);
/* fall-through */
case USB_AUDIO_FORMAT_PCM: case USB_AUDIO_FORMAT_PCM:
/* check the format byte size */ /* check the format byte size */
switch (fmt[6]) { switch (fmt[6]) {
......
This diff is collapsed.
/*
* Additional mixer mapping
*
* Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
struct usbmix_name_map {
int id;
const char *name;
int control;
};
struct usbmix_ctl_map {
int vendor;
int product;
const struct usbmix_name_map *map;
};
/*
* USB control mappers for SB Exitigy
*/
/*
* Topology of SB Extigy (see on the wide screen :)
USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PE[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24]
^ | | | |
USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PE[15]->+ | | | +->FU[25] > Dig_OUT[26]
^ ^ | | | |
Dig_IN[4] -+ | | | | +->FU[28]---------------------> Spk_OUT[19]
| | | |
Lin-IN[7] -+-->FU[8]---------+ | | +----------------------------------------> Hph_OUT[20]
| | |
Mic-IN[9] --+->FU[10]----------------------------+ |
|| |
|| +----------------------------------------------------+
VV V
++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13]
*/
static struct usbmix_name_map extigy_map[] = {
/* 1: IT pcm */
{ 2, "PCM Playback" }, /* FU */
/* 3: IT pcm */
/* 4: IT digital in */
{ 5, "Digital In Playback Source" }, /* SU */
{ 6, "Digital In" }, /* FU */
/* 7: IT line */
{ 8, "Line Playback" }, /* FU */
/* 9: IT mic */
{ 10, "Mic Playback" }, /* FU */
{ 11, "Capture Source" }, /* SU */
{ 12, "Capture" }, /* FU */
/* 13: OT pcm capture */
/* 14: MU (w/o controls) */
/* 15: PE (3D enh) */
/* 16: MU (w/o controls) */
/* 17: PE (updown) */ /* FIXME: what control? */
{ 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */
{ 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */
{ 18, "Master Playback" }, /* FU; others */
/* 19: OT speaker */
/* 20: OT headphone */
{ 21, "Digital Out Extension" }, /* EU */ /* FIXME: what? */
{ 22, "Digital Out Playback" }, /* FU */
{ 23, "Digital Out1 Playback" }, /* FU */ /* FIXME: corresponds to 24 */
/* 24: OT digital out */
{ 25, "Digital Out2 Playback" }, /* FU */ /* FIXME: corresponds to 26 */
/* 26: OT digital out */
{ 27, "Output Extension" }, /* EU */ /* FIXME: what? */
/* 28: FU (mute) */
{ 0 } /* terminator */
};
/*
* Control map entries
*/
static struct usbmix_ctl_map usbmix_ctl_maps[] = {
{ 0x41e, 0x3000, extigy_map },
{ 0 } /* terminator */
};
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
/* Yamaha devices */ /* Yamaha devices */
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1000), USB_DEVICE(0x0499, 0x1000),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "UX256", .product_name = "UX256",
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1001), USB_DEVICE(0x0499, 0x1001),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "MU1000", .product_name = "MU1000",
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1002), USB_DEVICE(0x0499, 0x1002),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "MU2000", .product_name = "MU2000",
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1003), USB_DEVICE(0x0499, 0x1003),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "MU500", .product_name = "MU500",
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1004), USB_DEVICE(0x0499, 0x1004),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "UW500", .product_name = "UW500",
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1005), USB_DEVICE(0x0499, 0x1005),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "MOTIF6", .product_name = "MOTIF6",
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1006), USB_DEVICE(0x0499, 0x1006),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "MOTIF7", .product_name = "MOTIF7",
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1007), USB_DEVICE(0x0499, 0x1007),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "MOTIF8", .product_name = "MOTIF8",
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1008), USB_DEVICE(0x0499, 0x1008),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "UX96", .product_name = "UX96",
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1009), USB_DEVICE(0x0499, 0x1009),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "UX16", .product_name = "UX16",
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x100a), USB_DEVICE(0x0499, 0x100a),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "EOS BX", .product_name = "EOS BX",
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x100e), USB_DEVICE(0x0499, 0x100e),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "S08", .product_name = "S08",
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x100f), USB_DEVICE(0x0499, 0x100f),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "CLP-150", .product_name = "CLP-150",
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1010), USB_DEVICE(0x0499, 0x1010),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha", .vendor_name = "Yamaha",
.product_name = "CLP-170", .product_name = "CLP-170",
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
* class-specific descriptors. * class-specific descriptors.
*/ */
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0000), USB_DEVICE(0x0582, 0x0000),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "UA-100", .product_name = "UA-100",
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0002), USB_DEVICE(0x0582, 0x0002),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "UM-4", .product_name = "UM-4",
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0003), USB_DEVICE(0x0582, 0x0003),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "SC-8850", .product_name = "SC-8850",
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0004), USB_DEVICE(0x0582, 0x0004),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "U-8", .product_name = "U-8",
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0005), USB_DEVICE(0x0582, 0x0005),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "UM-2", .product_name = "UM-2",
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0007), USB_DEVICE(0x0582, 0x0007),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "SC-8820", .product_name = "SC-8820",
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0008), USB_DEVICE(0x0582, 0x0008),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "PC-300", .product_name = "PC-300",
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0009), USB_DEVICE(0x0582, 0x0009),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "UM-1", .product_name = "UM-1",
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x000b), USB_DEVICE(0x0582, 0x000b),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "SK-500", .product_name = "SK-500",
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x000c), USB_DEVICE(0x0582, 0x000c),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "SC-D70", .product_name = "SC-D70",
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0012), USB_DEVICE(0x0582, 0x0012),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland", .vendor_name = "Roland",
.product_name = "XV-5050", .product_name = "XV-5050",
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0014), USB_DEVICE(0x0582, 0x0014),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "UM-880", .product_name = "UM-880",
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0016), USB_DEVICE(0x0582, 0x0016),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "SD-90", .product_name = "SD-90",
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0023), USB_DEVICE(0x0582, 0x0023),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "UM-550", .product_name = "UM-550",
...@@ -373,7 +373,7 @@ ...@@ -373,7 +373,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0027), USB_DEVICE(0x0582, 0x0027),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "SD-20", .product_name = "SD-20",
...@@ -387,7 +387,7 @@ ...@@ -387,7 +387,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0029), USB_DEVICE(0x0582, 0x0029),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "SD-80", .product_name = "SD-80",
...@@ -401,7 +401,7 @@ ...@@ -401,7 +401,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0582, 0x002b), USB_DEVICE(0x0582, 0x002b),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL", .vendor_name = "EDIROL",
.product_name = "UA-700", .product_name = "UA-700",
...@@ -467,7 +467,7 @@ ...@@ -467,7 +467,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0763, 0x2001), USB_DEVICE(0x0763, 0x2001),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "M-Audio", .vendor_name = "M-Audio",
.product_name = "Quattro", .product_name = "Quattro",
...@@ -477,7 +477,7 @@ ...@@ -477,7 +477,7 @@
} }
}, },
{ {
USB_DEVICE_VENDOR_SPEC(0x0763, 0x2003), USB_DEVICE(0x0763, 0x2003),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "M-Audio", .vendor_name = "M-Audio",
.product_name = "AudioPhile", .product_name = "AudioPhile",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment