From: Mark Brown Date: Mon, 20 Oct 2008 21:58:50 +0000 (+0200) Subject: mfd: Don't store volatile bits in WM8350 register cache X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e76f7558d89868bc295fe1220c2e5a0a82f698f6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mfd: Don't store volatile bits in WM8350 register cache This makes the contents of the cache clearer and fixes incorrect initialisation of the cache for partially volatile registers. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c index fbe22fb7847b..0d47fb9e4b3b 100644 --- a/drivers/mfd/wm8350-core.c +++ b/drivers/mfd/wm8350-core.c @@ -183,6 +183,9 @@ static int wm8350_write(struct wm8350 *wm8350, u8 reg, int num_regs, u16 *src) (wm8350->reg_cache[i] & ~wm8350_reg_io_map[i].writable) | src[i - reg]; + /* Don't store volatile bits */ + wm8350->reg_cache[i] &= ~wm8350_reg_io_map[i].vol; + src[i - reg] = cpu_to_be16(src[i - reg]); } @@ -1120,6 +1123,7 @@ static int wm8350_create_cache(struct wm8350 *wm8350, int mode) } value = be16_to_cpu(value); value &= wm8350_reg_io_map[i].readable; + value &= ~wm8350_reg_io_map[i].vol; wm8350->reg_cache[i] = value; } else wm8350->reg_cache[i] = reg_map[i];