aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-cache.c')
-rw-r--r--sound/soc/soc-cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index d9f8aded51f3..20b7f3b003a3 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -203,14 +203,14 @@ static int snd_soc_rbtree_cache_sync(struct snd_soc_codec *codec)
203 rbnode = rb_entry(node, struct snd_soc_rbtree_node, node); 203 rbnode = rb_entry(node, struct snd_soc_rbtree_node, node);
204 for (i = 0; i < rbnode->blklen; ++i) { 204 for (i = 0; i < rbnode->blklen; ++i) {
205 regtmp = rbnode->base_reg + i; 205 regtmp = rbnode->base_reg + i;
206 WARN_ON(codec->writable_register &&
207 codec->writable_register(codec, regtmp));
208 val = snd_soc_rbtree_get_register(rbnode, i); 206 val = snd_soc_rbtree_get_register(rbnode, i);
209 def = snd_soc_get_cache_val(codec->reg_def_copy, i, 207 def = snd_soc_get_cache_val(codec->reg_def_copy, i,
210 rbnode->word_size); 208 rbnode->word_size);
211 if (val == def) 209 if (val == def)
212 continue; 210 continue;
213 211
212 WARN_ON(!snd_soc_codec_writable_register(codec, regtmp));
213
214 codec->cache_bypass = 1; 214 codec->cache_bypass = 1;
215 ret = snd_soc_write(codec, regtmp, val); 215 ret = snd_soc_write(codec, regtmp, val);
216 codec->cache_bypass = 0; 216 codec->cache_bypass = 0;
@@ -563,8 +563,7 @@ static int snd_soc_lzo_cache_sync(struct snd_soc_codec *codec)
563 563
564 lzo_blocks = codec->reg_cache; 564 lzo_blocks = codec->reg_cache;
565 for_each_set_bit(i, lzo_blocks[0]->sync_bmp, lzo_blocks[0]->sync_bmp_nbits) { 565 for_each_set_bit(i, lzo_blocks[0]->sync_bmp, lzo_blocks[0]->sync_bmp_nbits) {
566 WARN_ON(codec->writable_register && 566 WARN_ON(!snd_soc_codec_writable_register(codec, i));
567 codec->writable_register(codec, i));
568 ret = snd_soc_cache_read(codec, i, &val); 567 ret = snd_soc_cache_read(codec, i, &val);
569 if (ret) 568 if (ret)
570 return ret; 569 return ret;
@@ -823,8 +822,6 @@ static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec)
823 822
824 codec_drv = codec->driver; 823 codec_drv = codec->driver;
825 for (i = 0; i < codec_drv->reg_cache_size; ++i) { 824 for (i = 0; i < codec_drv->reg_cache_size; ++i) {
826 WARN_ON(codec->writable_register &&
827 codec->writable_register(codec, i));
828 ret = snd_soc_cache_read(codec, i, &val); 825 ret = snd_soc_cache_read(codec, i, &val);
829 if (ret) 826 if (ret)
830 return ret; 827 return ret;
@@ -832,6 +829,9 @@ static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec)
832 if (snd_soc_get_cache_val(codec->reg_def_copy, 829 if (snd_soc_get_cache_val(codec->reg_def_copy,
833 i, codec_drv->reg_word_size) == val) 830 i, codec_drv->reg_word_size) == val)
834 continue; 831 continue;
832
833 WARN_ON(!snd_soc_codec_writable_register(codec, i));
834
835 ret = snd_soc_write(codec, i, val); 835 ret = snd_soc_write(codec, i, val);
836 if (ret) 836 if (ret)
837 return ret; 837 return ret;