diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-09-19 04:21:59 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-09-29 12:48:49 +0200 |
commit | 03e2a67eed7bf2e4c701587080bc8d60dd45209c (patch) | |
tree | fc564a3251471f2b26db4b0b7b740fa5ae9f7041 /sound/firewire/amdtp-am824.c | |
parent | ALSA: firewire-lib: add helper functions to set positions of data channels (diff) | |
download | linux-03e2a67eed7bf2e4c701587080bc8d60dd45209c.tar.xz linux-03e2a67eed7bf2e4c701587080bc8d60dd45209c.zip |
ALSA: firewire-lib: move MIDI trigger helper function to AM824 layer
In IEC 61883-6, MIDI messages are transferred in MIDI conformant data
channel. Essentially, packet streaming layer is not responsible for MIDI
functionality.
This commit moves MIDI trigger helper function from the layer to AM824
layer. The rest of codes related to MIDI functionality will be moved in
later commits.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp-am824.c')
-rw-r--r-- | sound/firewire/amdtp-am824.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/firewire/amdtp-am824.c b/sound/firewire/amdtp-am824.c index 5d99a9921d50..540a101661e2 100644 --- a/sound/firewire/amdtp-am824.c +++ b/sound/firewire/amdtp-am824.c @@ -101,6 +101,24 @@ int amdtp_am824_add_pcm_hw_constraints(struct amdtp_stream *s, EXPORT_SYMBOL_GPL(amdtp_am824_add_pcm_hw_constraints); /** + * amdtp_am824_midi_trigger - start/stop playback/capture with a MIDI device + * @s: the AMDTP stream + * @port: index of MIDI port + * @midi: the MIDI device to be started, or %NULL to stop the current device + * + * Call this function on a running isochronous stream to enable the actual + * transmission of MIDI data. This function should be called from the MIDI + * device's .trigger callback. + */ +void amdtp_am824_midi_trigger(struct amdtp_stream *s, unsigned int port, + struct snd_rawmidi_substream *midi) +{ + if (port < s->midi_ports) + ACCESS_ONCE(s->midi[port]) = midi; +} +EXPORT_SYMBOL_GPL(amdtp_am824_midi_trigger); + +/** * amdtp_am824_init - initialize an AMDTP stream structure to handle AM824 * data block * @s: the AMDTP stream to initialize |