mutex_lock(&motu->mutex);
- motu->capture_substreams++;
+ motu->substreams_counter++;
err = snd_motu_stream_start_duplex(motu, 0);
mutex_unlock(&motu->mutex);
mutex_lock(&motu->mutex);
- motu->playback_substreams++;
+ motu->substreams_counter++;
err = snd_motu_stream_start_duplex(motu, 0);
mutex_unlock(&motu->mutex);
mutex_lock(&motu->mutex);
- motu->capture_substreams--;
+ motu->substreams_counter--;
snd_motu_stream_stop_duplex(motu);
mutex_unlock(&motu->mutex);
mutex_lock(&motu->mutex);
- motu->playback_substreams--;
+ motu->substreams_counter--;
snd_motu_stream_stop_duplex(motu);
mutex_unlock(&motu->mutex);
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
mutex_lock(&motu->mutex);
- motu->capture_substreams++;
+ motu->substreams_counter++;
mutex_unlock(&motu->mutex);
}
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
mutex_lock(&motu->mutex);
- motu->playback_substreams++;
+ motu->substreams_counter++;
mutex_unlock(&motu->mutex);
}
mutex_lock(&motu->mutex);
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
- motu->capture_substreams--;
+ motu->substreams_counter--;
snd_motu_stream_stop_duplex(motu);
mutex_lock(&motu->mutex);
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
- motu->playback_substreams--;
+ motu->substreams_counter--;
snd_motu_stream_stop_duplex(motu);
unsigned int curr_rate;
int err = 0;
- if (motu->capture_substreams == 0 && motu->playback_substreams == 0)
+ if (motu->substreams_counter == 0)
return 0;
/* Some packet queueing errors. */
}
}
- if (!amdtp_stream_running(&motu->tx_stream) &&
- motu->capture_substreams > 0) {
+ if (!amdtp_stream_running(&motu->tx_stream)) {
err = start_isoc_ctx(motu, &motu->tx_stream);
if (err < 0) {
dev_err(&motu->unit->device,
void snd_motu_stream_stop_duplex(struct snd_motu *motu)
{
- if (motu->capture_substreams == 0) {
+ if (motu->substreams_counter == 0) {
if (amdtp_stream_running(&motu->tx_stream))
stop_isoc_ctx(motu, &motu->tx_stream);
- if (motu->playback_substreams == 0) {
- if (amdtp_stream_running(&motu->rx_stream))
- stop_isoc_ctx(motu, &motu->rx_stream);
- stop_both_streams(motu);
- }
+ if (amdtp_stream_running(&motu->rx_stream))
+ stop_isoc_ctx(motu, &motu->rx_stream);
}
}
destroy_stream(motu, AMDTP_IN_STREAM);
destroy_stream(motu, AMDTP_OUT_STREAM);
- motu->playback_substreams = 0;
- motu->capture_substreams = 0;
+ motu->substreams_counter = 0;
}
static void motu_lock_changed(struct snd_motu *motu)
struct amdtp_stream rx_stream;
struct fw_iso_resources tx_resources;
struct fw_iso_resources rx_resources;
- unsigned int capture_substreams;
- unsigned int playback_substreams;
+ unsigned int substreams_counter;
/* For notification. */
struct fw_address_handler async_handler;