From patchwork Sat Aug 31 12:17:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 2852378 Return-Path: X-Original-To: patchwork-linux-arm@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 B7895C0AB5 for ; Sat, 31 Aug 2013 12:22:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB9DC202DB for ; Sat, 31 Aug 2013 12:22:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91E2B202B9 for ; Sat, 31 Aug 2013 12:22:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFkCR-0004sC-4O; Sat, 31 Aug 2013 12:22:43 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFkCP-0004zc-1N; Sat, 31 Aug 2013 12:22:41 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFkCK-0004z4-70 for linux-arm-kernel@lists.infradead.org; Sat, 31 Aug 2013 12:22:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=3MRWncdVGzkBHDDn2UcRnRFcp5Te5awTXWpJBCLySHI=; b=P8BiFtND/P9hSSuUvV3bvupSR3CmYfERsdm39sWokarvJpxVgdzVXCqGWbxax5zeTqCnMUq2AXhMCH3MRtiXMkndh4lIIiSHcdMHhbWdYzwhTxxCaJJPYWRx+mbDPY2XjanuIphXy7VyXv5WzcbIO2UVLyQq0A4LhvzsjtlLLA8=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:42340) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1VFk72-00013i-1Z; Sat, 31 Aug 2013 13:17:08 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1VFk70-00083m-Iw; Sat, 31 Aug 2013 13:17:06 +0100 Date: Sat, 31 Aug 2013 13:17:06 +0100 From: Russell King - ARM Linux To: Jean-Francois Moine Subject: Re: [PATCH 2/2] ARM: Dove: Add the audio device to the Cubox DT Message-ID: <20130831121705.GE6617@n2100.arm.linux.org.uk> References: <20130828113521.35c53365@armhf> <521DCD80.9010105@gmail.com> <20130831125128.0e3a23c7@armhf> <20130831112430.GD6617@n2100.arm.linux.org.uk> <20130831135519.6ab0e163@armhf> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130831135519.6ab0e163@armhf> User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130831_082237_590350_A064227E X-CRM114-Status: GOOD ( 18.64 ) X-Spam-Score: -1.2 (-) Cc: Mark Rutland , devicetree@vger.kernel.org, Jason Cooper , Pawel Moll , Stephen Warren , linux-kernel@vger.kernel.org, Rob Herring , Ian Campbell , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, Aug 31, 2013 at 01:55:19PM +0200, Jean-Francois Moine wrote: > The last case was "when using the two audio controllers with different > sample rates" (I should have added "in the set [44.1, 48, 96 kHz]"). > Then, with or without the availability of external clocks, both > controllers will set the unique DCO to two different rates. Ah, yes. The documentation is rather confusing too. In one part, it does indeed say that there is only one DCO which is shared between the two blocks. However, each block has its own DCO register which allows it to be set to a different frequency - maybe it accesses the same physical register. In which case, it probably would be better that we use the external clock for everything when it is available - Rabeeh's kernel already does that, as does the kernel which I run on my Cubox. I'll pull that patch over to the series for mainline later today: a402fa7 ASoC: kirkwood: prefer external clock over internal clock (This is copy'n'pasted with gpm, so is white-space damaged). diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index 1c8177b..92cd467 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c @@ -222,20 +222,20 @@ static void kirkwood_set_rate(struct snd_soc_dai *dai, { uint32_t clks_ctrl; - if (rate == 44100 || rate == 48000 || rate == 96000) { - /* use internal dco for supported rates */ - dev_dbg(dai->dev, "%s: dco set rate = %lu\n", - __func__, rate); - kirkwood_set_dco(priv->io, rate); - - clks_ctrl = KIRKWOOD_MCLK_SOURCE_DCO; - } else if (!IS_ERR(priv->extclk)) { + if (!IS_ERR(priv->extclk)) { /* use optional external clk for other rates */ dev_dbg(dai->dev, "%s: extclk set rate = %lu -> %lu\n", __func__, rate, 256 * rate); clk_set_rate(priv->extclk, 256 * rate); clks_ctrl = KIRKWOOD_MCLK_SOURCE_EXTCLK; + } else if (rate == 44100 || rate == 48000 || rate == 96000) { + /* use internal dco for supported rates */ + dev_dbg(dai->dev, "%s: dco set rate = %lu\n", + __func__, rate); + kirkwood_set_dco(priv->io, rate); + + clks_ctrl = KIRKWOOD_MCLK_SOURCE_DCO; } writel(clks_ctrl, priv->io + KIRKWOOD_CLOCKS_CTRL); }