All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de
Cc: alsa-devel@alsa-project.org, fenlason@redhat.com,
	ffado-devel@lists.sf.net, linux1394-devel@lists.sourceforge.net
Subject: [PATCH 12/15] oxfw: Add support for Behringer/Mackie devices
Date: Tue, 13 May 2014 23:27:49 +0900	[thread overview]
Message-ID: <1399991272-5807-13-git-send-email-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <1399991272-5807-1-git-send-email-o-takashi@sakamocchi.jp>

Some devices produced by Behringer/Mackie are based on OXFW970/971. This
commit adds support for them. Additionally, this commit changes the way to
name card with some information in config rom.

The devices support capture/playback of PCM-samples and some of them
supports capture/playback of MIDI messages. These functionalities are
implemented by followed commits.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/Kconfig     |  4 +++
 sound/firewire/oxfw/oxfw.c | 74 +++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 70 insertions(+), 8 deletions(-)

diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig
index 63f3cea..38027bd 100644
--- a/sound/firewire/Kconfig
+++ b/sound/firewire/Kconfig
@@ -35,6 +35,10 @@ config SND_OXFW
 	  Oxford Semiconductor OXFW970/971 chipset.
 	   * Griffin Firewave
 	   * LaCie Firewire Speakers
+	   * Behringer F-Control Audio 202
+	   * Mackie(Loud) Onyx-i series (former models)
+	   * Mackie(Loud) Onyx Satellite
+	   * Mackie(Loud) Tapco Link.Firewire
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called snd-oxfw.
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index 825377a..0c9b8e2 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -16,6 +16,8 @@
 
 #define VENDOR_GRIFFIN		0x001292
 #define VENDOR_LACIE		0x00d04b
+#define VEN_BEHRINGER		0x001564
+#define VEN_LOUD		0x000ff2
 
 #define SPECIFIER_1394TA	0x00a02d
 #define VERSION_AVC		0x010001
