From patchwork Mon Oct 20 16:29:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5107501 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 E1B38C11AC for ; Mon, 20 Oct 2014 19:58:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EED2201D3 for ; Mon, 20 Oct 2014 19:58:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C17CF2012F for ; Mon, 20 Oct 2014 19:58:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CBE18261A66; Mon, 20 Oct 2014 21:58:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 5718326598D; Mon, 20 Oct 2014 21:10:01 +0200 (CEST) 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 0764E26598D; Mon, 20 Oct 2014 21:10:00 +0200 (CEST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by alsa0.perex.cz (Postfix) with ESMTP id 0052C2673A8 for ; Mon, 20 Oct 2014 18:29:01 +0200 (CEST) Received: by mail-lb0-f180.google.com with SMTP id n15so4152905lbi.39 for ; Mon, 20 Oct 2014 09:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JBdciqOtM+1JmBqAGua9mkiatt5GVaTFYYWLhxAYJ7U=; b=Ukh2jAp7xbmg1kX38Ye0tgHe2wFPczG0sk84Otu3ob8efAQV8RHYXBgdVBnU0T89yF N6WDFH8r/x+Thm5x6DU4bBHMdrFHWTolC6Z2APWL9taAdSZSXr7c7RyY8qnBgfwLTGKn 1KUSBl6ttYWNcELwixVk3IHVgDz76O8DahrPRrtJwtKbAUX34tiFRDjus5lXMFHL94xU X1jeJYZrd4boYClEBP2yCoT6hzsaWH6ogf5Z44aWim4hzPSNWht7g33oe4ZaZa4BeywN 7B2lVcu+c1yP8LGr8SGyiofP5lTjtarIfHYj7MU6YgKi6N0zJRDj7WzCpGBxScNFyqF/ 3ZNQ== MIME-Version: 1.0 X-Received: by 10.112.73.35 with SMTP id i3mr28846173lbv.75.1413822541427; Mon, 20 Oct 2014 09:29:01 -0700 (PDT) Received: by 10.152.7.39 with HTTP; Mon, 20 Oct 2014 09:29:01 -0700 (PDT) In-Reply-To: References: Date: Mon, 20 Oct 2014 14:29:01 -0200 Message-ID: From: Fabio Estevam To: Jonathan Bennett Cc: "alsa-devel@alsa-project.org" , Aaron Kling , Igor Grinberg , valentin@compulab.co.il Subject: Re: [alsa-devel] Help with wm8731 support for the Utilite (imx6q) 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, Oct 20, 2014 at 10:06 AM, Fabio Estevam wrote: >> clocks = <&clks IMX6QDL_CLK_SSI2>; > > This 'clocks' entry does not seem correct. > > IMX6QDL_CLK_SSI2 is the clock from SSI2 module, which is turned on by > the ssi driver. > > Who provides the MCLK for wm8731 on utilite board? Isn't it mx6 CLKO pin? > > Are you able to monitor this clock with a scope and make sure that it > is actually being turned on? > > We use CLKO output to drive MCLK pins on mx6qdl-sabresd board with > wm8762 codec. You can use it as a reference. > > Adding the Compulab's folks on Cc. Do the changes below help? (using IMX6QDL_CLK_CKO) codec: wm8731@1a { #sound-dai-cells = <0>; compatible = "wlf,wm8731"; reg = <0x1a>; AVDD-supply = <®_3p3v>; HPVDD-supply = <®_3p3v>; DCVDD-supply = <®_3p3v>; DBVDD-supply = <®_3p3v>; clocks = <&clks IMX6QDL_CLK_CKO>; with this one applied: --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -13,6 +13,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -46,6 +47,7 @@ struct wm8731_priv { struct regmap *regmap; struct regulator_bulk_data supplies[WM8731_NUM_SUPPLIES]; const struct snd_pcm_hw_constraint_list *constraints; + struct clk *mclk; unsigned int sysclk; int sysclk_type; int playback_fs; @@ -742,6 +744,21 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, return ret; } + wm8731->mclk = devm_clk_get(&i2c->dev, NULL); + if (IS_ERR(wm8731->mclk)) { + ret = PTR_ERR(wm8731->mclk); + dev_err(&i2c->dev, "Failed to get mclock: %d\n", ret); + /* Defer the probe to see if the clk will be provided later */ + if (ret == -ENOENT) + return -EPROBE_DEFER; + } + + if (!IS_ERR(wm8731->mclk)) { + ret = clk_prepare_enable(wm8731->mclk); + if (ret) + return ret; + } + i2c_set_clientdata(i2c, wm8731); ret = snd_soc_register_codec(&i2c->dev,