From patchwork Wed Sep 17 08:41:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Hsu X-Patchwork-Id: 4923281 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 9EF71BEEA5 for ; Wed, 17 Sep 2014 08:45:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45E0020166 for ; Wed, 17 Sep 2014 08:45:23 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B489220121 for ; Wed, 17 Sep 2014 08:45:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BBBF22655F4; Wed, 17 Sep 2014 10:45:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7B604265497; Wed, 17 Sep 2014 10:41:52 +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 8935D2654A6; Wed, 17 Sep 2014 10:41:49 +0200 (CEST) Received: from Kraken (unknown [124.219.7.128]) by alsa0.perex.cz (Postfix) with ESMTP id 21671265314 for ; Wed, 17 Sep 2014 10:41:32 +0200 (CEST) Received: by Kraken (Postfix, from userid 1011) id 785096A27AF; Wed, 17 Sep 2014 16:41:25 +0800 (CST) From: Xavier Hsu To: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, patches@linaro.org Date: Wed, 17 Sep 2014 16:41:14 +0800 Message-Id: <1410943275-4160-8-git-send-email-xavier.hsu@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1410943275-4160-1-git-send-email-xavier.hsu@linaro.org> References: <1410943275-4160-1-git-send-email-xavier.hsu@linaro.org> Cc: Xavier Hsu , ckeepax@opensource.wolfsonmicro.com, lars@metafoo.de, Andy Green Subject: [alsa-devel] [PATCHv4 8/9] WM8971 uses regcache_sync to replace snd_soc_cache_sync 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch improves WM8971. We uses regcache_sync to replace snd_soc_cache_sync. Signed-off-by: Xavier Hsu Signed-off-by: Andy Green --- Any comments about improving the patch are welcome. Thanks. sound/soc/codecs/wm8971.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index d081cae..6fecf2d 100755 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c @@ -38,6 +38,7 @@ /* codec private data */ struct wm8971_priv { + struct regmap *regmap; /* MCLK */ unsigned int sysclk; struct snd_pcm_hw_constraint_list *sysclk_constraints; @@ -720,6 +721,7 @@ static int wm8971_mute(struct snd_soc_dai *dai, int mute) static int wm8971_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { + struct wm8971_priv *wm8971 = snd_soc_codec_get_drvdata(codec); u16 pwr_reg = snd_soc_read(codec, WM8971_PWR1) & 0xfe3e; switch (level) { @@ -731,7 +733,7 @@ static int wm8971_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_STANDBY: if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) - snd_soc_cache_sync(codec); + regcache_sync(wm8971->regmap); /* mute dac and set vmid to 500k, enable VREF */ snd_soc_write(codec, WM8971_PWR1, pwr_reg | 0x0140); @@ -865,7 +867,6 @@ static int wm8971_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct wm8971_priv *wm8971; - struct regmap *regmap; int ret; wm8971 = devm_kzalloc(&i2c->dev, sizeof(struct wm8971_priv), @@ -875,9 +876,9 @@ static int wm8971_i2c_probe(struct i2c_client *i2c, mutex_init(&wm8971->deemph_mutex); - regmap = devm_regmap_init_i2c(i2c, &wm8971_regmap); - if (IS_ERR(regmap)) - return PTR_ERR(regmap); + wm8971->regmap = devm_regmap_init_i2c(i2c, &wm8971_regmap); + if (IS_ERR(wm8971->regmap)) + return PTR_ERR(wm8971->regmap); i2c_set_clientdata(i2c, wm8971);