summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-04-14 16:46:32 +0900
committerTakashi Iwai <tiwai@suse.de>2017-04-14 14:50:43 +0200
commitae369e559f16c5245d6b987c43799179af16e4d6 (patch)
treeae86ea2cd156f7e27ef9b04ba55cf0136ecee7e2 /sound
parent1f94205d2225339c77e64d5872ec575ee2815720 (diff)
downloadlinux-ae369e559f16c5245d6b987c43799179af16e4d6.tar.bz2
ALSA: firewire-tascam: support drain callback for MIDI playback substream
ALSA driver for TASCAM FireWire series transfers MIDI messages in system workqueue. In current design of the driver, applications should wait for sequence of transmission when they close ALSA rawmidi character devices. However, when considering design of rawmidi interface, it's preferable to wait in drain ioctl. This commit adds support for the drain ioctl to wait for the end of the transmission. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/firewire/tascam/tascam-midi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/firewire/tascam/tascam-midi.c b/sound/firewire/tascam/tascam-midi.c
index 760f72a86c27..4a741570d536 100644
--- a/sound/firewire/tascam/tascam-midi.c
+++ b/sound/firewire/tascam/tascam-midi.c
@@ -31,11 +31,14 @@ static int midi_capture_close(struct snd_rawmidi_substream *substream)
static int midi_playback_close(struct snd_rawmidi_substream *substream)
{
+ return 0;
+}
+
+static void midi_playback_drain(struct snd_rawmidi_substream *substream)
+{
struct snd_tscm *tscm = substream->rmidi->private_data;
snd_fw_async_midi_port_finish(&tscm->out_ports[substream->number]);
-
- return 0;
}
static void midi_capture_trigger(struct snd_rawmidi_substream *substrm, int up)
@@ -77,6 +80,7 @@ int snd_tscm_create_midi_devices(struct snd_tscm *tscm)
static const struct snd_rawmidi_ops playback_ops = {
.open = midi_playback_open,
.close = midi_playback_close,
+ .drain = midi_playback_drain,
.trigger = midi_playback_trigger,
};
struct snd_rawmidi *rmidi;