ASoC: soc-cache: Apply the cache_bypass option
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Wed, 19 Jan 2011 14:53:37 +0000 (14:53 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 20 Jan 2011 13:41:01 +0000 (13:41 +0000)
Incorporate the use of the cache_bypass functionality in the
syncing functions.  The snd_soc_flat_cache_sync() need not be
hooked as there is no performance benefit from using the
cache_bypass option.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-cache.c

index 1ebff9f..f834839 100644 (file)
@@ -890,7 +890,9 @@ static int snd_soc_rbtree_cache_sync(struct snd_soc_codec *codec)
                ret = snd_soc_cache_read(codec, rbnode->reg, &val);
                if (ret)
                        return ret;
+               codec->cache_bypass = 1;
                ret = snd_soc_write(codec, rbnode->reg, val);
+               codec->cache_bypass = 0;
                if (ret)
                        return ret;
                dev_dbg(codec->dev, "Synced register %#x, value = %#x\n",
@@ -1148,7 +1150,9 @@ static int snd_soc_lzo_cache_sync(struct snd_soc_codec *codec)
                ret = snd_soc_cache_read(codec, i, &val);
                if (ret)
                        return ret;
+               codec->cache_bypass = 1;
                ret = snd_soc_write(codec, i, val);
+               codec->cache_bypass = 0;
                if (ret)
                        return ret;
                dev_dbg(codec->dev, "Synced register %#x, value = %#x\n",