Commit ac1d5c67 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA update

  - usb midi driver rewritten to use rawmidi interface
parent 02bb5f56
...@@ -2,15 +2,9 @@ ...@@ -2,15 +2,9 @@
# Makefile for ALSA # Makefile for ALSA
# #
snd-usb-audio-objs := usbaudio.o usbmixer.o snd-usb-audio-objs := usbaudio.o usbmixer.o usbmidi.o
ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
snd-usb-midi-objs := usbmidi.o
endif
# Toplevel Module Dependency # Toplevel Module Dependency
obj-$(CONFIG_SND_USB_AUDIO) += snd-usb-audio.o obj-$(CONFIG_SND_USB_AUDIO) += snd-usb-audio.o
ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
obj-$(CONFIG_SND_USB_AUDIO) += snd-usb-midi.o
endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -1833,11 +1833,6 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, unsigned char *buffer, i ...@@ -1833,11 +1833,6 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, unsigned char *buffer, i
/* /*
* parse audio control descriptor and create pcm/midi streams * parse audio control descriptor and create pcm/midi streams
*/ */
static int snd_usb_create_midi_interface(snd_usb_audio_t *chip,
struct usb_interface *iface,
const snd_usb_audio_quirk_t *quirk);
static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif, static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif,
unsigned char *buffer, int buflen) unsigned char *buffer, int buflen)
{ {
...@@ -1896,32 +1891,6 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif, ...@@ -1896,32 +1891,6 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif,
return 0; return 0;
} }
static int snd_usb_create_midi_interface(snd_usb_audio_t *chip,
struct usb_interface *iface,
const snd_usb_audio_quirk_t *quirk)
{
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
snd_seq_device_t *seq_device;
snd_usb_midi_t *umidi;
int err;
err = snd_seq_device_new(chip->card, chip->next_seq_device,
SNDRV_SEQ_DEV_ID_USBMIDI,
sizeof(snd_usb_midi_t), &seq_device);
if (err < 0)
return err;
chip->next_seq_device++;
strcpy(seq_device->name, chip->card->shortname);
umidi = (snd_usb_midi_t *)SNDRV_SEQ_DEVICE_ARGPTR(seq_device);
umidi->chip = chip;
umidi->iface = iface;
umidi->ifnum = iface->altsetting->bInterfaceNumber;
umidi->quirk = quirk;
umidi->seq_client = -1;
#endif
return 0;
}
static inline int snd_usb_create_quirk(snd_usb_audio_t *chip, static inline int snd_usb_create_quirk(snd_usb_audio_t *chip,
struct usb_interface *iface, struct usb_interface *iface,
const snd_usb_audio_quirk_t *quirk) const snd_usb_audio_quirk_t *quirk)
......
...@@ -123,8 +123,6 @@ ...@@ -123,8 +123,6 @@
/* maximum number of endpoints per interface */ /* maximum number of endpoints per interface */
#define MIDI_MAX_ENDPOINTS 2 #define MIDI_MAX_ENDPOINTS 2
#define SNDRV_SEQ_DEV_ID_USBMIDI "usb-midi"
/* /*
*/ */
...@@ -140,9 +138,7 @@ struct snd_usb_audio { ...@@ -140,9 +138,7 @@ struct snd_usb_audio {
struct list_head pcm_list; /* list of pcm streams */ struct list_head pcm_list; /* list of pcm streams */
int pcm_devs; int pcm_devs;
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) int next_midi_device;
int next_seq_device;
#endif
}; };
/* /*
...@@ -176,31 +172,6 @@ struct snd_usb_midi_endpoint_info { ...@@ -176,31 +172,6 @@ struct snd_usb_midi_endpoint_info {
/* for QUIRK_MIDI_MIDIMAN, data is the number of ports */ /* for QUIRK_MIDI_MIDIMAN, data is the number of ports */
/*
* USB MIDI sequencer device data
*/
typedef struct snd_usb_midi snd_usb_midi_t;
typedef struct snd_usb_midi_endpoint snd_usb_midi_endpoint_t;
typedef struct snd_usb_midi_out_endpoint snd_usb_midi_out_endpoint_t;
typedef struct snd_usb_midi_in_endpoint snd_usb_midi_in_endpoint_t;
struct snd_usb_midi {
/* filled by usbaudio.c */
snd_usb_audio_t *chip;
struct usb_interface *iface;
int ifnum;
const snd_usb_audio_quirk_t *quirk;
/* used internally in usbmidi.c */
int seq_client;
struct snd_usb_midi_endpoint {
snd_usb_midi_out_endpoint_t *out;
snd_usb_midi_in_endpoint_t *in;
snd_rawmidi_t *rmidi[0x10];
} endpoints[MIDI_MAX_ENDPOINTS];
};
/* /*
*/ */
...@@ -215,4 +186,6 @@ void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsub ...@@ -215,4 +186,6 @@ void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsub
int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif, unsigned char *buffer, int buflen); int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif, unsigned char *buffer, int buflen);
int snd_usb_create_midi_interface(snd_usb_audio_t *chip, struct usb_interface *iface, const snd_usb_audio_quirk_t *quirk);
#endif /* __USBAUDIO_H */ #endif /* __USBAUDIO_H */
This diff is collapsed.
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