Lines Matching full:ff

3  * ff-pcm.c - a part of driver for RME Fireface series
8 #include "ff.h"
104 static int pcm_init_hw_params(struct snd_ff *ff, in pcm_init_hw_params() argument
114 s = &ff->tx_stream; in pcm_init_hw_params()
115 pcm_channels = ff->spec->pcm_capture_channels; in pcm_init_hw_params()
118 s = &ff->rx_stream; in pcm_init_hw_params()
119 pcm_channels = ff->spec->pcm_playback_channels; in pcm_init_hw_params()
141 struct snd_ff *ff = substream->private_data; in pcm_open() local
142 struct amdtp_domain *d = &ff->domain; in pcm_open()
147 err = snd_ff_stream_lock_try(ff); in pcm_open()
151 err = pcm_init_hw_params(ff, substream); in pcm_open()
155 err = ff->spec->protocol->get_clock(ff, &rate, &src); in pcm_open()
159 mutex_lock(&ff->mutex); in pcm_open()
173 mutex_unlock(&ff->mutex); in pcm_open()
181 if (ff->substreams_counter > 0) { in pcm_open()
185 rate = amdtp_rate_table[ff->rx_stream.sfc]; in pcm_open()
193 mutex_unlock(&ff->mutex); in pcm_open()
201 mutex_unlock(&ff->mutex); in pcm_open()
207 mutex_unlock(&ff->mutex); in pcm_open()
214 snd_ff_stream_lock_release(ff); in pcm_open()
220 struct snd_ff *ff = substream->private_data; in pcm_close() local
222 snd_ff_stream_lock_release(ff); in pcm_close()
230 struct snd_ff *ff = substream->private_data; in pcm_hw_params() local
238 mutex_lock(&ff->mutex); in pcm_hw_params()
239 err = snd_ff_stream_reserve_duplex(ff, rate, frames_per_period, in pcm_hw_params()
242 ++ff->substreams_counter; in pcm_hw_params()
243 mutex_unlock(&ff->mutex); in pcm_hw_params()
251 struct snd_ff *ff = substream->private_data; in pcm_hw_free() local
253 mutex_lock(&ff->mutex); in pcm_hw_free()
256 --ff->substreams_counter; in pcm_hw_free()
258 snd_ff_stream_stop_duplex(ff); in pcm_hw_free()
260 mutex_unlock(&ff->mutex); in pcm_hw_free()
267 struct snd_ff *ff = substream->private_data; in pcm_capture_prepare() local
271 mutex_lock(&ff->mutex); in pcm_capture_prepare()
273 err = snd_ff_stream_start_duplex(ff, runtime->rate); in pcm_capture_prepare()
275 amdtp_stream_pcm_prepare(&ff->tx_stream); in pcm_capture_prepare()
277 mutex_unlock(&ff->mutex); in pcm_capture_prepare()
284 struct snd_ff *ff = substream->private_data; in pcm_playback_prepare() local
288 mutex_lock(&ff->mutex); in pcm_playback_prepare()
290 err = snd_ff_stream_start_duplex(ff, runtime->rate); in pcm_playback_prepare()
292 amdtp_stream_pcm_prepare(&ff->rx_stream); in pcm_playback_prepare()
294 mutex_unlock(&ff->mutex); in pcm_playback_prepare()
301 struct snd_ff *ff = substream->private_data; in pcm_capture_trigger() local
305 amdtp_stream_pcm_trigger(&ff->tx_stream, substream); in pcm_capture_trigger()
308 amdtp_stream_pcm_trigger(&ff->tx_stream, NULL); in pcm_capture_trigger()
319 struct snd_ff *ff = substream->private_data; in pcm_playback_trigger() local
323 amdtp_stream_pcm_trigger(&ff->rx_stream, substream); in pcm_playback_trigger()
326 amdtp_stream_pcm_trigger(&ff->rx_stream, NULL); in pcm_playback_trigger()
337 struct snd_ff *ff = sbstrm->private_data; in pcm_capture_pointer() local
339 return amdtp_domain_stream_pcm_pointer(&ff->domain, &ff->tx_stream); in pcm_capture_pointer()
344 struct snd_ff *ff = sbstrm->private_data; in pcm_playback_pointer() local
346 return amdtp_domain_stream_pcm_pointer(&ff->domain, &ff->rx_stream); in pcm_playback_pointer()
351 struct snd_ff *ff = substream->private_data; in pcm_capture_ack() local
353 return amdtp_domain_stream_pcm_ack(&ff->domain, &ff->tx_stream); in pcm_capture_ack()
358 struct snd_ff *ff = substream->private_data; in pcm_playback_ack() local
360 return amdtp_domain_stream_pcm_ack(&ff->domain, &ff->rx_stream); in pcm_playback_ack()
363 int snd_ff_create_pcm_devices(struct snd_ff *ff) in snd_ff_create_pcm_devices() argument
388 err = snd_pcm_new(ff->card, ff->card->driver, 0, 1, 1, &pcm); in snd_ff_create_pcm_devices()
392 pcm->private_data = ff; in snd_ff_create_pcm_devices()
394 "%s PCM", ff->card->shortname); in snd_ff_create_pcm_devices()