diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-12-08 16:10:49 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-10 10:50:00 +0100 |
commit | 8985f4ac1c42bd25799f294f4e87fa73064673c7 (patch) | |
tree | 04f57545162b29abfc8a6b0c2d2833721b4bcc78 /sound/firewire/oxfw/oxfw-pcm.c | |
parent | ALSA: oxfw: Add support for capture/playback MIDI messages (diff) | |
download | linux-8985f4ac1c42bd25799f294f4e87fa73064673c7.tar.xz linux-8985f4ac1c42bd25799f294f4e87fa73064673c7.zip |
ALSA: oxfw: Add hwdep interface
This interface is designed for mixer/control application. By using this
interface, an application can get information about firewire node, can
lock/unlock kernel streaming and can get notification at starting/stopping
kernel streaming.
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-pcm.c')
-rw-r--r-- | sound/firewire/oxfw/oxfw-pcm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/firewire/oxfw/oxfw-pcm.c b/sound/firewire/oxfw/oxfw-pcm.c index e84fc9c4bfd1..9bc556b15a92 100644 --- a/sound/firewire/oxfw/oxfw-pcm.c +++ b/sound/firewire/oxfw/oxfw-pcm.c @@ -192,10 +192,14 @@ static int pcm_open(struct snd_pcm_substream *substream) struct snd_oxfw *oxfw = substream->private_data; int err; - err = init_hw_params(oxfw, substream); + err = snd_oxfw_stream_lock_try(oxfw); if (err < 0) goto end; + err = init_hw_params(oxfw, substream); + if (err < 0) + goto err_locked; + /* * When any PCM streams are already running, the available sampling * rate is limited at current value. @@ -210,10 +214,16 @@ static int pcm_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); end: return err; +err_locked: + snd_oxfw_stream_lock_release(oxfw); + return err; } static int pcm_close(struct snd_pcm_substream *substream) { + struct snd_oxfw *oxfw = substream->private_data; + + snd_oxfw_stream_lock_release(oxfw); return 0; } |