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);