aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/tascam/tascam.h
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.h
parentALSA: firewire-digi00x: add support for MIDI ports for physical controls (diff)
downloadlinux-dev-107cc0129a685e88d09af88b8a371caec5c51ff0.tar.xz
linux-dev-107cc0129a685e88d09af88b8a371caec5c51ff0.zip
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 '')
-rw-r--r--sound/firewire/tascam/tascam.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/firewire/tascam/tascam.h b/sound/firewire/tascam/tascam.h
index 75a3b9a81fea..b0e602bb5c8f 100644
--- a/sound/firewire/tascam/tascam.h
+++ b/sound/firewire/tascam/tascam.h
@@ -25,6 +25,7 @@
#include <sound/pcm_params.h>
#include <sound/firewire.h>
#include <sound/hwdep.h>
+#include <sound/rawmidi.h>
#include "../lib.h"
#include "../amdtp-stream.h"
@@ -41,6 +42,9 @@ struct snd_tscm_spec {
bool is_controller;
};
+#define TSCM_MIDI_IN_PORT_MAX 4
+#define TSCM_MIDI_OUT_PORT_MAX 4
+
struct snd_tscm {
struct snd_card *card;
struct fw_unit *unit;
@@ -59,6 +63,10 @@ struct snd_tscm {
int dev_lock_count;
bool dev_lock_changed;
wait_queue_head_t hwdep_wait;
+
+ /* For MIDI message incoming transactions. */
+ struct fw_address_handler async_handler;
+ struct snd_rawmidi_substream *tx_midi_substreams[TSCM_MIDI_IN_PORT_MAX];
};
#define TSCM_ADDR_BASE 0xffff00000000ull
@@ -81,6 +89,12 @@ struct snd_tscm {
#define TSCM_OFFSET_CLOCK_STATUS 0x0228
#define TSCM_OFFSET_SET_OPTION 0x022c
+#define TSCM_OFFSET_MIDI_TX_ON 0x0300
+#define TSCM_OFFSET_MIDI_TX_ADDR_HI 0x0304
+#define TSCM_OFFSET_MIDI_TX_ADDR_LO 0x0308
+
+#define TSCM_OFFSET_MIDI_RX_QUAD 0x4000
+
enum snd_tscm_clock {
SND_TSCM_CLOCK_INTERNAL = 0,
SND_TSCM_CLOCK_WORD = 1,
@@ -108,6 +122,10 @@ void snd_tscm_stream_lock_changed(struct snd_tscm *tscm);
int snd_tscm_stream_lock_try(struct snd_tscm *tscm);
void snd_tscm_stream_lock_release(struct snd_tscm *tscm);
+int snd_tscm_transaction_register(struct snd_tscm *tscm);
+int snd_tscm_transaction_reregister(struct snd_tscm *tscm);
+void snd_tscm_transaction_unregister(struct snd_tscm *tscm);
+
void snd_tscm_proc_init(struct snd_tscm *tscm);
int snd_tscm_create_pcm_devices(struct snd_tscm *tscm);