summaryrefslogtreecommitdiffstats
path: root/sound/firewire/amdtp.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 15:45:10 +0200
committerTakashi Iwai <tiwai@suse.de>2014-05-26 14:28:14 +0200
commit53111cdc53205fd35aac392c1d33893766be514e (patch)
tree7d03049d4b5dfc0ec256e6be982192e6bb1610c8 /sound/firewire/amdtp.c
parentALSA: fireworks: Add MIDI interface (diff)
downloadlinux-53111cdc53205fd35aac392c1d33893766be514e.tar.xz
linux-53111cdc53205fd35aac392c1d33893766be514e.zip
ALSA: fireworks/firewire-lib: Add a quirk of data blocks for MIDI in out-stream
Fireworks has a quirk to ignore MIDI messages in data blocks more than 8. This commit adds a flag for this quirk and codes to skip 8 or more data blocks to transfer MIDI messages. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp.c')
-rw-r--r--sound/firewire/amdtp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 5e13b3f15516..28ee3d86164d 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -78,6 +78,8 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
s->callbacked = false;
s->sync_slave = NULL;
+ s->rx_blocks_for_midi = UINT_MAX;
+
return 0;
}
EXPORT_SYMBOL(amdtp_stream_init);
@@ -472,7 +474,8 @@ static void amdtp_fill_midi(struct amdtp_stream *s,
b = (u8 *)&buffer[s->midi_position];
port = (s->data_block_counter + f) % 8;
- if ((s->midi[port] == NULL) ||
+ if ((f >= s->rx_blocks_for_midi) ||
+ (s->midi[port] == NULL) ||
(snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0))
b[0] = 0x80;
else