ALSA: bebob: add SYT-Match support
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 14 Jun 2015 03:49:32 +0000 (12:49 +0900)
committerTakashi Iwai <tiwai@suse.de>
Mon, 15 Jun 2015 11:37:07 +0000 (13:37 +0200)
In previous commits, this driver can detect the source of clock as mush
as possible. SYT-Match mode is also available.

This commit purge the restriction.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/bebob/bebob_pcm.c
sound/firewire/bebob/bebob_stream.c

index e3f65a0698c7a5e04a9cac0f29ad080ae045b1fa..e0a6b065952fa4a595126e9b4c8538e2dc8fa96f 100644 (file)
@@ -171,11 +171,6 @@ pcm_open(struct snd_pcm_substream *substream)
        err = snd_bebob_stream_get_clock_src(bebob, &src);
        if (err < 0)
                goto err_locked;
-       /* SYT-Match is not supported. */
-       if (src == SND_BEBOB_CLOCK_TYPE_SYT) {
-               err = -EBUSY;
-               goto err_locked;
-       }
 
        /*
         * When source of clock is internal or any PCM stream are running,
index c8af8ffe2d53b6459fdb2b6fad91944c24b4e7a5..5335c300728c52e56ae2056b02092e8705c16ccf 100644 (file)
@@ -474,8 +474,24 @@ destroy_both_connections(struct snd_bebob *bebob)
 static int
 get_sync_mode(struct snd_bebob *bebob, enum cip_flags *sync_mode)
 {
-       /* currently this module doesn't support SYT-Match mode */
-       *sync_mode = CIP_SYNC_TO_DEVICE;
+       enum snd_bebob_clock_type src;
+       int err;
+
+       err = snd_bebob_stream_get_clock_src(bebob, &src);
+       if (err < 0)
+               return err;
+
+       switch (src) {
+       case SND_BEBOB_CLOCK_TYPE_INTERNAL:
+       case SND_BEBOB_CLOCK_TYPE_EXTERNAL:
+               *sync_mode = CIP_SYNC_TO_DEVICE;
+               break;
+       default:
+       case SND_BEBOB_CLOCK_TYPE_SYT:
+               *sync_mode = 0;
+               break;
+       }
+
        return 0;
 }