@@ -44,19 +46,40 @@ static const struct device_info lacie_speakers = {
 static int name_card(struct snd_oxfw *oxfw)
 {
 	struct fw_device *fw_dev = fw_parent_device(oxfw->unit);
+	char vendor[24] = {0};
+	char model[32] = {0};
 	const char *d, *v, *m;
 	u32 firmware;
 	int err;
 
+	/* get vendor name from root directory */
+	err = fw_csr_string(fw_dev->config_rom + 5, CSR_VENDOR,
+			    vendor, sizeof(vendor));
+	if (err < 0)
+		goto end;
+
+	/* get model name from unit directory */
+	err = fw_csr_string(oxfw->unit->directory, CSR_MODEL,
+			    model, sizeof(model));
+	if (err < 0)
+		goto end;
+
 	err = snd_fw_transaction(oxfw->unit, TCODE_READ_QUADLET_REQUEST,
 				 OXFORD_FIRMWARE_ID_ADDRESS, &firmware, 4, 0);
 	if (err < 0)
 		goto end;
 	be32_to_cpus(&firmware);
 
-	d = oxfw->device_info->driver_name;
-	v = oxfw->device_info->vendor_name;
-	m = oxfw->device_info->driver_name;
+	/* to apply card definitions */
+	if (oxfw->device_info) {
+		d = oxfw->device_info->driver_name;
+		v = oxfw->device_info->vendor_name;
+		m = oxfw->device_info->driver_name;
+	} else {
+		d = "OXFW";
+		v = vendor;
+		m = model;
+	}
 
 	strcpy(oxfw->card->driver, d);
 	strcpy(oxfw->card->shortname, m);
@@ -109,16 +132,18 @@ static int oxfw_probe(struct fw_unit *unit,
 	if (err < 0)
 		goto error;
 
-	err = oxfw_create_mixer(oxfw);
-	if (err < 0)
-		goto error;
+	if (oxfw->device_info) {
+		err = snd_oxfw_create_mixer(oxfw);
+		if (err < 0)
+			goto error;
+	}
+
+	snd_oxfw_proc_init(oxfw);
 
 	err = snd_oxfw_stream_init_simplex(oxfw);
 	if (err < 0)
 		goto error;
 
-	snd_oxfw_proc_init(oxfw);
-
 	err = snd_card_register(card);
 	if (err < 0) {
 		snd_oxfw_stream_destroy_simplex(oxfw);
@@ -173,6 +198,39 @@ static const struct ieee1394_device_id oxfw_id_table[] = {
 		.version      = VERSION_AVC,
 		.driver_data  = (kernel_ulong_t)&lacie_speakers,
 	},
+	/* Behringer,F-Control Audio 202 */
+	{
+		.match_flags	= IEEE1394_MATCH_VENDOR_ID |
+				  IEEE1394_MATCH_MODEL_ID,
+		.vendor_id	= VEN_BEHRINGER,
+		.model_id	= 0x00fc22,
+	},
+	/* Mackie(Loud), Onyx-i series (former models) */
+	{
+		.match_flags	= IEEE1394_MATCH_VENDOR_ID |
+				  IEEE1394_MATCH_MODEL_ID,
+		.vendor_id	= VEN_LOUD,
+		.model_id	= 0x081216,
+	},
+	/* Mackie(Loud), Onyx Satellite */
+	{
+		.match_flags	= IEEE1394_MATCH_VENDOR_ID |
+				  IEEE1394_MATCH_MODEL_ID,
+		.vendor_id	= VEN_LOUD,
+		.model_id	= 0x00200f,
+	},
+	/*  Mackie(Loud), Tapco Link.Firewire */
+	{
+		.match_flags	= IEEE1394_MATCH_VENDOR_ID |
+				  IEEE1394_MATCH_MODEL_ID,
+		.vendor_id	= VEN_LOUD,
+		.model_id	= 0x000460,
+	},
+	/* IDs are unknown but able to be supported */
+	/*  Mackie(Loud), d.2 pro */
+	/*  Mackie(Loud), d.4 pro */
+	/*  Mackie(Loud), U.420 */
+	/*  Mackie(Loud), U.420d */
 	{ }
 };
 MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table);
-- 
1.8.3.2


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs

  parent reply	other threads:[~2014-05-13 14:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 14:27 [RFC][PATCH 00/15 v4] OXFW driver, a succesor to firewire-speakers Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 01/15] speakers: Rename to oxfw and rename some members Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 02/15] oxfw: Move to its own directory Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 03/15] oxfw: Split stream functionality to a new file and add a header file Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 04/15] oxfw: Split PCM functionality to a new file Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 05/15] oxfw: Split control " Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 06/15] oxfw: Change the way to name card Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 07/15] oxfw: Change the way to make PCM rules/constraints Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 08/15] oxfw: Add proc interface for debugging purpose Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 09/15] oxfw: Change the way to start stream Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 10/15] oxfw: Add support for AV/C stream format command to get supported stream formation Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 11/15] oxfw: Add a quirk for Griffin FireWave Takashi Sakamoto
2014-05-13 14:27 ` Takashi Sakamoto [this message]
2014-08-10 15:54   ` [alsa-devel] [PATCH 12/15] oxfw: Add support for Behringer/Mackie devices Clemens Ladisch
2014-08-11 23:48     ` Takashi Sakamoto
2014-08-12  7:33       ` [alsa-devel] " Clemens Ladisch
2014-08-12 23:21         ` Takashi Sakamoto
2014-08-13  6:41           ` Clemens Ladisch
2014-08-13  7:00             ` Takashi Sakamoto
2014-08-13  7:07               ` Clemens Ladisch
2014-08-13  7:57                 ` Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 13/15] oxfw: Add support AMDTP in-stream and PCM capture Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 14/15] oxfw: Add support for capture/playback MIDI messages Takashi Sakamoto
2014-05-13 14:27 ` [PATCH 15/15] oxfw: Add hwdep interface Takashi Sakamoto
2014-05-13 17:43 ` [RFC][PATCH 00/15 v4] OXFW driver, a succesor to firewire-speakers Stefan Richter
2014-05-14 14:15   ` Takashi Sakamoto
2014-08-10 15:54 ` Clemens Ladisch
2014-08-11 23:55   ` Takashi Sakamoto
2014-08-12  7:09     ` Clemens Ladisch
2014-08-12 22:45       ` Takashi Sakamoto
2014-08-13  7:06         ` Clemens Ladisch
2014-08-13 22:55           ` Takashi Sakamoto
2014-10-16 14:31       ` Takashi Sakamoto
2014-10-26 12:00 ` Stefan Richter
2014-10-26 14:15   ` 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=1399991272-5807-13-git-send-email-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=fenlason@redhat.com \
    --cc=ffado-devel@lists.sf.net \
    --cc=linux1394-devel@lists.sourceforge.net \
    /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.