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: 37512 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0182A2054D for ; Wed, 17 Sep 2014 08:41:37 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id t10sf734145eei.0 for ; Wed, 17 Sep 2014 01:41:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=w+9WQZ5c3My7Nnwvf266sYZ44raufjq155xl2iNyhN4=; b=AjR5sF4TFbd/hAutRXEhgJ2ijh8lHqcriw8EA+Dy9jWzMefIz6c/M3/Scc0ByQYXW5 e6cX5M+Gp3h8I8x4Ceg4kApfBubkUG27BtbYTsqYeYXmp1LapSTuJeJsA4M61cPcJU17 zshA6YDAwhDAQcq4Z0FRFNrV42SmvcZ/VAGYk8owHs/sq2ecdTg/wJ2WDm888F3cYI1F gALKDtCkH8ZMVKP3Vykk0vfyi7K3KD6O0aIo4ohwSVPZlCd7FNQL2UDC6zJx02K94bS8 VUvBrX+MBSotAibmQwDADO7ujWmknN4LzUPU5ahZ6QkiA0PJohlqlouCmFSheposkuTK B+cQ== X-Gm-Message-State: ALoCoQn8H4qrljVc1oOmH4XCA3gx3RvP/wDknEaBbrZV4BKv1CcH4gDIXK6NPKUX2f2N4Cop8DQ+ X-Received: by 10.112.190.102 with SMTP id gp6mr247193lbc.10.1410943297062; Wed, 17 Sep 2014 01:41:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.2 with SMTP id w2ls94278law.39.gmail; Wed, 17 Sep 2014 01:41:36 -0700 (PDT) X-Received: by 10.152.170.194 with SMTP id ao2mr17279069lac.78.1410943296835; Wed, 17 Sep 2014 01:41:36 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id of9si23839232lbb.124.2014.09.17.01.41.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 01:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id ge10so1407909lab.12 for ; Wed, 17 Sep 2014 01:41:36 -0700 (PDT) X-Received: by 10.152.246.6 with SMTP id xs6mr42691012lac.56.1410943296780; Wed, 17 Sep 2014 01:41:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.130.169 with SMTP id of9csp537477lbb; Wed, 17 Sep 2014 01:41:36 -0700 (PDT) X-Received: by 10.70.16.2 with SMTP id b2mr69896595pdd.36.1410943292467; Wed, 17 Sep 2014 01:41:32 -0700 (PDT) Received: from Kraken ([124.219.7.128]) by mx.google.com with ESMTP id v3si33667138pds.170.2014.09.17.01.41.30 for ; Wed, 17 Sep 2014 01:41:32 -0700 (PDT) Received-SPF: none (google.com: xavier@kraken does not designate permitted sender hosts) client-ip=124.219.7.128; 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 Cc: lars@metafoo.de, ckeepax@opensource.wolfsonmicro.com, Xavier Hsu , Andy Green Subject: [PATCHv4 8/9] WM8971 uses regcache_sync to replace snd_soc_cache_sync 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: xavier.hsu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);