summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorEric Millbrandt <emillbrandt@dekaresearch.com>2009-12-22 10:13:24 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-01-06 15:03:34 -0800
commit474ae5e72b8acc3c79354f0b14e77fb9e09108ff (patch)
tree23d4376c64322c8b4129431f30c1a0a5a53b12dc /sound
parentd75621cbb1dfadcd6801b39c03867bab60d94dd7 (diff)
ASoC: Do not write to invalid registers on the wm9712.
commit 48e3cbb3f67a27d9c2db075f3d0f700246c40caa upstream. This patch fixes a bug where "virtual" registers were being written to the ac97 bus. This was causing unrelated registers to become corrupted (headphone 0x04, touchscreen 0x78, etc). This patch duplicates protection that was included in the wm9713 driver. Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm9712.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 1fd4e88f50cf..e9123f54202d 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -464,7 +464,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
{
u16 *cache = codec->reg_cache;
- soc_ac97_ops.write(codec->ac97, reg, val);
+ if (reg < 0x7c)
+ soc_ac97_ops.write(codec->ac97, reg, val);
reg = reg >> 1;
if (reg < (ARRAY_SIZE(wm9712_reg)))
cache[reg] = val;