From: Dimitris Papastamos Date: Thu, 5 May 2011 13:18:11 +0000 (+0100) Subject: ASoC: soc-cache: Allow codec->cache_bypass to be used with snd_soc_hw_bulk_write_raw() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=64d27069755db41daa36e4770d88ebc57617559d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ASoC: soc-cache: Allow codec->cache_bypass to be used with snd_soc_hw_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 Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index a217db256700..687beec56476 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c @@ -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;