All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de, tiwai@suse.de
Cc: kim@incendio.no, alsa-devel@alsa-project.org, jh1ood@gmail.com,
	ffado-devel@lists.sf.net
Subject: [PATCH 06/11] ALSA: bebob: add SYT-Match support
Date: Mon,  8 Jun 2015 23:31:03 +0900	[thread overview]
Message-ID: <1433773868-17505-7-git-send-email-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <1433773868-17505-1-git-send-email-o-takashi@sakamocchi.jp>

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>
---
 sound/firewire/bebob/bebob_pcm.c    |  5 -----
 sound/firewire/bebob/bebob_stream.c | 20 ++++++++++++++++++--
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/sound/firewire/bebob/bebob_pcm.c b/sound/firewire/bebob/bebob_pcm.c
index e3f65a0..e0a6b06 100644
--- a/sound/firewire/bebob/bebob_pcm.c
+++ b/sound/firewire/bebob/bebob_pcm.c
@@ -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,
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index c8af8ff..5335c30 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;
 }
 
-- 
2.1.4

  parent reply	other threads:[~2015-06-08 14:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 14:30 [RFC][PATCH 00/11] improve support for DM1500/BeBoBv3 Takashi Sakamoto
2015-06-08 14:30 ` [PATCH 01/11] ALSA: bebob: improve signal mode detection for clock source Takashi Sakamoto
2015-06-08 14:30 ` [PATCH 02/11] ALSA: bebob: apply new enumerator to normalize the type of " Takashi Sakamoto
2015-06-08 14:31 ` [PATCH 03/11] ALSA: bebob: preparation for replacing string literals by normalized representation for model-dependent structures Takashi Sakamoto
2015-06-08 14:31 ` [PATCH 04/11] ALSA: bebob: use normalized representation for the type of clock source Takashi Sakamoto
2015-06-08 14:31 ` [PATCH 05/11] ALSA: bebob: obsolete string literal expression for " Takashi Sakamoto
2015-06-08 14:31 ` Takashi Sakamoto [this message]
2015-06-08 14:31 ` [PATCH 07/11] ALSA: bebob: add 'version' member for BeBoB protocol version Takashi Sakamoto
2015-06-08 14:31 ` [PATCH 08/11] ALSA: bebob: expand timeout for DM1500 quirk Takashi Sakamoto
2015-06-08 14:31 ` [PATCH 09/11] ALSA: bebob: loosen up severity of checking continuity for BeBoB v3 quirk Takashi Sakamoto
2015-06-08 14:31 ` [PATCH 10/11] ALSA: bebob: keep duplex streams always to keep internal multiplexer properly Takashi Sakamoto
2015-06-08 14:31 ` [PATCH 11/11] ALSA: bebob: add support for Behringer FCA 610/1616 Takashi Sakamoto
2015-06-14  3:49 [PATCH 00/11] ALSA: bebob: improve support for DM1500/BeBoBv3 Takashi Sakamoto
2015-06-14  3:49 ` [PATCH 06/11] ALSA: bebob: add SYT-Match support Takashi Sakamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433773868-17505-7-git-send-email-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sf.net \
    --cc=jh1ood@gmail.com \
    --cc=kim@incendio.no \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.