From patchwork Wed Oct 30 08:06:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11219147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1BA31515 for ; Wed, 30 Oct 2019 08:08:44 +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 83B03208E3 for ; Wed, 30 Oct 2019 08:08:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hvMUnIb9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="opYDE4ta"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KhFMx6Md" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83B03208E3 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 7217622C6; Wed, 30 Oct 2019 09:07:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7217622C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572422922; bh=MmX7Moxu2KmVAiuUVj/TBVJ+d/8YulZgiyrIm6WT6mg=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hvMUnIb9eVLeUV5qQnmJIFr6u5p2bRBiUvp7QYaTAwEAeudpdIDLhhpOlrQ9gZNf6 5mxbeBFKxBbCNpPiYHF7AUqFwjN7K/IchLBKsIM/31MKXyLDZfbSONNWe+Lu+8aPKc TuSou3Ue8WbP9hHGHC1JOVo/WKzITpmnQ8pyndHE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DB0E5F803D6; Wed, 30 Oct 2019 09:06:59 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E5BD8F8044A; Wed, 30 Oct 2019 09:06:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 54B41F802A1 for ; Wed, 30 Oct 2019 09:06:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 54B41F802A1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="opYDE4ta"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KhFMx6Md" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 14E1221EAE; Wed, 30 Oct 2019 04:06:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 30 Oct 2019 04:06:50 -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=fm2; bh=DcXYelHo99VsW jxIstdjT3ymsXZIM6dBkeNTwKawQdI=; b=opYDE4taL9Kc4gU4QmuUJJ+tgdm9g S27UQzSrkXG1mNsD/Od8bBX2n0tgTInGmGbAfo89+u5cKqqWdMNNkae1X/wT+D3o U1uTtRgjSQqjJoqFggE/HNiShkf8bJXbwkL33/OlaeJECDzQPmuUA2CdWPjpGZ83 hzZMdnc04E1NSXpA8yyH0ztNNhqR+DITFAQs5h8CNBBY4j4UB7kgZ1ZDZuZ/PFVo dluIdM3aCEoZBwE35plbupPV+xg4S8xUOP4BVdNIArHa3JGV3eoNGnqtBebL3eyE us4WP0IquAlGZMEFmyEJPcnjo3I3zsilcqvX+sT9qr/vEb83X1ZdKNjHg== 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= fm1; bh=DcXYelHo99VsWjxIstdjT3ymsXZIM6dBkeNTwKawQdI=; b=KhFMx6Md uJMc7fLduZKudmkTQFsL6hAN1rsy/l3YC7ul/jcCvaiCPx6h/FbgTtDFZJD09DNR 8oGfGjcFn23zzqbwajA2C3sVxAbulXs60V2kKHKf1ZKSNc/o7rxNwA5sQgM/LQm1 ZvEOoe3+u4Ch9fBFcjo97C/E3z0DAS/9+T7reyfqCWF5KH1m/xYxTafEGVwflMMw 82OEcP1WXwqywcqcHHgSp1y1XhWXKDXi1FtM4dGramM5C1Phmca25JAnfAsB9VbZ 76eIzDz8C+6QTK1YtUXTh5P5b1jk13T/kQSjBbHkdiL+cFQCNTV+tPibHx8RpPQz euLmATB55CtIgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id D0DE13060060; Wed, 30 Oct 2019 04:06:48 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 30 Oct 2019 17:06:39 +0900 Message-Id: <20191030080644.1704-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191030080644.1704-1-o-takashi@sakamocchi.jp> References: <20191030080644.1704-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/6] ALSA: firewire-motu: fix wrong spelling for macro 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" Just replace 'SEPARETED' with 'SEPARATED' for macro. Signed-off-by: Takashi Sakamoto --- sound/firewire/motu/motu-protocol-v2.c | 2 +- sound/firewire/motu/motu-protocol-v3.c | 2 +- sound/firewire/motu/motu.c | 8 ++++---- sound/firewire/motu/motu.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/firewire/motu/motu-protocol-v2.c b/sound/firewire/motu/motu-protocol-v2.c index 9e2f16eebe0a..a42f77fc3858 100644 --- a/sound/firewire/motu/motu-protocol-v2.c +++ b/sound/firewire/motu/motu-protocol-v2.c @@ -191,7 +191,7 @@ static void calculate_fixed_part(struct snd_motu_packet_format *formats, pcm_chunks[1] += 2; } } else { - if (flags & SND_MOTU_SPEC_RX_SEPARETED_MAIN) { + if (flags & SND_MOTU_SPEC_RX_SEPARATED_MAIN) { pcm_chunks[0] += 2; pcm_chunks[1] += 2; } diff --git a/sound/firewire/motu/motu-protocol-v3.c b/sound/firewire/motu/motu-protocol-v3.c index 5eafa506e8a9..ba5794c724be 100644 --- a/sound/firewire/motu/motu-protocol-v3.c +++ b/sound/firewire/motu/motu-protocol-v3.c @@ -187,7 +187,7 @@ static void calculate_fixed_part(struct snd_motu_packet_format *formats, pcm_chunks[1] += 2; } } else { - if (flags & SND_MOTU_SPEC_RX_SEPARETED_MAIN) { + if (flags & SND_MOTU_SPEC_RX_SEPARATED_MAIN) { pcm_chunks[0] += 2; pcm_chunks[1] += 2; } diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c index 72908b4de77c..680e363d0a4b 100644 --- a/sound/firewire/motu/motu.c +++ b/sound/firewire/motu/motu.c @@ -178,7 +178,7 @@ static const struct snd_motu_spec motu_828mk2 = { .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | SND_MOTU_SPEC_TX_MICINST_CHUNK | SND_MOTU_SPEC_TX_RETURN_CHUNK | - SND_MOTU_SPEC_RX_SEPARETED_MAIN | + SND_MOTU_SPEC_RX_SEPARATED_MAIN | SND_MOTU_SPEC_HAS_OPT_IFACE_A | SND_MOTU_SPEC_RX_MIDI_2ND_Q | SND_MOTU_SPEC_TX_MIDI_2ND_Q, @@ -224,7 +224,7 @@ static const struct snd_motu_spec motu_828mk3 = { SND_MOTU_SPEC_TX_MICINST_CHUNK | SND_MOTU_SPEC_TX_RETURN_CHUNK | SND_MOTU_SPEC_TX_REVERB_CHUNK | - SND_MOTU_SPEC_RX_SEPARETED_MAIN | + SND_MOTU_SPEC_RX_SEPARATED_MAIN | SND_MOTU_SPEC_HAS_OPT_IFACE_A | SND_MOTU_SPEC_HAS_OPT_IFACE_B | SND_MOTU_SPEC_RX_MIDI_3RD_Q | @@ -240,7 +240,7 @@ static const struct snd_motu_spec motu_audio_express = { .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | SND_MOTU_SPEC_TX_MICINST_CHUNK | SND_MOTU_SPEC_TX_RETURN_CHUNK | - SND_MOTU_SPEC_RX_SEPARETED_MAIN | + SND_MOTU_SPEC_RX_SEPARATED_MAIN | SND_MOTU_SPEC_RX_MIDI_2ND_Q | SND_MOTU_SPEC_TX_MIDI_3RD_Q, .analog_in_ports = 2, @@ -253,7 +253,7 @@ static const struct snd_motu_spec motu_4pre = { .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | SND_MOTU_SPEC_TX_MICINST_CHUNK | SND_MOTU_SPEC_TX_RETURN_CHUNK | - SND_MOTU_SPEC_RX_SEPARETED_MAIN, + SND_MOTU_SPEC_RX_SEPARATED_MAIN, .analog_in_ports = 2, .analog_out_ports = 2, }; diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h index 35ed8b6bb8e8..08e3d568221d 100644 --- a/sound/firewire/motu/motu.h +++ b/sound/firewire/motu/motu.h @@ -86,7 +86,7 @@ enum snd_motu_spec_flags { SND_MOTU_SPEC_RX_MIDI_3RD_Q = 0x0200, SND_MOTU_SPEC_TX_MIDI_2ND_Q = 0x0400, SND_MOTU_SPEC_TX_MIDI_3RD_Q = 0x0800, - SND_MOTU_SPEC_RX_SEPARETED_MAIN = 0x1000, + SND_MOTU_SPEC_RX_SEPARATED_MAIN = 0x1000, }; #define SND_MOTU_CLOCK_RATE_COUNT 6 From patchwork Wed Oct 30 08:06:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11219153 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51B811515 for ; Wed, 30 Oct 2019 08:09:32 +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 D8A8A208E3 for ; Wed, 30 Oct 2019 08:09:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="HchaSfuK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="GRcUU+gG"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="v0D/8GBk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8A8A208E3 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 25E2922DA; Wed, 30 Oct 2019 09:08:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 25E2922DA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572422969; bh=RoiyirFMGrWnz1CBBWwE8Ga3DPlrthRyFXpkdqGgF1E=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HchaSfuKLyFcjbaqnALjUzODHbQZS1TQgmSeDkAAzzsLXIfGrsY0hg0ef9iesUCyj jpy0xKBN+wpZ+XORKIgtFaBYJmoqcNf90HpniBPkHgo0CnPHccFWvAWzbXq02k78ux jICrGogSfoK6i10b1ELDPY7WIDeqGqIlyfhe9xh4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C9F6DF805FC; Wed, 30 Oct 2019 09:07:02 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7B0BAF805FC; Wed, 30 Oct 2019 09:06:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 359F1F802BD for ; Wed, 30 Oct 2019 09:06:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 359F1F802BD Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="GRcUU+gG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="v0D/8GBk" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9CCC521E29; Wed, 30 Oct 2019 04:06:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 30 Oct 2019 04:06:51 -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=fm2; bh=yrisgRAv+hEtQ 8kdYK1taGGy69KSDtTWd95dzKPOUaw=; b=GRcUU+gG4lGrFOEGF+vXl381Frne7 3Ck+hBcLkQxqnPrvogPFMC3Z4hmjkkjMLCOLMnXvwMIpyQJbGFmd7gplYaLvyHCZ wXuZd8Bx93TJEvcvpYSDSZGZGB06HzH9zdqUnN35sGi9KEOZakoBUkufxLcEnQiS lOgPx9mWUQf1uLJzMmTxjOVEB8AxbjwFwJWm4YUCNkVKkr+Gf5+TdkWgi0X1ifg/ sC+s26wxTT0Vi/nYf60SCgcSzybIuxmMwsGI5Sm14OqjUpJzYuulduMXXkxfF2EY XeiYLP6K9+JeSCpmfJEPJA6YexOJaoH5CB/QjwEsbG/dRO01VlG0NBnRg== 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= fm1; bh=yrisgRAv+hEtQ8kdYK1taGGy69KSDtTWd95dzKPOUaw=; b=v0D/8GBk gvBMAnLHI9fhl9hK7uJqoBNFwbHg7DcBxxCx4ClriFawWEqsjyXHxN4nu15RRUjk d7TbrKYUd9hR0SKc07tmR2Y0pZLIBt4WSWoPO9UmGG6Q9HtBO8txHigs4cP5+Aaf Akmx4FzQiVyZByxm2v7Ie7h4zbQlmdD8Z+bVMBFR/wS/Sqe3qXpJXKjMrfI20tb9 jpLdP3x2EJOcOEfWT1GCG7kPEkJLmcvIRH0eNVC6JRy21JxAFLv60HK9eICKHqkb i6K5zF2LT8jx2D3I1TkH0lfIfPPw1b8EPkP7poBlFp+UtH79IlP3QGH5N8bUp/HZ XEUyVtXE5rmMqA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 53BB3306005E; Wed, 30 Oct 2019 04:06:50 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 30 Oct 2019 17:06:40 +0900 Message-Id: <20191030080644.1704-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191030080644.1704-1-o-takashi@sakamocchi.jp> References: <20191030080644.1704-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 2/6] ALSA: firewire-motu: print for unknown source of sampling clock 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" When unknown source is detected for sampling clock, corresponding label was not added for node on procfs. This commit adds it. Signed-off-by: Takashi Sakamoto --- sound/firewire/motu/motu-proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/firewire/motu/motu-proc.c b/sound/firewire/motu/motu-proc.c index ea46fb4c1b5a..4e5767c0c8d7 100644 --- a/sound/firewire/motu/motu-proc.c +++ b/sound/firewire/motu/motu-proc.c @@ -19,6 +19,7 @@ static const char *const clock_names[] = { [SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX] = "S/PCIF on coaxial interface", [SND_MOTU_CLOCK_SOURCE_AESEBU_ON_XLR] = "AESEBU on XLR interface", [SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC] = "Word clock on BNC interface", + [SND_MOTU_CLOCK_SOURCE_UNKNOWN] = "Unknown", }; static void proc_read_clock(struct snd_info_entry *entry, From patchwork Wed Oct 30 08:06:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11219155 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C60F21515 for ; Wed, 30 Oct 2019 08:10:25 +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 56FA6208E3 for ; Wed, 30 Oct 2019 08:10:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="gF4suT/P"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="VteVYoN6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Wsx13Yjg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56FA6208E3 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 99ADC22FD; Wed, 30 Oct 2019 09:09:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 99ADC22FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572423023; bh=VSQv22yhXrgndULvuQg2GwNcaD47GYrhU2+uzY2lNAI=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gF4suT/PPVBM6ma2Q4+MlHxCtJZygJ+t9r5427dMw+iYXVIli3cG8efOzjkb0SE+q AQ2YA4S056TIqiKMKlmeASslJCMxvVb/8aG/7XjG6UvQ18P2Isn7h5srRzHFhgRmC9 FC4vMphH9VxI09WRFdsW2bOVmRLCU1eu/RFfBJMU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6A649F80633; Wed, 30 Oct 2019 09:07:05 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49C27F805FB; Wed, 30 Oct 2019 09:06:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 71CF3F803D6 for ; Wed, 30 Oct 2019 09:06:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 71CF3F803D6 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="VteVYoN6"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Wsx13Yjg" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2940421EA7; Wed, 30 Oct 2019 04:06:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 30 Oct 2019 04:06:53 -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=fm2; bh=SHNibI4qN7Chw fUHFuomulByrRHZJ9Azs8yTi+eX3Pc=; b=VteVYoN6vcRh8UdfBDPzviMMp/G35 Jkd9sA4bOplOnZgoOb5B+7Xmov6ebpfspQSrgu/W0z8dZmnLa3rvGM2zVb66skHE 8JpcKBpTksOGtKmvaNEYg1+IZ40V4RD3fYMUQOUB6gg8fFeI4/GurPDY6GfxraJD yfk5DNxNboD4eyet60SKRLaoZnhPeg4ndOmrvLJAxYYVHxAW/1Ss/Lnt2WrXUeGU h+IxoDYvS8sYspwxxrhQd/+5S7aUtCXBE+Kihv7x3A24smd0bqgyxbG8BE9lHOjE hfi+hF7PH9ik0vqz1Sknbg+WDVJU0azobZAJsnYbLYp9YQiSQPEifjnIg== 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= fm1; bh=SHNibI4qN7ChwfUHFuomulByrRHZJ9Azs8yTi+eX3Pc=; b=Wsx13Yjg o1l4ByOmBF2HX37sVbD7CZfgLUw0raUDP3br2DGDqM13FM0IIqEV1uxjVxoMe8wn u8IlW/tdLsnaRsDoHB++tkFuTfpui6QdyizQSw/hjS70bTgdOzf0LapcYYNOGkF3 NqYtEqzEuUZIGpKi/ZW5SdcPIjb+P2/hinbA1lEOB1COgpztI7tpJgU7xp9rgc+W n0PBJyxjt8twhCWyFNg137/9rJqLIVfzfptDWOxQoJmILIRq4C9v55dOw/8G9mXR PokYSwn+v6zZ9T/IWgrr99OOZvgWZXRZujU68NguFHeMHOFcDBXZKF9Pwou3eLnU wVN0Hi/LG5HJVg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id CC3AC306005C; Wed, 30 Oct 2019 04:06:51 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 30 Oct 2019 17:06:41 +0900 Message-Id: <20191030080644.1704-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191030080644.1704-1-o-takashi@sakamocchi.jp> References: <20191030080644.1704-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 3/6] ALSA: firewire-motu: detect SPH source of sampling clock 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 MOTU FireWire series, devices have a mode to generate sampling clock from a sequence of source packet header (SPH) included in each data block of received packet. This mode is used for several purposes such as mode for SMPTE time code, sync to the other sound cards and so on. This commit adds support for the SPH mode. Signed-off-by: Takashi Sakamoto --- sound/firewire/motu/motu-pcm.c | 3 ++- sound/firewire/motu/motu-proc.c | 1 + sound/firewire/motu/motu-protocol-v2.c | 3 +++ sound/firewire/motu/motu-protocol-v3.c | 2 ++ sound/firewire/motu/motu.h | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/firewire/motu/motu-pcm.c b/sound/firewire/motu/motu-pcm.c index 55d3d6661731..490408b49157 100644 --- a/sound/firewire/motu/motu-pcm.c +++ b/sound/firewire/motu/motu-pcm.c @@ -159,7 +159,8 @@ static int pcm_open(struct snd_pcm_substream *substream) // When source of clock is not internal or any stream is reserved for // transmission of PCM frames, the available sampling rate is limited // at current one. - if (src != SND_MOTU_CLOCK_SOURCE_INTERNAL || + if ((src != SND_MOTU_CLOCK_SOURCE_INTERNAL && + src != SND_MOTU_CLOCK_SOURCE_SPH) || (motu->substreams_counter > 0 && d->events_per_period > 0)) { unsigned int frames_per_period = d->events_per_period; unsigned int frames_per_buffer = d->events_per_buffer; diff --git a/sound/firewire/motu/motu-proc.c b/sound/firewire/motu/motu-proc.c index 4e5767c0c8d7..b47ba818343f 100644 --- a/sound/firewire/motu/motu-proc.c +++ b/sound/firewire/motu/motu-proc.c @@ -19,6 +19,7 @@ static const char *const clock_names[] = { [SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX] = "S/PCIF on coaxial interface", [SND_MOTU_CLOCK_SOURCE_AESEBU_ON_XLR] = "AESEBU on XLR interface", [SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC] = "Word clock on BNC interface", + [SND_MOTU_CLOCK_SOURCE_SPH] = "Source packet header", [SND_MOTU_CLOCK_SOURCE_UNKNOWN] = "Unknown", }; diff --git a/sound/firewire/motu/motu-protocol-v2.c b/sound/firewire/motu/motu-protocol-v2.c index a42f77fc3858..2757e5b42b9b 100644 --- a/sound/firewire/motu/motu-protocol-v2.c +++ b/sound/firewire/motu/motu-protocol-v2.c @@ -114,6 +114,9 @@ static int v2_get_clock_source(struct snd_motu *motu, case 2: *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX; break; + case 3: + *src = SND_MOTU_CLOCK_SOURCE_SPH; + break; case 4: *src = SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC; break; diff --git a/sound/firewire/motu/motu-protocol-v3.c b/sound/firewire/motu/motu-protocol-v3.c index ba5794c724be..d1545e2b5caa 100644 --- a/sound/firewire/motu/motu-protocol-v3.c +++ b/sound/firewire/motu/motu-protocol-v3.c @@ -104,6 +104,8 @@ static int v3_get_clock_source(struct snd_motu *motu, *src = SND_MOTU_CLOCK_SOURCE_INTERNAL; } else if (val == 0x01) { *src = SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC; + } else if (val == 0x02) { + *src = SND_MOTU_CLOCK_SOURCE_SPH; } else if (val == 0x10) { *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX; } else if (val == 0x18 || val == 0x19) { diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h index 08e3d568221d..bd782ee4e763 100644 --- a/sound/firewire/motu/motu.h +++ b/sound/firewire/motu/motu.h @@ -104,6 +104,7 @@ enum snd_motu_clock_source { SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX, SND_MOTU_CLOCK_SOURCE_AESEBU_ON_XLR, SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC, + SND_MOTU_CLOCK_SOURCE_SPH, SND_MOTU_CLOCK_SOURCE_UNKNOWN, }; From patchwork Wed Oct 30 08:06:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11219157 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 913D6139A for ; Wed, 30 Oct 2019 08:11:08 +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 234D320874 for ; Wed, 30 Oct 2019 08:11:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="tiL23QgE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="PUVXPPkz"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ufAGlv+v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 234D320874 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 6B13022DA; Wed, 30 Oct 2019 09:10:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6B13022DA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572423066; bh=KGmTLURGE9niQXFJDtMjQPpXav5i7BHkYWevglc4PUk=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tiL23QgEEqOAGWaktJcG5hQLld3vmD5c1/gO37bq4bIwi74PIEV39VjKRlZ8v10DF bisnutY3dF44iaNFSF+kjwngMZc0G6Hv/+iO3/pun1zU1nvylkMie3gRQU5kpTbwO7 hP2Rj793haK8LTAM4jK4ivAWaLPsO6Tm34ViAjqA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DB060F80638; Wed, 30 Oct 2019 09:07:06 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7B30CF805AE; Wed, 30 Oct 2019 09:06:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 74D5BF802A0 for ; Wed, 30 Oct 2019 09:06:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 74D5BF802A0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="PUVXPPkz"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ufAGlv+v" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A156021E29; Wed, 30 Oct 2019 04:06:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 30 Oct 2019 04:06:54 -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=fm2; bh=lPnFwmOzoAxfO Ck9z0gCam72sWGmuDMjE9qlknBPeF4=; b=PUVXPPkz7lbwgSIZobDB3hFbcOEST DzIVug2Xa5M3KweeauTwTbMABTkcZpvLxyiJJs71ENFgl3vq12E9bLIwDxX7hB/4 qb3cwrsW7Xzj70yla1MCTkMe9He5WNUlUq2UWYyrGeuwL/RTYyxwKdREMSyF0O6U 9MgnctQ394Ew4GUNEhwGWZG/yVhVyN4Nbk+4LoQYajaGrMA5rPJIz75qwVQLr6BM K8HBN1fSHbKZEu3LEmYB8Mh6RZHrp0+oxvFkeVpSK6zXYb2QVEaTTtbfCBDxY7Np fRYRiqwVM6zf0zuO5sy0Zmo9FJiEBGDz0XfbGvgEW2aqQe8nUmpUATzbw== 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= fm1; bh=lPnFwmOzoAxfOCk9z0gCam72sWGmuDMjE9qlknBPeF4=; b=ufAGlv+v 0M29eukKqWEsce0+6NGcb0ioWnXFWPP+kgEum2ZlPtq8UbXvWunPpCot0KSmrrTl V0R9d8fUzTTpyy8MapeuozhxRhwAxh5HEW30h/k1ZjcnPpWLNZeYpVSUUURy0/SA Kq0MxOaIbtaI9l7T3vSLqC1sptRFtaad3ZIcLsyCPpwyLSm9xPlCGoHAfekE+Tt2 fHVqDIzClUfxtKKEmfj1E4sPtA/B5+fnf7NKHtkW6cTZlrueGKPWfWjnOGqTqVhn HZQKmHP1XJFsyA9SmmCQsBlwJG5BC1QENueye5zPL7bVD050TA5GzRGUJ9k+sxss fbbjqVupcbzs2A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 53CD2306005C; Wed, 30 Oct 2019 04:06:53 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 30 Oct 2019 17:06:42 +0900 Message-Id: <20191030080644.1704-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191030080644.1704-1-o-takashi@sakamocchi.jp> References: <20191030080644.1704-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 4/6] ALSA: firewire-motu: minor code refactoring for protocol version 2 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" This commit adds some helper functions to parse register value for source of sampling clock and nominal sampling transmission frequency. Signed-off-by: Takashi Sakamoto --- sound/firewire/motu/motu-protocol-v2.c | 65 +++++++++++++++----------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/sound/firewire/motu/motu-protocol-v2.c b/sound/firewire/motu/motu-protocol-v2.c index 2757e5b42b9b..cb0e58a9f33d 100644 --- a/sound/firewire/motu/motu-protocol-v2.c +++ b/sound/firewire/motu/motu-protocol-v2.c @@ -26,10 +26,20 @@ #define V2_OPT_IFACE_MODE_ADAT 1 #define V2_OPT_IFACE_MODE_SPDIF 2 +static int get_clock_rate(u32 data, unsigned int *rate) +{ + unsigned int index = (data & V2_CLOCK_RATE_MASK) >> V2_CLOCK_RATE_SHIFT; + if (index >= ARRAY_SIZE(snd_motu_clock_rates)) + return -EIO; + + *rate = snd_motu_clock_rates[index]; + + return 0; +} + static int v2_get_clock_rate(struct snd_motu *motu, unsigned int *rate) { __be32 reg; - unsigned int index; int err; err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, @@ -37,13 +47,7 @@ static int v2_get_clock_rate(struct snd_motu *motu, unsigned int *rate) if (err < 0) return err; - index = (be32_to_cpu(reg) & V2_CLOCK_RATE_MASK) >> V2_CLOCK_RATE_SHIFT; - if (index >= ARRAY_SIZE(snd_motu_clock_rates)) - return -EIO; - - *rate = snd_motu_clock_rates[index]; - - return 0; + return get_clock_rate(be32_to_cpu(reg), rate); } static int v2_set_clock_rate(struct snd_motu *motu, unsigned int rate) @@ -79,38 +83,33 @@ static int v2_set_clock_rate(struct snd_motu *motu, unsigned int rate) sizeof(reg)); } -static int v2_get_clock_source(struct snd_motu *motu, - enum snd_motu_clock_source *src) +static int get_clock_source(struct snd_motu *motu, u32 data, + enum snd_motu_clock_source *src) { - __be32 reg; - unsigned int index; - int err; - - err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, - sizeof(reg)); - if (err < 0) - return err; - - index = be32_to_cpu(reg) & V2_CLOCK_SRC_MASK; + unsigned int index = data & V2_CLOCK_SRC_MASK; if (index > 5) return -EIO; - /* To check the configuration of optical interface. */ - err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET, ®, - sizeof(reg)); - if (err < 0) - return err; - switch (index) { case 0: *src = SND_MOTU_CLOCK_SOURCE_INTERNAL; break; case 1: + { + __be32 reg; + + // To check the configuration of optical interface. + int err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET, + ®, sizeof(reg)); + if (err < 0) + return err; + if (be32_to_cpu(reg) & 0x00000200) *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_OPT; else *src = SND_MOTU_CLOCK_SOURCE_ADAT_ON_OPT; break; + } case 2: *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX; break; @@ -130,6 +129,20 @@ static int v2_get_clock_source(struct snd_motu *motu, return 0; } +static int v2_get_clock_source(struct snd_motu *motu, + enum snd_motu_clock_source *src) +{ + __be32 reg; + int err; + + err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, + sizeof(reg)); + if (err < 0) + return err; + + return get_clock_source(motu, be32_to_cpu(reg), src); +} + static int v2_switch_fetching_mode(struct snd_motu *motu, bool enable) { __be32 reg; From patchwork Wed Oct 30 08:06:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11219163 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EAE2F1515 for ; Wed, 30 Oct 2019 08:11:28 +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 7B1C9208E3 for ; Wed, 30 Oct 2019 08:11:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="H2kJ9khd"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="o1DhWeAe"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Zw28uc10" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B1C9208E3 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 C6CF72309; Wed, 30 Oct 2019 09:10:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C6CF72309 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572423086; bh=TuTBf8UHTFkPI2Zz0aXZFKvu/DZ8kGCbrBwbPImKlPY=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=H2kJ9khdBPEZ5zRFV70zZ/L34CTvMkm/q9e+9UDMLUQe6/H29wZm3oa5Y5kNHiEeD LrAO6SwyL8HA9IBAZjALuWrI6rinDI2Jx7XXdfK/oAzWZAau0uRs1Hg0rMCAKKEYjH QwIgrYmOupSXrO5jWar+TVrVLwEzTHLcF0NzUUgM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0922DF8063D; Wed, 30 Oct 2019 09:07:08 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E48B9F805FD; Wed, 30 Oct 2019 09:07:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 F19C5F805A9 for ; Wed, 30 Oct 2019 09:06:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F19C5F805A9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="o1DhWeAe"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Zw28uc10" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 25E5921EAE; Wed, 30 Oct 2019 04:06:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 30 Oct 2019 04:06:56 -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=fm2; bh=3RL7AnV/Y4fAz W3UhGKbpdplYOj2TSdVr3pvq12p/ic=; b=o1DhWeAeXUo89XBqJ99iJMh2egJFg j0tmXU6mSF2F9W4e3KMVTYUGRavAUzUdYsbDwnVEnLXu1CojNFPzWubtTbXAc4bI gMY/AC6Q+o5njaWKGTO+0UNgWThsA3okJD+pWMyRNJtibzHhACraVQiRUBjAfiNJ 8bIaNKN6Vp9Vt6d3iFhAz8yvHySKDb+GQhgpla4o9jMz/FLmmW6yaMDCbHanzENJ ISmdOo2pRuiQbmSnhO7rqcq+eiiJTxSZSXZvtUxoq+Vmk5wRcSpATHGAxxUTB8Y5 /K9bn2s0Lza6aVCqUvr4f88QnrLOxrxM2DTWv5/9/AA/bck/PamFP5LNA== 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= fm1; bh=3RL7AnV/Y4fAzW3UhGKbpdplYOj2TSdVr3pvq12p/ic=; b=Zw28uc10 rmO6Ro/BbegpZnyEvExv+azuPXB3H8SCsaKuiy8Nwz54ipFxbL9qp7AD9oVCLa4C 4MTSE2acE78gyjBbPBjhsmYEaP+PFP3Ws+TqpRV3aaEx6DbEierasTFboP1jx9WT y+vIFvC/I83BkuQz2yTS+uWCChT9QRVPiTnSVdR7xcLo9C57qdk8uA6eqGmUU13E 6vuE0Otv8rC62KmYU2lVLUVTB0s8YD1VXH0d4k+GhJrXFd9xFpmO1zKHCIh/rFG6 9nKRR3hyyGjykB9dOFZC5Smh/7M/+eLdcH8cqUWDZxN2pOKQq0oPWBjY6gDpYR4x 1+3ONXT3Kb1ORA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id CB8363060057; Wed, 30 Oct 2019 04:06:54 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 30 Oct 2019 17:06:43 +0900 Message-Id: <20191030080644.1704-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191030080644.1704-1-o-takashi@sakamocchi.jp> References: <20191030080644.1704-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 5/6] ALSA: firewire-motu: code refactoring to handle model specific switch for protocol v2 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 MOTU FireWire series, devices which support protocol version 2 have several types of hardware design to process audio data frames for isoc packet. Roughly devices are categorized into three groups: - 828mkII - Traveler/896HD - UltraLite/8pre FireWire Some bit flags in register addressed by 0x'ffff'f000'0b14 includes device-specific effects. This commit cleanups implementation of protocol v2 in this point. Signed-off-by: Takashi Sakamoto --- sound/firewire/motu/motu-protocol-v2.c | 72 +++++++++++++------------- sound/firewire/motu/motu.c | 12 ++--- sound/firewire/motu/motu.h | 3 +- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/sound/firewire/motu/motu-protocol-v2.c b/sound/firewire/motu/motu-protocol-v2.c index cb0e58a9f33d..619b6ae73f62 100644 --- a/sound/firewire/motu/motu-protocol-v2.c +++ b/sound/firewire/motu/motu-protocol-v2.c @@ -12,10 +12,8 @@ #define V2_CLOCK_RATE_SHIFT 3 #define V2_CLOCK_SRC_MASK 0x00000007 #define V2_CLOCK_SRC_SHIFT 0 -#define V2_CLOCK_TRAVELER_FETCH_DISABLE 0x04000000 -#define V2_CLOCK_TRAVELER_FETCH_ENABLE 0x03000000 -#define V2_CLOCK_8PRE_FETCH_DISABLE 0x02000000 -#define V2_CLOCK_8PRE_FETCH_ENABLE 0x00000000 +#define V2_CLOCK_FETCH_ENABLE 0x02000000 +#define V2_CLOCK_MODEL_SPECIFIC 0x04000000 #define V2_IN_OUT_CONF_OFFSET 0x0c04 #define V2_OPT_OUT_IFACE_MASK 0x00000c00 @@ -73,11 +71,6 @@ static int v2_set_clock_rate(struct snd_motu *motu, unsigned int rate) data &= ~V2_CLOCK_RATE_MASK; data |= i << V2_CLOCK_RATE_SHIFT; - if (motu->spec == &snd_motu_spec_traveler) { - data &= ~V2_CLOCK_TRAVELER_FETCH_ENABLE; - data |= V2_CLOCK_TRAVELER_FETCH_DISABLE; - } - reg = cpu_to_be32(data); return snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, ®, sizeof(reg)); @@ -145,42 +138,49 @@ static int v2_get_clock_source(struct snd_motu *motu, static int v2_switch_fetching_mode(struct snd_motu *motu, bool enable) { + enum snd_motu_clock_source src; __be32 reg; u32 data; int err = 0; - if (motu->spec == &snd_motu_spec_traveler || - motu->spec == &snd_motu_spec_8pre) { - err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, - ®, sizeof(reg)); + // 828mkII implements Altera ACEX 1K EP1K30. Nothing to do. + if (motu->spec == &snd_motu_spec_828mk2) + return 0; + + err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, + sizeof(reg)); + if (err < 0) + return err; + data = be32_to_cpu(reg); + + err = get_clock_source(motu, data, &src); + if (err < 0) + return err; + + data &= ~(V2_CLOCK_FETCH_ENABLE | V2_CLOCK_MODEL_SPECIFIC); + if (enable) + data |= V2_CLOCK_FETCH_ENABLE; + + if (motu->spec->flags & SND_MOTU_SPEC_SUPPORT_CLOCK_X4) { + // Expected for Traveler and 896HD, which implements Altera + // Cyclone EP1C3. + data |= V2_CLOCK_MODEL_SPECIFIC; + } else { + // For UltraLite and 8pre, which implements Xilinx Spartan + // XC3S200. + unsigned int rate; + + err = get_clock_rate(data, &rate); if (err < 0) return err; - data = be32_to_cpu(reg); - - if (motu->spec == &snd_motu_spec_traveler) { - data &= ~(V2_CLOCK_TRAVELER_FETCH_DISABLE | - V2_CLOCK_TRAVELER_FETCH_ENABLE); - - if (enable) - data |= V2_CLOCK_TRAVELER_FETCH_ENABLE; - else - data |= V2_CLOCK_TRAVELER_FETCH_DISABLE; - } else if (motu->spec == &snd_motu_spec_8pre) { - data &= ~(V2_CLOCK_8PRE_FETCH_DISABLE | - V2_CLOCK_8PRE_FETCH_ENABLE); - - if (enable) - data |= V2_CLOCK_8PRE_FETCH_DISABLE; - else - data |= V2_CLOCK_8PRE_FETCH_ENABLE; - } - reg = cpu_to_be32(data); - err = snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, - ®, sizeof(reg)); + if (src == SND_MOTU_CLOCK_SOURCE_SPH && rate > 48000) + data |= V2_CLOCK_MODEL_SPECIFIC; } - return err; + reg = cpu_to_be32(data); + return snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, ®, + sizeof(reg)); } static void calculate_fixed_part(struct snd_motu_packet_format *formats, diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c index 680e363d0a4b..f249ad39d8a8 100644 --- a/sound/firewire/motu/motu.c +++ b/sound/firewire/motu/motu.c @@ -172,7 +172,7 @@ static void motu_bus_update(struct fw_unit *unit) snd_motu_transaction_reregister(motu); } -static const struct snd_motu_spec motu_828mk2 = { +const struct snd_motu_spec snd_motu_spec_828mk2 = { .name = "828mk2", .protocol = &snd_motu_protocol_v2, .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | @@ -187,7 +187,7 @@ static const struct snd_motu_spec motu_828mk2 = { .analog_out_ports = 8, }; -const struct snd_motu_spec snd_motu_spec_traveler = { +static const struct snd_motu_spec motu_traveler = { .name = "Traveler", .protocol = &snd_motu_protocol_v2, .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | @@ -202,7 +202,7 @@ const struct snd_motu_spec snd_motu_spec_traveler = { .analog_out_ports = 8, }; -const struct snd_motu_spec snd_motu_spec_8pre = { +static const struct snd_motu_spec motu_8pre = { .name = "8pre", .protocol = &snd_motu_protocol_v2, // In tx, use coax chunks for mix-return 1/2. In rx, use coax chunks for @@ -270,9 +270,9 @@ static const struct snd_motu_spec motu_4pre = { } static const struct ieee1394_device_id motu_id_table[] = { - SND_MOTU_DEV_ENTRY(0x000003, &motu_828mk2), - SND_MOTU_DEV_ENTRY(0x000009, &snd_motu_spec_traveler), - SND_MOTU_DEV_ENTRY(0x00000f, &snd_motu_spec_8pre), + SND_MOTU_DEV_ENTRY(0x000003, &snd_motu_spec_828mk2), + SND_MOTU_DEV_ENTRY(0x000009, &motu_traveler), + SND_MOTU_DEV_ENTRY(0x00000f, &motu_8pre), SND_MOTU_DEV_ENTRY(0x000015, &motu_828mk3), /* FireWire only. */ SND_MOTU_DEV_ENTRY(0x000035, &motu_828mk3), /* Hybrid. */ SND_MOTU_DEV_ENTRY(0x000033, &motu_audio_express), diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h index bd782ee4e763..6efbde405a0d 100644 --- a/sound/firewire/motu/motu.h +++ b/sound/firewire/motu/motu.h @@ -130,8 +130,7 @@ struct snd_motu_spec { extern const struct snd_motu_protocol snd_motu_protocol_v2; extern const struct snd_motu_protocol snd_motu_protocol_v3; -extern const struct snd_motu_spec snd_motu_spec_traveler; -extern const struct snd_motu_spec snd_motu_spec_8pre; +extern const struct snd_motu_spec snd_motu_spec_828mk2; int amdtp_motu_init(struct amdtp_stream *s, struct fw_unit *unit, enum amdtp_stream_direction dir, From patchwork Wed Oct 30 08:06:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11219171 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55C2F1599 for ; Wed, 30 Oct 2019 08:12:10 +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 DCCF520578 for ; Wed, 30 Oct 2019 08:12:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="VEcxAIl/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="hBtxU07d"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="e91Va252" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCCF520578 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 0CDC22312; Wed, 30 Oct 2019 09:11:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0CDC22312 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572423128; bh=akHk8tK4sfiAFfmIjIXvLtm0/NjH8R3hcvfgNjIoQ0w=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VEcxAIl/4L1szqQPI2ewpx+F9HnWtAJW7UHYEiKtdtLavqhRNqdQgHlTZHOIerR6L ieEh8OVK2V7LIntSPWhFf6UzQHulfvFOeGNkMdpbOW+8WtkJrHYHBc8Wd2YNGow1tu kREktrdA/rznDFakANJShKXZ1sWsl8WJnFy1mC4E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2E787F80659; Wed, 30 Oct 2019 09:07:09 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 765F4F805FD; Wed, 30 Oct 2019 09:07:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 7B36AF805FC for ; Wed, 30 Oct 2019 09:06:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7B36AF805FC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="hBtxU07d"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="e91Va252" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9F4BD21ED6; Wed, 30 Oct 2019 04:06:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 30 Oct 2019 04:06:57 -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=fm2; bh=qJnMDdNv4bY2B Vkz9I15A4xcPhhF6I3MF66TJk7A6Oc=; b=hBtxU07dkFNG66EG2N3s/bbdpBTlr QhMNxyvshCVolP4NZj61a/dAHnnlNFSoK5pfAtpNLI2VEqKYVYYUoIB7kZ8e7EXi FrnGuPFNsJvl4Ap28W/uEDKs/6oc/LVfzaj5eLBgM2hu6zdaezIKOBihVH2KxCCY VkIZr1bBFh+qxBa570J2tNMWnCHghpec5DxFqqdAPxDiHqvO6jYRqEy8fe54ZpSm c1RAKDIjLMxGBzorjN6Ac352ilJkURqeNygqDulc+2sk0exSssEqOq0QFTia73BX SNrbcYgcqKENfaKf/MvCGIC/XNmMP/s8E80WaJ1sCVIAQ2luGFxhwIUEA== 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= fm1; bh=qJnMDdNv4bY2BVkz9I15A4xcPhhF6I3MF66TJk7A6Oc=; b=e91Va252 6XqzygsmA7hhm/s7kFURBps7YiHcOCkXX48Nt29W1zA2qeQcqJVamDKv4dIVPiMN ZJaKAai/4mOg7mhb5ypTREMgxekKnP0HWjIlGCs2bUiuvhmeJPpUCqmGCmP2CN5t +ocKe6Bei62t1ssJjdBxKpb4GPVZhsXixPmpLYZm+qx2GMVYKLVWHZFw5A5iEy3L 4F7pkhX7blZxKYUmgeUsXZpabACnEK3cIyfk2GtM7bj5O2TmoVQSmwCVhq7dBFIZ OuiRKbcLvix0UJYh4pNVOKcSDXJ21vB+0LGMdSsvQDTMX1RZvzxx6q4qbcH4SLRb KX5bCfLntyobeQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 4F6473060057; Wed, 30 Oct 2019 04:06:56 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 30 Oct 2019 17:06:44 +0900 Message-Id: <20191030080644.1704-7-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191030080644.1704-1-o-takashi@sakamocchi.jp> References: <20191030080644.1704-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 6/6] ALSA: firewire-motu: add support for MOTU UltraLite 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" UltraLite was shipped in 2005 by MOTU, and already discontinued. This model consists of below ICs: - Texus Instruments TSB41AB2 for physical layer of IEEE 1394 bus - Xilinx Spartan XC35S200 for link layer of IEEE 1394 bus, protocol layer and signal processing This commit adds support for this model. Like the other MOTU models, ALSA firewire MOTU driver fails to drive the device for stable sampling clock and generate noisy sound. $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 04107574 bus_info_length 4, crc_length 16, crc 30068 404 31333934 bus_name "1394" 408 20001000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4) 40c 0001f200 company_id 0001f2 | 410 0007b82d device_id 000007b82d | EUI-64 0001f2000007b82d root directory ----------------------------------------------------------------- 414 0004c65c directory_length 4, crc 50780 418 030001f2 vendor 41c 0c0083c0 node capabilities per IEEE 1394 420 8d000006 --> eui-64 leaf at 438 424 d1000001 --> unit directory at 428 unit directory at 428 ----------------------------------------------------------------- 428 0003d80a directory_length 3, crc 55306 42c 120001f2 specifier id 430 1300000d version 434 17100800 model eui-64 leaf at 438 ----------------------------------------------------------------- 438 00024566 leaf_length 2, crc 17766 43c 0001f200 company_id 0001f2 | 440 0007b82d device_id 000007b82d | EUI-64 0001f2000007b82d Signed-off-by: Takashi Sakamoto --- sound/firewire/motu/motu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c index f249ad39d8a8..f2080d720aa9 100644 --- a/sound/firewire/motu/motu.c +++ b/sound/firewire/motu/motu.c @@ -202,6 +202,19 @@ static const struct snd_motu_spec motu_traveler = { .analog_out_ports = 8, }; +static const struct snd_motu_spec motu_ultralite = { + .name = "UltraLite", + .protocol = &snd_motu_protocol_v2, + .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | + SND_MOTU_SPEC_TX_MICINST_CHUNK | // padding. + SND_MOTU_SPEC_TX_RETURN_CHUNK | + SND_MOTU_SPEC_RX_MIDI_2ND_Q | + SND_MOTU_SPEC_TX_MIDI_2ND_Q | + SND_MOTU_SPEC_RX_SEPARATED_MAIN, + .analog_in_ports = 8, + .analog_out_ports = 8, +}; + static const struct snd_motu_spec motu_8pre = { .name = "8pre", .protocol = &snd_motu_protocol_v2, @@ -272,6 +285,7 @@ static const struct snd_motu_spec motu_4pre = { static const struct ieee1394_device_id motu_id_table[] = { SND_MOTU_DEV_ENTRY(0x000003, &snd_motu_spec_828mk2), SND_MOTU_DEV_ENTRY(0x000009, &motu_traveler), + SND_MOTU_DEV_ENTRY(0x00000d, &motu_ultralite), SND_MOTU_DEV_ENTRY(0x00000f, &motu_8pre), SND_MOTU_DEV_ENTRY(0x000015, &motu_828mk3), /* FireWire only. */ SND_MOTU_DEV_ENTRY(0x000035, &motu_828mk3), /* Hybrid. */