alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org, clemens@ladisch.de
Subject: [PATCH v4 11/11] ALSA: oxfw: add quirk flag for blocking transmission method
Date: Tue, 18 May 2021 17:45:57 +0900	[thread overview]
Message-ID: <20210518084557.102681-12-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <20210518084557.102681-1-o-takashi@sakamocchi.jp>

Stanton SCS.1m and Apogee Duet FireWire use blocking transmission method
unlike the other models.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/oxfw/oxfw-stream.c |  7 ++++++-
 sound/firewire/oxfw/oxfw.c        | 14 +++++++++++---
 sound/firewire/oxfw/oxfw.h        |  2 ++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c
index 5771ff44dd5d..e9b6a9f171bf 100644
--- a/sound/firewire/oxfw/oxfw-stream.c
+++ b/sound/firewire/oxfw/oxfw-stream.c
@@ -153,9 +153,14 @@ static int init_stream(struct snd_oxfw *oxfw, struct amdtp_stream *stream)
 	struct cmp_connection *conn;
 	enum cmp_direction c_dir;
 	enum amdtp_stream_direction s_dir;
-	unsigned int flags = CIP_NONBLOCKING;
+	unsigned int flags;
 	int err;
 
+	if (!(oxfw->quirks & SND_OXFW_QUIRK_BLOCKING_TRANSMISSION))
+		flags = CIP_NONBLOCKING;
+	else
+		flags = CIP_BLOCKING;
+
 	if (stream == &oxfw->tx_stream) {
 		conn = &oxfw->out_conn;
 		c_dir = CMP_OUTPUT;
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index 966697dace47..59bffa32636c 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -23,6 +23,8 @@
 #define OUI_APOGEE		0x0003db
 
 #define MODEL_SATELLITE		0x00200f
+#define MODEL_SCS1M		0x001000
+#define MODEL_DUET_FW		0x01dddd
 
 #define SPECIFIER_1394TA	0x00a02d
 #define VERSION_AVC		0x010001
@@ -144,13 +146,19 @@ static int detect_quirks(struct snd_oxfw *oxfw)
 	 * messages.
 	 */
 	if (oxfw->entry->vendor_id == OUI_STANTON) {
-		/* No physical MIDI ports. */
+		if (oxfw->entry->model_id == MODEL_SCS1M)
+			oxfw->quirks |= SND_OXFW_QUIRK_BLOCKING_TRANSMISSION;
+
+		// No physical MIDI ports.
 		oxfw->midi_input_ports = 0;
 		oxfw->midi_output_ports = 0;
 
 		return snd_oxfw_scs1x_add(oxfw);
 	}
 
+	if (oxfw->entry->vendor_id == OUI_APOGEE && oxfw->entry->model_id == MODEL_DUET_FW)
+		oxfw->quirks |= SND_OXFW_QUIRK_BLOCKING_TRANSMISSION;
+
 	/*
 	 * TASCAM FireOne has physical control and requires a pair of additional
 	 * MIDI ports.
@@ -377,11 +385,11 @@ static const struct ieee1394_device_id oxfw_id_table[] = {
 	// TASCAM, FireOne.
 	OXFW_DEV_ENTRY(VENDOR_TASCAM, 0x800007, NULL),
 	// Stanton, Stanton Controllers & Systems 1 Mixer (SCS.1m).
-	OXFW_DEV_ENTRY(OUI_STANTON, 0x001000, NULL),
+	OXFW_DEV_ENTRY(OUI_STANTON, MODEL_SCS1M, NULL),
 	// Stanton, Stanton Controllers & Systems 1 Deck (SCS.1d).
 	OXFW_DEV_ENTRY(OUI_STANTON, 0x002000, NULL),
 	// APOGEE, duet FireWire.
-	OXFW_DEV_ENTRY(OUI_APOGEE, 0x01dddd, NULL),
+	OXFW_DEV_ENTRY(OUI_APOGEE, MODEL_DUET_FW, NULL),
 	{ }
 };
 MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table);
diff --git a/sound/firewire/oxfw/oxfw.h b/sound/firewire/oxfw/oxfw.h
index 4002998d41e8..853135b5002d 100644
--- a/sound/firewire/oxfw/oxfw.h
+++ b/sound/firewire/oxfw/oxfw.h
@@ -38,6 +38,8 @@ enum snd_oxfw_quirk {
 	SND_OXFW_QUIRK_JUMBO_PAYLOAD = 0x01,
 	// The dbs field of CIP header in tx packet is wrong.
 	SND_OXFW_QUIRK_WRONG_DBS = 0x02,
+	// Blocking transmission mode is used.
+	SND_OXFW_QUIRK_BLOCKING_TRANSMISSION = 0x04,
 };
 
 /* This is an arbitrary number for convinience. */
-- 
2.27.0


  parent reply	other threads:[~2021-05-18  8:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  8:45 [PATCH v4 00/11] ALSA: oxfw: code refactoring for quirks specific to ASICs Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 01/11] Revert "ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro" Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 02/11] ALSA: firewire-lib/motu: use int type for the value of bitwise OR with enumerator-constant Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 03/11] ALSA: oxfw: code refactoring for existent device entry with specifier_id and version Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 04/11] ALSA: oxfw: code refactoring to detect mackie models Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 05/11] ALSA: oxfw: add explicit device entry for Loud Technologies Tapco Link.FireWire 4x6 Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 06/11] ALSA: oxfw: add explicit device entry for Loud Technologies Mackie Onyx Sattelite Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 07/11] ALSA: oxfw: add comment for the type of ASICs Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 08/11] ALSA: oxfw: code refactoring for jumbo-payload quirk in OXFW970 Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 09/11] ALSA: firewire-lib: code refactoring for jumbo payload quirk Takashi Sakamoto
2021-05-18  8:45 ` [PATCH v4 10/11] ALSA: oxfw: code refactoring for wrong_dbs quirk Takashi Sakamoto
2021-05-18  8:45 ` Takashi Sakamoto [this message]
2021-05-18 10:29 ` [PATCH v4 00/11] ALSA: oxfw: code refactoring for quirks specific to ASICs Takashi Iwai

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=20210518084557.102681-12-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).