From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Liam Girdwood <lrg@ti.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
alsa-devel@alsa-project.org
Subject: [RFC][PATCH] ASoC: Suppress restore of default register values for lzo cache sync
Date: Thu, 13 Oct 2011 17:28:33 +0800 [thread overview]
Message-ID: <1318498113.2857.16.camel@phoenix> (raw)
Currently we do suppress restore of default register values for rbtree
and flat cache sync.
A couple users use this trick to avoid writing reset register while resume.
Thus make lzo cache sync suppress restore of default register values,
so we have consistent behavior for all types of cache sync.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
sound/soc/soc-cache.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 9077aa4..eb3c016 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -555,16 +555,22 @@ static inline int snd_soc_lzo_get_blksize(struct snd_soc_codec *codec)
static int snd_soc_lzo_cache_sync(struct snd_soc_codec *codec)
{
struct snd_soc_lzo_ctx **lzo_blocks;
- unsigned int val;
+ unsigned int val, def;
+ unsigned int word_size;
int i;
int ret;
lzo_blocks = codec->reg_cache;
+ word_size = codec->driver->reg_word_size;
for_each_set_bit(i, lzo_blocks[0]->sync_bmp, lzo_blocks[0]->sync_bmp_nbits) {
WARN_ON(!snd_soc_codec_writable_register(codec, i));
ret = snd_soc_cache_read(codec, i, &val);
if (ret)
return ret;
+ def = snd_soc_get_cache_val(codec->reg_def_copy, i, word_size);
+ if (val == def)
+ continue;
+
codec->cache_bypass = 1;
ret = snd_soc_write(codec, i, val);
codec->cache_bypass = 0;
--
1.7.4.1
next reply other threads:[~2011-10-13 9:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 9:28 Axel Lin [this message]
2011-10-13 10:57 ` [RFC][PATCH] ASoC: Suppress restore of default register values for lzo cache sync Mark Brown
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=1318498113.2857.16.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.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