diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2017-03-22 21:30:23 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-03-28 12:33:56 +0200 |
commit | 9e796e7d59e71f8a556cfbdc2ffa3aff0555dd0e (patch) | |
tree | 2248865f8f2695690589c5792cda0092f0afc1e8 /sound/firewire/motu/motu.c | |
parent | dd49b2d1f04af9b1f44e9fe82c85f374f662c61b (diff) |
ALSA: firewire-motu: add MIDI functionality
In MOTU FireWire series, MIDI messages are multiplexed to isochronous
packets as well as PCM frames, while the way is different from the one
in IEC 61883-6.
MIDI messages are put into a certain position in message chunks. One data
block can includes one byte of the MIDI messages. When data block includes
a MIDI byte, the block has a flag in a certain position of the message
chunk. These positions are unique depending on protocols.
Once a data block includes a MIDI byte, some following data blocks includes
no MIDI bytes. Next MIDI byte appears on a data block corresponding to
next cycle of physical MIDI bus. This seems to avoid buffer overflow caused
by bandwidth differences between IEEE 1394 bus and physical MIDI bus.
This commit adds MIDI functionality to transfer/receive MIDI messages.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu.c')
-rw-r--r-- | sound/firewire/motu/motu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c index 801d6a73b0f3..d4da1377fa50 100644 --- a/sound/firewire/motu/motu.c +++ b/sound/firewire/motu/motu.c @@ -103,6 +103,12 @@ static void do_registration(struct work_struct *work) if (err < 0) goto error; + if (motu->spec->flags & SND_MOTU_SPEC_HAS_MIDI) { + err = snd_motu_create_midi_devices(motu); + if (err < 0) + goto error; + } + err = snd_card_register(motu->card); if (err < 0) goto error; @@ -138,6 +144,7 @@ static int motu_probe(struct fw_unit *unit, dev_set_drvdata(&unit->device, motu); mutex_init(&motu->mutex); + spin_lock_init(&motu->lock); /* Allocate and register this sound card later. */ INIT_DEFERRABLE_WORK(&motu->dwork, do_registration); |