Lines Matching refs:motu
69 static void limit_channels_and_rates(struct snd_motu *motu, in limit_channels_and_rates() argument
95 static int init_hw_info(struct snd_motu *motu, in init_hw_info() argument
106 stream = &motu->tx_stream; in init_hw_info()
107 formats = &motu->tx_packet_formats; in init_hw_info()
110 stream = &motu->rx_stream; in init_hw_info()
111 formats = &motu->rx_packet_formats; in init_hw_info()
114 limit_channels_and_rates(motu, runtime, formats); in init_hw_info()
132 struct snd_motu *motu = substream->private_data; in pcm_open() local
133 struct amdtp_domain *d = &motu->domain; in pcm_open()
137 err = snd_motu_stream_lock_try(motu); in pcm_open()
141 mutex_lock(&motu->mutex); in pcm_open()
143 err = snd_motu_stream_cache_packet_formats(motu); in pcm_open()
147 err = init_hw_info(motu, substream); in pcm_open()
151 err = snd_motu_protocol_get_clock_source(motu, &src); in pcm_open()
160 (motu->substreams_counter > 0 && d->events_per_period > 0)) { in pcm_open()
165 err = snd_motu_protocol_get_clock_rate(motu, &rate); in pcm_open()
189 mutex_unlock(&motu->mutex); in pcm_open()
193 mutex_unlock(&motu->mutex); in pcm_open()
194 snd_motu_stream_lock_release(motu); in pcm_open()
200 struct snd_motu *motu = substream->private_data; in pcm_close() local
202 snd_motu_stream_lock_release(motu); in pcm_close()
210 struct snd_motu *motu = substream->private_data; in pcm_hw_params() local
218 mutex_lock(&motu->mutex); in pcm_hw_params()
219 err = snd_motu_stream_reserve_duplex(motu, rate, in pcm_hw_params()
222 ++motu->substreams_counter; in pcm_hw_params()
223 mutex_unlock(&motu->mutex); in pcm_hw_params()
231 struct snd_motu *motu = substream->private_data; in pcm_hw_free() local
233 mutex_lock(&motu->mutex); in pcm_hw_free()
236 --motu->substreams_counter; in pcm_hw_free()
238 snd_motu_stream_stop_duplex(motu); in pcm_hw_free()
240 mutex_unlock(&motu->mutex); in pcm_hw_free()
247 struct snd_motu *motu = substream->private_data; in capture_prepare() local
250 mutex_lock(&motu->mutex); in capture_prepare()
251 err = snd_motu_stream_start_duplex(motu); in capture_prepare()
252 mutex_unlock(&motu->mutex); in capture_prepare()
254 amdtp_stream_pcm_prepare(&motu->tx_stream); in capture_prepare()
260 struct snd_motu *motu = substream->private_data; in playback_prepare() local
263 mutex_lock(&motu->mutex); in playback_prepare()
264 err = snd_motu_stream_start_duplex(motu); in playback_prepare()
265 mutex_unlock(&motu->mutex); in playback_prepare()
267 amdtp_stream_pcm_prepare(&motu->rx_stream); in playback_prepare()
274 struct snd_motu *motu = substream->private_data; in capture_trigger() local
278 amdtp_stream_pcm_trigger(&motu->tx_stream, substream); in capture_trigger()
281 amdtp_stream_pcm_trigger(&motu->tx_stream, NULL); in capture_trigger()
291 struct snd_motu *motu = substream->private_data; in playback_trigger() local
295 amdtp_stream_pcm_trigger(&motu->rx_stream, substream); in playback_trigger()
298 amdtp_stream_pcm_trigger(&motu->rx_stream, NULL); in playback_trigger()
309 struct snd_motu *motu = substream->private_data; in capture_pointer() local
311 return amdtp_domain_stream_pcm_pointer(&motu->domain, &motu->tx_stream); in capture_pointer()
315 struct snd_motu *motu = substream->private_data; in playback_pointer() local
317 return amdtp_domain_stream_pcm_pointer(&motu->domain, &motu->rx_stream); in playback_pointer()
322 struct snd_motu *motu = substream->private_data; in capture_ack() local
324 return amdtp_domain_stream_pcm_ack(&motu->domain, &motu->tx_stream); in capture_ack()
329 struct snd_motu *motu = substream->private_data; in playback_ack() local
331 return amdtp_domain_stream_pcm_ack(&motu->domain, &motu->rx_stream); in playback_ack()
334 int snd_motu_create_pcm_devices(struct snd_motu *motu) in snd_motu_create_pcm_devices() argument
359 err = snd_pcm_new(motu->card, motu->card->driver, 0, 1, 1, &pcm); in snd_motu_create_pcm_devices()
362 pcm->private_data = motu; in snd_motu_create_pcm_devices()
363 strcpy(pcm->name, motu->card->shortname); in snd_motu_create_pcm_devices()