From patchwork Sun Oct 26 13:49:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 5154371 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 447D6C11AC for ; Sun, 26 Oct 2014 13:50:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87BDF20303 for ; Sun, 26 Oct 2014 13:50:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 202CD20340 for ; Sun, 26 Oct 2014 13:50:16 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 551792606A9; Sun, 26 Oct 2014 14:50:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1F2292606AC; Sun, 26 Oct 2014 14:50:04 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2D09B2606B8; Sun, 26 Oct 2014 14:50:02 +0100 (CET) Received: from smtp303.phy.lolipop.jp (smtp303.phy.lolipop.jp [210.157.22.87]) by alsa0.perex.cz (Postfix) with ESMTP id C22AE2606A9 for ; Sun, 26 Oct 2014 14:49:53 +0100 (CET) Received: from smtp303.phy.lolipop.lan (HELO smtp303.phy.lolipop.jp) (172.17.1.87) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp303.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Sun, 26 Oct 2014 22:49:49 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp303.phy.lolipop.jp (LOLIPOP-Fsecure); Sun, 26 Oct 2014 22:49:45 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 26 Oct 2014 22:49:45 +0900 Message-Id: <1414331385-14731-1-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: muranyia@gmail.com, alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH][fix] ALSA: bebob: fix wrong decoding of clock information for Terratec PHASE 88 Rack FW X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Terratec PHASE 88 rack fw has two registers for source of clock, one is for internal/external, and another is for wordclock/spdif for external. When clock source is internal, information in another register has no meaning. Thus it must be ignored, but current implementation decodes it. This causes over-indexing reference to labels. Reported-by: András Murányi Tested-by: András Murányi Signed-off-by: Takashi Sakamoto Acked-by: Clemens Ladisch --- sound/firewire/bebob/bebob_terratec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/firewire/bebob/bebob_terratec.c b/sound/firewire/bebob/bebob_terratec.c index 0e4c0bf..9940611 100644 --- a/sound/firewire/bebob/bebob_terratec.c +++ b/sound/firewire/bebob/bebob_terratec.c @@ -24,7 +24,12 @@ phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id) if (err < 0) goto end; - *id = (enable_ext & 0x01) | ((enable_word & 0x01) << 1); + if (enable_ext == 0) + *id = 0; + else if (enable_word == 0) + *id = 1; + else + *id = 2; end: return err; }