]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/firewire/bebob/bebob_pcm.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[karo-tx-linux.git] / sound / firewire / bebob / bebob_pcm.c
index 4a55561ed4ec028084a6d2f5bbd43f33c74f38e5..7a2c1f53bc4436e018b3081507f8577420bc869a 100644 (file)
@@ -157,7 +157,7 @@ pcm_open(struct snd_pcm_substream *substream)
        struct snd_bebob *bebob = substream->private_data;
        struct snd_bebob_rate_spec *spec = bebob->spec->rate;
        unsigned int sampling_rate;
-       bool internal;
+       enum snd_bebob_clock_type src;
        int err;
 
        err = snd_bebob_stream_lock_try(bebob);
@@ -168,7 +168,7 @@ pcm_open(struct snd_pcm_substream *substream)
        if (err < 0)
                goto err_locked;
 
-       err = snd_bebob_stream_check_internal_clock(bebob, &internal);
+       err = snd_bebob_stream_get_clock_src(bebob, &src);
        if (err < 0)
                goto err_locked;
 
@@ -176,7 +176,7 @@ pcm_open(struct snd_pcm_substream *substream)
         * When source of clock is internal or any PCM stream are running,
         * the available sampling rate is limited at current sampling rate.
         */
-       if (!internal ||
+       if (src == SND_BEBOB_CLOCK_TYPE_EXTERNAL ||
            amdtp_stream_pcm_running(&bebob->tx_stream) ||
            amdtp_stream_pcm_running(&bebob->rx_stream)) {
                err = spec->get(bebob, &sampling_rate);
@@ -213,7 +213,7 @@ pcm_capture_hw_params(struct snd_pcm_substream *substream,
        struct snd_bebob *bebob = substream->private_data;
 
        if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN)
-               atomic_inc(&bebob->capture_substreams);
+               atomic_inc(&bebob->substreams_counter);
        amdtp_stream_set_pcm_format(&bebob->tx_stream,
                                    params_format(hw_params));
        return snd_pcm_lib_alloc_vmalloc_buffer(substream,
@@ -226,7 +226,7 @@ pcm_playback_hw_params(struct snd_pcm_substream *substream,
        struct snd_bebob *bebob = substream->private_data;
 
        if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN)
-               atomic_inc(&bebob->playback_substreams);
+               atomic_inc(&bebob->substreams_counter);
        amdtp_stream_set_pcm_format(&bebob->rx_stream,
                                    params_format(hw_params));
        return snd_pcm_lib_alloc_vmalloc_buffer(substream,
@@ -239,7 +239,7 @@ pcm_capture_hw_free(struct snd_pcm_substream *substream)
        struct snd_bebob *bebob = substream->private_data;
 
        if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
-               atomic_dec(&bebob->capture_substreams);
+               atomic_dec(&bebob->substreams_counter);
 
        snd_bebob_stream_stop_duplex(bebob);
 
@@ -251,7 +251,7 @@ pcm_playback_hw_free(struct snd_pcm_substream *substream)
        struct snd_bebob *bebob = substream->private_data;
 
        if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
-               atomic_dec(&bebob->playback_substreams);
+               atomic_dec(&bebob->substreams_counter);
 
        snd_bebob_stream_stop_duplex(bebob);