diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0019-ASoC-codecs-wm8523-Fix-register-cache-incoherency.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap/linus/0019-ASoC-codecs-wm8523-Fix-register-cache-incoherency.patch | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0019-ASoC-codecs-wm8523-Fix-register-cache-incoherency.patch b/extras/recipes-kernel/linux/linux-omap/linus/0019-ASoC-codecs-wm8523-Fix-register-cache-incoherency.patch new file mode 100644 index 00000000..6ef2360a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/linus/0019-ASoC-codecs-wm8523-Fix-register-cache-incoherency.patch | |||
@@ -0,0 +1,74 @@ | |||
1 | From 50e75c326e4d3278b73385a3baf78fc4660d3610 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lars-Peter Clausen <lars@metafoo.de> | ||
3 | Date: Tue, 28 Dec 2010 21:37:57 +0100 | ||
4 | Subject: [PATCH 19/65] ASoC: codecs: wm8523: Fix register cache incoherency | ||
5 | |||
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 wm8523 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 wm8523 driver to use the | ||
13 | generic register cache in its private functions. | ||
14 | |||
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/wm8523.c | 9 +++++---- | ||
22 | 1 files changed, 5 insertions(+), 4 deletions(-) | ||
23 | |||
24 | diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c | ||
25 | index 9a433a5..deca79e 100644 | ||
26 | --- a/sound/soc/codecs/wm8523.c | ||
27 | +++ b/sound/soc/codecs/wm8523.c | ||
28 | @@ -41,7 +41,6 @@ static const char *wm8523_supply_names[WM8523_NUM_SUPPLIES] = { | ||
29 | /* codec private data */ | ||
30 | struct wm8523_priv { | ||
31 | enum snd_soc_control_type control_type; | ||
32 | - u16 reg_cache[WM8523_REGISTER_COUNT]; | ||
33 | struct regulator_bulk_data supplies[WM8523_NUM_SUPPLIES]; | ||
34 | unsigned int sysclk; | ||
35 | unsigned int rate_constraint_list[WM8523_NUM_RATES]; | ||
36 | @@ -314,6 +313,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec, | ||
37 | enum snd_soc_bias_level level) | ||
38 | { | ||
39 | struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec); | ||
40 | + u16 *reg_cache = codec->reg_cache; | ||
41 | int ret, i; | ||
42 | |||
43 | switch (level) { | ||
44 | @@ -344,7 +344,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec, | ||
45 | /* Sync back default/cached values */ | ||
46 | for (i = WM8523_AIF_CTRL1; | ||
47 | i < WM8523_MAX_REGISTER; i++) | ||
48 | - snd_soc_write(codec, i, wm8523->reg_cache[i]); | ||
49 | + snd_soc_write(codec, i, reg_cache[i]); | ||
50 | |||
51 | |||
52 | msleep(100); | ||
53 | @@ -414,6 +414,7 @@ static int wm8523_resume(struct snd_soc_codec *codec) | ||
54 | static int wm8523_probe(struct snd_soc_codec *codec) | ||
55 | { | ||
56 | struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec); | ||
57 | + u16 *reg_cache = codec->reg_cache; | ||
58 | int ret, i; | ||
59 | |||
60 | codec->hw_write = (hw_write_t)i2c_master_send; | ||
61 | @@ -470,8 +471,8 @@ static int wm8523_probe(struct snd_soc_codec *codec) | ||
62 | } | ||
63 | |||
64 | /* Change some default settings - latch VU and enable ZC */ | ||
65 | - wm8523->reg_cache[WM8523_DAC_GAINR] |= WM8523_DACR_VU; | ||
66 | - wm8523->reg_cache[WM8523_DAC_CTRL3] |= WM8523_ZC; | ||
67 | + reg_cache[WM8523_DAC_GAINR] |= WM8523_DACR_VU; | ||
68 | + reg_cache[WM8523_DAC_CTRL3] |= WM8523_ZC; | ||
69 | |||
70 | wm8523_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
71 | |||
72 | -- | ||
73 | 1.6.6.1 | ||
74 | |||