summaryrefslogtreecommitdiff
path: root/sound/firewire/bebob/bebob_stream.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2015-06-14 12:49:32 +0900
committerTakashi Iwai <tiwai@suse.de>2015-06-15 13:37:07 +0200
commit05773792716e5a75b0f4bf4edcdc1e9c3b199ab8 (patch)
tree181e932e401049fb83ee1a086758e1e0af0d070d /sound/firewire/bebob/bebob_stream.c
parent554d8983a07d853bc4761c575db2f1bbb2f14372 (diff)
ALSA: bebob: add SYT-Match support
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>
Diffstat (limited to 'sound/firewire/bebob/bebob_stream.c')
-rw-r--r--sound/firewire/bebob/bebob_stream.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index c8af8ffe2d53..5335c300728c 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -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;
}