diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-12-11 19:17:34 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-12-11 14:57:38 +0100 |
commit | aef4ad2f5aa27ec05f0306547bcf7cf86a9e9873 (patch) | |
tree | b05dce2d6f44e7c144ca8d959091e0bd6e629250 /sound/firewire/fireface/ff-transaction.c | |
parent | 3eb8a24459491acc40440b655ca640c87125c5a3 (diff) |
ALSA: fireface: localize a handler for MIDI messages on tx transaction
Content of asynchronous transaction for MIDI messages differs between
Fireface 400 and 800.
This commit adds a model-specific handler for the transaction and adds
arrangement.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface/ff-transaction.c')
-rw-r--r-- | sound/firewire/fireface/ff-transaction.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/sound/firewire/fireface/ff-transaction.c b/sound/firewire/fireface/ff-transaction.c index 1ce4cef6ca35..d8768348067b 100644 --- a/sound/firewire/fireface/ff-transaction.c +++ b/sound/firewire/fireface/ff-transaction.c @@ -206,42 +206,10 @@ static void handle_midi_msg(struct fw_card *card, struct fw_request *request, { struct snd_ff *ff = callback_data; __le32 *buf = data; - u32 quad; - u8 byte; - unsigned int index; - struct snd_rawmidi_substream *substream; - int i; fw_send_response(card, request, RCODE_COMPLETE); - for (i = 0; i < length / 4; i++) { - quad = le32_to_cpu(buf[i]); - - /* Message in first port. */ - /* - * This value may represent the index of this unit when the same - * units are on the same IEEE 1394 bus. This driver doesn't use - * it. - */ - index = (quad >> 8) & 0xff; - if (index > 0) { - substream = READ_ONCE(ff->tx_midi_substreams[0]); - if (substream != NULL) { - byte = quad & 0xff; - snd_rawmidi_receive(substream, &byte, 1); - } - } - - /* Message in second port. */ - index = (quad >> 24) & 0xff; - if (index > 0) { - substream = READ_ONCE(ff->tx_midi_substreams[1]); - if (substream != NULL) { - byte = (quad >> 16) & 0xff; - snd_rawmidi_receive(substream, &byte, 1); - } - } - } + ff->spec->protocol->handle_midi_msg(ff, buf, length); } static int allocate_own_address(struct snd_ff *ff, int i) |