From: Xavier Hsu <xavier.hsu@linaro.org>
To: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
patches@linaro.org
Cc: Xavier Hsu <xavier.hsu@linaro.org>,
ckeepax@opensource.wolfsonmicro.com, lars@metafoo.de,
Andy Green <andy.green@linaro.org>
Subject: [PATCHv4 8/9] WM8971 uses regcache_sync to replace snd_soc_cache_sync
Date: Wed, 17 Sep 2014 16:41:14 +0800 [thread overview]
Message-ID: <1410943275-4160-8-git-send-email-xavier.hsu@linaro.org> (raw)
In-Reply-To: <1410943275-4160-1-git-send-email-xavier.hsu@linaro.org>
This patch improves WM8971.
We uses regcache_sync to replace snd_soc_cache_sync.
Signed-off-by: Xavier Hsu <xavier.hsu@linaro.org>
Signed-off-by: Andy Green <andy.green@linaro.org>
---
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);
--
1.7.9.5
next prev parent reply other threads:[~2014-09-17 8:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 8:41 [PATCHv4 1/9] Clean WM8971 through checkpatch Xavier Hsu
2014-09-17 8:41 ` [PATCHv4 2/9] WM8971 modifies the control of deemphasis Xavier Hsu
2014-09-17 8:41 ` [PATCHv4 3/9] WM8971 uses SOC_ENUM_SINGLE_DECL to replace SOC_ENUM_SINGLE Xavier Hsu
2014-09-17 8:41 ` [PATCHv4 4/9] WM8971 uses TLV information Xavier Hsu
2014-09-17 8:41 ` [PATCHv4 5/9] Improve wm8971_set_dai_fmt Xavier Hsu
2014-09-17 8:41 ` [PATCHv4 6/9] Using the constraint based on wm8971_set_dai_sysclk Xavier Hsu
2014-09-17 8:41 ` [PATCHv4 7/9] WM8971 uses msleep to replace work queue Xavier Hsu
2014-09-22 12:16 ` Charles Keepax
2014-09-24 7:37 ` Xavier Hsu
2014-09-17 8:41 ` Xavier Hsu [this message]
2014-09-17 8:41 ` [PATCHv4 9/9] ASOC add WM8973 support to WM8971 Xavier Hsu
2014-09-22 12:34 ` Charles Keepax
2014-09-22 12:35 ` [PATCHv4 1/9] Clean WM8971 through checkpatch Charles Keepax
2014-09-23 6:54 ` Xavier Hsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410943275-4160-8-git-send-email-xavier.hsu@linaro.org \
--to=xavier.hsu@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=andy.green@linaro.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=lars@metafoo.de \
--cc=patches@linaro.org \
--cc=patches@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).