]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-bsp/linux/linux-omap/linus/0020-ASoC-codecs-wm8741-Fix-register-cache-incoherency.patch
160440c69a2e244f2b99a53c2b414759077a9814
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / linus / 0020-ASoC-codecs-wm8741-Fix-register-cache-incoherency.patch
1 From 52ca353bc8597dcc1d6d7abc03eecc1b452d79c9 Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Tue, 28 Dec 2010 21:37:58 +0100
4 Subject: [PATCH 20/66] ASoC: codecs: wm8741: Fix register cache incoherency
6 The multi-component patch(commit f0fba2ad1) moved the allocation of the
7 register cache from the driver to the ASoC core. Most drivers where adjusted to
8 this, but the wm8741 driver still uses its own register cache for its
9 private functions, while functions from the ASoC core use the generic cache.
10 Thus we end up with two from each other incoherent caches, which can lead to
11 undefined behaviour.
12 This patch fixes the issue by changing the wm8741 driver to use the
13 generic register cache in its private functions.
15 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
16 Cc: Ian Lartey <ian@opensource.wolfsonmicro.com>
17 Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
18 Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
19 Cc: stable@kernel.org (for 2.6.37 only)
20 ---
21  sound/soc/codecs/wm8741.c |   10 +++++-----
22  1 files changed, 5 insertions(+), 5 deletions(-)
24 diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
25 index 90e31e9..aea60ef 100644
26 --- a/sound/soc/codecs/wm8741.c
27 +++ b/sound/soc/codecs/wm8741.c
28 @@ -41,7 +41,6 @@ static const char *wm8741_supply_names[WM8741_NUM_SUPPLIES] = {
29  /* codec private data */
30  struct wm8741_priv {
31         enum snd_soc_control_type control_type;
32 -       u16 reg_cache[WM8741_REGISTER_COUNT];
33         struct regulator_bulk_data supplies[WM8741_NUM_SUPPLIES];
34         unsigned int sysclk;
35         struct snd_pcm_hw_constraint_list *sysclk_constraints;
36 @@ -422,6 +421,7 @@ static int wm8741_resume(struct snd_soc_codec *codec)
37  static int wm8741_probe(struct snd_soc_codec *codec)
38  {
39         struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
40 +       u16 *reg_cache = codec->reg_cache;
41         int ret = 0;
42  
43         ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8741->control_type);
44 @@ -437,10 +437,10 @@ static int wm8741_probe(struct snd_soc_codec *codec)
45         }
46  
47         /* Change some default settings - latch VU */
48 -       wm8741->reg_cache[WM8741_DACLLSB_ATTENUATION] |= WM8741_UPDATELL;
49 -       wm8741->reg_cache[WM8741_DACLMSB_ATTENUATION] |= WM8741_UPDATELM;
50 -       wm8741->reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERL;
51 -       wm8741->reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERM;
52 +       reg_cache[WM8741_DACLLSB_ATTENUATION] |= WM8741_UPDATELL;
53 +       reg_cache[WM8741_DACLMSB_ATTENUATION] |= WM8741_UPDATELM;
54 +       reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERL;
55 +       reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERM;
56  
57         snd_soc_add_controls(codec, wm8741_snd_controls,
58                              ARRAY_SIZE(wm8741_snd_controls));
59 -- 
60 1.6.6.1