Skip to content

Commit

Permalink
mfd: Keep a cache of WM8350 volatile values
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed May 19, 2009
1 parent 279e677 commit b126d11
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/mfd/wm8350-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ static int wm8350_phys_read(struct wm8350 *wm8350, u8 reg, int num_regs,
/* Cache is CPU endian */
dest[i - reg] = be16_to_cpu(dest[i - reg]);

/* Satisfy non-volatile bits from cache */
dest[i - reg] &= wm8350_reg_io_map[i].vol;
dest[i - reg] |= wm8350->reg_cache[i];

/* Mask out non-readable bits */
dest[i - reg] &= wm8350_reg_io_map[i].readable;
}
Expand Down Expand Up @@ -182,9 +178,6 @@ 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]);
}

Expand Down Expand Up @@ -1261,7 +1254,6 @@ static int wm8350_create_cache(struct wm8350 *wm8350, int type, int mode)
(i < WM8350_CLOCK_CONTROL_1 || i > WM8350_AIF_TEST)) {
value = be16_to_cpu(wm8350->reg_cache[i]);
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];
Expand Down

0 comments on commit b126d11

Please sign in to comment.