summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/linus/0018-ASoC-codecs-max98088-Fix-register-cache-incoherency.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0018-ASoC-codecs-max98088-Fix-register-cache-incoherency.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/linus/0018-ASoC-codecs-max98088-Fix-register-cache-incoherency.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0018-ASoC-codecs-max98088-Fix-register-cache-incoherency.patch b/extras/recipes-kernel/linux/linux-omap/linus/0018-ASoC-codecs-max98088-Fix-register-cache-incoherency.patch
new file mode 100644
index 00000000..5c139ab5
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/linus/0018-ASoC-codecs-max98088-Fix-register-cache-incoherency.patch
@@ -0,0 +1,72 @@
1From 0ff8217bd7272d8aef1e58250d84cf5680b16b2d Mon Sep 17 00:00:00 2001
2From: Lars-Peter Clausen <lars@metafoo.de>
3Date: Tue, 28 Dec 2010 21:37:56 +0100
4Subject: [PATCH 18/65] ASoC: codecs: max98088: Fix register cache incoherency
5
6The multi-component patch(commit f0fba2ad1) moved the allocation of the
7register cache from the driver to the ASoC core. Most drivers where adjusted to
8this, but the max98088 driver still uses its own register cache for its
9private functions, while functions from the ASoC core use the generic cache.
10Thus we end up with two from each other incoherent caches, which can lead to
11undefined behaviour.
12This patch fixes the issue by changing the max98088 driver to use the
13generic register cache in its private functions.
14
15Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
16Cc: Peter Hsiang <Peter.Hsiang@maxim-ic.com>
17Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
18Cc: stable@kernel.org (for 2.6.37 only)
19---
20 sound/soc/codecs/max98088.c | 10 ++++------
21 1 files changed, 4 insertions(+), 6 deletions(-)
22
23diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
24index d63e287..6447dbb 100644
25--- a/sound/soc/codecs/max98088.c
26+++ b/sound/soc/codecs/max98088.c
27@@ -40,7 +40,6 @@ struct max98088_cdata {
28 };
29
30 struct max98088_priv {
31- u8 reg_cache[M98088_REG_CNT];
32 enum max98088_type devtype;
33 void *control_data;
34 struct max98088_pdata *pdata;
35@@ -1588,7 +1587,7 @@ static int max98088_dai2_set_fmt(struct snd_soc_dai *codec_dai,
36
37 static void max98088_sync_cache(struct snd_soc_codec *codec)
38 {
39- struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
40+ u16 *reg_cache = codec->reg_cache;
41 int i;
42
43 if (!codec->cache_sync)
44@@ -1599,14 +1598,14 @@ static void max98088_sync_cache(struct snd_soc_codec *codec)
45 /* write back cached values if they're writeable and
46 * different from the hardware default.
47 */
48- for (i = 1; i < ARRAY_SIZE(max98088->reg_cache); i++) {
49+ for (i = 1; i < codec->driver->reg_cache_size; i++) {
50 if (!max98088_access[i].writable)
51 continue;
52
53- if (max98088->reg_cache[i] == max98088_reg[i])
54+ if (reg_cache[i] == max98088_reg[i])
55 continue;
56
57- snd_soc_write(codec, i, max98088->reg_cache[i]);
58+ snd_soc_write(codec, i, reg_cache[i]);
59 }
60
61 codec->cache_sync = 0;
62@@ -1951,7 +1950,6 @@ static int max98088_probe(struct snd_soc_codec *codec)
63 int ret = 0;
64
65 codec->cache_sync = 1;
66- memcpy(codec->reg_cache, max98088_reg, sizeof(max98088_reg));
67
68 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C);
69 if (ret != 0) {
70--
711.6.6.1
72