diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-12-08 10:10:49 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-10 04:50:00 -0500 |
commit | 8985f4ac1c42bd25799f294f4e87fa73064673c7 (patch) | |
tree | 04f57545162b29abfc8a6b0c2d2833721b4bcc78 /sound/firewire/oxfw/oxfw-pcm.c | |
parent | 05588d340a128ff5c7b768c517150e31842a78aa (diff) |
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) | |||
192 | struct snd_oxfw *oxfw = substream->private_data; | 192 | struct snd_oxfw *oxfw = substream->private_data; |
193 | int err; | 193 | int err; |
194 | 194 | ||
195 | err = init_hw_params(oxfw, substream); | 195 | err = snd_oxfw_stream_lock_try(oxfw); |
196 | if (err < 0) | 196 | if (err < 0) |
197 | goto end; | 197 | goto end; |
198 | 198 | ||
199 | err = init_hw_params(oxfw, substream); | ||
200 | if (err < 0) | ||
201 | goto err_locked; | ||
202 | |||
199 | /* | 203 | /* |
200 | * When any PCM streams are already running, the available sampling | 204 | * When any PCM streams are already running, the available sampling |
201 | * rate is limited at current value. | 205 | * rate is limited at current value. |
@@ -210,10 +214,16 @@ static int pcm_open(struct snd_pcm_substream *substream) | |||
210 | snd_pcm_set_sync(substream); | 214 | snd_pcm_set_sync(substream); |
211 | end: | 215 | end: |
212 | return err; | 216 | return err; |
217 | err_locked: | ||
218 | snd_oxfw_stream_lock_release(oxfw); | ||
219 | return err; | ||
213 | } | 220 | } |
214 | 221 | ||
215 | static int pcm_close(struct snd_pcm_substream *substream) | 222 | static int pcm_close(struct snd_pcm_substream *substream) |
216 | { | 223 | { |
224 | struct snd_oxfw *oxfw = substream->private_data; | ||
225 | |||
226 | snd_oxfw_stream_lock_release(oxfw); | ||
217 | return 0; | 227 | return 0; |
218 | } | 228 | } |
219 | 229 | ||