Commit 9d48ce93 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA update

  - USB audio/midi code dependency/detection fixes
    - added a quirk for the Roland UA100 hardware
  - SB16 - added rmidi_callback to avoid dependency for mpu401_uart module
  - HSDP - fixed dependency
parent 8fd667b0
......@@ -89,7 +89,7 @@
#define AC97_BC_BASS_TREBLE 0x0004 /* Bass & Treble Control */
#define AC97_BC_SIM_STEREO 0x0008 /* Simulated stereo */
#define AC97_BC_HEADPHONE 0x0010 /* Headphone Out Support */
#define AC97_BC_LOUDNESS 0x0020 /* Loudness (bass boost) Supporqt */
#define AC97_BC_LOUDNESS 0x0020 /* Loudness (bass boost) Support */
#define AC97_BC_16BIT_DAC 0x0000 /* 16-bit DAC resolution */
#define AC97_BC_18BIT_DAC 0x0040 /* 18-bit DAC resolution */
#define AC97_BC_20BIT_DAC 0x0080 /* 20-bit DAC resolution */
......@@ -195,6 +195,10 @@
#define AC97_CXR_SPDIF_PCM 0x0
#define AC97_CXR_SPDIF_AC3 0x2
/* specific - ALC */
#define AC97_ALC650_MULTICH 0x6a
#define AC97_ALC650_CLOCK 0x7a
/* ac97->scaps */
#define AC97_SCAP_AUDIO (1<<0) /* audio AC'97 codec */
#define AC97_SCAP_MODEM (1<<1) /* modem AC'97 codec */
......
......@@ -99,6 +99,7 @@ struct _snd_sb {
snd_rawmidi_t *rmidi;
snd_rawmidi_substream_t *midi_substream_input;
snd_rawmidi_substream_t *midi_substream_output;
void (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs);
spinlock_t reg_lock;
spinlock_t open_lock;
......
/* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc3"
#define CONFIG_SND_DATE " (Tue Oct 22 14:30:41 2002 UTC)"
#define CONFIG_SND_DATE " (Sun Oct 27 07:55:05 2002 UTC)"
......@@ -91,7 +91,7 @@ obj-$(CONFIG_SND_EMU10K1) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep
obj-$(CONFIG_SND_KORG1212) += snd-pcm.o snd-timer.o snd.o
obj-$(CONFIG_SND_NM256) += snd-pcm.o snd-timer.o snd.o
obj-$(CONFIG_SND_RME9652) += snd-pcm.o snd-timer.o snd.o
obj-$(CONFIG_SND_HDSP) += snd-pcm.o snd-timer.o snd.o
obj-$(CONFIG_SND_HDSP) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_TRIDENT) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_YMFPCI) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_POWERMAC) += snd-pcm.o snd-timer.o snd.o
......@@ -100,10 +100,7 @@ ifeq ($(CONFIG_SND_SB16_CSP),y)
obj-$(CONFIG_SND_SB16) += snd-hwdep.o
obj-$(CONFIG_SND_SBAWE) += snd-hwdep.o
endif
obj-$(CONFIG_SND_USB_AUDIO) += snd-pcm.o snd-timer.o snd.o
ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
obj-$(CONFIG_SND_USB_AUDIO) += snd-rawmidi.o
endif
obj-$(CONFIG_SND_USB_AUDIO) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o
obj-m := $(sort $(obj-m))
......
......@@ -73,7 +73,7 @@ obj-$(CONFIG_SND_CS46XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-mi
obj-$(CONFIG_SND_EMU10K1) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-virmidi.o
obj-$(CONFIG_SND_TRIDENT) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
obj-$(CONFIG_SND_YMFPCI) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
obj-$(CONFIG_SND_USB_AUDIO) += snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-virmidi.o
obj-$(CONFIG_SND_USB_AUDIO) += snd-seq.o snd-seq-device.o snd-seq-midi-event.o
obj-m := $(sort $(obj-m))
......
......@@ -473,6 +473,7 @@ static int __init snd_sb16_probe(int dev)
snd_card_free(card);
return -ENXIO;
}
chip->rmidi_callback = snd_mpu401_uart_interrupt;
}
if (fm_port[dev] > 0) {
......
......@@ -396,8 +396,8 @@ void snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
spin_lock(&chip->mixer_lock);
status = snd_sbmixer_read(chip, SB_DSP4_IRQSTATUS);
spin_unlock(&chip->mixer_lock);
if ((status & SB_IRQTYPE_MPUIN) && chip->rmidi)
snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
if ((status & SB_IRQTYPE_MPUIN) && chip->rmidi_callback)
chip->rmidi_callback(irq, chip->rmidi->private_data, regs);
if (status & SB_IRQTYPE_8BIT) {
ok = 0;
if (chip->mode & SB_MODE_PLAYBACK_8) {
......
......@@ -1891,12 +1891,95 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif,
return 0;
}
static inline int snd_usb_create_quirk(snd_usb_audio_t *chip,
static int snd_usb_roland_ua100_hack_intf(snd_usb_audio_t *chip, int ifnum)
{
struct audioformat *fp;
int err;
fp = kmalloc(sizeof(*fp), GFP_KERNEL);
if (! fp) {
snd_printk(KERN_ERR "cannot malloc\n");
return -ENOMEM;
}
memset(fp, 0, sizeof(*fp));
fp->format = SNDRV_PCM_FORMAT_S16_LE;
fp->channels = ifnum == 0 ? 4 : 2;
fp->iface = ifnum;
fp->altsetting = 1;
fp->altset_idx = 1;
fp->attributes = ifnum == 0 ? 0 : EP_CS_ATTR_FILL_MAX;
fp->endpoint = ifnum == 0 ? 0x01 : 0x81;
fp->ep_attr = ifnum == 0 ? 0x09 : 0x05;
fp->rates = SNDRV_PCM_RATE_CONTINUOUS;
fp->rate_min = fp->rate_max = 44100;
err = add_audio_endpoint(chip, ifnum == 0 ? SNDRV_PCM_STREAM_PLAYBACK
: SNDRV_PCM_STREAM_CAPTURE, fp);
if (err < 0) {
kfree(fp);
return err;
}
usb_set_interface(chip->dev, ifnum, 0);
return 0;
}
static int snd_usb_roland_ua100_hack(snd_usb_audio_t *chip)
{
static const snd_usb_midi_endpoint_info_t ep_quirk = {
.epnum = -1,
.out_cables = 0x0007,
.in_cables = 0x0007
};
static const snd_usb_audio_quirk_t midi_quirk = {
.vendor_name = "Roland",
.product_name = "UA-100",
.ifnum = 2,
.type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = &ep_quirk
};
struct usb_config_descriptor *cfg = chip->dev->actconfig;
struct usb_interface *iface;
int err;
if (cfg->bNumInterfaces != 3) {
snd_printdd(KERN_ERR "invalid UA-100 descriptor\n");
return -ENXIO;
}
/* if 0: output */
if ((err = snd_usb_roland_ua100_hack_intf(chip, 0)) < 0)
return err;
/* if 1: input */
iface = &cfg->interface[1];
if (! usb_interface_claimed(iface)) {
if ((err = snd_usb_roland_ua100_hack_intf(chip, 1)) < 0)
return err;
usb_driver_claim_interface(&usb_audio_driver, iface, (void*)-1);
}
/* if 2: MIDI */
iface = &cfg->interface[2];
if (! usb_interface_claimed(iface)) {
if ((err = snd_usb_create_midi_interface(chip, iface, &midi_quirk)) < 0)
return err;
usb_driver_claim_interface(&usb_audio_driver, iface, (void*)-1);
}
return 0;
}
static int snd_usb_create_quirk(snd_usb_audio_t *chip,
struct usb_interface *iface,
const snd_usb_audio_quirk_t *quirk)
{
/* in the future, there may be quirks for PCM devices */
switch (quirk->type) {
case QUIRK_MIDI_FIXED_ENDPOINT:
case QUIRK_MIDI_YAMAHA:
case QUIRK_MIDI_MIDIMAN:
return snd_usb_create_midi_interface(chip, iface, quirk);
case QUIRK_ROLAND_UA100:
return snd_usb_roland_ua100_hack(chip);
default:
snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
return -ENXIO;
}
}
......
......@@ -149,6 +149,7 @@ struct snd_usb_audio {
#define QUIRK_MIDI_FIXED_ENDPOINT 0
#define QUIRK_MIDI_YAMAHA 1
#define QUIRK_MIDI_MIDIMAN 2
#define QUIRK_ROLAND_UA100 3
typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t;
typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t;
......@@ -172,6 +173,8 @@ struct snd_usb_midi_endpoint_info {
/* for QUIRK_MIDI_MIDIMAN, data is the number of ports */
/* for QUIRK_ROLAND_UA100, data is NULL */
/*
*/
......
......@@ -34,8 +34,6 @@
.idProduct = prod, \
.bInterfaceClass = USB_CLASS_VENDOR_SPEC
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
/* Yamaha devices */
{
USB_DEVICE(0x0499, 0x1000),
......@@ -74,7 +72,7 @@
}
},
{
USB_DEVICE(0x0499, 0x1004),
USB_DEVICE_VENDOR_SPEC(0x0499, 0x1004),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha",
.product_name = "UW500",
......@@ -128,7 +126,7 @@
}
},
{
USB_DEVICE(0x0499, 0x100a),
USB_DEVICE_VENDOR_SPEC(0x0499, 0x100a),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Yamaha",
.product_name = "EOS BX",
......@@ -181,13 +179,8 @@
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "Roland",
.product_name = "UA-100",
.ifnum = 2,
.type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = & (const snd_usb_midi_endpoint_info_t) {
.epnum = -1,
.out_cables = 0x0007,
.in_cables = 0x0007
}
.ifnum = 0,
.type = QUIRK_ROLAND_UA100
}
},
{
......@@ -467,7 +460,7 @@
}
},
{
USB_DEVICE(0x0763, 0x2001),
USB_DEVICE_VENDOR_SPEC(0x0763, 0x2001),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "M-Audio",
.product_name = "Quattro",
......@@ -477,7 +470,7 @@
}
},
{
USB_DEVICE(0x0763, 0x2003),
USB_DEVICE_VENDOR_SPEC(0x0763, 0x2003),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "M-Audio",
.product_name = "AudioPhile",
......@@ -487,6 +480,4 @@
}
},
#endif /* CONFIG_SND_SEQUENCER(_MODULE) */
#undef USB_DEVICE_VENDOR_SPEC
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