From patchwork Sun May 10 07:42:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 192780 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 CED27C54E8A for ; Sun, 10 May 2020 07:45:06 +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 532C6208DB for ; Sun, 10 May 2020 07:45:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="C9lcgVAs"; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="mMp7Pgo9"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="1VLO9l68" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 532C6208DB 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 678F315E2; Sun, 10 May 2020 09:44:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 678F315E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589096704; bh=RLbOq6LoeWZ4FnZodJB1dVoi4VDHwGnKcZ49c1auoHU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=C9lcgVAsShpwVj4/HjYnxZoPbC8S8B+0fYcBIyYFX7APh4VZHF5OCGO+jfDIcIk4t v9iObtObTWyCOt6mSRs48c427ledWm1iie/Xgrlsw8eICQj5h6Z0LZsFpJqS1Bp0cg uAzzyKVOXCVDQf1tZrC3R9IRjGRcmZl2RrwAG9xw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6DB67F8027D; Sun, 10 May 2020 09:43:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DFD3FF8027B; Sun, 10 May 2020 09:43:18 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9AE8CF80148 for ; Sun, 10 May 2020 09:43:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9AE8CF80148 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="mMp7Pgo9"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="1VLO9l68" Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B1AC25C0081; Sun, 10 May 2020 03:43:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 10 May 2020 03:43:06 -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=LXOTGcRk5He84 rg3s/Ou6yI0iMopv+DCIDPQ/wnQy0k=; b=mMp7Pgo9z6l8/T8fHV3IA1fFLVSyE APAwkq30C1tKl/1qXtS7aLRnmaFzEbQZvtkcoP4EvExUADW/+dI2NfG5v7RgxbRy 03vYHtfYl5V/+Ubaq7VTwhG9kgxcA4O+HGLeOPNFSVaxPEwbEysLkSDiPKIofDqD FH8INKXcP4OXtG3zKOzjpu6qgb1/9aKj0D+XFDNgFEs3RRSKX+D6p7k6NZRArjd4 jEMqutbV2S0u2+z0kZzyMTiz23jeYX1PtQ3KzIbe0w1ny5lngvojnRSrejket/Vo 4oQXGpyCMFdPonB47tvRMgB/PAGnC0O4+Iky4KLCb6DGo+f8ctKUaMDLQ== 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=LXOTGcRk5He84rg3s/Ou6yI0iMopv+DCIDPQ/wnQy0k=; b=1VLO9l68 mZ4DjJ8dpuglzQL0MgKK8Y8RNz8N2Z6lKinaOrfneKIETmyFgRL3GFQgedm1Z5Ab 4ieL/hSr5WsPVXXAgZ/nQL0B4Xxt9bSf+KudDlxD1r4IUTfHtiPvAKcyht9IcFND BdTRuTJC/Asi8qKZSY4e83YACIp+ATr/3UvbUc+BkROYRQ57W00w74iXAu4QD2ro YX5/EQe4G41SGYXLl9tlrfEBiFR+npMYpK0lcBqHzHOdolLf829Ug5JkjRAo8HAq kz8c1CpRP/WUo9ssVU8nl8i8dWGRezXhF3N32Kf0V/M3P3JlChhHcXzRMcXo2RZZ BuNeQsGiKWlhNQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeejgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpeevfefffeekte fgveegfeelheffhfeujedtjeevtefhkeevkedtjeejvddtjefhjeenucfkphepudektddr vdefhedrfedrheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjph X-ME-Proxy: Received: from workstation.flets-east.jp (ad003054.dynamic.ppp.asahi-net.or.jp [180.235.3.54]) by mail.messagingengine.com (Postfix) with ESMTPA id 6A37A306625B; Sun, 10 May 2020 03:43:05 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Subject: [PATCH 1/6] ALSA: fireface: fix configuration error for nominal sampling transfer frequency Date: Sun, 10 May 2020 16:42:56 +0900 Message-Id: <20200510074301.116224-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200510074301.116224-1-o-takashi@sakamocchi.jp> References: <20200510074301.116224-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sourceforge.net, stable@vger.kernel.org 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" 128000 and 192000 are congruence modulo 32000, thus it's wrong to distinguish them as multiple of 32000 and 48000 by modulo 32000 at first. Additionally, used condition statement to detect quadruple speed can cause missing bit flag. Furthermore, counter to ensure the configuration is wrong and it causes false positive. This commit fixes the above three bugs. Cc: Fixes: 60aec494b389 ("ALSA: fireface: support allocate_resources operation in latter protocol") Signed-off-by: Takashi Sakamoto --- sound/firewire/fireface/ff-protocol-latter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/firewire/fireface/ff-protocol-latter.c b/sound/firewire/fireface/ff-protocol-latter.c index 0e4c3a9ed5e4..76ae568489ef 100644 --- a/sound/firewire/fireface/ff-protocol-latter.c +++ b/sound/firewire/fireface/ff-protocol-latter.c @@ -107,18 +107,18 @@ static int latter_allocate_resources(struct snd_ff *ff, unsigned int rate) int err; // Set the number of data blocks transferred in a second. - if (rate % 32000 == 0) - code = 0x00; + if (rate % 48000 == 0) + code = 0x04; else if (rate % 44100 == 0) code = 0x02; - else if (rate % 48000 == 0) - code = 0x04; + else if (rate % 32000 == 0) + code = 0x00; else return -EINVAL; if (rate >= 64000 && rate < 128000) code |= 0x08; - else if (rate >= 128000 && rate < 192000) + else if (rate >= 128000) code |= 0x10; reg = cpu_to_le32(code); @@ -140,7 +140,7 @@ static int latter_allocate_resources(struct snd_ff *ff, unsigned int rate) if (curr_rate == rate) break; } - if (count == 10) + if (count > 10) return -ETIMEDOUT; for (i = 0; i < ARRAY_SIZE(amdtp_rate_table); ++i) { From patchwork Sun May 10 07:42:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 192779 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,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 3EDD9C54E49 for ; Sun, 10 May 2020 07:46:23 +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 BD8B920801 for ; Sun, 10 May 2020 07:46:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="lL8Ub8kn"; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="J2KxumKm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="0xXLKg2m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD8B920801 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 20BEF1614; Sun, 10 May 2020 09:45:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 20BEF1614 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589096781; bh=OzHrAYxeWqcimv03EqlB6sLQFLa+Tf2ewcd3xmLkMMY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lL8Ub8knqpQgr/2bUAIffa23MauDJOO39yIdVOUGTFwA5ER1HV9p0AWtfu6JJgbFk 6T5XEOrMSQS2vS9pnSm7VL5zyfW7UHAm5Kv8BPSEMREHoyy+uD11dGc0qjOk4XB+tr Sx0WXzL+NbOiR72JSmqJ4NLI0CYb1VIQH494CQY8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 63AF5F80292; Sun, 10 May 2020 09:43:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94BC9F8027D; Sun, 10 May 2020 09:43:21 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A3B20F80158 for ; Sun, 10 May 2020 09:43:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A3B20F80158 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="J2KxumKm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="0xXLKg2m" Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A98475C0090; Sun, 10 May 2020 03:43:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 10 May 2020 03:43:09 -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=T0pGWYEClGeyY ISJYddvzFRck3Y4t7wQf5OrcBbXPHQ=; b=J2KxumKmj83HAYIKKhYoDdqi4De3L 2XTyt1unFiBYil7NmoyoxNyxYHKbWXAJi1OpVK2cXLLzFHEFD3W5f4iMNUd5x/DD rve8vjynwhPd94puOhHaHf7Eswxos80grdtakYJac+pfX5W2PyTALoIfwJKsPQBj QqbDOeOF5m68JXHgQwZHG/URI2ibM2XTC52wSO6g/ezRGiMifWyb9o2/JUEWbUoy JRt5nCHnvI2+vrl2a3mmCp2Gl/8KAD7uoIx+u25tbfmfTFX8IvKCtRFePEcY2I0D 3mKxPWtDeEFxkqGIBv0qN7/PaCamG5wMqupMuv5CRdx/vJ9yK58YVgr3A== 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=T0pGWYEClGeyYISJYddvzFRck3Y4t7wQf5OrcBbXPHQ=; b=0xXLKg2m ZYvEuyn99Bo3/tS4YFEUYm7p+k5LTPVu8P5UR7A91VRnlEU5ZYCOUGMCd70Vjkrc Ru4ZulGzGa58NSC1WL6FPCfk1QyytokCFPt+7OtkzDTzfNg5cfZxHuKjql9UMGGR uGuifEqwScWcNHeQ0RchW7bbrYnSYj3wNTpk0w33E1mtoRImRI2QcmHij6wZVjJQ cTuzzt+VhQiHxQR/53HzWoKRxJwj1gVB/K8jPJKOjqrLays82vAPBRlxy7kUJiTo cryur47c0/BYGesSB9kcJm/MN852RSh73gc8LGU9Fs/5U5COtyKtyyv9yzO5quV+ WiAdk6D0migc7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeejgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpeevfefffeekte fgveegfeelheffhfeujedtjeevtefhkeevkedtjeejvddtjefhjeenucfkphepudektddr vdefhedrfedrheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjph X-ME-Proxy: Received: from workstation.flets-east.jp (ad003054.dynamic.ppp.asahi-net.or.jp [180.235.3.54]) by mail.messagingengine.com (Postfix) with ESMTPA id 76C463066258; Sun, 10 May 2020 03:43:08 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Subject: [PATCH 3/6] ALSA: fireface: code refactoring to add enumeration constants for model identification Date: Sun, 10 May 2020 16:42:58 +0900 Message-Id: <20200510074301.116224-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200510074301.116224-1-o-takashi@sakamocchi.jp> References: <20200510074301.116224-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sourceforge.net 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" In RME fireface series, version field of unit directory in configuration ROM is used to distinguish each model. The value of field is known and it's better to use enumeration constants for code representation. This commit adds enumeration constants for model identification. Signed-off-by: Takashi Sakamoto --- sound/firewire/fireface/ff.c | 6 +++--- sound/firewire/fireface/ff.h | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sound/firewire/fireface/ff.c b/sound/firewire/fireface/ff.c index b62a4fd22407..b295e40a425d 100644 --- a/sound/firewire/fireface/ff.c +++ b/sound/firewire/fireface/ff.c @@ -189,7 +189,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = { IEEE1394_MATCH_MODEL_ID, .vendor_id = OUI_RME, .specifier_id = OUI_RME, - .version = 0x000001, + .version = SND_FF_UNIT_VERSION_FF800, .model_id = 0x101800, .driver_data = (kernel_ulong_t)&spec_ff800, }, @@ -201,7 +201,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = { IEEE1394_MATCH_MODEL_ID, .vendor_id = OUI_RME, .specifier_id = OUI_RME, - .version = 0x000002, + .version = SND_FF_UNIT_VERSION_FF400, .model_id = 0x101800, .driver_data = (kernel_ulong_t)&spec_ff400, }, @@ -213,7 +213,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = { IEEE1394_MATCH_MODEL_ID, .vendor_id = OUI_RME, .specifier_id = OUI_RME, - .version = 0x000004, + .version = SND_FF_UNIT_VERSION_UCX, .model_id = 0x101800, .driver_data = (kernel_ulong_t)&spec_ucx, }, diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h index dc7a20f75983..62ad921c3706 100644 --- a/sound/firewire/fireface/ff.h +++ b/sound/firewire/fireface/ff.h @@ -34,6 +34,12 @@ #define SND_FF_IN_MIDI_PORTS 2 #define SND_FF_OUT_MIDI_PORTS 2 +enum snd_ff_unit_version { + SND_FF_UNIT_VERSION_FF800 = 0x000001, + SND_FF_UNIT_VERSION_FF400 = 0x000002, + SND_FF_UNIT_VERSION_UCX = 0x000004, +}; + enum snd_ff_stream_mode { SND_FF_STREAM_MODE_LOW = 0, SND_FF_STREAM_MODE_MID, From patchwork Sun May 10 07:43:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 192778 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,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 34059C54E49 for ; Sun, 10 May 2020 07:47: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 AE80320801 for ; Sun, 10 May 2020 07:47:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Uq4quhRo"; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="aJ85auD1"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="w4Ik+ZWP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE80320801 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 1AE821658; Sun, 10 May 2020 09:46:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1AE821658 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589096854; bh=tifCb5FYnFqQgdtgItfMbTQl269oFvKE9+s64YxRmGM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Uq4quhRoh3rUJVOI/9OAe+UBeFOpH5zopnd+bIMqFxfqtv+MNbVMvuZ+dpIfXqt8+ WJfHDZ54FG4onMa/XTi77eVu2wISQwfcst7fMb41LstwBDPvwr5ztWck0Wv9ZD9iFm iVI+8AbSEyDXVpidVobVxInc+eLKbJj0Y4BWb6RQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E26AFF802C2; Sun, 10 May 2020 09:43:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7004F802C2; Sun, 10 May 2020 09:43:36 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CE227F8021D for ; Sun, 10 May 2020 09:43:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CE227F8021D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="aJ85auD1"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="w4Ik+ZWP" Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 0CA8C5C00E5; Sun, 10 May 2020 03:43:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 10 May 2020 03:43:14 -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=5zW9USb7YyWkq Rkg/IvsAkba5Mq+2knZqmTJOPBA4KI=; b=aJ85auD1lnzOCgC4/WLa9ZtIWbjTt jiR0bSXV7sEgBpHR2OUYAFIHBRj/aVOgArun9569XvWBa/IldXwhxdS+payvu1Pq WSIsJIALWkK94JZT5dSkPd35xZAMqsNNx/eWANCfsFyFwb3SOIFMQRw6c8Gav5de xmt8vgQQe9v5chSUhJvCQU1GRec6EeWy+/IuCsjROrmWaqV1aElGNtrxi+VDIuss gUjDFAcZXdufcz3En5Ej9mXZtUdFry9zWFtjnp9FUrK1pP2QcTkJIUVdDMB7xPhT YCDCdvTCBNHpim084l2TauUAfDQn7rfrmms1Rjq0bsibHFl/T8xc873/Q== 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=5zW9USb7YyWkqRkg/IvsAkba5Mq+2knZqmTJOPBA4KI=; b=w4Ik+ZWP VsYM0xc/sReasiEgFtx4o3/ezdssm6rhILT2PonhouVegoug0iA8xDMD7H6cvFS1 MU29mCTgAVo2i8UJiqqbTyKHo2qJjwzXJuFHZD/YogRWBxASJRGnYrNQZqv78lcr 2V0D10Tk9SGXClF8HuLjsQNdGvSqSSHgcSUYAPvFuo+fCTez9hFPclGhUvTcATpV 6HnCrSZ5tQqavT/lPDHoIp2SMQibshOeefiYpmHGEf9wQ9LurnA6Mcxykny3h91O AvbjK0/t0HO49Qs0h6SLsZwDOy5rLrmEimp8irPMj/SOB7O8Jaf7Oeh5qLrgN5CG OCW+qZJgg6d/6Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeejgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpeevfefffeekte fgveegfeelheffhfeujedtjeevtefhkeevkedtjeejvddtjefhjeenucfkphepudektddr vdefhedrfedrheegnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehmrghilh hfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjph X-ME-Proxy: Received: from workstation.flets-east.jp (ad003054.dynamic.ppp.asahi-net.or.jp [180.235.3.54]) by mail.messagingengine.com (Postfix) with ESMTPA id C53EC3066258; Sun, 10 May 2020 03:43:12 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Subject: [PATCH 6/6] ALSA: fireface: add support for RME Fireface UFX (untested) Date: Sun, 10 May 2020 16:43:01 +0900 Message-Id: <20200510074301.116224-7-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200510074301.116224-1-o-takashi@sakamocchi.jp> References: <20200510074301.116224-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sourceforge.net 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" Fireface UFX was shipped by RME GmbH in 2010, and now discontinued. Although this model has some enhanced feature which Fireface 802 doesn't have (e.g. on-board USB mass storage device class, configuration interface with color display), the functionality relevant to packet communication on IEEE 1394 bus seems to be the same as Fireface 802 (e.g. available number of channels for PCM frame in each sampling transfer frequency). With the assumption, this commit adds support for Fireface UFX. In ALSA fireface driver, these two models are handled as the same one. Signed-off-by: Takashi Sakamoto --- sound/firewire/Kconfig | 1 + sound/firewire/fireface/ff-protocol-latter.c | 2 +- sound/firewire/fireface/ff.c | 17 +++++++++++++++-- sound/firewire/fireface/ff.h | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig index 4f39ef924a1a..f7ed69d60310 100644 --- a/sound/firewire/Kconfig +++ b/sound/firewire/Kconfig @@ -164,6 +164,7 @@ config SND_FIREFACE Say Y here to include support for RME fireface series. * Fireface 400 * Fireface 800 + * Fireface UFX * Fireface UCX * Fireface 802 diff --git a/sound/firewire/fireface/ff-protocol-latter.c b/sound/firewire/fireface/ff-protocol-latter.c index ea885e725950..8d3b23778eb2 100644 --- a/sound/firewire/fireface/ff-protocol-latter.c +++ b/sound/firewire/fireface/ff-protocol-latter.c @@ -199,7 +199,7 @@ static int latter_begin_session(struct snd_ff *ff, unsigned int rate) else return -EINVAL; } else { - // For Fireface 802. Due to bandwidth limitation on + // For Fireface UFX and 802. Due to bandwidth limitation on // IEEE 1394a (400 Mbps), Analog 1-12 and AES are available // without any ADAT at quadruple speed. if (rate >= 32000 && rate <= 48000) diff --git a/sound/firewire/fireface/ff.c b/sound/firewire/fireface/ff.c index e4140116f3cc..bc39269415d2 100644 --- a/sound/firewire/fireface/ff.c +++ b/sound/firewire/fireface/ff.c @@ -19,6 +19,7 @@ static void name_card(struct snd_ff *ff) const char *const names[] = { [SND_FF_UNIT_VERSION_FF800] = "Fireface800", [SND_FF_UNIT_VERSION_FF400] = "Fireface400", + [SND_FF_UNIT_VERSION_UFX] = "FirefaceUFX", [SND_FF_UNIT_VERSION_UCX] = "FirefaceUCX", [SND_FF_UNIT_VERSION_802] = "Fireface802", }; @@ -187,7 +188,7 @@ static const struct snd_ff_spec spec_ucx = { .midi_rx_addrs = {0xffff00000030ull, 0xffff00000030ull}, }; -static const struct snd_ff_spec spec_802 = { +static const struct snd_ff_spec spec_ufx_802 = { .pcm_capture_channels = {30, 22, 14}, .pcm_playback_channels = {30, 22, 14}, .midi_in_ports = 1, @@ -223,6 +224,18 @@ static const struct ieee1394_device_id snd_ff_id_table[] = { .model_id = 0x101800, .driver_data = (kernel_ulong_t)&spec_ff400, }, + // Fireface UFX. + { + .match_flags = IEEE1394_MATCH_VENDOR_ID | + IEEE1394_MATCH_SPECIFIER_ID | + IEEE1394_MATCH_VERSION | + IEEE1394_MATCH_MODEL_ID, + .vendor_id = OUI_RME, + .specifier_id = OUI_RME, + .version = SND_FF_UNIT_VERSION_UFX, + .model_id = 0x101800, + .driver_data = (kernel_ulong_t)&spec_ufx_802, + }, // Fireface UCX. { .match_flags = IEEE1394_MATCH_VENDOR_ID | @@ -245,7 +258,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = { .specifier_id = OUI_RME, .version = SND_FF_UNIT_VERSION_802, .model_id = 0x101800, - .driver_data = (kernel_ulong_t)&spec_802, + .driver_data = (kernel_ulong_t)&spec_ufx_802, }, {} }; diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h index 1282a57c009f..705e7df4f929 100644 --- a/sound/firewire/fireface/ff.h +++ b/sound/firewire/fireface/ff.h @@ -37,6 +37,7 @@ enum snd_ff_unit_version { SND_FF_UNIT_VERSION_FF800 = 0x000001, SND_FF_UNIT_VERSION_FF400 = 0x000002, + SND_FF_UNIT_VERSION_UFX = 0x000003, SND_FF_UNIT_VERSION_UCX = 0x000004, SND_FF_UNIT_VERSION_802 = 0x000005, };