From patchwork Fri May 14 08:54:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 12257259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2393C433B4 for ; Fri, 14 May 2021 08:56:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B514161355 for ; Fri, 14 May 2021 08:56:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B514161355 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 58DD41788; Fri, 14 May 2021 10:55:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 58DD41788 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1620982593; bh=m+/S3H8Fd7K7Ydmc9PdOfJwDzU55PeMcbF8ceq5uQVQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DXWchYG9zGo+Z7RBjd4Fq9yIFJiiLAzqpJkobiBzdNnZLEG5L354wxPSpJ7LBnRXY EiNVAfXHIQIRMoeKZgoL2xYPBZHAnr9wPsf0xC4C8SZL+iBjDcy4XnWQjgAQ4Dy3dz SyGdnMFDjK+P79crjbfxFeFEC4OQwoHuA6YCm0MQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 51116F80240; Fri, 14 May 2021 10:54:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 595C1F8020C; Fri, 14 May 2021 10:54:50 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BB0D6F8020C for ; Fri, 14 May 2021 10:54:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BB0D6F8020C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="WoaTWLTm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TjdVemHc" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8C0C55C00F4; Fri, 14 May 2021 04:54:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 14 May 2021 04:54:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=jz94ulqf9iplJ AQgpFQD+EtLKh4YR0GrnvodjB7vzRg=; b=WoaTWLTmlVHRn7qKBSsKGorFme2+W eB7xXQTFdXxxIvRuyz95hnft9Q/rogmV2glx9+IqtLiELJyWj3Htgu0svyP09/sO cwYCg9ib+3SWs0jbWse3WbI4z6dbEohkPW4aQtXVjf2Kr6yyWMnV4RReqjNIhurC gUYAlgr3YJYOI1c8cjpbtl5E62/c2xPyr3uQsIiDPnBIV7jH/z8HYvYIIgDkgPT/ 9BszdCa1I+QOb9YdD2CNoZFXD+YCNOZNoe+X7EHvOW3VstNGK6/jb8bmczm1pKKz mUw6Kk8T9CyCk6ozEoAaWVx23nLV55H6I5XsQ2Y7IIIbHqnPHrATaDCag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=jz94ulqf9iplJAQgpFQD+EtLKh4YR0GrnvodjB7vzRg=; b=TjdVemHc wA1WKquc4SXHycRispaEfeCtuLpdoxLj1DTTVOwx3ml/73b2rs+RzH5XjGyh2wKM 5Wo2aTcBGi/uzeXhRi3TBMtJq/t4h6FvvfhQB3NVDCgHPSiF5/cJ6GyGgpiWfGDT 3aIG4hMTf6KaSUbmqu4LQF4Ko/2iCkD1toEBw+L7cLAsU4x4M75MeRA0xwcuD/ll F1Emh7arvrm4P3nAp1wRSh1jS0XnYNpZfa8YJEpxjRYfxnoJ44/A0JcHfRrsrD9n OK86knvIPbNvPRNY6n/kf3lBF0TkhSlS6Tia79JiCjIAFsSSR1ijHD/6StuOf/Xw yEB6uWusOtKdhw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehhedgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpeevfefffe ektefgveegfeelheffhfeujedtjeevtefhkeevkedtjeejvddtjefhjeenucfkphepudeg rdefrdeihedrudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Received: from workstation.flets-east.jp (ae065175.dynamic.ppp.asahi-net.or.jp [14.3.65.175]) by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 14 May 2021 04:54:40 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de Subject: [PATCH 1/7] ALSA: oxfw: code refactoring for existent device entry with specifier_id and version Date: Fri, 14 May 2021 17:54:29 +0900 Message-Id: <20210514085435.92807-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514085435.92807-1-o-takashi@sakamocchi.jp> References: <20210514085435.92807-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, clemens@ladisch.de X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" All of the devices known to be based on OXFW ASICs have the same layout of configuration ROM, in which unit directory includes vendor, model, specifier_id and version immediate values. Especially, the pair of specifier_id and version is fixed to represent AV/C general protocol. This commit refactors device entries to fulfil with these 4 elements. Signed-off-by: Takashi Sakamoto --- sound/firewire/oxfw/oxfw.c | 82 ++++++++++++-------------------------- 1 file changed, 25 insertions(+), 57 deletions(-) diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 9eea25c46dc7..f01c8bfd71cc 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -320,36 +320,24 @@ static const struct compat_info lacie_speakers = { .model_name = "FireWire Speakers", }; +#define OXFW_DEV_ENTRY(vendor, model, data) \ +{ \ + .match_flags = IEEE1394_MATCH_VENDOR_ID | \ + IEEE1394_MATCH_MODEL_ID | \ + IEEE1394_MATCH_SPECIFIER_ID | \ + IEEE1394_MATCH_VERSION, \ + .vendor_id = vendor, \ + .model_id = model, \ + .specifier_id = SPECIFIER_1394TA, \ + .version = VERSION_AVC, \ + .driver_data = (kernel_ulong_t)data, \ +} + static const struct ieee1394_device_id oxfw_id_table[] = { - { - .match_flags = IEEE1394_MATCH_VENDOR_ID | - IEEE1394_MATCH_MODEL_ID | - IEEE1394_MATCH_SPECIFIER_ID | - IEEE1394_MATCH_VERSION, - .vendor_id = VENDOR_GRIFFIN, - .model_id = 0x00f970, - .specifier_id = SPECIFIER_1394TA, - .version = VERSION_AVC, - .driver_data = (kernel_ulong_t)&griffin_firewave, - }, - { - .match_flags = IEEE1394_MATCH_VENDOR_ID | - IEEE1394_MATCH_MODEL_ID | - IEEE1394_MATCH_SPECIFIER_ID | - IEEE1394_MATCH_VERSION, - .vendor_id = VENDOR_LACIE, - .model_id = 0x00f970, - .specifier_id = SPECIFIER_1394TA, - .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 = VENDOR_BEHRINGER, - .model_id = 0x00fc22, - }, + OXFW_DEV_ENTRY(VENDOR_GRIFFIN, 0x00f970, &griffin_firewave), + OXFW_DEV_ENTRY(VENDOR_LACIE, 0x00f970, &lacie_speakers), + // Behringer,F-Control Audio 202. + OXFW_DEV_ENTRY(VENDOR_BEHRINGER, 0x00fc22, NULL), /* * Any Mackie(Loud) models (name string/model id): * Onyx-i series (former models): 0x081216 @@ -367,34 +355,14 @@ static const struct ieee1394_device_id oxfw_id_table[] = { .specifier_id = SPECIFIER_1394TA, .version = VERSION_AVC, }, - /* TASCAM, FireOne */ - { - .match_flags = IEEE1394_MATCH_VENDOR_ID | - IEEE1394_MATCH_MODEL_ID, - .vendor_id = VENDOR_TASCAM, - .model_id = 0x800007, - }, - /* Stanton, Stanton Controllers & Systems 1 Mixer (SCS.1m) */ - { - .match_flags = IEEE1394_MATCH_VENDOR_ID | - IEEE1394_MATCH_MODEL_ID, - .vendor_id = OUI_STANTON, - .model_id = 0x001000, - }, - /* Stanton, Stanton Controllers & Systems 1 Deck (SCS.1d) */ - { - .match_flags = IEEE1394_MATCH_VENDOR_ID | - IEEE1394_MATCH_MODEL_ID, - .vendor_id = OUI_STANTON, - .model_id = 0x002000, - }, - // APOGEE, duet FireWire - { - .match_flags = IEEE1394_MATCH_VENDOR_ID | - IEEE1394_MATCH_MODEL_ID, - .vendor_id = OUI_APOGEE, - .model_id = 0x01dddd, - }, + // TASCAM, FireOne. + OXFW_DEV_ENTRY(VENDOR_TASCAM, 0x800007, NULL), + // Stanton, Stanton Controllers & Systems 1 Mixer (SCS.1m). + OXFW_DEV_ENTRY(OUI_STANTON, 0x001000, 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), { } }; MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table);