summaryrefslogtreecommitdiffstats
path: root/sound/firewire/oxfw/oxfw.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-12-08 16:10:48 +0100
committerTakashi Iwai <tiwai@suse.de>2014-12-10 10:49:33 +0100
commit05588d340a128ff5c7b768c517150e31842a78aa (patch)
tree60a509a34e46e8ff91fae1e2da6f821adfa0d8e6 /sound/firewire/oxfw/oxfw.c
parentALSA: oxfw: add support for capturing PCM samples (diff)
downloadlinux-05588d340a128ff5c7b768c517150e31842a78aa.tar.xz
linux-05588d340a128ff5c7b768c517150e31842a78aa.zip
ALSA: oxfw: Add support for capture/playback MIDI messages
This commit adds MIDI functionality with an assumption of 'if the device has MIDI comformant data channels in its stream formation, the device has one MIDI port'. When no streams have already started, MIDI functionality starts stream with current sampling rate. When MIDI functionality has already starts some streams and PCM functionality is going to start streams at different sampling rate, this driver stops streams once and changes sampling rate, then restarts streams for both PCM/MIDI substreams. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/oxfw/oxfw.c')
-rw-r--r--sound/firewire/oxfw/oxfw.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index 23c00a2bb7d3..9cfbfb168dac 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -138,6 +138,7 @@ static int oxfw_probe(struct fw_unit *unit,
mutex_init(&oxfw->mutex);
oxfw->unit = unit;
oxfw->device_info = (const struct device_info *)id->driver_data;
+ spin_lock_init(&oxfw->lock);
err = snd_oxfw_stream_discover(oxfw);
if (err < 0)
@@ -159,6 +160,10 @@ static int oxfw_probe(struct fw_unit *unit,
snd_oxfw_proc_init(oxfw);
+ err = snd_oxfw_create_midi(oxfw);
+ if (err < 0)
+ goto error;
+
err = snd_oxfw_stream_init_simplex(oxfw, &oxfw->rx_stream);
if (err < 0)
goto error;