summaryrefslogtreecommitdiff
path: root/sound/firewire/tascam/tascam.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2015-10-12 19:10:21 +0900
committerTakashi Iwai <tiwai@suse.de>2015-10-12 14:16:17 +0200
commit107cc0129a685e88d09af88b8a371caec5c51ff0 (patch)
tree7f0421ba74c87b31c3d32558320f16eb7d61ba41 /sound/firewire/tascam/tascam.c
parente8bd577ae6df59160cd6fd82b8d3562bbbdd3c1d (diff)
ALSA: firewire-tascam: add support for incoming MIDI messages by asynchronous transaction
TASCAM FireWire series use asynchronous transaction to transfer MIDI messages. The transaction is sent to a registered address. This commit supports the incoming MIDI messages. The messages in the transaction include some quirks: * Two quadlets are used for one MIDI message and one timestamp. * Usually, the first byte of the first quadlet includes MIDI port and MSB 4 bit of MIDI status. For system exclusive message, the first byte includes MIDI port and 0x04, or 0x07 in the end of the message. * The rest of the first quadlet includes MIDI bytes up to 3. * Several set of MIDI messages and timestamp can be transferred in one block transaction, up to 8 sets. I note that TASCAM FireWire series ignores ID bytes of system exclusive message. When receiving system exclusive messages with ID bytes on physical MIDI bus, the series transfers the messages without ID bytes on IEEE 1394 bus, and vice versa. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/tascam/tascam.c')
-rw-r--r--sound/firewire/tascam/tascam.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/firewire/tascam/tascam.c b/sound/firewire/tascam/tascam.c
index ee2f498dcce4..de9e8df25569 100644
--- a/sound/firewire/tascam/tascam.c
+++ b/sound/firewire/tascam/tascam.c
@@ -82,6 +82,7 @@ static void tscm_card_free(struct snd_card *card)
{
struct snd_tscm *tscm = card->private_data;
+ snd_tscm_transaction_unregister(tscm);
snd_tscm_stream_destroy_duplex(tscm);
fw_unit_put(tscm->unit);
@@ -127,6 +128,10 @@ static int snd_tscm_probe(struct fw_unit *unit,
if (err < 0)
goto error;
+ err = snd_tscm_transaction_register(tscm);
+ if (err < 0)
+ goto error;
+
err = snd_tscm_create_hwdep_device(tscm);
if (err < 0)
goto error;
@@ -147,6 +152,8 @@ static void snd_tscm_update(struct fw_unit *unit)
{
struct snd_tscm *tscm = dev_get_drvdata(&unit->device);
+ snd_tscm_transaction_reregister(tscm);
+
mutex_lock(&tscm->mutex);
snd_tscm_stream_update_duplex(tscm);
mutex_unlock(&tscm->mutex);