Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Keep a cache of WM8350 volatile values

Due to the way that the WM8350 audio driver handles CODEC_ENA many of
the WM8350 audio registers are marked as volatile when they aren't
actually so. Allow the audio driver to see a cache of these values for
inspection during interrupt context.

To do this we need to stop satisfying any bits from volatile registers
from cache - there's no real benefit from doing so anyway, we did the
read already.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Mark Brown and committed by
Samuel Ortiz
b126d113 279e677f

-8
-8
drivers/mfd/wm8350-core.c
··· 79 79 /* Cache is CPU endian */ 80 80 dest[i - reg] = be16_to_cpu(dest[i - reg]); 81 81 82 - /* Satisfy non-volatile bits from cache */ 83 - dest[i - reg] &= wm8350_reg_io_map[i].vol; 84 - dest[i - reg] |= wm8350->reg_cache[i]; 85 - 86 82 /* Mask out non-readable bits */ 87 83 dest[i - reg] &= wm8350_reg_io_map[i].readable; 88 84 } ··· 177 181 wm8350->reg_cache[i] = 178 182 (wm8350->reg_cache[i] & ~wm8350_reg_io_map[i].writable) 179 183 | src[i - reg]; 180 - 181 - /* Don't store volatile bits */ 182 - wm8350->reg_cache[i] &= ~wm8350_reg_io_map[i].vol; 183 184 184 185 src[i - reg] = cpu_to_be16(src[i - reg]); 185 186 } ··· 1254 1261 (i < WM8350_CLOCK_CONTROL_1 || i > WM8350_AIF_TEST)) { 1255 1262 value = be16_to_cpu(wm8350->reg_cache[i]); 1256 1263 value &= wm8350_reg_io_map[i].readable; 1257 - value &= ~wm8350_reg_io_map[i].vol; 1258 1264 wm8350->reg_cache[i] = value; 1259 1265 } else 1260 1266 wm8350->reg_cache[i] = reg_map[i];