summaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireworks/fireworks_midi.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-06-12 17:44:11 +0900
committerTakashi Iwai <tiwai@suse.de>2019-06-12 15:26:52 +0200
commit3d7250667ea96e7f9738caa6d5af85d87982066e (patch)
tree8268c629a8ff269c6896d0ae7175a03e6d77d8bf /sound/firewire/fireworks/fireworks_midi.c
parentfb56eb73c6266164e4b06c9eca9716348420dbf1 (diff)
ALSA: fireworks: configure sampling transfer frequency in pcm.hw_params callback
This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. At present, several operations are done in pcm.prepare callback. To reduce load of the callback, This commit splits out an operation to set sampling transfer frequency in pcm.hw_params callback. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireworks/fireworks_midi.c')
-rw-r--r--sound/firewire/fireworks/fireworks_midi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/firewire/fireworks/fireworks_midi.c b/sound/firewire/fireworks/fireworks_midi.c
index ee5dc7be70b6..6d3d942e2dce 100644
--- a/sound/firewire/fireworks/fireworks_midi.c
+++ b/sound/firewire/fireworks/fireworks_midi.c
@@ -18,8 +18,11 @@ static int midi_open(struct snd_rawmidi_substream *substream)
goto end;
mutex_lock(&efw->mutex);
- ++efw->substreams_counter;
- err = snd_efw_stream_start_duplex(efw, 0);
+ err = snd_efw_stream_reserve_duplex(efw, 0);
+ if (err >= 0) {
+ ++efw->substreams_counter;
+ err = snd_efw_stream_start_duplex(efw);
+ }
mutex_unlock(&efw->mutex);
if (err < 0)
snd_efw_stream_lock_release(efw);