Skip to content

Commit

Permalink
ASoC: soc-cache: Allow codec->cache_bypass to be used with snd_soc_hw…
Browse files Browse the repository at this point in the history
…_bulk_write_raw()

If we specifically want to write a block of data to the hw bypassing the
cache, then allow this to happen inside snd_soc_hw_bulk_write_raw().

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Dimitris Papastamos authored and broonie committed May 8, 2011
1 parent 7753015 commit 64d2706
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sound/soc/soc-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,13 @@ static int snd_soc_hw_bulk_write_raw(struct snd_soc_codec *codec, unsigned int r
{
int ret;

/* Ensure that the base register is volatile. Subsequently
* any other register that is touched by this routine should be
* volatile as well to ensure that we don't get out of sync with
* the cache.
/* To ensure that we don't get out of sync with the cache, check
* whether the base register is volatile or if we've directly asked
* to bypass the cache. Out of bounds registers are considered
* volatile.
*/
if (!snd_soc_codec_volatile_register(codec, reg)
if (!codec->cache_bypass
&& !snd_soc_codec_volatile_register(codec, reg)
&& reg < codec->driver->reg_cache_size)
return -EINVAL;

Expand Down

0 comments on commit 64d2706

Please sign in to comment.