From patchwork Mon Feb 16 12:58:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Lauss X-Patchwork-Id: 5832421 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A90F09F373 for ; Mon, 16 Feb 2015 12:59:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4703201FA for ; Mon, 16 Feb 2015 12:59:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8754D201D3 for ; Mon, 16 Feb 2015 12:59:16 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id EC6F226067E; Mon, 16 Feb 2015 13:59:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 215282605A1; Mon, 16 Feb 2015 13:59:07 +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 C7E14260601; Mon, 16 Feb 2015 13:59:05 +0100 (CET) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by alsa0.perex.cz (Postfix) with ESMTP id 1AF08260570 for ; Mon, 16 Feb 2015 13:58:59 +0100 (CET) Received: by mail-wg0-f52.google.com with SMTP id x12so19361186wgg.11 for ; Mon, 16 Feb 2015 04:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=/etSFqquje4m+9ru4wCCmxug7GbjP0vmwh2+2+0rOtA=; b=1D+/4eoGS9Ste6v/KtljFi3x2lIcil//Bk2Qxfx8b4Yqzz21KKgxRgw2B6LhoX8nHa x5XRtSm+SxB/bQSjM7/rFzv1d7800+/gHog5hHQvpAtVXNT5+iRUYpS6eM+RtfqIN+li R/o9wAGZevk4R/G4gbN4BL+B/AcX6Z0vEYw+PzuBEffk2B5/CDAAUglltuNvMp44Elir xjEBsCkEq1gC7x1qWDlQ177HQoEdQnTsuo7nnqcZrtHGzaRSMPNw/Ofp0amOBQ3pqmIm d0nClMCYKJoqphDO6tyAdEW5R3wW88menN1SfwcKky5vwVIRwiTTzbgmJf7M5O2wF0n+ lWzQ== X-Received: by 10.194.92.9 with SMTP id ci9mr49526669wjb.142.1424091538757; Mon, 16 Feb 2015 04:58:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.44.66 with HTTP; Mon, 16 Feb 2015 04:58:18 -0800 (PST) In-Reply-To: <20150216103122.GA1091@opensource.wolfsonmicro.com> References: <1423121713-19434-1-git-send-email-voice.shen@atmel.com> <54DC62EA.5030503@atmel.com> <20150216103122.GA1091@opensource.wolfsonmicro.com> From: Manuel Lauss Date: Mon, 16 Feb 2015 13:58:18 +0100 Message-ID: To: Charles Keepax Cc: alsa-devel , Richard Purdie , patches@opensource.wolfsonmicro.com, LKML , linux-sound@vger.kernel.org, Manuel Lauss , Mark Brown , Bo Shen , linux-arm-kernel@lists.infradead.org, Liam Girdwood Subject: Re: [alsa-devel] [PATCH] ASoC: wm8731: let codec to manage clock by itself 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 On Mon, Feb 16, 2015 at 11:31 AM, Charles Keepax wrote: > On Thu, Feb 12, 2015 at 04:23:06PM +0800, Bo Shen wrote: >> Hi All, >> >> On 02/05/2015 03:35 PM, Bo Shen wrote: >>> Let the wm8731 codec to manage clock by itself. >>> >>> Signed-off-by: Bo Shen >>> --- >>> >>> sound/soc/codecs/wm8731.c | 28 ++++++++++++++++++++++++++++ >>> 1 file changed, 28 insertions(+) >> >> Any comments for this patch (aka ping?) > > I preferred the idea of having the clock as optional and from the > discussion on the last patch it didn't look too tricky to me too > achieve. OTOH I think the Atmel system is the only one that uses > both this CODEC and common clock so it doesn't look like this > would cause any problems, but might be nice for this not to be > one more thing for someone to fix up when moving a system to > common clock. Not quite, there's one MIPS platform I maintain which needs a patch like the one below (tested): diff --git a/arch/mips/alchemy/devboards/db1200.c b/arch/mips/alchemy/devboards/db1200.c index 8c13675..aa01ab2 100644 --- a/arch/mips/alchemy/devboards/db1200.c +++ b/arch/mips/alchemy/devboards/db1200.c @@ -19,6 +19,8 @@ */ #include +#include +#include #include #include #include @@ -862,6 +864,12 @@ int __init db1200_dev_setup(void) irq_set_status_flags(DB1200_PC1_INSERT_INT, IRQ_NOAUTOEN); irq_set_status_flags(DB1200_PC1_EJECT_INT, IRQ_NOAUTOEN); + /* register the 12MHz crystal for the WM8731 I2S codec */ + c = clk_register_fixed_rate(NULL, "wm8731xtal", NULL, + CLK_IS_ROOT, 12000000); + if (!IS_ERR(c)) + clk_register_clkdev(c, "mclk", "0-001b"); + i2c_register_board_info(0, db1200_i2c_devs, ARRAY_SIZE(db1200_i2c_devs)); spi_register_board_info(db1200_spi_devs, diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c index 1c64fdb..1aa01c8 100644 --- a/arch/mips/alchemy/devboards/db1300.c +++ b/arch/mips/alchemy/devboards/db1300.c @@ -5,6 +5,8 @@ */ #include +#include +#include #include #include #include @@ -799,6 +801,12 @@ int __init db1300_dev_setup(void) if (platform_driver_register(&db1300_wm97xx_driver)) pr_warn("DB1300: failed to init touch pen irq support!\n"); + /* register the 12MHz crystal for the WM8731 I2S codec */ + c = clk_register_fixed_rate(NULL, "wm8731xtal", NULL, + CLK_IS_ROOT, 12000000); + if (!IS_ERR(c)) + clk_register_clkdev(c, "mclk", "0-001b"); + /* Audio PSC clock is supplied by codecs (PSC1, 2) */ __raw_writel(PSC_SEL_CLK_SERCLK, (void __iomem *)KSEG1ADDR(AU1300_PSC1_PHYS_ADDR) + PSC_SEL_OFFSET);