From patchwork Wed Dec 19 20:11:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10738093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9D1C14E2 for ; Wed, 19 Dec 2018 20:11:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D2D0286DF for ; Wed, 19 Dec 2018 20:11:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B415286EE; Wed, 19 Dec 2018 20:11:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A883286E0 for ; Wed, 19 Dec 2018 20:11:30 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 68852267B38; Wed, 19 Dec 2018 21:11:23 +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 280CE267B34; Wed, 19 Dec 2018 21:11:18 +0100 (CET) Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by alsa0.perex.cz (Postfix) with ESMTP id 20533267A8E for ; Wed, 19 Dec 2018 21:11:15 +0100 (CET) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 43KmFl43Djz6R; Wed, 19 Dec 2018 21:09:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1545250187; bh=6wFLghiwC1NnirPTAXQvmgCbUTagArCFG3w5930KLSc=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=la3EmXFHHAFQIZKCKH6FLlDAnXL3hGuo8pBsYJvlnDGERd7cmOpzWVm141jC13SlT YQMd5wvBdREH+QE/oqNEhwVmWjgcj6uXIXEesm0A04dbxqwXHXtutUQS6JpjnUWu+U 8rDV4SkYiUQvR+eIHackKb0qZY2aZm4g/6pHglCvIUYf2zBNHBvHeNWa7LMuSiE1Ax K+REEJz8OKk/oc1TquiSD7MZExPgu6fYYuffTtXAioq161nrdjD7hHxmH2AhxxyUJO yyc9p981bQYsWBskeIHTd9DX+UENy2w7rwgjXYZGyNA9vaRtwFZga4uIydHjHMUm+n fR2aLQvBB6OAw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Wed, 19 Dec 2018 21:11:15 +0100 Message-Id: <138161713c87d094c8e4f966f88b08a4dec16df9.1545249666.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= MIME-Version: 1.0 To: patches@opensource.cirrus.com, alsa-devel@alsa-project.org Cc: Takashi Iwai , Mark Brown , Liam Girdwood Subject: [alsa-devel] [PATCH 1/4] ASoC: wm8904: make the driver visible in Kconfig 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 For platforms that use the audio-graph-card driver, the codec is not selected by SoC-platform driver. Make it available. Signed-off-by: Michał Mirosław Acked-by: Charles Keepax --- sound/soc/codecs/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 9cc4f1848c9b..f9e6e07be005 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -1205,7 +1205,8 @@ config SND_SOC_WM8903 depends on I2C config SND_SOC_WM8904 - tristate + tristate "Wolfson Microelectronics WM8904 CODEC" + depends on I2C config SND_SOC_WM8940 tristate From patchwork Wed Dec 19 20:11:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10738097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 876896C5 for ; Wed, 19 Dec 2018 20:11:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AB7B286F1 for ; Wed, 19 Dec 2018 20:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78FCB286EC; Wed, 19 Dec 2018 20:11:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA882286F5 for ; Wed, 19 Dec 2018 20:11:44 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B3F98267B3F; Wed, 19 Dec 2018 21:11:26 +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 3C8EB267B31; Wed, 19 Dec 2018 21:11:20 +0100 (CET) Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by alsa0.perex.cz (Postfix) with ESMTP id 59958267B14 for ; Wed, 19 Dec 2018 21:11:16 +0100 (CET) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 43KmFl6Kp0zKh; Wed, 19 Dec 2018 21:09:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1545250188; bh=07p9wspnLa0BaVOz/TIs7B1V7hzuPCcxYLNyXfXIoVw=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=IGlXMQ9gN1TCURd8wcnv+seT09DMqCNrvbMgFLMBxc1CmX5zniXZ0FWe/H5mOVCPY tA+pgUqHGraF3IG0hHGRzhytGsVe3JmnG/czSkkiK57O+zAugBSHGpiZJI34pZNZAM XYRxzcQYX2bq8+7gWKJYuNCnHs/i7riEKR9HtEsSstCRAjBJm8s+7PNEzegvU+fh6k h2zTVVMGQUMPoUAhqnze9TV3z8R+8SyA9nwkZpklOIiG+HJv9Sz0Ji6SLcawgXZjuB YaT87pVHhEhSEkx6+3mHXEZC7guXsdg9JP9Gmw4SS8MOwA3IPsvSzZvtj1rPu5grMJ CX33JRN3lKlpA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Wed, 19 Dec 2018 21:11:15 +0100 Message-Id: <5353df1d654eae0bbbf26bc1a1d172e611c385db.1545249666.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= MIME-Version: 1.0 To: patches@opensource.cirrus.com, alsa-devel@alsa-project.org Cc: Takashi Iwai , Mark Brown , Liam Girdwood Subject: [alsa-devel] [PATCH 2/4] ASoC: wm8904: Automatically enable FLL when selected 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 This makes FLL the clock used from audio-graph-card platform driver (it explicitly uses clock id 0). Other platform drivers select the clock manually. Signed-off-by: Michał Mirosław --- sound/soc/codecs/wm8904.c | 21 ++++++++++++++++++--- sound/soc/codecs/wm8904.h | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 2a3e5fbd04e4..f8a17fcdfdeb 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -315,6 +315,9 @@ static bool wm8904_readable_register(struct device *dev, unsigned int reg) } } +static int wm8904_set_fll(struct snd_soc_component *component, int fll_id, int source, + unsigned int Fref, unsigned int Fout); + static int wm8904_configure_clocking(struct snd_soc_component *component) { struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); @@ -339,6 +342,13 @@ static int wm8904_configure_clocking(struct snd_soc_component *component) break; case WM8904_CLK_FLL: + if (!wm8904->fll_fout) { + int ret = wm8904_set_fll(component, WM8904_FLL_MCLK, WM8904_FLL_MCLK, + clk_get_rate(wm8904->mclk), 12288000); + if (ret) + return ret; + } + dev_dbg(component->dev, "Using %dHz FLL clock\n", wm8904->fll_fout); @@ -1675,10 +1685,9 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, return 0; } -static int wm8904_set_fll(struct snd_soc_dai *dai, int fll_id, int source, +static int wm8904_set_fll(struct snd_soc_component *component, int fll_id, int source, unsigned int Fref, unsigned int Fout) { - struct snd_soc_component *component = dai->component; struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); struct _fll_div fll_div; int ret, val; @@ -1814,6 +1823,12 @@ static int wm8904_set_fll(struct snd_soc_dai *dai, int fll_id, int source, return 0; } +static int wm8904_set_dai_fll(struct snd_soc_dai *dai, int fll_id, int source, + unsigned int Fref, unsigned int Fout) +{ + return wm8904_set_fll(dai->component, fll_id, source, Fref, Fout); +} + static int wm8904_digital_mute(struct snd_soc_dai *codec_dai, int mute) { struct snd_soc_component *component = codec_dai->component; @@ -1921,7 +1936,7 @@ static const struct snd_soc_dai_ops wm8904_dai_ops = { .set_sysclk = wm8904_set_sysclk, .set_fmt = wm8904_set_fmt, .set_tdm_slot = wm8904_set_tdm_slot, - .set_pll = wm8904_set_fll, + .set_pll = wm8904_set_dai_fll, .hw_params = wm8904_hw_params, .digital_mute = wm8904_digital_mute, }; diff --git a/sound/soc/codecs/wm8904.h b/sound/soc/codecs/wm8904.h index c29a0e8131ca..ed3260bcae62 100644 --- a/sound/soc/codecs/wm8904.h +++ b/sound/soc/codecs/wm8904.h @@ -13,8 +13,8 @@ #ifndef _WM8904_H #define _WM8904_H +#define WM8904_CLK_FLL 0 #define WM8904_CLK_MCLK 1 -#define WM8904_CLK_FLL 2 #define WM8904_FLL_MCLK 1 #define WM8904_FLL_BCLK 2 From patchwork Wed Dec 19 20:11:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10738095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33D5514E2 for ; Wed, 19 Dec 2018 20:11:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2723E286BC for ; Wed, 19 Dec 2018 20:11:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2529E286C7; Wed, 19 Dec 2018 20:11:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CE5B286D3 for ; Wed, 19 Dec 2018 20:11:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E8814267B42; Wed, 19 Dec 2018 21:11:24 +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 0D5A7267B34; Wed, 19 Dec 2018 21:11:20 +0100 (CET) Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by alsa0.perex.cz (Postfix) with ESMTP id A65C6267B31 for ; Wed, 19 Dec 2018 21:11:16 +0100 (CET) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 43KmFm2QxWzLn; Wed, 19 Dec 2018 21:09:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1545250188; bh=Ww6hjTFUQwF8WGsPOTgGNV84VmF4pOZ5aCK52+ooeas=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=lVf61jWrdZN2zJnxYcMvMg+XTnv8uVQnjrbL0QbbePYvbOYAOZCl8YxWwGk4o4xxI 09DNcj1bB63o49f63+++0jQCIVVy1bX5AJn4eq5qHTpKR5w+oHqbVImCOvQeqTzy6p Y/CVuR4Whz5Gvq+xAnoDexTNcm6AaH2AeNp0LK2iHW6tvfD7n/86y4BSEVP0EDkXIJ OrC8VkFfJJbEqZB5+leDr7tbCxLuDM33Q3AR3acdBz2VmN4IoLmdsh7C7T0p/ssKts Uk152W56YFCvGjFsXaag3s6XUqIaJjsscpHGIIUzC8Jb/Yc8p0b5Fv9wEmGFAjmhUF pRXAbW84I8CZQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Wed, 19 Dec 2018 21:11:16 +0100 Message-Id: <30114be8a4e9eda7c6b2a6f555397f51f9a389f8.1545249666.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= MIME-Version: 1.0 To: patches@opensource.cirrus.com, alsa-devel@alsa-project.org Cc: Takashi Iwai , Mark Brown , Liam Girdwood Subject: [alsa-devel] [PATCH 3/4] ASoC: wm8904: save model id directly in of_device_id.data 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 Save 2x unsigned int of .rodata. Signed-off-by: Michał Mirosław Acked-by: Charles Keepax --- sound/soc/codecs/wm8904.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index f8a17fcdfdeb..2813b7f6a58e 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2123,16 +2123,13 @@ static const struct regmap_config wm8904_regmap = { }; #ifdef CONFIG_OF -static enum wm8904_type wm8904_data = WM8904; -static enum wm8904_type wm8912_data = WM8912; - static const struct of_device_id wm8904_of_match[] = { { .compatible = "wlf,wm8904", - .data = &wm8904_data, + .data = (void *)WM8904, }, { .compatible = "wlf,wm8912", - .data = &wm8912_data, + .data = (void *)WM8912, }, { /* sentinel */ } @@ -2173,7 +2170,7 @@ static int wm8904_i2c_probe(struct i2c_client *i2c, match = of_match_node(wm8904_of_match, i2c->dev.of_node); if (match == NULL) return -EINVAL; - wm8904->devtype = *((enum wm8904_type *)match->data); + wm8904->devtype = (enum wm8904_type)match->data; } else { wm8904->devtype = id->driver_data; } From patchwork Wed Dec 19 20:11:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10738099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DB9C14E2 for ; Wed, 19 Dec 2018 20:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F5072866D for ; Wed, 19 Dec 2018 20:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20C8028685; Wed, 19 Dec 2018 20:11:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF0B528685 for ; Wed, 19 Dec 2018 20:11:51 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2E695267B4E; Wed, 19 Dec 2018 21:11:28 +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 6863B267B14; Wed, 19 Dec 2018 21:11:20 +0100 (CET) Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by alsa0.perex.cz (Postfix) with ESMTP id 4C1C826782E for ; Wed, 19 Dec 2018 21:11:16 +0100 (CET) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 43KmFm4XqQzRH; Wed, 19 Dec 2018 21:09:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1545250188; bh=3lN2c9SIZmarvokUfROrYpSMDai93Tj17F/OHkhxhFA=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=SVMIQjtcfO2U69jbG63fCUsJhzB1jDdIBudbHYbgLJqhFKEQ1rK8MYNidH0eha2JM yCOxlvoFC5lAqU/7k4uvJb8RHhxwFPEPKTqrcFJzkZA2Pf/Acis+6+gkBv1jevfoC+ hXM3ndpudwgCC6ompLmLb5mWUxk1kCynfdEUnE0iZaaica8TYEuEDfoC2bQ/S2bgVv VZKqYjPl7wkt5l8LX68mz9dkb8MUjFmwy3UwUGulSG+KD8PIDLaoc3yQcIWMLciJgd BXosFxKb0TSUysdbU+Z8kfMIzOIJZypIyA+5lH5J8+cGPr3Bi0rSwVDvHzukdBko50 ndnzA5K/+wcdg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Wed, 19 Dec 2018 21:11:16 +0100 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= MIME-Version: 1.0 To: patches@opensource.cirrus.com, alsa-devel@alsa-project.org Cc: Takashi Iwai , Mark Brown , Liam Girdwood Subject: [alsa-devel] [PATCH 4/4] ASoC: wm8904: enable MCLK in STANDBY 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 MCLK input is needed when accessing any register after enabling SYSCLK. This also fixes imbalance of clk_enable / clk_disable when transitioning between ON -> STANDBY -> ON bias levels. Signed-off-by: Michał Mirosław Acked-by: Charles Keepax --- sound/soc/codecs/wm8904.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 2813b7f6a58e..9f0167a39e51 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1852,9 +1852,6 @@ static int wm8904_set_bias_level(struct snd_soc_component *component, switch (level) { case SND_SOC_BIAS_ON: - ret = clk_prepare_enable(wm8904->mclk); - if (ret) - return ret; break; case SND_SOC_BIAS_PREPARE: @@ -1879,6 +1876,15 @@ static int wm8904_set_bias_level(struct snd_soc_component *component, return ret; } + ret = clk_prepare_enable(wm8904->mclk); + if (ret) { + dev_err(component->dev, + "Failed to enable MCLK: %d\n", ret); + regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), + wm8904->supplies); + return ret; + } + regcache_cache_only(wm8904->regmap, false); regcache_sync(wm8904->regmap);