From patchwork Tue May 13 14:27:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 4168261 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 63E459F334 for ; Tue, 13 May 2014 14:42:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E3FA2025B for ; Tue, 13 May 2014 14:42:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2C41C2020E for ; Tue, 13 May 2014 14:42:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 32FF82656D1; Tue, 13 May 2014 16:42:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 99D8A2655AF; Tue, 13 May 2014 16:33:00 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B0ACF265704; Tue, 13 May 2014 16:32:58 +0200 (CEST) Received: from smtp303.phy.lolipop.jp (smtp303.phy.lolipop.jp [210.157.22.87]) by alsa0.perex.cz (Postfix) with ESMTP id E39492655AF for ; Tue, 13 May 2014 16:28:19 +0200 (CEST) Received: from smtp303.phy.lolipop.lan (HELO smtp303.phy.lolipop.jp) (172.17.1.87) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp303.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Tue, 13 May 2014 23:28:19 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp303.phy.lolipop.jp (LOLIPOP-Fsecure); Tue, 13 May 2014 23:27:53 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: clemens@ladisch.de Date: Tue, 13 May 2014 23:27:49 +0900 Message-Id: <1399991272-5807-13-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1399991272-5807-1-git-send-email-o-takashi@sakamocchi.jp> References: <1399991272-5807-1-git-send-email-o-takashi@sakamocchi.jp> Cc: alsa-devel@alsa-project.org, stefanr@s5r6.in-berlin.de, fenlason@redhat.com, ffado-devel@lists.sf.net, linux1394-devel@lists.sourceforge.net Subject: [alsa-devel] [PATCH 12/15] oxfw: Add support for Behringer/Mackie devices X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);