mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
ASoC: Suppress restore of default register values for rbtree cache sync
Currently the rbtree code will write out the entire register map when doing a cache sync which is wasteful and will slow things down. Check to see if the value we're about to write is the default and don't bother restoring it if it is, either the value will have been retained or the device will have been reset and holds the value already. We should really store the defaults in the nodes but this resolves the immediate issue. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
This commit is contained in:
parent
0168bf0d13
commit
ffdaa48aed
1 changed files with 6 additions and 1 deletions
|
@ -610,7 +610,7 @@ static int snd_soc_rbtree_cache_sync(struct snd_soc_codec *codec)
|
|||
struct rb_node *node;
|
||||
struct snd_soc_rbtree_node *rbnode;
|
||||
unsigned int regtmp;
|
||||
unsigned int val;
|
||||
unsigned int val, def;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -622,6 +622,11 @@ static int snd_soc_rbtree_cache_sync(struct snd_soc_codec *codec)
|
|||
WARN_ON(codec->writable_register &&
|
||||
codec->writable_register(codec, regtmp));
|
||||
val = snd_soc_rbtree_get_register(rbnode, i);
|
||||
def = snd_soc_get_cache_val(codec->reg_def_copy, i,
|
||||
rbnode->word_size);
|
||||
if (val == def)
|
||||
continue;
|
||||
|
||||
codec->cache_bypass = 1;
|
||||
ret = snd_soc_write(codec, regtmp, val);
|
||||
codec->cache_bypass = 0;
|
||||
|
|
Loading…
Reference in a new issue